Turn FUNCTION_ARG_PADDING into a target hook
[official-gcc.git] / gcc / doc / invoke.texi
blobd15497c054709593027181acf8b607e7922457f4
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
5495 This warning is enabled by @option{-Wall}.
5497 @item -Wtrampolines
5498 @opindex Wtrampolines
5499 @opindex Wno-trampolines
5500 Warn about trampolines generated for pointers to nested functions.
5501 A trampoline is a small piece of data or code that is created at run
5502 time on the stack when the address of a nested function is taken, and is
5503 used to call the nested function indirectly.  For some targets, it is
5504 made up of data only and thus requires no special treatment.  But, for
5505 most targets, it is made up of code and thus requires the stack to be
5506 made executable in order for the program to work properly.
5508 @item -Wfloat-equal
5509 @opindex Wfloat-equal
5510 @opindex Wno-float-equal
5511 Warn if floating-point values are used in equality comparisons.
5513 The idea behind this is that sometimes it is convenient (for the
5514 programmer) to consider floating-point values as approximations to
5515 infinitely precise real numbers.  If you are doing this, then you need
5516 to compute (by analyzing the code, or in some other way) the maximum or
5517 likely maximum error that the computation introduces, and allow for it
5518 when performing comparisons (and when producing output, but that's a
5519 different problem).  In particular, instead of testing for equality, you
5520 should check to see whether the two values have ranges that overlap; and
5521 this is done with the relational operators, so equality comparisons are
5522 probably mistaken.
5524 @item -Wtraditional @r{(C and Objective-C only)}
5525 @opindex Wtraditional
5526 @opindex Wno-traditional
5527 Warn about certain constructs that behave differently in traditional and
5528 ISO C@.  Also warn about ISO C constructs that have no traditional C
5529 equivalent, and/or problematic constructs that should be avoided.
5531 @itemize @bullet
5532 @item
5533 Macro parameters that appear within string literals in the macro body.
5534 In traditional C macro replacement takes place within string literals,
5535 but in ISO C it does not.
5537 @item
5538 In traditional C, some preprocessor directives did not exist.
5539 Traditional preprocessors only considered a line to be a directive
5540 if the @samp{#} appeared in column 1 on the line.  Therefore
5541 @option{-Wtraditional} warns about directives that traditional C
5542 understands but ignores because the @samp{#} does not appear as the
5543 first character on the line.  It also suggests you hide directives like
5544 @code{#pragma} not understood by traditional C by indenting them.  Some
5545 traditional implementations do not recognize @code{#elif}, so this option
5546 suggests avoiding it altogether.
5548 @item
5549 A function-like macro that appears without arguments.
5551 @item
5552 The unary plus operator.
5554 @item
5555 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
5556 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
5557 constants.)  Note, these suffixes appear in macros defined in the system
5558 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
5559 Use of these macros in user code might normally lead to spurious
5560 warnings, however GCC's integrated preprocessor has enough context to
5561 avoid warning in these cases.
5563 @item
5564 A function declared external in one block and then used after the end of
5565 the block.
5567 @item
5568 A @code{switch} statement has an operand of type @code{long}.
5570 @item
5571 A non-@code{static} function declaration follows a @code{static} one.
5572 This construct is not accepted by some traditional C compilers.
5574 @item
5575 The ISO type of an integer constant has a different width or
5576 signedness from its traditional type.  This warning is only issued if
5577 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
5578 typically represent bit patterns, are not warned about.
5580 @item
5581 Usage of ISO string concatenation is detected.
5583 @item
5584 Initialization of automatic aggregates.
5586 @item
5587 Identifier conflicts with labels.  Traditional C lacks a separate
5588 namespace for labels.
5590 @item
5591 Initialization of unions.  If the initializer is zero, the warning is
5592 omitted.  This is done under the assumption that the zero initializer in
5593 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
5594 initializer warnings and relies on default initialization to zero in the
5595 traditional C case.
5597 @item
5598 Conversions by prototypes between fixed/floating-point values and vice
5599 versa.  The absence of these prototypes when compiling with traditional
5600 C causes serious problems.  This is a subset of the possible
5601 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
5603 @item
5604 Use of ISO C style function definitions.  This warning intentionally is
5605 @emph{not} issued for prototype declarations or variadic functions
5606 because these ISO C features appear in your code when using
5607 libiberty's traditional C compatibility macros, @code{PARAMS} and
5608 @code{VPARAMS}.  This warning is also bypassed for nested functions
5609 because that feature is already a GCC extension and thus not relevant to
5610 traditional C compatibility.
5611 @end itemize
5613 @item -Wtraditional-conversion @r{(C and Objective-C only)}
5614 @opindex Wtraditional-conversion
5615 @opindex Wno-traditional-conversion
5616 Warn if a prototype causes a type conversion that is different from what
5617 would happen to the same argument in the absence of a prototype.  This
5618 includes conversions of fixed point to floating and vice versa, and
5619 conversions changing the width or signedness of a fixed-point argument
5620 except when the same as the default promotion.
5622 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
5623 @opindex Wdeclaration-after-statement
5624 @opindex Wno-declaration-after-statement
5625 Warn when a declaration is found after a statement in a block.  This
5626 construct, known from C++, was introduced with ISO C99 and is by default
5627 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
5629 @item -Wshadow
5630 @opindex Wshadow
5631 @opindex Wno-shadow
5632 Warn whenever a local variable or type declaration shadows another
5633 variable, parameter, type, class member (in C++), or instance variable
5634 (in Objective-C) or whenever a built-in function is shadowed. Note
5635 that in C++, the compiler warns if a local variable shadows an
5636 explicit typedef, but not if it shadows a struct/class/enum.
5637 Same as @option{-Wshadow=global}.
5639 @item -Wno-shadow-ivar @r{(Objective-C only)}
5640 @opindex Wno-shadow-ivar
5641 @opindex Wshadow-ivar
5642 Do not warn whenever a local variable shadows an instance variable in an
5643 Objective-C method.
5645 @item -Wshadow=global
5646 @opindex Wshadow=local
5647 The default for @option{-Wshadow}. Warns for any (global) shadowing.
5649 @item -Wshadow=local
5650 @opindex Wshadow=local
5651 Warn when a local variable shadows another local variable or parameter.
5652 This warning is enabled by @option{-Wshadow=global}.
5654 @item -Wshadow=compatible-local
5655 @opindex Wshadow=compatible-local
5656 Warn when a local variable shadows another local variable or parameter
5657 whose type is compatible with that of the shadowing variable. In C++,
5658 type compatibility here means the type of the shadowing variable can be
5659 converted to that of the shadowed variable. The creation of this flag
5660 (in addition to @option{-Wshadow=local}) is based on the idea that when
5661 a local variable shadows another one of incompatible type, it is most
5662 likely intentional, not a bug or typo, as shown in the following example:
5664 @smallexample
5665 @group
5666 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
5668   for (int i = 0; i < N; ++i)
5669   @{
5670     ...
5671   @}
5672   ...
5674 @end group
5675 @end smallexample
5677 Since the two variable @code{i} in the example above have incompatible types,
5678 enabling only @option{-Wshadow=compatible-local} will not emit a warning.
5679 Because their types are incompatible, if a programmer accidentally uses one
5680 in place of the other, type checking will catch that and emit an error or
5681 warning. So not warning (about shadowing) in this case will not lead to
5682 undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
5683 possibly reduce the number of warnings triggered by intentional shadowing.
5685 This warning is enabled by @option{-Wshadow=local}.
5687 @item -Wlarger-than=@var{len}
5688 @opindex Wlarger-than=@var{len}
5689 @opindex Wlarger-than-@var{len}
5690 Warn whenever an object of larger than @var{len} bytes is defined.
5692 @item -Wframe-larger-than=@var{len}
5693 @opindex Wframe-larger-than
5694 Warn if the size of a function frame is larger than @var{len} bytes.
5695 The computation done to determine the stack frame size is approximate
5696 and not conservative.
5697 The actual requirements may be somewhat greater than @var{len}
5698 even if you do not get a warning.  In addition, any space allocated
5699 via @code{alloca}, variable-length arrays, or related constructs
5700 is not included by the compiler when determining
5701 whether or not to issue a warning.
5703 @item -Wno-free-nonheap-object
5704 @opindex Wno-free-nonheap-object
5705 @opindex Wfree-nonheap-object
5706 Do not warn when attempting to free an object that was not allocated
5707 on the heap.
5709 @item -Wstack-usage=@var{len}
5710 @opindex Wstack-usage
5711 Warn if the stack usage of a function might be larger than @var{len} bytes.
5712 The computation done to determine the stack usage is conservative.
5713 Any space allocated via @code{alloca}, variable-length arrays, or related
5714 constructs is included by the compiler when determining whether or not to
5715 issue a warning.
5717 The message is in keeping with the output of @option{-fstack-usage}.
5719 @itemize
5720 @item
5721 If the stack usage is fully static but exceeds the specified amount, it's:
5723 @smallexample
5724   warning: stack usage is 1120 bytes
5725 @end smallexample
5726 @item
5727 If the stack usage is (partly) dynamic but bounded, it's:
5729 @smallexample
5730   warning: stack usage might be 1648 bytes
5731 @end smallexample
5732 @item
5733 If the stack usage is (partly) dynamic and not bounded, it's:
5735 @smallexample
5736   warning: stack usage might be unbounded
5737 @end smallexample
5738 @end itemize
5740 @item -Wunsafe-loop-optimizations
5741 @opindex Wunsafe-loop-optimizations
5742 @opindex Wno-unsafe-loop-optimizations
5743 Warn if the loop cannot be optimized because the compiler cannot
5744 assume anything on the bounds of the loop indices.  With
5745 @option{-funsafe-loop-optimizations} warn if the compiler makes
5746 such assumptions.
5748 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
5749 @opindex Wno-pedantic-ms-format
5750 @opindex Wpedantic-ms-format
5751 When used in combination with @option{-Wformat}
5752 and @option{-pedantic} without GNU extensions, this option
5753 disables the warnings about non-ISO @code{printf} / @code{scanf} format
5754 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
5755 which depend on the MS runtime.
5757 @item -Waligned-new
5758 @opindex Waligned-new
5759 @opindex Wno-aligned-new
5760 Warn about a new-expression of a type that requires greater alignment
5761 than the @code{alignof(std::max_align_t)} but uses an allocation
5762 function without an explicit alignment parameter. This option is
5763 enabled by @option{-Wall}.
5765 Normally this only warns about global allocation functions, but
5766 @option{-Waligned-new=all} also warns about class member allocation
5767 functions.
5769 @item -Wplacement-new
5770 @itemx -Wplacement-new=@var{n}
5771 @opindex Wplacement-new
5772 @opindex Wno-placement-new
5773 Warn about placement new expressions with undefined behavior, such as
5774 constructing an object in a buffer that is smaller than the type of
5775 the object.  For example, the placement new expression below is diagnosed
5776 because it attempts to construct an array of 64 integers in a buffer only
5777 64 bytes large.
5778 @smallexample
5779 char buf [64];
5780 new (buf) int[64];
5781 @end smallexample
5782 This warning is enabled by default.
5784 @table @gcctabopt
5785 @item -Wplacement-new=1
5786 This is the default warning level of @option{-Wplacement-new}.  At this
5787 level the warning is not issued for some strictly undefined constructs that
5788 GCC allows as extensions for compatibility with legacy code.  For example,
5789 the following @code{new} expression is not diagnosed at this level even
5790 though it has undefined behavior according to the C++ standard because
5791 it writes past the end of the one-element array.
5792 @smallexample
5793 struct S @{ int n, a[1]; @};
5794 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
5795 new (s->a)int [32]();
5796 @end smallexample
5798 @item -Wplacement-new=2
5799 At this level, in addition to diagnosing all the same constructs as at level
5800 1, a diagnostic is also issued for placement new expressions that construct
5801 an object in the last member of structure whose type is an array of a single
5802 element and whose size is less than the size of the object being constructed.
5803 While the previous example would be diagnosed, the following construct makes
5804 use of the flexible member array extension to avoid the warning at level 2.
5805 @smallexample
5806 struct S @{ int n, a[]; @};
5807 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
5808 new (s->a)int [32]();
5809 @end smallexample
5811 @end table
5813 @item -Wpointer-arith
5814 @opindex Wpointer-arith
5815 @opindex Wno-pointer-arith
5816 Warn about anything that depends on the ``size of'' a function type or
5817 of @code{void}.  GNU C assigns these types a size of 1, for
5818 convenience in calculations with @code{void *} pointers and pointers
5819 to functions.  In C++, warn also when an arithmetic operation involves
5820 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
5822 @item -Wpointer-compare
5823 @opindex Wpointer-compare
5824 @opindex Wno-pointer-compare
5825 Warn if a pointer is compared with a zero character constant.  This usually
5826 means that the pointer was meant to be dereferenced.  For example:
5828 @smallexample
5829 const char *p = foo ();
5830 if (p == '\0')
5831   return 42;
5832 @end smallexample
5834 Note that the code above is invalid in C++11.
5836 This warning is enabled by default.
5838 @item -Wtype-limits
5839 @opindex Wtype-limits
5840 @opindex Wno-type-limits
5841 Warn if a comparison is always true or always false due to the limited
5842 range of the data type, but do not warn for constant expressions.  For
5843 example, warn if an unsigned variable is compared against zero with
5844 @code{<} or @code{>=}.  This warning is also enabled by
5845 @option{-Wextra}.
5847 @include cppwarnopts.texi
5849 @item -Wbad-function-cast @r{(C and Objective-C only)}
5850 @opindex Wbad-function-cast
5851 @opindex Wno-bad-function-cast
5852 Warn when a function call is cast to a non-matching type.
5853 For example, warn if a call to a function returning an integer type 
5854 is cast to a pointer type.
5856 @item -Wc90-c99-compat @r{(C and Objective-C only)}
5857 @opindex Wc90-c99-compat
5858 @opindex Wno-c90-c99-compat
5859 Warn about features not present in ISO C90, but present in ISO C99.
5860 For instance, warn about use of variable length arrays, @code{long long}
5861 type, @code{bool} type, compound literals, designated initializers, and so
5862 on.  This option is independent of the standards mode.  Warnings are disabled
5863 in the expression that follows @code{__extension__}.
5865 @item -Wc99-c11-compat @r{(C and Objective-C only)}
5866 @opindex Wc99-c11-compat
5867 @opindex Wno-c99-c11-compat
5868 Warn about features not present in ISO C99, but present in ISO C11.
5869 For instance, warn about use of anonymous structures and unions,
5870 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
5871 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
5872 and so on.  This option is independent of the standards mode.  Warnings are
5873 disabled in the expression that follows @code{__extension__}.
5875 @item -Wc++-compat @r{(C and Objective-C only)}
5876 @opindex Wc++-compat
5877 Warn about ISO C constructs that are outside of the common subset of
5878 ISO C and ISO C++, e.g.@: request for implicit conversion from
5879 @code{void *} to a pointer to non-@code{void} type.
5881 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
5882 @opindex Wc++11-compat
5883 Warn about C++ constructs whose meaning differs between ISO C++ 1998
5884 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
5885 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
5886 enabled by @option{-Wall}.
5888 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
5889 @opindex Wc++14-compat
5890 Warn about C++ constructs whose meaning differs between ISO C++ 2011
5891 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
5893 @item -Wc++1z-compat @r{(C++ and Objective-C++ only)}
5894 @opindex Wc++1z-compat
5895 Warn about C++ constructs whose meaning differs between ISO C++ 2014
5896 and the forthoming ISO C++ 2017(?).  This warning is enabled by @option{-Wall}.
5898 @item -Wcast-qual
5899 @opindex Wcast-qual
5900 @opindex Wno-cast-qual
5901 Warn whenever a pointer is cast so as to remove a type qualifier from
5902 the target type.  For example, warn if a @code{const char *} is cast
5903 to an ordinary @code{char *}.
5905 Also warn when making a cast that introduces a type qualifier in an
5906 unsafe way.  For example, casting @code{char **} to @code{const char **}
5907 is unsafe, as in this example:
5909 @smallexample
5910   /* p is char ** value.  */
5911   const char **q = (const char **) p;
5912   /* Assignment of readonly string to const char * is OK.  */
5913   *q = "string";
5914   /* Now char** pointer points to read-only memory.  */
5915   **p = 'b';
5916 @end smallexample
5918 @item -Wcast-align
5919 @opindex Wcast-align
5920 @opindex Wno-cast-align
5921 Warn whenever a pointer is cast such that the required alignment of the
5922 target is increased.  For example, warn if a @code{char *} is cast to
5923 an @code{int *} on machines where integers can only be accessed at
5924 two- or four-byte boundaries.
5926 @item -Wwrite-strings
5927 @opindex Wwrite-strings
5928 @opindex Wno-write-strings
5929 When compiling C, give string constants the type @code{const
5930 char[@var{length}]} so that copying the address of one into a
5931 non-@code{const} @code{char *} pointer produces a warning.  These
5932 warnings help you find at compile time code that can try to write
5933 into a string constant, but only if you have been very careful about
5934 using @code{const} in declarations and prototypes.  Otherwise, it is
5935 just a nuisance. This is why we did not make @option{-Wall} request
5936 these warnings.
5938 When compiling C++, warn about the deprecated conversion from string
5939 literals to @code{char *}.  This warning is enabled by default for C++
5940 programs.
5942 @item -Wcatch-value
5943 @itemx -Wcatch-value=@var{n} @r{(C++ and Objective-C++ only)}
5944 @opindex Wcatch-value
5945 @opindex Wno-catch-value
5946 Warn about catch handlers that do not catch via reference.
5947 With @option{-Wcatch-value=1} (or @option{-Wcatch-value} for short)
5948 warn about polymorphic class types that are caught by value.
5949 With @option{-Wcatch-value=2} warn about all class types that are caught
5950 by value. With @option{-Wcatch-value=3} warn about all types that are
5951 not caught by reference. @option{-Wcatch-value} is enabled by @option{-Wall}.
5953 @item -Wclobbered
5954 @opindex Wclobbered
5955 @opindex Wno-clobbered
5956 Warn for variables that might be changed by @code{longjmp} or
5957 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5959 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5960 @opindex Wconditionally-supported
5961 @opindex Wno-conditionally-supported
5962 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5964 @item -Wconversion
5965 @opindex Wconversion
5966 @opindex Wno-conversion
5967 Warn for implicit conversions that may alter a value. This includes
5968 conversions between real and integer, like @code{abs (x)} when
5969 @code{x} is @code{double}; conversions between signed and unsigned,
5970 like @code{unsigned ui = -1}; and conversions to smaller types, like
5971 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5972 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5973 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5974 conversions between signed and unsigned integers can be disabled by
5975 using @option{-Wno-sign-conversion}.
5977 For C++, also warn for confusing overload resolution for user-defined
5978 conversions; and conversions that never use a type conversion
5979 operator: conversions to @code{void}, the same type, a base class or a
5980 reference to them. Warnings about conversions between signed and
5981 unsigned integers are disabled by default in C++ unless
5982 @option{-Wsign-conversion} is explicitly enabled.
5984 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5985 @opindex Wconversion-null
5986 @opindex Wno-conversion-null
5987 Do not warn for conversions between @code{NULL} and non-pointer
5988 types. @option{-Wconversion-null} is enabled by default.
5990 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5991 @opindex Wzero-as-null-pointer-constant
5992 @opindex Wno-zero-as-null-pointer-constant
5993 Warn when a literal @samp{0} is used as null pointer constant.  This can
5994 be useful to facilitate the conversion to @code{nullptr} in C++11.
5996 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
5997 @opindex Wsubobject-linkage
5998 @opindex Wno-subobject-linkage
5999 Warn if a class type has a base or a field whose type uses the anonymous
6000 namespace or depends on a type with no linkage.  If a type A depends on
6001 a type B with no or internal linkage, defining it in multiple
6002 translation units would be an ODR violation because the meaning of B
6003 is different in each translation unit.  If A only appears in a single
6004 translation unit, the best way to silence the warning is to give it
6005 internal linkage by putting it in an anonymous namespace as well.  The
6006 compiler doesn't give this warning for types defined in the main .C
6007 file, as those are unlikely to have multiple definitions.
6008 @option{-Wsubobject-linkage} is enabled by default.
6010 @item -Wdangling-else
6011 @opindex Wdangling-else
6012 @opindex Wno-dangling-else
6013 Warn about constructions where there may be confusion to which
6014 @code{if} statement an @code{else} branch belongs.  Here is an example of
6015 such a case:
6017 @smallexample
6018 @group
6020   if (a)
6021     if (b)
6022       foo ();
6023   else
6024     bar ();
6026 @end group
6027 @end smallexample
6029 In C/C++, every @code{else} branch belongs to the innermost possible
6030 @code{if} statement, which in this example is @code{if (b)}.  This is
6031 often not what the programmer expected, as illustrated in the above
6032 example by indentation the programmer chose.  When there is the
6033 potential for this confusion, GCC issues a warning when this flag
6034 is specified.  To eliminate the warning, add explicit braces around
6035 the innermost @code{if} statement so there is no way the @code{else}
6036 can belong to the enclosing @code{if}.  The resulting code
6037 looks like this:
6039 @smallexample
6040 @group
6042   if (a)
6043     @{
6044       if (b)
6045         foo ();
6046       else
6047         bar ();
6048     @}
6050 @end group
6051 @end smallexample
6053 This warning is enabled by @option{-Wparentheses}.
6055 @item -Wdate-time
6056 @opindex Wdate-time
6057 @opindex Wno-date-time
6058 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
6059 are encountered as they might prevent bit-wise-identical reproducible
6060 compilations.
6062 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
6063 @opindex Wdelete-incomplete
6064 @opindex Wno-delete-incomplete
6065 Warn when deleting a pointer to incomplete type, which may cause
6066 undefined behavior at runtime.  This warning is enabled by default.
6068 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
6069 @opindex Wuseless-cast
6070 @opindex Wno-useless-cast
6071 Warn when an expression is casted to its own type.
6073 @item -Wempty-body
6074 @opindex Wempty-body
6075 @opindex Wno-empty-body
6076 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
6077 while} statement.  This warning is also enabled by @option{-Wextra}.
6079 @item -Wenum-compare
6080 @opindex Wenum-compare
6081 @opindex Wno-enum-compare
6082 Warn about a comparison between values of different enumerated types.
6083 In C++ enumerated type mismatches in conditional expressions are also
6084 diagnosed and the warning is enabled by default.  In C this warning is 
6085 enabled by @option{-Wall}.
6087 @item -Wextra-semi @r{(C++, Objective-C++ only)}
6088 @opindex Wextra-semi
6089 @opindex Wno-extra-semi
6090 Warn about redundant semicolon after in-class function definition.
6092 @item -Wjump-misses-init @r{(C, Objective-C only)}
6093 @opindex Wjump-misses-init
6094 @opindex Wno-jump-misses-init
6095 Warn if a @code{goto} statement or a @code{switch} statement jumps
6096 forward across the initialization of a variable, or jumps backward to a
6097 label after the variable has been initialized.  This only warns about
6098 variables that are initialized when they are declared.  This warning is
6099 only supported for C and Objective-C; in C++ this sort of branch is an
6100 error in any case.
6102 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
6103 can be disabled with the @option{-Wno-jump-misses-init} option.
6105 @item -Wsign-compare
6106 @opindex Wsign-compare
6107 @opindex Wno-sign-compare
6108 @cindex warning for comparison of signed and unsigned values
6109 @cindex comparison of signed and unsigned values, warning
6110 @cindex signed and unsigned values, comparison warning
6111 Warn when a comparison between signed and unsigned values could produce
6112 an incorrect result when the signed value is converted to unsigned.
6113 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
6114 also enabled by @option{-Wextra}.
6116 @item -Wsign-conversion
6117 @opindex Wsign-conversion
6118 @opindex Wno-sign-conversion
6119 Warn for implicit conversions that may change the sign of an integer
6120 value, like assigning a signed integer expression to an unsigned
6121 integer variable. An explicit cast silences the warning. In C, this
6122 option is enabled also by @option{-Wconversion}.
6124 @item -Wfloat-conversion
6125 @opindex Wfloat-conversion
6126 @opindex Wno-float-conversion
6127 Warn for implicit conversions that reduce the precision of a real value.
6128 This includes conversions from real to integer, and from higher precision
6129 real to lower precision real values.  This option is also enabled by
6130 @option{-Wconversion}.
6132 @item -Wno-scalar-storage-order
6133 @opindex -Wno-scalar-storage-order
6134 @opindex -Wscalar-storage-order
6135 Do not warn on suspicious constructs involving reverse scalar storage order.
6137 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
6138 @opindex Wsized-deallocation
6139 @opindex Wno-sized-deallocation
6140 Warn about a definition of an unsized deallocation function
6141 @smallexample
6142 void operator delete (void *) noexcept;
6143 void operator delete[] (void *) noexcept;
6144 @end smallexample
6145 without a definition of the corresponding sized deallocation function
6146 @smallexample
6147 void operator delete (void *, std::size_t) noexcept;
6148 void operator delete[] (void *, std::size_t) noexcept;
6149 @end smallexample
6150 or vice versa.  Enabled by @option{-Wextra} along with
6151 @option{-fsized-deallocation}.
6153 @item -Wsizeof-pointer-div
6154 @opindex Wsizeof-pointer-div
6155 @opindex Wno-sizeof-pointer-div
6156 Warn for suspicious divisions of two sizeof expressions that divide
6157 the pointer size by the element size, which is the usual way to compute
6158 the array size but won't work out correctly with pointers.  This warning
6159 warns e.g.@: about @code{sizeof (ptr) / sizeof (ptr[0])} if @code{ptr} is
6160 not an array, but a pointer.  This warning is enabled by @option{-Wall}.
6162 @item -Wsizeof-pointer-memaccess
6163 @opindex Wsizeof-pointer-memaccess
6164 @opindex Wno-sizeof-pointer-memaccess
6165 Warn for suspicious length parameters to certain string and memory built-in
6166 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
6167 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
6168 but a pointer, and suggests a possible fix, or about
6169 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
6170 @option{-Wall}.
6172 @item -Wsizeof-array-argument
6173 @opindex Wsizeof-array-argument
6174 @opindex Wno-sizeof-array-argument
6175 Warn when the @code{sizeof} operator is applied to a parameter that is
6176 declared as an array in a function definition.  This warning is enabled by
6177 default for C and C++ programs.
6179 @item -Wmemset-elt-size
6180 @opindex Wmemset-elt-size
6181 @opindex Wno-memset-elt-size
6182 Warn for suspicious calls to the @code{memset} built-in function, if the
6183 first argument references an array, and the third argument is a number
6184 equal to the number of elements, but not equal to the size of the array
6185 in memory.  This indicates that the user has omitted a multiplication by
6186 the element size.  This warning is enabled by @option{-Wall}.
6188 @item -Wmemset-transposed-args
6189 @opindex Wmemset-transposed-args
6190 @opindex Wno-memset-transposed-args
6191 Warn for suspicious calls to the @code{memset} built-in function, if the
6192 second argument is not zero and the third argument is zero.  This warns e.g.@
6193 about @code{memset (buf, sizeof buf, 0)} where most probably
6194 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
6195 is only emitted if the third argument is literal zero.  If it is some
6196 expression that is folded to zero, a cast of zero to some type, etc., 
6197 it is far less likely that the user has mistakenly exchanged the arguments 
6198 and no warning is emitted.  This warning is enabled by @option{-Wall}.
6200 @item -Waddress
6201 @opindex Waddress
6202 @opindex Wno-address
6203 Warn about suspicious uses of memory addresses. These include using
6204 the address of a function in a conditional expression, such as
6205 @code{void func(void); if (func)}, and comparisons against the memory
6206 address of a string literal, such as @code{if (x == "abc")}.  Such
6207 uses typically indicate a programmer error: the address of a function
6208 always evaluates to true, so their use in a conditional usually
6209 indicate that the programmer forgot the parentheses in a function
6210 call; and comparisons against string literals result in unspecified
6211 behavior and are not portable in C, so they usually indicate that the
6212 programmer intended to use @code{strcmp}.  This warning is enabled by
6213 @option{-Wall}.
6215 @item -Wlogical-op
6216 @opindex Wlogical-op
6217 @opindex Wno-logical-op
6218 Warn about suspicious uses of logical operators in expressions.
6219 This includes using logical operators in contexts where a
6220 bit-wise operator is likely to be expected.  Also warns when
6221 the operands of a logical operator are the same:
6222 @smallexample
6223 extern int a;
6224 if (a < 0 && a < 0) @{ @dots{} @}
6225 @end smallexample
6227 @item -Wlogical-not-parentheses
6228 @opindex Wlogical-not-parentheses
6229 @opindex Wno-logical-not-parentheses
6230 Warn about logical not used on the left hand side operand of a comparison.
6231 This option does not warn if the right operand is considered to be a boolean
6232 expression.  Its purpose is to detect suspicious code like the following:
6233 @smallexample
6234 int a;
6235 @dots{}
6236 if (!a > 1) @{ @dots{} @}
6237 @end smallexample
6239 It is possible to suppress the warning by wrapping the LHS into
6240 parentheses:
6241 @smallexample
6242 if ((!a) > 1) @{ @dots{} @}
6243 @end smallexample
6245 This warning is enabled by @option{-Wall}.
6247 @item -Waggregate-return
6248 @opindex Waggregate-return
6249 @opindex Wno-aggregate-return
6250 Warn if any functions that return structures or unions are defined or
6251 called.  (In languages where you can return an array, this also elicits
6252 a warning.)
6254 @item -Wno-aggressive-loop-optimizations
6255 @opindex Wno-aggressive-loop-optimizations
6256 @opindex Waggressive-loop-optimizations
6257 Warn if in a loop with constant number of iterations the compiler detects
6258 undefined behavior in some statement during one or more of the iterations.
6260 @item -Wno-attributes
6261 @opindex Wno-attributes
6262 @opindex Wattributes
6263 Do not warn if an unexpected @code{__attribute__} is used, such as
6264 unrecognized attributes, function attributes applied to variables,
6265 etc.  This does not stop errors for incorrect use of supported
6266 attributes.
6268 @item -Wno-builtin-declaration-mismatch
6269 @opindex Wno-builtin-declaration-mismatch
6270 @opindex Wbuiltin-declaration-mismatch
6271 Warn if a built-in function is declared with the wrong signature.
6272 This warning is enabled by default.
6274 @item -Wno-builtin-macro-redefined
6275 @opindex Wno-builtin-macro-redefined
6276 @opindex Wbuiltin-macro-redefined
6277 Do not warn if certain built-in macros are redefined.  This suppresses
6278 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
6279 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
6281 @item -Wstrict-prototypes @r{(C and Objective-C only)}
6282 @opindex Wstrict-prototypes
6283 @opindex Wno-strict-prototypes
6284 Warn if a function is declared or defined without specifying the
6285 argument types.  (An old-style function definition is permitted without
6286 a warning if preceded by a declaration that specifies the argument
6287 types.)
6289 @item -Wold-style-declaration @r{(C and Objective-C only)}
6290 @opindex Wold-style-declaration
6291 @opindex Wno-old-style-declaration
6292 Warn for obsolescent usages, according to the C Standard, in a
6293 declaration. For example, warn if storage-class specifiers like
6294 @code{static} are not the first things in a declaration.  This warning
6295 is also enabled by @option{-Wextra}.
6297 @item -Wold-style-definition @r{(C and Objective-C only)}
6298 @opindex Wold-style-definition
6299 @opindex Wno-old-style-definition
6300 Warn if an old-style function definition is used.  A warning is given
6301 even if there is a previous prototype.
6303 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
6304 @opindex Wmissing-parameter-type
6305 @opindex Wno-missing-parameter-type
6306 A function parameter is declared without a type specifier in K&R-style
6307 functions:
6309 @smallexample
6310 void foo(bar) @{ @}
6311 @end smallexample
6313 This warning is also enabled by @option{-Wextra}.
6315 @item -Wmissing-prototypes @r{(C and Objective-C only)}
6316 @opindex Wmissing-prototypes
6317 @opindex Wno-missing-prototypes
6318 Warn if a global function is defined without a previous prototype
6319 declaration.  This warning is issued even if the definition itself
6320 provides a prototype.  Use this option to detect global functions
6321 that do not have a matching prototype declaration in a header file.
6322 This option is not valid for C++ because all function declarations
6323 provide prototypes and a non-matching declaration declares an
6324 overload rather than conflict with an earlier declaration.
6325 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
6327 @item -Wmissing-declarations
6328 @opindex Wmissing-declarations
6329 @opindex Wno-missing-declarations
6330 Warn if a global function is defined without a previous declaration.
6331 Do so even if the definition itself provides a prototype.
6332 Use this option to detect global functions that are not declared in
6333 header files.  In C, no warnings are issued for functions with previous
6334 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
6335 missing prototypes.  In C++, no warnings are issued for function templates,
6336 or for inline functions, or for functions in anonymous namespaces.
6338 @item -Wmissing-field-initializers
6339 @opindex Wmissing-field-initializers
6340 @opindex Wno-missing-field-initializers
6341 @opindex W
6342 @opindex Wextra
6343 @opindex Wno-extra
6344 Warn if a structure's initializer has some fields missing.  For
6345 example, the following code causes such a warning, because
6346 @code{x.h} is implicitly zero:
6348 @smallexample
6349 struct s @{ int f, g, h; @};
6350 struct s x = @{ 3, 4 @};
6351 @end smallexample
6353 This option does not warn about designated initializers, so the following
6354 modification does not trigger a warning:
6356 @smallexample
6357 struct s @{ int f, g, h; @};
6358 struct s x = @{ .f = 3, .g = 4 @};
6359 @end smallexample
6361 In C this option does not warn about the universal zero initializer
6362 @samp{@{ 0 @}}:
6364 @smallexample
6365 struct s @{ int f, g, h; @};
6366 struct s x = @{ 0 @};
6367 @end smallexample
6369 Likewise, in C++ this option does not warn about the empty @{ @}
6370 initializer, for example:
6372 @smallexample
6373 struct s @{ int f, g, h; @};
6374 s x = @{ @};
6375 @end smallexample
6377 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
6378 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
6380 @item -Wno-multichar
6381 @opindex Wno-multichar
6382 @opindex Wmultichar
6383 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
6384 Usually they indicate a typo in the user's code, as they have
6385 implementation-defined values, and should not be used in portable code.
6387 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
6388 @opindex Wnormalized=
6389 @opindex Wnormalized
6390 @opindex Wno-normalized
6391 @cindex NFC
6392 @cindex NFKC
6393 @cindex character set, input normalization
6394 In ISO C and ISO C++, two identifiers are different if they are
6395 different sequences of characters.  However, sometimes when characters
6396 outside the basic ASCII character set are used, you can have two
6397 different character sequences that look the same.  To avoid confusion,
6398 the ISO 10646 standard sets out some @dfn{normalization rules} which
6399 when applied ensure that two sequences that look the same are turned into
6400 the same sequence.  GCC can warn you if you are using identifiers that
6401 have not been normalized; this option controls that warning.
6403 There are four levels of warning supported by GCC@.  The default is
6404 @option{-Wnormalized=nfc}, which warns about any identifier that is
6405 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
6406 recommended form for most uses.  It is equivalent to
6407 @option{-Wnormalized}.
6409 Unfortunately, there are some characters allowed in identifiers by
6410 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
6411 identifiers.  That is, there's no way to use these symbols in portable
6412 ISO C or C++ and have all your identifiers in NFC@.
6413 @option{-Wnormalized=id} suppresses the warning for these characters.
6414 It is hoped that future versions of the standards involved will correct
6415 this, which is why this option is not the default.
6417 You can switch the warning off for all characters by writing
6418 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
6419 only do this if you are using some other normalization scheme (like
6420 ``D''), because otherwise you can easily create bugs that are
6421 literally impossible to see.
6423 Some characters in ISO 10646 have distinct meanings but look identical
6424 in some fonts or display methodologies, especially once formatting has
6425 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
6426 LETTER N'', displays just like a regular @code{n} that has been
6427 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
6428 normalization scheme to convert all these into a standard form as
6429 well, and GCC warns if your code is not in NFKC if you use
6430 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
6431 about every identifier that contains the letter O because it might be
6432 confused with the digit 0, and so is not the default, but may be
6433 useful as a local coding convention if the programming environment 
6434 cannot be fixed to display these characters distinctly.
6436 @item -Wno-deprecated
6437 @opindex Wno-deprecated
6438 @opindex Wdeprecated
6439 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
6441 @item -Wno-deprecated-declarations
6442 @opindex Wno-deprecated-declarations
6443 @opindex Wdeprecated-declarations
6444 Do not warn about uses of functions (@pxref{Function Attributes}),
6445 variables (@pxref{Variable Attributes}), and types (@pxref{Type
6446 Attributes}) marked as deprecated by using the @code{deprecated}
6447 attribute.
6449 @item -Wno-overflow
6450 @opindex Wno-overflow
6451 @opindex Woverflow
6452 Do not warn about compile-time overflow in constant expressions.
6454 @item -Wno-odr
6455 @opindex Wno-odr
6456 @opindex Wodr
6457 Warn about One Definition Rule violations during link-time optimization.
6458 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
6460 @item -Wopenmp-simd
6461 @opindex Wopenm-simd
6462 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
6463 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
6464 option can be used to relax the cost model.
6466 @item -Woverride-init @r{(C and Objective-C only)}
6467 @opindex Woverride-init
6468 @opindex Wno-override-init
6469 @opindex W
6470 @opindex Wextra
6471 @opindex Wno-extra
6472 Warn if an initialized field without side effects is overridden when
6473 using designated initializers (@pxref{Designated Inits, , Designated
6474 Initializers}).
6476 This warning is included in @option{-Wextra}.  To get other
6477 @option{-Wextra} warnings without this one, use @option{-Wextra
6478 -Wno-override-init}.
6480 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
6481 @opindex Woverride-init-side-effects
6482 @opindex Wno-override-init-side-effects
6483 Warn if an initialized field with side effects is overridden when
6484 using designated initializers (@pxref{Designated Inits, , Designated
6485 Initializers}).  This warning is enabled by default.
6487 @item -Wpacked
6488 @opindex Wpacked
6489 @opindex Wno-packed
6490 Warn if a structure is given the packed attribute, but the packed
6491 attribute has no effect on the layout or size of the structure.
6492 Such structures may be mis-aligned for little benefit.  For
6493 instance, in this code, the variable @code{f.x} in @code{struct bar}
6494 is misaligned even though @code{struct bar} does not itself
6495 have the packed attribute:
6497 @smallexample
6498 @group
6499 struct foo @{
6500   int x;
6501   char a, b, c, d;
6502 @} __attribute__((packed));
6503 struct bar @{
6504   char z;
6505   struct foo f;
6507 @end group
6508 @end smallexample
6510 @item -Wpacked-bitfield-compat
6511 @opindex Wpacked-bitfield-compat
6512 @opindex Wno-packed-bitfield-compat
6513 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
6514 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
6515 the change can lead to differences in the structure layout.  GCC
6516 informs you when the offset of such a field has changed in GCC 4.4.
6517 For example there is no longer a 4-bit padding between field @code{a}
6518 and @code{b} in this structure:
6520 @smallexample
6521 struct foo
6523   char a:4;
6524   char b:8;
6525 @} __attribute__ ((packed));
6526 @end smallexample
6528 This warning is enabled by default.  Use
6529 @option{-Wno-packed-bitfield-compat} to disable this warning.
6531 @item -Wpacked-not-aligned @r{(C, C++, Objective-C and Objective-C++ only)}
6532 @opindex Wpacked-not-aligned
6533 @opindex Wno-packed-not-aligned
6534 Warn if a structure field with explicitly specified alignment in a
6535 packed struct or union is misaligned.  For example, a warning will
6536 be issued on @code{struct S}, like, @code{warning: alignment 1 of
6537 'struct S' is less than 8}, in this code:
6539 @smallexample
6540 @group
6541 struct __attribute__ ((aligned (8))) S8 @{ char a[8]; @};
6542 struct __attribute__ ((packed)) S @{
6543   struct S8 s8;
6545 @end group
6546 @end smallexample
6548 This warning is enabled by @option{-Wall}.
6550 @item -Wpadded
6551 @opindex Wpadded
6552 @opindex Wno-padded
6553 Warn if padding is included in a structure, either to align an element
6554 of the structure or to align the whole structure.  Sometimes when this
6555 happens it is possible to rearrange the fields of the structure to
6556 reduce the padding and so make the structure smaller.
6558 @item -Wredundant-decls
6559 @opindex Wredundant-decls
6560 @opindex Wno-redundant-decls
6561 Warn if anything is declared more than once in the same scope, even in
6562 cases where multiple declaration is valid and changes nothing.
6564 @item -Wrestrict
6565 @opindex Wrestrict
6566 @opindex Wno-restrict
6567 Warn when an argument passed to a restrict-qualified parameter
6568 aliases with another argument.
6570 @item -Wnested-externs @r{(C and Objective-C only)}
6571 @opindex Wnested-externs
6572 @opindex Wno-nested-externs
6573 Warn if an @code{extern} declaration is encountered within a function.
6575 @item -Wno-inherited-variadic-ctor
6576 @opindex Winherited-variadic-ctor
6577 @opindex Wno-inherited-variadic-ctor
6578 Suppress warnings about use of C++11 inheriting constructors when the
6579 base class inherited from has a C variadic constructor; the warning is
6580 on by default because the ellipsis is not inherited.
6582 @item -Winline
6583 @opindex Winline
6584 @opindex Wno-inline
6585 Warn if a function that is declared as inline cannot be inlined.
6586 Even with this option, the compiler does not warn about failures to
6587 inline functions declared in system headers.
6589 The compiler uses a variety of heuristics to determine whether or not
6590 to inline a function.  For example, the compiler takes into account
6591 the size of the function being inlined and the amount of inlining
6592 that has already been done in the current function.  Therefore,
6593 seemingly insignificant changes in the source program can cause the
6594 warnings produced by @option{-Winline} to appear or disappear.
6596 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
6597 @opindex Wno-invalid-offsetof
6598 @opindex Winvalid-offsetof
6599 Suppress warnings from applying the @code{offsetof} macro to a non-POD
6600 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
6601 to a non-standard-layout type is undefined.  In existing C++ implementations,
6602 however, @code{offsetof} typically gives meaningful results.
6603 This flag is for users who are aware that they are
6604 writing nonportable code and who have deliberately chosen to ignore the
6605 warning about it.
6607 The restrictions on @code{offsetof} may be relaxed in a future version
6608 of the C++ standard.
6610 @item -Wint-in-bool-context
6611 @opindex Wint-in-bool-context
6612 @opindex Wno-int-in-bool-context
6613 Warn for suspicious use of integer values where boolean values are expected,
6614 such as conditional expressions (?:) using non-boolean integer constants in
6615 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
6616 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
6617 for all kinds of multiplications regardless of the data type.
6618 This warning is enabled by @option{-Wall}.
6620 @item -Wno-int-to-pointer-cast
6621 @opindex Wno-int-to-pointer-cast
6622 @opindex Wint-to-pointer-cast
6623 Suppress warnings from casts to pointer type of an integer of a
6624 different size. In C++, casting to a pointer type of smaller size is
6625 an error. @option{Wint-to-pointer-cast} is enabled by default.
6628 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
6629 @opindex Wno-pointer-to-int-cast
6630 @opindex Wpointer-to-int-cast
6631 Suppress warnings from casts from a pointer to an integer type of a
6632 different size.
6634 @item -Winvalid-pch
6635 @opindex Winvalid-pch
6636 @opindex Wno-invalid-pch
6637 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
6638 the search path but cannot be used.
6640 @item -Wlong-long
6641 @opindex Wlong-long
6642 @opindex Wno-long-long
6643 Warn if @code{long long} type is used.  This is enabled by either
6644 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
6645 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
6647 @item -Wvariadic-macros
6648 @opindex Wvariadic-macros
6649 @opindex Wno-variadic-macros
6650 Warn if variadic macros are used in ISO C90 mode, or if the GNU
6651 alternate syntax is used in ISO C99 mode.  This is enabled by either
6652 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
6653 messages, use @option{-Wno-variadic-macros}.
6655 @item -Wvarargs
6656 @opindex Wvarargs
6657 @opindex Wno-varargs
6658 Warn upon questionable usage of the macros used to handle variable
6659 arguments like @code{va_start}.  This is default.  To inhibit the
6660 warning messages, use @option{-Wno-varargs}.
6662 @item -Wvector-operation-performance
6663 @opindex Wvector-operation-performance
6664 @opindex Wno-vector-operation-performance
6665 Warn if vector operation is not implemented via SIMD capabilities of the
6666 architecture.  Mainly useful for the performance tuning.
6667 Vector operation can be implemented @code{piecewise}, which means that the
6668 scalar operation is performed on every vector element; 
6669 @code{in parallel}, which means that the vector operation is implemented
6670 using scalars of wider type, which normally is more performance efficient;
6671 and @code{as a single scalar}, which means that vector fits into a
6672 scalar type.
6674 @item -Wno-virtual-move-assign
6675 @opindex Wvirtual-move-assign
6676 @opindex Wno-virtual-move-assign
6677 Suppress warnings about inheriting from a virtual base with a
6678 non-trivial C++11 move assignment operator.  This is dangerous because
6679 if the virtual base is reachable along more than one path, it is
6680 moved multiple times, which can mean both objects end up in the
6681 moved-from state.  If the move assignment operator is written to avoid
6682 moving from a moved-from object, this warning can be disabled.
6684 @item -Wvla
6685 @opindex Wvla
6686 @opindex Wno-vla
6687 Warn if a variable-length array is used in the code.
6688 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
6689 the variable-length array.
6691 @item -Wvla-larger-than=@var{n}
6692 If this option is used, the compiler will warn on uses of
6693 variable-length arrays where the size is either unbounded, or bounded
6694 by an argument that can be larger than @var{n} bytes.  This is similar
6695 to how @option{-Walloca-larger-than=@var{n}} works, but with
6696 variable-length arrays.
6698 Note that GCC may optimize small variable-length arrays of a known
6699 value into plain arrays, so this warning may not get triggered for
6700 such arrays.
6702 This warning is not enabled by @option{-Wall}, and is only active when
6703 @option{-ftree-vrp} is active (default for @option{-O2} and above).
6705 See also @option{-Walloca-larger-than=@var{n}}.
6707 @item -Wvolatile-register-var
6708 @opindex Wvolatile-register-var
6709 @opindex Wno-volatile-register-var
6710 Warn if a register variable is declared volatile.  The volatile
6711 modifier does not inhibit all optimizations that may eliminate reads
6712 and/or writes to register variables.  This warning is enabled by
6713 @option{-Wall}.
6715 @item -Wdisabled-optimization
6716 @opindex Wdisabled-optimization
6717 @opindex Wno-disabled-optimization
6718 Warn if a requested optimization pass is disabled.  This warning does
6719 not generally indicate that there is anything wrong with your code; it
6720 merely indicates that GCC's optimizers are unable to handle the code
6721 effectively.  Often, the problem is that your code is too big or too
6722 complex; GCC refuses to optimize programs when the optimization
6723 itself is likely to take inordinate amounts of time.
6725 @item -Wpointer-sign @r{(C and Objective-C only)}
6726 @opindex Wpointer-sign
6727 @opindex Wno-pointer-sign
6728 Warn for pointer argument passing or assignment with different signedness.
6729 This option is only supported for C and Objective-C@.  It is implied by
6730 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
6731 @option{-Wno-pointer-sign}.
6733 @item -Wstack-protector
6734 @opindex Wstack-protector
6735 @opindex Wno-stack-protector
6736 This option is only active when @option{-fstack-protector} is active.  It
6737 warns about functions that are not protected against stack smashing.
6739 @item -Woverlength-strings
6740 @opindex Woverlength-strings
6741 @opindex Wno-overlength-strings
6742 Warn about string constants that are longer than the ``minimum
6743 maximum'' length specified in the C standard.  Modern compilers
6744 generally allow string constants that are much longer than the
6745 standard's minimum limit, but very portable programs should avoid
6746 using longer strings.
6748 The limit applies @emph{after} string constant concatenation, and does
6749 not count the trailing NUL@.  In C90, the limit was 509 characters; in
6750 C99, it was raised to 4095.  C++98 does not specify a normative
6751 minimum maximum, so we do not diagnose overlength strings in C++@.
6753 This option is implied by @option{-Wpedantic}, and can be disabled with
6754 @option{-Wno-overlength-strings}.
6756 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
6757 @opindex Wunsuffixed-float-constants
6759 Issue a warning for any floating constant that does not have
6760 a suffix.  When used together with @option{-Wsystem-headers} it
6761 warns about such constants in system header files.  This can be useful
6762 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
6763 from the decimal floating-point extension to C99.
6765 @item -Wno-designated-init @r{(C and Objective-C only)}
6766 Suppress warnings when a positional initializer is used to initialize
6767 a structure that has been marked with the @code{designated_init}
6768 attribute.
6770 @item -Whsa
6771 Issue a warning when HSAIL cannot be emitted for the compiled function or
6772 OpenMP construct.
6774 @end table
6776 @node Debugging Options
6777 @section Options for Debugging Your Program
6778 @cindex options, debugging
6779 @cindex debugging information options
6781 To tell GCC to emit extra information for use by a debugger, in almost 
6782 all cases you need only to add @option{-g} to your other options.
6784 GCC allows you to use @option{-g} with
6785 @option{-O}.  The shortcuts taken by optimized code may occasionally
6786 be surprising: some variables you declared may not exist
6787 at all; flow of control may briefly move where you did not expect it;
6788 some statements may not be executed because they compute constant
6789 results or their values are already at hand; some statements may
6790 execute in different places because they have been moved out of loops.
6791 Nevertheless it is possible to debug optimized output.  This makes
6792 it reasonable to use the optimizer for programs that might have bugs.
6794 If you are not using some other optimization option, consider
6795 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
6796 With no @option{-O} option at all, some compiler passes that collect
6797 information useful for debugging do not run at all, so that
6798 @option{-Og} may result in a better debugging experience.
6800 @table @gcctabopt
6801 @item -g
6802 @opindex g
6803 Produce debugging information in the operating system's native format
6804 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
6805 information.
6807 On most systems that use stabs format, @option{-g} enables use of extra
6808 debugging information that only GDB can use; this extra information
6809 makes debugging work better in GDB but probably makes other debuggers
6810 crash or
6811 refuse to read the program.  If you want to control for certain whether
6812 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
6813 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
6815 @item -ggdb
6816 @opindex ggdb
6817 Produce debugging information for use by GDB@.  This means to use the
6818 most expressive format available (DWARF, stabs, or the native format
6819 if neither of those are supported), including GDB extensions if at all
6820 possible.
6822 @item -gdwarf
6823 @itemx -gdwarf-@var{version}
6824 @opindex gdwarf
6825 Produce debugging information in DWARF format (if that is supported).
6826 The value of @var{version} may be either 2, 3, 4 or 5; the default version
6827 for most targets is 4.  DWARF Version 5 is only experimental.
6829 Note that with DWARF Version 2, some ports require and always
6830 use some non-conflicting DWARF 3 extensions in the unwind tables.
6832 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
6833 for maximum benefit.
6835 GCC no longer supports DWARF Version 1, which is substantially
6836 different than Version 2 and later.  For historical reasons, some
6837 other DWARF-related options such as
6838 @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
6839 in their names, but apply to all currently-supported versions of DWARF.
6841 @item -gstabs
6842 @opindex gstabs
6843 Produce debugging information in stabs format (if that is supported),
6844 without GDB extensions.  This is the format used by DBX on most BSD
6845 systems.  On MIPS, Alpha and System V Release 4 systems this option
6846 produces stabs debugging output that is not understood by DBX or SDB@.
6847 On System V Release 4 systems this option requires the GNU assembler.
6849 @item -gstabs+
6850 @opindex gstabs+
6851 Produce debugging information in stabs format (if that is supported),
6852 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6853 use of these extensions is likely to make other debuggers crash or
6854 refuse to read the program.
6856 @item -gcoff
6857 @opindex gcoff
6858 Produce debugging information in COFF format (if that is supported).
6859 This is the format used by SDB on most System V systems prior to
6860 System V Release 4.
6862 @item -gxcoff
6863 @opindex gxcoff
6864 Produce debugging information in XCOFF format (if that is supported).
6865 This is the format used by the DBX debugger on IBM RS/6000 systems.
6867 @item -gxcoff+
6868 @opindex gxcoff+
6869 Produce debugging information in XCOFF format (if that is supported),
6870 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6871 use of these extensions is likely to make other debuggers crash or
6872 refuse to read the program, and may cause assemblers other than the GNU
6873 assembler (GAS) to fail with an error.
6875 @item -gvms
6876 @opindex gvms
6877 Produce debugging information in Alpha/VMS debug format (if that is
6878 supported).  This is the format used by DEBUG on Alpha/VMS systems.
6880 @item -g@var{level}
6881 @itemx -ggdb@var{level}
6882 @itemx -gstabs@var{level}
6883 @itemx -gcoff@var{level}
6884 @itemx -gxcoff@var{level}
6885 @itemx -gvms@var{level}
6886 Request debugging information and also use @var{level} to specify how
6887 much information.  The default level is 2.
6889 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
6890 @option{-g}.
6892 Level 1 produces minimal information, enough for making backtraces in
6893 parts of the program that you don't plan to debug.  This includes
6894 descriptions of functions and external variables, and line number
6895 tables, but no information about local variables.
6897 Level 3 includes extra information, such as all the macro definitions
6898 present in the program.  Some debuggers support macro expansion when
6899 you use @option{-g3}.
6901 @option{-gdwarf} does not accept a concatenated debug level, to avoid
6902 confusion with @option{-gdwarf-@var{level}}.
6903 Instead use an additional @option{-g@var{level}} option to change the
6904 debug level for DWARF.
6906 @item -feliminate-unused-debug-symbols
6907 @opindex feliminate-unused-debug-symbols
6908 Produce debugging information in stabs format (if that is supported),
6909 for only symbols that are actually used.
6911 @item -femit-class-debug-always
6912 @opindex femit-class-debug-always
6913 Instead of emitting debugging information for a C++ class in only one
6914 object file, emit it in all object files using the class.  This option
6915 should be used only with debuggers that are unable to handle the way GCC
6916 normally emits debugging information for classes because using this
6917 option increases the size of debugging information by as much as a
6918 factor of two.
6920 @item -fno-merge-debug-strings
6921 @opindex fmerge-debug-strings
6922 @opindex fno-merge-debug-strings
6923 Direct the linker to not merge together strings in the debugging
6924 information that are identical in different object files.  Merging is
6925 not supported by all assemblers or linkers.  Merging decreases the size
6926 of the debug information in the output file at the cost of increasing
6927 link processing time.  Merging is enabled by default.
6929 @item -fdebug-prefix-map=@var{old}=@var{new}
6930 @opindex fdebug-prefix-map
6931 When compiling files in directory @file{@var{old}}, record debugging
6932 information describing them as in @file{@var{new}} instead.
6934 @item -fvar-tracking
6935 @opindex fvar-tracking
6936 Run variable tracking pass.  It computes where variables are stored at each
6937 position in code.  Better debugging information is then generated
6938 (if the debugging information format supports this information).
6940 It is enabled by default when compiling with optimization (@option{-Os},
6941 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6942 the debug info format supports it.
6944 @item -fvar-tracking-assignments
6945 @opindex fvar-tracking-assignments
6946 @opindex fno-var-tracking-assignments
6947 Annotate assignments to user variables early in the compilation and
6948 attempt to carry the annotations over throughout the compilation all the
6949 way to the end, in an attempt to improve debug information while
6950 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6952 It can be enabled even if var-tracking is disabled, in which case
6953 annotations are created and maintained, but discarded at the end.
6954 By default, this flag is enabled together with @option{-fvar-tracking},
6955 except when selective scheduling is enabled.
6957 @item -gsplit-dwarf
6958 @opindex gsplit-dwarf
6959 Separate as much DWARF debugging information as possible into a
6960 separate output file with the extension @file{.dwo}.  This option allows
6961 the build system to avoid linking files with debug information.  To
6962 be useful, this option requires a debugger capable of reading @file{.dwo}
6963 files.
6965 @item -gpubnames
6966 @opindex gpubnames
6967 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
6969 @item -ggnu-pubnames
6970 @opindex ggnu-pubnames
6971 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
6972 suitable for conversion into a GDB@ index.  This option is only useful
6973 with a linker that can produce GDB@ index version 7.
6975 @item -fdebug-types-section
6976 @opindex fdebug-types-section
6977 @opindex fno-debug-types-section
6978 When using DWARF Version 4 or higher, type DIEs can be put into
6979 their own @code{.debug_types} section instead of making them part of the
6980 @code{.debug_info} section.  It is more efficient to put them in a separate
6981 comdat sections since the linker can then remove duplicates.
6982 But not all DWARF consumers support @code{.debug_types} sections yet
6983 and on some objects @code{.debug_types} produces larger instead of smaller
6984 debugging information.
6986 @item -grecord-gcc-switches
6987 @item -gno-record-gcc-switches
6988 @opindex grecord-gcc-switches
6989 @opindex gno-record-gcc-switches
6990 This switch causes the command-line options used to invoke the
6991 compiler that may affect code generation to be appended to the
6992 DW_AT_producer attribute in DWARF debugging information.  The options
6993 are concatenated with spaces separating them from each other and from
6994 the compiler version.  
6995 It is enabled by default.
6996 See also @option{-frecord-gcc-switches} for another
6997 way of storing compiler options into the object file.  
6999 @item -gstrict-dwarf
7000 @opindex gstrict-dwarf
7001 Disallow using extensions of later DWARF standard version than selected
7002 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
7003 DWARF extensions from later standard versions is allowed.
7005 @item -gno-strict-dwarf
7006 @opindex gno-strict-dwarf
7007 Allow using extensions of later DWARF standard version than selected with
7008 @option{-gdwarf-@var{version}}.
7010 @item -gcolumn-info
7011 @item -gno-column-info
7012 @opindex gcolumn-info
7013 @opindex gno-column-info
7014 Emit location column information into DWARF debugging information, rather
7015 than just file and line.
7016 This option is disabled by default.
7018 @item -gz@r{[}=@var{type}@r{]}
7019 @opindex gz
7020 Produce compressed debug sections in DWARF format, if that is supported.
7021 If @var{type} is not given, the default type depends on the capabilities
7022 of the assembler and linker used.  @var{type} may be one of
7023 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
7024 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
7025 compression in traditional GNU format).  If the linker doesn't support
7026 writing compressed debug sections, the option is rejected.  Otherwise,
7027 if the assembler does not support them, @option{-gz} is silently ignored
7028 when producing object files.
7030 @item -femit-struct-debug-baseonly
7031 @opindex femit-struct-debug-baseonly
7032 Emit debug information for struct-like types
7033 only when the base name of the compilation source file
7034 matches the base name of file in which the struct is defined.
7036 This option substantially reduces the size of debugging information,
7037 but at significant potential loss in type information to the debugger.
7038 See @option{-femit-struct-debug-reduced} for a less aggressive option.
7039 See @option{-femit-struct-debug-detailed} for more detailed control.
7041 This option works only with DWARF debug output.
7043 @item -femit-struct-debug-reduced
7044 @opindex femit-struct-debug-reduced
7045 Emit debug information for struct-like types
7046 only when the base name of the compilation source file
7047 matches the base name of file in which the type is defined,
7048 unless the struct is a template or defined in a system header.
7050 This option significantly reduces the size of debugging information,
7051 with some potential loss in type information to the debugger.
7052 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
7053 See @option{-femit-struct-debug-detailed} for more detailed control.
7055 This option works only with DWARF debug output.
7057 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
7058 @opindex femit-struct-debug-detailed
7059 Specify the struct-like types
7060 for which the compiler generates debug information.
7061 The intent is to reduce duplicate struct debug information
7062 between different object files within the same program.
7064 This option is a detailed version of
7065 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
7066 which serves for most needs.
7068 A specification has the syntax@*
7069 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
7071 The optional first word limits the specification to
7072 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
7073 A struct type is used directly when it is the type of a variable, member.
7074 Indirect uses arise through pointers to structs.
7075 That is, when use of an incomplete struct is valid, the use is indirect.
7076 An example is
7077 @samp{struct one direct; struct two * indirect;}.
7079 The optional second word limits the specification to
7080 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
7081 Generic structs are a bit complicated to explain.
7082 For C++, these are non-explicit specializations of template classes,
7083 or non-template classes within the above.
7084 Other programming languages have generics,
7085 but @option{-femit-struct-debug-detailed} does not yet implement them.
7087 The third word specifies the source files for those
7088 structs for which the compiler should emit debug information.
7089 The values @samp{none} and @samp{any} have the normal meaning.
7090 The value @samp{base} means that
7091 the base of name of the file in which the type declaration appears
7092 must match the base of the name of the main compilation file.
7093 In practice, this means that when compiling @file{foo.c}, debug information
7094 is generated for types declared in that file and @file{foo.h},
7095 but not other header files.
7096 The value @samp{sys} means those types satisfying @samp{base}
7097 or declared in system or compiler headers.
7099 You may need to experiment to determine the best settings for your application.
7101 The default is @option{-femit-struct-debug-detailed=all}.
7103 This option works only with DWARF debug output.
7105 @item -fno-dwarf2-cfi-asm
7106 @opindex fdwarf2-cfi-asm
7107 @opindex fno-dwarf2-cfi-asm
7108 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
7109 instead of using GAS @code{.cfi_*} directives.
7111 @item -fno-eliminate-unused-debug-types
7112 @opindex feliminate-unused-debug-types
7113 @opindex fno-eliminate-unused-debug-types
7114 Normally, when producing DWARF output, GCC avoids producing debug symbol 
7115 output for types that are nowhere used in the source file being compiled.
7116 Sometimes it is useful to have GCC emit debugging
7117 information for all types declared in a compilation
7118 unit, regardless of whether or not they are actually used
7119 in that compilation unit, for example 
7120 if, in the debugger, you want to cast a value to a type that is
7121 not actually used in your program (but is declared).  More often,
7122 however, this results in a significant amount of wasted space.
7123 @end table
7125 @node Optimize Options
7126 @section Options That Control Optimization
7127 @cindex optimize options
7128 @cindex options, optimization
7130 These options control various sorts of optimizations.
7132 Without any optimization option, the compiler's goal is to reduce the
7133 cost of compilation and to make debugging produce the expected
7134 results.  Statements are independent: if you stop the program with a
7135 breakpoint between statements, you can then assign a new value to any
7136 variable or change the program counter to any other statement in the
7137 function and get exactly the results you expect from the source
7138 code.
7140 Turning on optimization flags makes the compiler attempt to improve
7141 the performance and/or code size at the expense of compilation time
7142 and possibly the ability to debug the program.
7144 The compiler performs optimization based on the knowledge it has of the
7145 program.  Compiling multiple files at once to a single output file mode allows
7146 the compiler to use information gained from all of the files when compiling
7147 each of them.
7149 Not all optimizations are controlled directly by a flag.  Only
7150 optimizations that have a flag are listed in this section.
7152 Most optimizations are only enabled if an @option{-O} level is set on
7153 the command line.  Otherwise they are disabled, even if individual
7154 optimization flags are specified.
7156 Depending on the target and how GCC was configured, a slightly different
7157 set of optimizations may be enabled at each @option{-O} level than
7158 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7159 to find out the exact set of optimizations that are enabled at each level.
7160 @xref{Overall Options}, for examples.
7162 @table @gcctabopt
7163 @item -O
7164 @itemx -O1
7165 @opindex O
7166 @opindex O1
7167 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7168 more memory for a large function.
7170 With @option{-O}, the compiler tries to reduce code size and execution
7171 time, without performing any optimizations that take a great deal of
7172 compilation time.
7174 @option{-O} turns on the following optimization flags:
7175 @gccoptlist{
7176 -fauto-inc-dec @gol
7177 -fbranch-count-reg @gol
7178 -fcombine-stack-adjustments @gol
7179 -fcompare-elim @gol
7180 -fcprop-registers @gol
7181 -fdce @gol
7182 -fdefer-pop @gol
7183 -fdelayed-branch @gol
7184 -fdse @gol
7185 -fforward-propagate @gol
7186 -fguess-branch-probability @gol
7187 -fif-conversion2 @gol
7188 -fif-conversion @gol
7189 -finline-functions-called-once @gol
7190 -fipa-pure-const @gol
7191 -fipa-profile @gol
7192 -fipa-reference @gol
7193 -fmerge-constants @gol
7194 -fmove-loop-invariants @gol
7195 -freorder-blocks @gol
7196 -fshrink-wrap @gol
7197 -fshrink-wrap-separate @gol
7198 -fsplit-wide-types @gol
7199 -fssa-backprop @gol
7200 -fssa-phiopt @gol
7201 -ftree-bit-ccp @gol
7202 -ftree-ccp @gol
7203 -ftree-ch @gol
7204 -ftree-coalesce-vars @gol
7205 -ftree-copy-prop @gol
7206 -ftree-dce @gol
7207 -ftree-dominator-opts @gol
7208 -ftree-dse @gol
7209 -ftree-forwprop @gol
7210 -ftree-fre @gol
7211 -ftree-phiprop @gol
7212 -ftree-sink @gol
7213 -ftree-slsr @gol
7214 -ftree-sra @gol
7215 -ftree-pta @gol
7216 -ftree-ter @gol
7217 -funit-at-a-time}
7219 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7220 where doing so does not interfere with debugging.
7222 @item -O2
7223 @opindex O2
7224 Optimize even more.  GCC performs nearly all supported optimizations
7225 that do not involve a space-speed tradeoff.
7226 As compared to @option{-O}, this option increases both compilation time
7227 and the performance of the generated code.
7229 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7230 also turns on the following optimization flags:
7231 @gccoptlist{-fthread-jumps @gol
7232 -falign-functions  -falign-jumps @gol
7233 -falign-loops  -falign-labels @gol
7234 -fcaller-saves @gol
7235 -fcrossjumping @gol
7236 -fcse-follow-jumps  -fcse-skip-blocks @gol
7237 -fdelete-null-pointer-checks @gol
7238 -fdevirtualize -fdevirtualize-speculatively @gol
7239 -fexpensive-optimizations @gol
7240 -fgcse  -fgcse-lm  @gol
7241 -fhoist-adjacent-loads @gol
7242 -finline-small-functions @gol
7243 -findirect-inlining @gol
7244 -fipa-cp @gol
7245 -fipa-bit-cp @gol
7246 -fipa-vrp @gol
7247 -fipa-sra @gol
7248 -fipa-icf @gol
7249 -fisolate-erroneous-paths-dereference @gol
7250 -flra-remat @gol
7251 -foptimize-sibling-calls @gol
7252 -foptimize-strlen @gol
7253 -fpartial-inlining @gol
7254 -fpeephole2 @gol
7255 -freorder-blocks-algorithm=stc @gol
7256 -freorder-blocks-and-partition -freorder-functions @gol
7257 -frerun-cse-after-loop  @gol
7258 -fsched-interblock  -fsched-spec @gol
7259 -fschedule-insns  -fschedule-insns2 @gol
7260 -fstore-merging @gol
7261 -fstrict-aliasing @gol
7262 -ftree-builtin-call-dce @gol
7263 -ftree-switch-conversion -ftree-tail-merge @gol
7264 -fcode-hoisting @gol
7265 -ftree-pre @gol
7266 -ftree-vrp @gol
7267 -fipa-ra}
7269 Please note the warning under @option{-fgcse} about
7270 invoking @option{-O2} on programs that use computed gotos.
7272 @item -O3
7273 @opindex O3
7274 Optimize yet more.  @option{-O3} turns on all optimizations specified
7275 by @option{-O2} and also turns on the following optimization flags:
7276 @gccoptlist{-finline-functions @gol
7277 -funswitch-loops @gol
7278 -fpredictive-commoning @gol
7279 -fgcse-after-reload @gol
7280 -ftree-loop-vectorize @gol
7281 -ftree-loop-distribution @gol
7282 -ftree-loop-distribute-patterns @gol
7283 -fsplit-paths @gol
7284 -ftree-slp-vectorize @gol
7285 -fvect-cost-model @gol
7286 -ftree-partial-pre @gol
7287 -fpeel-loops @gol
7288 -fipa-cp-clone}
7290 @item -O0
7291 @opindex O0
7292 Reduce compilation time and make debugging produce the expected
7293 results.  This is the default.
7295 @item -Os
7296 @opindex Os
7297 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7298 do not typically increase code size.  It also performs further
7299 optimizations designed to reduce code size.
7301 @option{-Os} disables the following optimization flags:
7302 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7303 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
7304 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
7306 @item -Ofast
7307 @opindex Ofast
7308 Disregard strict standards compliance.  @option{-Ofast} enables all
7309 @option{-O3} optimizations.  It also enables optimizations that are not
7310 valid for all standard-compliant programs.
7311 It turns on @option{-ffast-math} and the Fortran-specific
7312 @option{-fstack-arrays}, unless @option{-fmax-stack-var-size} is
7313 specified, and @option{-fno-protect-parens}.
7315 @item -Og
7316 @opindex Og
7317 Optimize debugging experience.  @option{-Og} enables optimizations
7318 that do not interfere with debugging. It should be the optimization
7319 level of choice for the standard edit-compile-debug cycle, offering
7320 a reasonable level of optimization while maintaining fast compilation
7321 and a good debugging experience.
7322 @end table
7324 If you use multiple @option{-O} options, with or without level numbers,
7325 the last such option is the one that is effective.
7327 Options of the form @option{-f@var{flag}} specify machine-independent
7328 flags.  Most flags have both positive and negative forms; the negative
7329 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7330 below, only one of the forms is listed---the one you typically 
7331 use.  You can figure out the other form by either removing @samp{no-}
7332 or adding it.
7334 The following options control specific optimizations.  They are either
7335 activated by @option{-O} options or are related to ones that are.  You
7336 can use the following flags in the rare cases when ``fine-tuning'' of
7337 optimizations to be performed is desired.
7339 @table @gcctabopt
7340 @item -fno-defer-pop
7341 @opindex fno-defer-pop
7342 Always pop the arguments to each function call as soon as that function
7343 returns.  For machines that must pop arguments after a function call,
7344 the compiler normally lets arguments accumulate on the stack for several
7345 function calls and pops them all at once.
7347 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7349 @item -fforward-propagate
7350 @opindex fforward-propagate
7351 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7352 instructions and checks if the result can be simplified.  If loop unrolling
7353 is active, two passes are performed and the second is scheduled after
7354 loop unrolling.
7356 This option is enabled by default at optimization levels @option{-O},
7357 @option{-O2}, @option{-O3}, @option{-Os}.
7359 @item -ffp-contract=@var{style}
7360 @opindex ffp-contract
7361 @option{-ffp-contract=off} disables floating-point expression contraction.
7362 @option{-ffp-contract=fast} enables floating-point expression contraction
7363 such as forming of fused multiply-add operations if the target has
7364 native support for them.
7365 @option{-ffp-contract=on} enables floating-point expression contraction
7366 if allowed by the language standard.  This is currently not implemented
7367 and treated equal to @option{-ffp-contract=off}.
7369 The default is @option{-ffp-contract=fast}.
7371 @item -fomit-frame-pointer
7372 @opindex fomit-frame-pointer
7373 Don't keep the frame pointer in a register for functions that
7374 don't need one.  This avoids the instructions to save, set up and
7375 restore frame pointers; it also makes an extra register available
7376 in many functions.  @strong{It also makes debugging impossible on
7377 some machines.}
7379 On some machines, such as the VAX, this flag has no effect, because
7380 the standard calling sequence automatically handles the frame pointer
7381 and nothing is saved by pretending it doesn't exist.  The
7382 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7383 whether a target machine supports this flag.  @xref{Registers,,Register
7384 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7386 The default setting (when not optimizing for
7387 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7388 @option{-fomit-frame-pointer}.  You can configure GCC with the
7389 @option{--enable-frame-pointer} configure option to change the default.
7391 Note that @option{-fno-omit-frame-pointer} doesn't force a new stack
7392 frame for all functions if it isn't otherwise needed, and hence doesn't
7393 guarantee a new frame pointer for all functions.
7395 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7397 @item -foptimize-sibling-calls
7398 @opindex foptimize-sibling-calls
7399 Optimize sibling and tail recursive calls.
7401 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7403 @item -foptimize-strlen
7404 @opindex foptimize-strlen
7405 Optimize various standard C string functions (e.g. @code{strlen},
7406 @code{strchr} or @code{strcpy}) and
7407 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7409 Enabled at levels @option{-O2}, @option{-O3}.
7411 @item -fno-inline
7412 @opindex fno-inline
7413 Do not expand any functions inline apart from those marked with
7414 the @code{always_inline} attribute.  This is the default when not
7415 optimizing.
7417 Single functions can be exempted from inlining by marking them
7418 with the @code{noinline} attribute.
7420 @item -finline-small-functions
7421 @opindex finline-small-functions
7422 Integrate functions into their callers when their body is smaller than expected
7423 function call code (so overall size of program gets smaller).  The compiler
7424 heuristically decides which functions are simple enough to be worth integrating
7425 in this way.  This inlining applies to all functions, even those not declared
7426 inline.
7428 Enabled at level @option{-O2}.
7430 @item -findirect-inlining
7431 @opindex findirect-inlining
7432 Inline also indirect calls that are discovered to be known at compile
7433 time thanks to previous inlining.  This option has any effect only
7434 when inlining itself is turned on by the @option{-finline-functions}
7435 or @option{-finline-small-functions} options.
7437 Enabled at level @option{-O2}.
7439 @item -finline-functions
7440 @opindex finline-functions
7441 Consider all functions for inlining, even if they are not declared inline.
7442 The compiler heuristically decides which functions are worth integrating
7443 in this way.
7445 If all calls to a given function are integrated, and the function is
7446 declared @code{static}, then the function is normally not output as
7447 assembler code in its own right.
7449 Enabled at level @option{-O3}.
7451 @item -finline-functions-called-once
7452 @opindex finline-functions-called-once
7453 Consider all @code{static} functions called once for inlining into their
7454 caller even if they are not marked @code{inline}.  If a call to a given
7455 function is integrated, then the function is not output as assembler code
7456 in its own right.
7458 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7460 @item -fearly-inlining
7461 @opindex fearly-inlining
7462 Inline functions marked by @code{always_inline} and functions whose body seems
7463 smaller than the function call overhead early before doing
7464 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7465 makes profiling significantly cheaper and usually inlining faster on programs
7466 having large chains of nested wrapper functions.
7468 Enabled by default.
7470 @item -fipa-sra
7471 @opindex fipa-sra
7472 Perform interprocedural scalar replacement of aggregates, removal of
7473 unused parameters and replacement of parameters passed by reference
7474 by parameters passed by value.
7476 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7478 @item -finline-limit=@var{n}
7479 @opindex finline-limit
7480 By default, GCC limits the size of functions that can be inlined.  This flag
7481 allows coarse control of this limit.  @var{n} is the size of functions that
7482 can be inlined in number of pseudo instructions.
7484 Inlining is actually controlled by a number of parameters, which may be
7485 specified individually by using @option{--param @var{name}=@var{value}}.
7486 The @option{-finline-limit=@var{n}} option sets some of these parameters
7487 as follows:
7489 @table @gcctabopt
7490 @item max-inline-insns-single
7491 is set to @var{n}/2.
7492 @item max-inline-insns-auto
7493 is set to @var{n}/2.
7494 @end table
7496 See below for a documentation of the individual
7497 parameters controlling inlining and for the defaults of these parameters.
7499 @emph{Note:} there may be no value to @option{-finline-limit} that results
7500 in default behavior.
7502 @emph{Note:} pseudo instruction represents, in this particular context, an
7503 abstract measurement of function's size.  In no way does it represent a count
7504 of assembly instructions and as such its exact meaning might change from one
7505 release to an another.
7507 @item -fno-keep-inline-dllexport
7508 @opindex fno-keep-inline-dllexport
7509 This is a more fine-grained version of @option{-fkeep-inline-functions},
7510 which applies only to functions that are declared using the @code{dllexport}
7511 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
7512 Functions}.
7514 @item -fkeep-inline-functions
7515 @opindex fkeep-inline-functions
7516 In C, emit @code{static} functions that are declared @code{inline}
7517 into the object file, even if the function has been inlined into all
7518 of its callers.  This switch does not affect functions using the
7519 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7520 inline functions into the object file.
7522 @item -fkeep-static-functions
7523 @opindex fkeep-static-functions
7524 Emit @code{static} functions into the object file, even if the function
7525 is never used.
7527 @item -fkeep-static-consts
7528 @opindex fkeep-static-consts
7529 Emit variables declared @code{static const} when optimization isn't turned
7530 on, even if the variables aren't referenced.
7532 GCC enables this option by default.  If you want to force the compiler to
7533 check if a variable is referenced, regardless of whether or not
7534 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7536 @item -fmerge-constants
7537 @opindex fmerge-constants
7538 Attempt to merge identical constants (string constants and floating-point
7539 constants) across compilation units.
7541 This option is the default for optimized compilation if the assembler and
7542 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7543 behavior.
7545 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7547 @item -fmerge-all-constants
7548 @opindex fmerge-all-constants
7549 Attempt to merge identical constants and identical variables.
7551 This option implies @option{-fmerge-constants}.  In addition to
7552 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7553 arrays or initialized constant variables with integral or floating-point
7554 types.  Languages like C or C++ require each variable, including multiple
7555 instances of the same variable in recursive calls, to have distinct locations,
7556 so using this option results in non-conforming
7557 behavior.
7559 @item -fmodulo-sched
7560 @opindex fmodulo-sched
7561 Perform swing modulo scheduling immediately before the first scheduling
7562 pass.  This pass looks at innermost loops and reorders their
7563 instructions by overlapping different iterations.
7565 @item -fmodulo-sched-allow-regmoves
7566 @opindex fmodulo-sched-allow-regmoves
7567 Perform more aggressive SMS-based modulo scheduling with register moves
7568 allowed.  By setting this flag certain anti-dependences edges are
7569 deleted, which triggers the generation of reg-moves based on the
7570 life-range analysis.  This option is effective only with
7571 @option{-fmodulo-sched} enabled.
7573 @item -fno-branch-count-reg
7574 @opindex fno-branch-count-reg
7575 Avoid running a pass scanning for opportunities to use ``decrement and
7576 branch'' instructions on a count register instead of generating sequences
7577 of instructions that decrement a register, compare it against zero, and
7578 then branch based upon the result.  This option is only meaningful on
7579 architectures that support such instructions, which include x86, PowerPC,
7580 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
7581 doesn't remove the decrement and branch instructions from the generated
7582 instruction stream introduced by other optimization passes.
7584 Enabled by default at @option{-O1} and higher.
7586 The default is @option{-fbranch-count-reg}.
7588 @item -fno-function-cse
7589 @opindex fno-function-cse
7590 Do not put function addresses in registers; make each instruction that
7591 calls a constant function contain the function's address explicitly.
7593 This option results in less efficient code, but some strange hacks
7594 that alter the assembler output may be confused by the optimizations
7595 performed when this option is not used.
7597 The default is @option{-ffunction-cse}
7599 @item -fno-zero-initialized-in-bss
7600 @opindex fno-zero-initialized-in-bss
7601 If the target supports a BSS section, GCC by default puts variables that
7602 are initialized to zero into BSS@.  This can save space in the resulting
7603 code.
7605 This option turns off this behavior because some programs explicitly
7606 rely on variables going to the data section---e.g., so that the
7607 resulting executable can find the beginning of that section and/or make
7608 assumptions based on that.
7610 The default is @option{-fzero-initialized-in-bss}.
7612 @item -fthread-jumps
7613 @opindex fthread-jumps
7614 Perform optimizations that check to see if a jump branches to a
7615 location where another comparison subsumed by the first is found.  If
7616 so, the first branch is redirected to either the destination of the
7617 second branch or a point immediately following it, depending on whether
7618 the condition is known to be true or false.
7620 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7622 @item -fsplit-wide-types
7623 @opindex fsplit-wide-types
7624 When using a type that occupies multiple registers, such as @code{long
7625 long} on a 32-bit system, split the registers apart and allocate them
7626 independently.  This normally generates better code for those types,
7627 but may make debugging more difficult.
7629 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7630 @option{-Os}.
7632 @item -fcse-follow-jumps
7633 @opindex fcse-follow-jumps
7634 In common subexpression elimination (CSE), scan through jump instructions
7635 when the target of the jump is not reached by any other path.  For
7636 example, when CSE encounters an @code{if} statement with an
7637 @code{else} clause, CSE follows the jump when the condition
7638 tested is false.
7640 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7642 @item -fcse-skip-blocks
7643 @opindex fcse-skip-blocks
7644 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7645 follow jumps that conditionally skip over blocks.  When CSE
7646 encounters a simple @code{if} statement with no else clause,
7647 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7648 body of the @code{if}.
7650 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7652 @item -frerun-cse-after-loop
7653 @opindex frerun-cse-after-loop
7654 Re-run common subexpression elimination after loop optimizations are
7655 performed.
7657 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7659 @item -fgcse
7660 @opindex fgcse
7661 Perform a global common subexpression elimination pass.
7662 This pass also performs global constant and copy propagation.
7664 @emph{Note:} When compiling a program using computed gotos, a GCC
7665 extension, you may get better run-time performance if you disable
7666 the global common subexpression elimination pass by adding
7667 @option{-fno-gcse} to the command line.
7669 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7671 @item -fgcse-lm
7672 @opindex fgcse-lm
7673 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7674 attempts to move loads that are only killed by stores into themselves.  This
7675 allows a loop containing a load/store sequence to be changed to a load outside
7676 the loop, and a copy/store within the loop.
7678 Enabled by default when @option{-fgcse} is enabled.
7680 @item -fgcse-sm
7681 @opindex fgcse-sm
7682 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7683 global common subexpression elimination.  This pass attempts to move
7684 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7685 loops containing a load/store sequence can be changed to a load before
7686 the loop and a store after the loop.
7688 Not enabled at any optimization level.
7690 @item -fgcse-las
7691 @opindex fgcse-las
7692 When @option{-fgcse-las} is enabled, the global common subexpression
7693 elimination pass eliminates redundant loads that come after stores to the
7694 same memory location (both partial and full redundancies).
7696 Not enabled at any optimization level.
7698 @item -fgcse-after-reload
7699 @opindex fgcse-after-reload
7700 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7701 pass is performed after reload.  The purpose of this pass is to clean up
7702 redundant spilling.
7704 @item -faggressive-loop-optimizations
7705 @opindex faggressive-loop-optimizations
7706 This option tells the loop optimizer to use language constraints to
7707 derive bounds for the number of iterations of a loop.  This assumes that
7708 loop code does not invoke undefined behavior by for example causing signed
7709 integer overflows or out-of-bound array accesses.  The bounds for the
7710 number of iterations of a loop are used to guide loop unrolling and peeling
7711 and loop exit test optimizations.
7712 This option is enabled by default.
7714 @item -funconstrained-commons
7715 @opindex funconstrained-commons
7716 This option tells the compiler that variables declared in common blocks
7717 (e.g. Fortran) may later be overridden with longer trailing arrays. This
7718 prevents certain optimizations that depend on knowing the array bounds.
7720 @item -fcrossjumping
7721 @opindex fcrossjumping
7722 Perform cross-jumping transformation.
7723 This transformation unifies equivalent code and saves code size.  The
7724 resulting code may or may not perform better than without cross-jumping.
7726 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7728 @item -fauto-inc-dec
7729 @opindex fauto-inc-dec
7730 Combine increments or decrements of addresses with memory accesses.
7731 This pass is always skipped on architectures that do not have
7732 instructions to support this.  Enabled by default at @option{-O} and
7733 higher on architectures that support this.
7735 @item -fdce
7736 @opindex fdce
7737 Perform dead code elimination (DCE) on RTL@.
7738 Enabled by default at @option{-O} and higher.
7740 @item -fdse
7741 @opindex fdse
7742 Perform dead store elimination (DSE) on RTL@.
7743 Enabled by default at @option{-O} and higher.
7745 @item -fif-conversion
7746 @opindex fif-conversion
7747 Attempt to transform conditional jumps into branch-less equivalents.  This
7748 includes use of conditional moves, min, max, set flags and abs instructions, and
7749 some tricks doable by standard arithmetics.  The use of conditional execution
7750 on chips where it is available is controlled by @option{-fif-conversion2}.
7752 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7754 @item -fif-conversion2
7755 @opindex fif-conversion2
7756 Use conditional execution (where available) to transform conditional jumps into
7757 branch-less equivalents.
7759 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7761 @item -fdeclone-ctor-dtor
7762 @opindex fdeclone-ctor-dtor
7763 The C++ ABI requires multiple entry points for constructors and
7764 destructors: one for a base subobject, one for a complete object, and
7765 one for a virtual destructor that calls operator delete afterwards.
7766 For a hierarchy with virtual bases, the base and complete variants are
7767 clones, which means two copies of the function.  With this option, the
7768 base and complete variants are changed to be thunks that call a common
7769 implementation.
7771 Enabled by @option{-Os}.
7773 @item -fdelete-null-pointer-checks
7774 @opindex fdelete-null-pointer-checks
7775 Assume that programs cannot safely dereference null pointers, and that
7776 no code or data element resides at address zero.
7777 This option enables simple constant
7778 folding optimizations at all optimization levels.  In addition, other
7779 optimization passes in GCC use this flag to control global dataflow
7780 analyses that eliminate useless checks for null pointers; these assume
7781 that a memory access to address zero always results in a trap, so
7782 that if a pointer is checked after it has already been dereferenced,
7783 it cannot be null.
7785 Note however that in some environments this assumption is not true.
7786 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7787 for programs that depend on that behavior.
7789 This option is enabled by default on most targets.  On Nios II ELF, it
7790 defaults to off.  On AVR and CR16, this option is completely disabled.  
7792 Passes that use the dataflow information
7793 are enabled independently at different optimization levels.
7795 @item -fdevirtualize
7796 @opindex fdevirtualize
7797 Attempt to convert calls to virtual functions to direct calls.  This
7798 is done both within a procedure and interprocedurally as part of
7799 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
7800 propagation (@option{-fipa-cp}).
7801 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7803 @item -fdevirtualize-speculatively
7804 @opindex fdevirtualize-speculatively
7805 Attempt to convert calls to virtual functions to speculative direct calls.
7806 Based on the analysis of the type inheritance graph, determine for a given call
7807 the set of likely targets. If the set is small, preferably of size 1, change
7808 the call into a conditional deciding between direct and indirect calls.  The
7809 speculative calls enable more optimizations, such as inlining.  When they seem
7810 useless after further optimization, they are converted back into original form.
7812 @item -fdevirtualize-at-ltrans
7813 @opindex fdevirtualize-at-ltrans
7814 Stream extra information needed for aggressive devirtualization when running
7815 the link-time optimizer in local transformation mode.  
7816 This option enables more devirtualization but
7817 significantly increases the size of streamed data. For this reason it is
7818 disabled by default.
7820 @item -fexpensive-optimizations
7821 @opindex fexpensive-optimizations
7822 Perform a number of minor optimizations that are relatively expensive.
7824 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7826 @item -free
7827 @opindex free
7828 Attempt to remove redundant extension instructions.  This is especially
7829 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7830 registers after writing to their lower 32-bit half.
7832 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7833 @option{-O3}, @option{-Os}.
7835 @item -fno-lifetime-dse
7836 @opindex fno-lifetime-dse
7837 In C++ the value of an object is only affected by changes within its
7838 lifetime: when the constructor begins, the object has an indeterminate
7839 value, and any changes during the lifetime of the object are dead when
7840 the object is destroyed.  Normally dead store elimination will take
7841 advantage of this; if your code relies on the value of the object
7842 storage persisting beyond the lifetime of the object, you can use this
7843 flag to disable this optimization.  To preserve stores before the
7844 constructor starts (e.g. because your operator new clears the object
7845 storage) but still treat the object as dead after the destructor you,
7846 can use @option{-flifetime-dse=1}.  The default behavior can be
7847 explicitly selected with @option{-flifetime-dse=2}.
7848 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
7850 @item -flive-range-shrinkage
7851 @opindex flive-range-shrinkage
7852 Attempt to decrease register pressure through register live range
7853 shrinkage.  This is helpful for fast processors with small or moderate
7854 size register sets.
7856 @item -fira-algorithm=@var{algorithm}
7857 @opindex fira-algorithm
7858 Use the specified coloring algorithm for the integrated register
7859 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7860 specifies Chow's priority coloring, or @samp{CB}, which specifies
7861 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7862 for all architectures, but for those targets that do support it, it is
7863 the default because it generates better code.
7865 @item -fira-region=@var{region}
7866 @opindex fira-region
7867 Use specified regions for the integrated register allocator.  The
7868 @var{region} argument should be one of the following:
7870 @table @samp
7872 @item all
7873 Use all loops as register allocation regions.
7874 This can give the best results for machines with a small and/or
7875 irregular register set.
7877 @item mixed
7878 Use all loops except for loops with small register pressure 
7879 as the regions.  This value usually gives
7880 the best results in most cases and for most architectures,
7881 and is enabled by default when compiling with optimization for speed
7882 (@option{-O}, @option{-O2}, @dots{}).
7884 @item one
7885 Use all functions as a single region.  
7886 This typically results in the smallest code size, and is enabled by default for
7887 @option{-Os} or @option{-O0}.
7889 @end table
7891 @item -fira-hoist-pressure
7892 @opindex fira-hoist-pressure
7893 Use IRA to evaluate register pressure in the code hoisting pass for
7894 decisions to hoist expressions.  This option usually results in smaller
7895 code, but it can slow the compiler down.
7897 This option is enabled at level @option{-Os} for all targets.
7899 @item -fira-loop-pressure
7900 @opindex fira-loop-pressure
7901 Use IRA to evaluate register pressure in loops for decisions to move
7902 loop invariants.  This option usually results in generation
7903 of faster and smaller code on machines with large register files (>= 32
7904 registers), but it can slow the compiler down.
7906 This option is enabled at level @option{-O3} for some targets.
7908 @item -fno-ira-share-save-slots
7909 @opindex fno-ira-share-save-slots
7910 Disable sharing of stack slots used for saving call-used hard
7911 registers living through a call.  Each hard register gets a
7912 separate stack slot, and as a result function stack frames are
7913 larger.
7915 @item -fno-ira-share-spill-slots
7916 @opindex fno-ira-share-spill-slots
7917 Disable sharing of stack slots allocated for pseudo-registers.  Each
7918 pseudo-register that does not get a hard register gets a separate
7919 stack slot, and as a result function stack frames are larger.
7921 @item -flra-remat
7922 @opindex flra-remat
7923 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
7924 values of spilled pseudos, LRA tries to rematerialize (recalculate)
7925 values if it is profitable.
7927 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7929 @item -fdelayed-branch
7930 @opindex fdelayed-branch
7931 If supported for the target machine, attempt to reorder instructions
7932 to exploit instruction slots available after delayed branch
7933 instructions.
7935 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7937 @item -fschedule-insns
7938 @opindex fschedule-insns
7939 If supported for the target machine, attempt to reorder instructions to
7940 eliminate execution stalls due to required data being unavailable.  This
7941 helps machines that have slow floating point or memory load instructions
7942 by allowing other instructions to be issued until the result of the load
7943 or floating-point instruction is required.
7945 Enabled at levels @option{-O2}, @option{-O3}.
7947 @item -fschedule-insns2
7948 @opindex fschedule-insns2
7949 Similar to @option{-fschedule-insns}, but requests an additional pass of
7950 instruction scheduling after register allocation has been done.  This is
7951 especially useful on machines with a relatively small number of
7952 registers and where memory load instructions take more than one cycle.
7954 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7956 @item -fno-sched-interblock
7957 @opindex fno-sched-interblock
7958 Don't schedule instructions across basic blocks.  This is normally
7959 enabled by default when scheduling before register allocation, i.e.@:
7960 with @option{-fschedule-insns} or at @option{-O2} or higher.
7962 @item -fno-sched-spec
7963 @opindex fno-sched-spec
7964 Don't allow speculative motion of non-load instructions.  This is normally
7965 enabled by default when scheduling before register allocation, i.e.@:
7966 with @option{-fschedule-insns} or at @option{-O2} or higher.
7968 @item -fsched-pressure
7969 @opindex fsched-pressure
7970 Enable register pressure sensitive insn scheduling before register
7971 allocation.  This only makes sense when scheduling before register
7972 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7973 @option{-O2} or higher.  Usage of this option can improve the
7974 generated code and decrease its size by preventing register pressure
7975 increase above the number of available hard registers and subsequent
7976 spills in register allocation.
7978 @item -fsched-spec-load
7979 @opindex fsched-spec-load
7980 Allow speculative motion of some load instructions.  This only makes
7981 sense when scheduling before register allocation, i.e.@: with
7982 @option{-fschedule-insns} or at @option{-O2} or higher.
7984 @item -fsched-spec-load-dangerous
7985 @opindex fsched-spec-load-dangerous
7986 Allow speculative motion of more load instructions.  This only makes
7987 sense when scheduling before register allocation, i.e.@: with
7988 @option{-fschedule-insns} or at @option{-O2} or higher.
7990 @item -fsched-stalled-insns
7991 @itemx -fsched-stalled-insns=@var{n}
7992 @opindex fsched-stalled-insns
7993 Define how many insns (if any) can be moved prematurely from the queue
7994 of stalled insns into the ready list during the second scheduling pass.
7995 @option{-fno-sched-stalled-insns} means that no insns are moved
7996 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7997 on how many queued insns can be moved prematurely.
7998 @option{-fsched-stalled-insns} without a value is equivalent to
7999 @option{-fsched-stalled-insns=1}.
8001 @item -fsched-stalled-insns-dep
8002 @itemx -fsched-stalled-insns-dep=@var{n}
8003 @opindex fsched-stalled-insns-dep
8004 Define how many insn groups (cycles) are examined for a dependency
8005 on a stalled insn that is a candidate for premature removal from the queue
8006 of stalled insns.  This has an effect only during the second scheduling pass,
8007 and only if @option{-fsched-stalled-insns} is used.
8008 @option{-fno-sched-stalled-insns-dep} is equivalent to
8009 @option{-fsched-stalled-insns-dep=0}.
8010 @option{-fsched-stalled-insns-dep} without a value is equivalent to
8011 @option{-fsched-stalled-insns-dep=1}.
8013 @item -fsched2-use-superblocks
8014 @opindex fsched2-use-superblocks
8015 When scheduling after register allocation, use superblock scheduling.
8016 This allows motion across basic block boundaries,
8017 resulting in faster schedules.  This option is experimental, as not all machine
8018 descriptions used by GCC model the CPU closely enough to avoid unreliable
8019 results from the algorithm.
8021 This only makes sense when scheduling after register allocation, i.e.@: with
8022 @option{-fschedule-insns2} or at @option{-O2} or higher.
8024 @item -fsched-group-heuristic
8025 @opindex fsched-group-heuristic
8026 Enable the group heuristic in the scheduler.  This heuristic favors
8027 the instruction that belongs to a schedule group.  This is enabled
8028 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8029 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8031 @item -fsched-critical-path-heuristic
8032 @opindex fsched-critical-path-heuristic
8033 Enable the critical-path heuristic in the scheduler.  This heuristic favors
8034 instructions on the critical path.  This is enabled by default when
8035 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
8036 or @option{-fschedule-insns2} or at @option{-O2} or higher.
8038 @item -fsched-spec-insn-heuristic
8039 @opindex fsched-spec-insn-heuristic
8040 Enable the speculative instruction heuristic in the scheduler.  This
8041 heuristic favors speculative instructions with greater dependency weakness.
8042 This is enabled by default when scheduling is enabled, i.e.@:
8043 with @option{-fschedule-insns} or @option{-fschedule-insns2}
8044 or at @option{-O2} or higher.
8046 @item -fsched-rank-heuristic
8047 @opindex fsched-rank-heuristic
8048 Enable the rank heuristic in the scheduler.  This heuristic favors
8049 the instruction belonging to a basic block with greater size or frequency.
8050 This is enabled by default when scheduling is enabled, i.e.@:
8051 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8052 at @option{-O2} or higher.
8054 @item -fsched-last-insn-heuristic
8055 @opindex fsched-last-insn-heuristic
8056 Enable the last-instruction heuristic in the scheduler.  This heuristic
8057 favors the instruction that is less dependent on the last instruction
8058 scheduled.  This is enabled by default when scheduling is enabled,
8059 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8060 at @option{-O2} or higher.
8062 @item -fsched-dep-count-heuristic
8063 @opindex fsched-dep-count-heuristic
8064 Enable the dependent-count heuristic in the scheduler.  This heuristic
8065 favors the instruction that has more instructions depending on it.
8066 This is enabled by default when scheduling is enabled, i.e.@:
8067 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
8068 at @option{-O2} or higher.
8070 @item -freschedule-modulo-scheduled-loops
8071 @opindex freschedule-modulo-scheduled-loops
8072 Modulo scheduling is performed before traditional scheduling.  If a loop
8073 is modulo scheduled, later scheduling passes may change its schedule.  
8074 Use this option to control that behavior.
8076 @item -fselective-scheduling
8077 @opindex fselective-scheduling
8078 Schedule instructions using selective scheduling algorithm.  Selective
8079 scheduling runs instead of the first scheduler pass.
8081 @item -fselective-scheduling2
8082 @opindex fselective-scheduling2
8083 Schedule instructions using selective scheduling algorithm.  Selective
8084 scheduling runs instead of the second scheduler pass.
8086 @item -fsel-sched-pipelining
8087 @opindex fsel-sched-pipelining
8088 Enable software pipelining of innermost loops during selective scheduling.
8089 This option has no effect unless one of @option{-fselective-scheduling} or
8090 @option{-fselective-scheduling2} is turned on.
8092 @item -fsel-sched-pipelining-outer-loops
8093 @opindex fsel-sched-pipelining-outer-loops
8094 When pipelining loops during selective scheduling, also pipeline outer loops.
8095 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
8097 @item -fsemantic-interposition
8098 @opindex fsemantic-interposition
8099 Some object formats, like ELF, allow interposing of symbols by the 
8100 dynamic linker.
8101 This means that for symbols exported from the DSO, the compiler cannot perform
8102 interprocedural propagation, inlining and other optimizations in anticipation
8103 that the function or variable in question may change. While this feature is
8104 useful, for example, to rewrite memory allocation functions by a debugging
8105 implementation, it is expensive in the terms of code quality.
8106 With @option{-fno-semantic-interposition} the compiler assumes that 
8107 if interposition happens for functions the overwriting function will have 
8108 precisely the same semantics (and side effects). 
8109 Similarly if interposition happens
8110 for variables, the constructor of the variable will be the same. The flag
8111 has no effect for functions explicitly declared inline 
8112 (where it is never allowed for interposition to change semantics) 
8113 and for symbols explicitly declared weak.
8115 @item -fshrink-wrap
8116 @opindex fshrink-wrap
8117 Emit function prologues only before parts of the function that need it,
8118 rather than at the top of the function.  This flag is enabled by default at
8119 @option{-O} and higher.
8121 @item -fshrink-wrap-separate
8122 @opindex fshrink-wrap-separate
8123 Shrink-wrap separate parts of the prologue and epilogue separately, so that
8124 those parts are only executed when needed.
8125 This option is on by default, but has no effect unless @option{-fshrink-wrap}
8126 is also turned on and the target supports this.
8128 @item -fcaller-saves
8129 @opindex fcaller-saves
8130 Enable allocation of values to registers that are clobbered by
8131 function calls, by emitting extra instructions to save and restore the
8132 registers around such calls.  Such allocation is done only when it
8133 seems to result in better code.
8135 This option is always enabled by default on certain machines, usually
8136 those which have no call-preserved registers to use instead.
8138 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8140 @item -fcombine-stack-adjustments
8141 @opindex fcombine-stack-adjustments
8142 Tracks stack adjustments (pushes and pops) and stack memory references
8143 and then tries to find ways to combine them.
8145 Enabled by default at @option{-O1} and higher.
8147 @item -fipa-ra
8148 @opindex fipa-ra
8149 Use caller save registers for allocation if those registers are not used by
8150 any called function.  In that case it is not necessary to save and restore
8151 them around calls.  This is only possible if called functions are part of
8152 same compilation unit as current function and they are compiled before it.
8154 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
8155 is disabled if generated code will be instrumented for profiling
8156 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
8157 exactly (this happens on targets that do not expose prologues
8158 and epilogues in RTL).
8160 @item -fconserve-stack
8161 @opindex fconserve-stack
8162 Attempt to minimize stack usage.  The compiler attempts to use less
8163 stack space, even if that makes the program slower.  This option
8164 implies setting the @option{large-stack-frame} parameter to 100
8165 and the @option{large-stack-frame-growth} parameter to 400.
8167 @item -ftree-reassoc
8168 @opindex ftree-reassoc
8169 Perform reassociation on trees.  This flag is enabled by default
8170 at @option{-O} and higher.
8172 @item -fcode-hoisting
8173 @opindex fcode-hoisting
8174 Perform code hoisting.  Code hoisting tries to move the
8175 evaluation of expressions executed on all paths to the function exit
8176 as early as possible.  This is especially useful as a code size
8177 optimization, but it often helps for code speed as well.
8178 This flag is enabled by default at @option{-O2} and higher.
8180 @item -ftree-pre
8181 @opindex ftree-pre
8182 Perform partial redundancy elimination (PRE) on trees.  This flag is
8183 enabled by default at @option{-O2} and @option{-O3}.
8185 @item -ftree-partial-pre
8186 @opindex ftree-partial-pre
8187 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8188 enabled by default at @option{-O3}.
8190 @item -ftree-forwprop
8191 @opindex ftree-forwprop
8192 Perform forward propagation on trees.  This flag is enabled by default
8193 at @option{-O} and higher.
8195 @item -ftree-fre
8196 @opindex ftree-fre
8197 Perform full redundancy elimination (FRE) on trees.  The difference
8198 between FRE and PRE is that FRE only considers expressions
8199 that are computed on all paths leading to the redundant computation.
8200 This analysis is faster than PRE, though it exposes fewer redundancies.
8201 This flag is enabled by default at @option{-O} and higher.
8203 @item -ftree-phiprop
8204 @opindex ftree-phiprop
8205 Perform hoisting of loads from conditional pointers on trees.  This
8206 pass is enabled by default at @option{-O} and higher.
8208 @item -fhoist-adjacent-loads
8209 @opindex fhoist-adjacent-loads
8210 Speculatively hoist loads from both branches of an if-then-else if the
8211 loads are from adjacent locations in the same structure and the target
8212 architecture has a conditional move instruction.  This flag is enabled
8213 by default at @option{-O2} and higher.
8215 @item -ftree-copy-prop
8216 @opindex ftree-copy-prop
8217 Perform copy propagation on trees.  This pass eliminates unnecessary
8218 copy operations.  This flag is enabled by default at @option{-O} and
8219 higher.
8221 @item -fipa-pure-const
8222 @opindex fipa-pure-const
8223 Discover which functions are pure or constant.
8224 Enabled by default at @option{-O} and higher.
8226 @item -fipa-reference
8227 @opindex fipa-reference
8228 Discover which static variables do not escape the
8229 compilation unit.
8230 Enabled by default at @option{-O} and higher.
8232 @item -fipa-pta
8233 @opindex fipa-pta
8234 Perform interprocedural pointer analysis and interprocedural modification
8235 and reference analysis.  This option can cause excessive memory and
8236 compile-time usage on large compilation units.  It is not enabled by
8237 default at any optimization level.
8239 @item -fipa-profile
8240 @opindex fipa-profile
8241 Perform interprocedural profile propagation.  The functions called only from
8242 cold functions are marked as cold. Also functions executed once (such as
8243 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8244 functions and loop less parts of functions executed once are then optimized for
8245 size.
8246 Enabled by default at @option{-O} and higher.
8248 @item -fipa-cp
8249 @opindex fipa-cp
8250 Perform interprocedural constant propagation.
8251 This optimization analyzes the program to determine when values passed
8252 to functions are constants and then optimizes accordingly.
8253 This optimization can substantially increase performance
8254 if the application has constants passed to functions.
8255 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8257 @item -fipa-cp-clone
8258 @opindex fipa-cp-clone
8259 Perform function cloning to make interprocedural constant propagation stronger.
8260 When enabled, interprocedural constant propagation performs function cloning
8261 when externally visible function can be called with constant arguments.
8262 Because this optimization can create multiple copies of functions,
8263 it may significantly increase code size
8264 (see @option{--param ipcp-unit-growth=@var{value}}).
8265 This flag is enabled by default at @option{-O3}.
8267 @item -fipa-bit-cp
8268 @opindex -fipa-bit-cp
8269 When enabled, perform interprocedural bitwise constant
8270 propagation. This flag is enabled by default at @option{-O2}. It
8271 requires that @option{-fipa-cp} is enabled.
8273 @item -fipa-vrp
8274 @opindex -fipa-vrp
8275 When enabled, perform interprocedural propagation of value
8276 ranges. This flag is enabled by default at @option{-O2}. It requires
8277 that @option{-fipa-cp} is enabled.
8279 @item -fipa-icf
8280 @opindex fipa-icf
8281 Perform Identical Code Folding for functions and read-only variables.
8282 The optimization reduces code size and may disturb unwind stacks by replacing
8283 a function by equivalent one with a different name. The optimization works
8284 more effectively with link-time optimization enabled.
8286 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8287 works on different levels and thus the optimizations are not same - there are
8288 equivalences that are found only by GCC and equivalences found only by Gold.
8290 This flag is enabled by default at @option{-O2} and @option{-Os}.
8292 @item -fisolate-erroneous-paths-dereference
8293 @opindex fisolate-erroneous-paths-dereference
8294 Detect paths that trigger erroneous or undefined behavior due to
8295 dereferencing a null pointer.  Isolate those paths from the main control
8296 flow and turn the statement with erroneous or undefined behavior into a trap.
8297 This flag is enabled by default at @option{-O2} and higher and depends on
8298 @option{-fdelete-null-pointer-checks} also being enabled.
8300 @item -fisolate-erroneous-paths-attribute
8301 @opindex fisolate-erroneous-paths-attribute
8302 Detect paths that trigger erroneous or undefined behavior due a null value
8303 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8304 attribute.  Isolate those paths from the main control flow and turn the
8305 statement with erroneous or undefined behavior into a trap.  This is not
8306 currently enabled, but may be enabled by @option{-O2} in the future.
8308 @item -ftree-sink
8309 @opindex ftree-sink
8310 Perform forward store motion on trees.  This flag is
8311 enabled by default at @option{-O} and higher.
8313 @item -ftree-bit-ccp
8314 @opindex ftree-bit-ccp
8315 Perform sparse conditional bit constant propagation on trees and propagate
8316 pointer alignment information.
8317 This pass only operates on local scalar variables and is enabled by default
8318 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8320 @item -ftree-ccp
8321 @opindex ftree-ccp
8322 Perform sparse conditional constant propagation (CCP) on trees.  This
8323 pass only operates on local scalar variables and is enabled by default
8324 at @option{-O} and higher.
8326 @item -fssa-backprop
8327 @opindex fssa-backprop
8328 Propagate information about uses of a value up the definition chain
8329 in order to simplify the definitions.  For example, this pass strips
8330 sign operations if the sign of a value never matters.  The flag is
8331 enabled by default at @option{-O} and higher.
8333 @item -fssa-phiopt
8334 @opindex fssa-phiopt
8335 Perform pattern matching on SSA PHI nodes to optimize conditional
8336 code.  This pass is enabled by default at @option{-O} and higher.
8338 @item -ftree-switch-conversion
8339 @opindex ftree-switch-conversion
8340 Perform conversion of simple initializations in a switch to
8341 initializations from a scalar array.  This flag is enabled by default
8342 at @option{-O2} and higher.
8344 @item -ftree-tail-merge
8345 @opindex ftree-tail-merge
8346 Look for identical code sequences.  When found, replace one with a jump to the
8347 other.  This optimization is known as tail merging or cross jumping.  This flag
8348 is enabled by default at @option{-O2} and higher.  The compilation time
8349 in this pass can
8350 be limited using @option{max-tail-merge-comparisons} parameter and
8351 @option{max-tail-merge-iterations} parameter.
8353 @item -ftree-dce
8354 @opindex ftree-dce
8355 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8356 default at @option{-O} and higher.
8358 @item -ftree-builtin-call-dce
8359 @opindex ftree-builtin-call-dce
8360 Perform conditional dead code elimination (DCE) for calls to built-in functions
8361 that may set @code{errno} but are otherwise side-effect free.  This flag is
8362 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8363 specified.
8365 @item -ftree-dominator-opts
8366 @opindex ftree-dominator-opts
8367 Perform a variety of simple scalar cleanups (constant/copy
8368 propagation, redundancy elimination, range propagation and expression
8369 simplification) based on a dominator tree traversal.  This also
8370 performs jump threading (to reduce jumps to jumps). This flag is
8371 enabled by default at @option{-O} and higher.
8373 @item -ftree-dse
8374 @opindex ftree-dse
8375 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8376 a memory location that is later overwritten by another store without
8377 any intervening loads.  In this case the earlier store can be deleted.  This
8378 flag is enabled by default at @option{-O} and higher.
8380 @item -ftree-ch
8381 @opindex ftree-ch
8382 Perform loop header copying on trees.  This is beneficial since it increases
8383 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8384 is enabled by default at @option{-O} and higher.  It is not enabled
8385 for @option{-Os}, since it usually increases code size.
8387 @item -ftree-loop-optimize
8388 @opindex ftree-loop-optimize
8389 Perform loop optimizations on trees.  This flag is enabled by default
8390 at @option{-O} and higher.
8392 @item -ftree-loop-linear
8393 @itemx -floop-interchange
8394 @itemx -floop-strip-mine
8395 @itemx -floop-block
8396 @itemx -floop-unroll-and-jam
8397 @opindex ftree-loop-linear
8398 @opindex floop-interchange
8399 @opindex floop-strip-mine
8400 @opindex floop-block
8401 @opindex floop-unroll-and-jam
8402 Perform loop nest optimizations.  Same as
8403 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
8404 to be configured with @option{--with-isl} to enable the Graphite loop
8405 transformation infrastructure.
8407 @item -fgraphite-identity
8408 @opindex fgraphite-identity
8409 Enable the identity transformation for graphite.  For every SCoP we generate
8410 the polyhedral representation and transform it back to gimple.  Using
8411 @option{-fgraphite-identity} we can check the costs or benefits of the
8412 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8413 are also performed by the code generator isl, like index splitting and
8414 dead code elimination in loops.
8416 @item -floop-nest-optimize
8417 @opindex floop-nest-optimize
8418 Enable the isl based loop nest optimizer.  This is a generic loop nest
8419 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8420 structure optimized for data-locality and parallelism.  This option
8421 is experimental.
8423 @item -floop-parallelize-all
8424 @opindex floop-parallelize-all
8425 Use the Graphite data dependence analysis to identify loops that can
8426 be parallelized.  Parallelize all the loops that can be analyzed to
8427 not contain loop carried dependences without checking that it is
8428 profitable to parallelize the loops.
8430 @item -ftree-coalesce-vars
8431 @opindex ftree-coalesce-vars
8432 While transforming the program out of the SSA representation, attempt to
8433 reduce copying by coalescing versions of different user-defined
8434 variables, instead of just compiler temporaries.  This may severely
8435 limit the ability to debug an optimized program compiled with
8436 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
8437 prevents SSA coalescing of user variables.  This option is enabled by
8438 default if optimization is enabled, and it does very little otherwise.
8440 @item -ftree-loop-if-convert
8441 @opindex ftree-loop-if-convert
8442 Attempt to transform conditional jumps in the innermost loops to
8443 branch-less equivalents.  The intent is to remove control-flow from
8444 the innermost loops in order to improve the ability of the
8445 vectorization pass to handle these loops.  This is enabled by default
8446 if vectorization is enabled.
8448 @item -ftree-loop-distribution
8449 @opindex ftree-loop-distribution
8450 Perform loop distribution.  This flag can improve cache performance on
8451 big loop bodies and allow further loop optimizations, like
8452 parallelization or vectorization, to take place.  For example, the loop
8453 @smallexample
8454 DO I = 1, N
8455   A(I) = B(I) + C
8456   D(I) = E(I) * F
8457 ENDDO
8458 @end smallexample
8459 is transformed to
8460 @smallexample
8461 DO I = 1, N
8462    A(I) = B(I) + C
8463 ENDDO
8464 DO I = 1, N
8465    D(I) = E(I) * F
8466 ENDDO
8467 @end smallexample
8469 @item -ftree-loop-distribute-patterns
8470 @opindex ftree-loop-distribute-patterns
8471 Perform loop distribution of patterns that can be code generated with
8472 calls to a library.  This flag is enabled by default at @option{-O3}.
8474 This pass distributes the initialization loops and generates a call to
8475 memset zero.  For example, the loop
8476 @smallexample
8477 DO I = 1, N
8478   A(I) = 0
8479   B(I) = A(I) + I
8480 ENDDO
8481 @end smallexample
8482 is transformed to
8483 @smallexample
8484 DO I = 1, N
8485    A(I) = 0
8486 ENDDO
8487 DO I = 1, N
8488    B(I) = A(I) + I
8489 ENDDO
8490 @end smallexample
8491 and the initialization loop is transformed into a call to memset zero.
8493 @item -ftree-loop-im
8494 @opindex ftree-loop-im
8495 Perform loop invariant motion on trees.  This pass moves only invariants that
8496 are hard to handle at RTL level (function calls, operations that expand to
8497 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8498 operands of conditions that are invariant out of the loop, so that we can use
8499 just trivial invariantness analysis in loop unswitching.  The pass also includes
8500 store motion.
8502 @item -ftree-loop-ivcanon
8503 @opindex ftree-loop-ivcanon
8504 Create a canonical counter for number of iterations in loops for which
8505 determining number of iterations requires complicated analysis.  Later
8506 optimizations then may determine the number easily.  Useful especially
8507 in connection with unrolling.
8509 @item -fivopts
8510 @opindex fivopts
8511 Perform induction variable optimizations (strength reduction, induction
8512 variable merging and induction variable elimination) on trees.
8514 @item -ftree-parallelize-loops=n
8515 @opindex ftree-parallelize-loops
8516 Parallelize loops, i.e., split their iteration space to run in n threads.
8517 This is only possible for loops whose iterations are independent
8518 and can be arbitrarily reordered.  The optimization is only
8519 profitable on multiprocessor machines, for loops that are CPU-intensive,
8520 rather than constrained e.g.@: by memory bandwidth.  This option
8521 implies @option{-pthread}, and thus is only supported on targets
8522 that have support for @option{-pthread}.
8524 @item -ftree-pta
8525 @opindex ftree-pta
8526 Perform function-local points-to analysis on trees.  This flag is
8527 enabled by default at @option{-O} and higher.
8529 @item -ftree-sra
8530 @opindex ftree-sra
8531 Perform scalar replacement of aggregates.  This pass replaces structure
8532 references with scalars to prevent committing structures to memory too
8533 early.  This flag is enabled by default at @option{-O} and higher.
8535 @item -fstore-merging
8536 @opindex fstore-merging
8537 Perform merging of narrow stores to consecutive memory addresses.  This pass
8538 merges contiguous stores of immediate values narrower than a word into fewer
8539 wider stores to reduce the number of instructions.  This is enabled by default
8540 at @option{-O2} and higher as well as @option{-Os}.
8542 @item -ftree-ter
8543 @opindex ftree-ter
8544 Perform temporary expression replacement during the SSA->normal phase.  Single
8545 use/single def temporaries are replaced at their use location with their
8546 defining expression.  This results in non-GIMPLE code, but gives the expanders
8547 much more complex trees to work on resulting in better RTL generation.  This is
8548 enabled by default at @option{-O} and higher.
8550 @item -ftree-slsr
8551 @opindex ftree-slsr
8552 Perform straight-line strength reduction on trees.  This recognizes related
8553 expressions involving multiplications and replaces them by less expensive
8554 calculations when possible.  This is enabled by default at @option{-O} and
8555 higher.
8557 @item -ftree-vectorize
8558 @opindex ftree-vectorize
8559 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8560 and @option{-ftree-slp-vectorize} if not explicitly specified.
8562 @item -ftree-loop-vectorize
8563 @opindex ftree-loop-vectorize
8564 Perform loop vectorization on trees. This flag is enabled by default at
8565 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8567 @item -ftree-slp-vectorize
8568 @opindex ftree-slp-vectorize
8569 Perform basic block vectorization on trees. This flag is enabled by default at
8570 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8572 @item -fvect-cost-model=@var{model}
8573 @opindex fvect-cost-model
8574 Alter the cost model used for vectorization.  The @var{model} argument
8575 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
8576 With the @samp{unlimited} model the vectorized code-path is assumed
8577 to be profitable while with the @samp{dynamic} model a runtime check
8578 guards the vectorized code-path to enable it only for iteration
8579 counts that will likely execute faster than when executing the original
8580 scalar loop.  The @samp{cheap} model disables vectorization of
8581 loops where doing so would be cost prohibitive for example due to
8582 required runtime checks for data dependence or alignment but otherwise
8583 is equal to the @samp{dynamic} model.
8584 The default cost model depends on other optimization flags and is
8585 either @samp{dynamic} or @samp{cheap}.
8587 @item -fsimd-cost-model=@var{model}
8588 @opindex fsimd-cost-model
8589 Alter the cost model used for vectorization of loops marked with the OpenMP
8590 or Cilk Plus simd directive.  The @var{model} argument should be one of
8591 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
8592 have the same meaning as described in @option{-fvect-cost-model} and by
8593 default a cost model defined with @option{-fvect-cost-model} is used.
8595 @item -ftree-vrp
8596 @opindex ftree-vrp
8597 Perform Value Range Propagation on trees.  This is similar to the
8598 constant propagation pass, but instead of values, ranges of values are
8599 propagated.  This allows the optimizers to remove unnecessary range
8600 checks like array bound checks and null pointer checks.  This is
8601 enabled by default at @option{-O2} and higher.  Null pointer check
8602 elimination is only done if @option{-fdelete-null-pointer-checks} is
8603 enabled.
8605 @item -fsplit-paths
8606 @opindex fsplit-paths
8607 Split paths leading to loop backedges.  This can improve dead code
8608 elimination and common subexpression elimination.  This is enabled by
8609 default at @option{-O2} and above.
8611 @item -fsplit-ivs-in-unroller
8612 @opindex fsplit-ivs-in-unroller
8613 Enables expression of values of induction variables in later iterations
8614 of the unrolled loop using the value in the first iteration.  This breaks
8615 long dependency chains, thus improving efficiency of the scheduling passes.
8617 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8618 same effect.  However, that is not reliable in cases where the loop body
8619 is more complicated than a single basic block.  It also does not work at all
8620 on some architectures due to restrictions in the CSE pass.
8622 This optimization is enabled by default.
8624 @item -fvariable-expansion-in-unroller
8625 @opindex fvariable-expansion-in-unroller
8626 With this option, the compiler creates multiple copies of some
8627 local variables when unrolling a loop, which can result in superior code.
8629 @item -fpartial-inlining
8630 @opindex fpartial-inlining
8631 Inline parts of functions.  This option has any effect only
8632 when inlining itself is turned on by the @option{-finline-functions}
8633 or @option{-finline-small-functions} options.
8635 Enabled at level @option{-O2}.
8637 @item -fpredictive-commoning
8638 @opindex fpredictive-commoning
8639 Perform predictive commoning optimization, i.e., reusing computations
8640 (especially memory loads and stores) performed in previous
8641 iterations of loops.
8643 This option is enabled at level @option{-O3}.
8645 @item -fprefetch-loop-arrays
8646 @opindex fprefetch-loop-arrays
8647 If supported by the target machine, generate instructions to prefetch
8648 memory to improve the performance of loops that access large arrays.
8650 This option may generate better or worse code; results are highly
8651 dependent on the structure of loops within the source code.
8653 Disabled at level @option{-Os}.
8655 @item -fno-printf-return-value
8656 @opindex fno-printf-return-value
8657 Do not substitute constants for known return value of formatted output
8658 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
8659 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
8660 transformation allows GCC to optimize or even eliminate branches based
8661 on the known return value of these functions called with arguments that
8662 are either constant, or whose values are known to be in a range that
8663 makes determining the exact return value possible.  For example, when
8664 @option{-fprintf-return-value} is in effect, both the branch and the
8665 body of the @code{if} statement (but not the call to @code{snprint})
8666 can be optimized away when @code{i} is a 32-bit or smaller integer
8667 because the return value is guaranteed to be at most 8.
8669 @smallexample
8670 char buf[9];
8671 if (snprintf (buf, "%08x", i) >= sizeof buf)
8672   @dots{}
8673 @end smallexample
8675 The @option{-fprintf-return-value} option relies on other optimizations
8676 and yields best results with @option{-O2}.  It works in tandem with the
8677 @option{-Wformat-overflow} and @option{-Wformat-truncation} options.
8678 The @option{-fprintf-return-value} option is enabled by default.
8680 @item -fno-peephole
8681 @itemx -fno-peephole2
8682 @opindex fno-peephole
8683 @opindex fno-peephole2
8684 Disable any machine-specific peephole optimizations.  The difference
8685 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8686 are implemented in the compiler; some targets use one, some use the
8687 other, a few use both.
8689 @option{-fpeephole} is enabled by default.
8690 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8692 @item -fno-guess-branch-probability
8693 @opindex fno-guess-branch-probability
8694 Do not guess branch probabilities using heuristics.
8696 GCC uses heuristics to guess branch probabilities if they are
8697 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8698 heuristics are based on the control flow graph.  If some branch probabilities
8699 are specified by @code{__builtin_expect}, then the heuristics are
8700 used to guess branch probabilities for the rest of the control flow graph,
8701 taking the @code{__builtin_expect} info into account.  The interactions
8702 between the heuristics and @code{__builtin_expect} can be complex, and in
8703 some cases, it may be useful to disable the heuristics so that the effects
8704 of @code{__builtin_expect} are easier to understand.
8706 The default is @option{-fguess-branch-probability} at levels
8707 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8709 @item -freorder-blocks
8710 @opindex freorder-blocks
8711 Reorder basic blocks in the compiled function in order to reduce number of
8712 taken branches and improve code locality.
8714 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8716 @item -freorder-blocks-algorithm=@var{algorithm}
8717 @opindex freorder-blocks-algorithm
8718 Use the specified algorithm for basic block reordering.  The
8719 @var{algorithm} argument can be @samp{simple}, which does not increase
8720 code size (except sometimes due to secondary effects like alignment),
8721 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
8722 put all often executed code together, minimizing the number of branches
8723 executed by making extra copies of code.
8725 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
8726 @samp{stc} at levels @option{-O2}, @option{-O3}.
8728 @item -freorder-blocks-and-partition
8729 @opindex freorder-blocks-and-partition
8730 In addition to reordering basic blocks in the compiled function, in order
8731 to reduce number of taken branches, partitions hot and cold basic blocks
8732 into separate sections of the assembly and @file{.o} files, to improve
8733 paging and cache locality performance.
8735 This optimization is automatically turned off in the presence of
8736 exception handling or unwind tables (on targets using setjump/longjump or target specific scheme), for linkonce sections, for functions with a user-defined
8737 section attribute and on any architecture that does not support named
8738 sections.  When @option{-fsplit-stack} is used this option is not
8739 enabled by default (to avoid linker errors), but may be enabled
8740 explicitly (if using a working linker).
8742 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8744 @item -freorder-functions
8745 @opindex freorder-functions
8746 Reorder functions in the object file in order to
8747 improve code locality.  This is implemented by using special
8748 subsections @code{.text.hot} for most frequently executed functions and
8749 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8750 the linker so object file format must support named sections and linker must
8751 place them in a reasonable way.
8753 Also profile feedback must be available to make this option effective.  See
8754 @option{-fprofile-arcs} for details.
8756 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8758 @item -fstrict-aliasing
8759 @opindex fstrict-aliasing
8760 Allow the compiler to assume the strictest aliasing rules applicable to
8761 the language being compiled.  For C (and C++), this activates
8762 optimizations based on the type of expressions.  In particular, an
8763 object of one type is assumed never to reside at the same address as an
8764 object of a different type, unless the types are almost the same.  For
8765 example, an @code{unsigned int} can alias an @code{int}, but not a
8766 @code{void*} or a @code{double}.  A character type may alias any other
8767 type.
8769 @anchor{Type-punning}Pay special attention to code like this:
8770 @smallexample
8771 union a_union @{
8772   int i;
8773   double d;
8776 int f() @{
8777   union a_union t;
8778   t.d = 3.0;
8779   return t.i;
8781 @end smallexample
8782 The practice of reading from a different union member than the one most
8783 recently written to (called ``type-punning'') is common.  Even with
8784 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8785 is accessed through the union type.  So, the code above works as
8786 expected.  @xref{Structures unions enumerations and bit-fields
8787 implementation}.  However, this code might not:
8788 @smallexample
8789 int f() @{
8790   union a_union t;
8791   int* ip;
8792   t.d = 3.0;
8793   ip = &t.i;
8794   return *ip;
8796 @end smallexample
8798 Similarly, access by taking the address, casting the resulting pointer
8799 and dereferencing the result has undefined behavior, even if the cast
8800 uses a union type, e.g.:
8801 @smallexample
8802 int f() @{
8803   double d = 3.0;
8804   return ((union a_union *) &d)->i;
8806 @end smallexample
8808 The @option{-fstrict-aliasing} option is enabled at levels
8809 @option{-O2}, @option{-O3}, @option{-Os}.
8811 @item -falign-functions
8812 @itemx -falign-functions=@var{n}
8813 @opindex falign-functions
8814 Align the start of functions to the next power-of-two greater than
8815 @var{n}, skipping up to @var{n} bytes.  For instance,
8816 @option{-falign-functions=32} aligns functions to the next 32-byte
8817 boundary, but @option{-falign-functions=24} aligns to the next
8818 32-byte boundary only if this can be done by skipping 23 bytes or less.
8820 @option{-fno-align-functions} and @option{-falign-functions=1} are
8821 equivalent and mean that functions are not aligned.
8823 Some assemblers only support this flag when @var{n} is a power of two;
8824 in that case, it is rounded up.
8826 If @var{n} is not specified or is zero, use a machine-dependent default.
8828 Enabled at levels @option{-O2}, @option{-O3}.
8830 @item -flimit-function-alignment
8831 If this option is enabled, the compiler tries to avoid unnecessarily
8832 overaligning functions. It attempts to instruct the assembler to align
8833 by the amount specified by @option{-falign-functions}, but not to
8834 skip more bytes than the size of the function.
8836 @item -falign-labels
8837 @itemx -falign-labels=@var{n}
8838 @opindex falign-labels
8839 Align all branch targets to a power-of-two boundary, skipping up to
8840 @var{n} bytes like @option{-falign-functions}.  This option can easily
8841 make code slower, because it must insert dummy operations for when the
8842 branch target is reached in the usual flow of the code.
8844 @option{-fno-align-labels} and @option{-falign-labels=1} are
8845 equivalent and mean that labels are not aligned.
8847 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8848 are greater than this value, then their values are used instead.
8850 If @var{n} is not specified or is zero, use a machine-dependent default
8851 which is very likely to be @samp{1}, meaning no alignment.
8853 Enabled at levels @option{-O2}, @option{-O3}.
8855 @item -falign-loops
8856 @itemx -falign-loops=@var{n}
8857 @opindex falign-loops
8858 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8859 like @option{-falign-functions}.  If the loops are
8860 executed many times, this makes up for any execution of the dummy
8861 operations.
8863 @option{-fno-align-loops} and @option{-falign-loops=1} are
8864 equivalent and mean that loops are not aligned.
8866 If @var{n} is not specified or is zero, use a machine-dependent default.
8868 Enabled at levels @option{-O2}, @option{-O3}.
8870 @item -falign-jumps
8871 @itemx -falign-jumps=@var{n}
8872 @opindex falign-jumps
8873 Align branch targets to a power-of-two boundary, for branch targets
8874 where the targets can only be reached by jumping, skipping up to @var{n}
8875 bytes like @option{-falign-functions}.  In this case, no dummy operations
8876 need be executed.
8878 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8879 equivalent and mean that loops are not aligned.
8881 If @var{n} is not specified or is zero, use a machine-dependent default.
8883 Enabled at levels @option{-O2}, @option{-O3}.
8885 @item -funit-at-a-time
8886 @opindex funit-at-a-time
8887 This option is left for compatibility reasons. @option{-funit-at-a-time}
8888 has no effect, while @option{-fno-unit-at-a-time} implies
8889 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8891 Enabled by default.
8893 @item -fno-toplevel-reorder
8894 @opindex fno-toplevel-reorder
8895 Do not reorder top-level functions, variables, and @code{asm}
8896 statements.  Output them in the same order that they appear in the
8897 input file.  When this option is used, unreferenced static variables
8898 are not removed.  This option is intended to support existing code
8899 that relies on a particular ordering.  For new code, it is better to
8900 use attributes when possible.
8902 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8903 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8904 targets.
8906 @item -fweb
8907 @opindex fweb
8908 Constructs webs as commonly used for register allocation purposes and assign
8909 each web individual pseudo register.  This allows the register allocation pass
8910 to operate on pseudos directly, but also strengthens several other optimization
8911 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8912 however, make debugging impossible, since variables no longer stay in a
8913 ``home register''.
8915 Enabled by default with @option{-funroll-loops}.
8917 @item -fwhole-program
8918 @opindex fwhole-program
8919 Assume that the current compilation unit represents the whole program being
8920 compiled.  All public functions and variables with the exception of @code{main}
8921 and those merged by attribute @code{externally_visible} become static functions
8922 and in effect are optimized more aggressively by interprocedural optimizers.
8924 This option should not be used in combination with @option{-flto}.
8925 Instead relying on a linker plugin should provide safer and more precise
8926 information.
8928 @item -flto[=@var{n}]
8929 @opindex flto
8930 This option runs the standard link-time optimizer.  When invoked
8931 with source code, it generates GIMPLE (one of GCC's internal
8932 representations) and writes it to special ELF sections in the object
8933 file.  When the object files are linked together, all the function
8934 bodies are read from these ELF sections and instantiated as if they
8935 had been part of the same translation unit.
8937 To use the link-time optimizer, @option{-flto} and optimization
8938 options should be specified at compile time and during the final link.
8939 It is recommended that you compile all the files participating in the
8940 same link with the same options and also specify those options at
8941 link time.  
8942 For example:
8944 @smallexample
8945 gcc -c -O2 -flto foo.c
8946 gcc -c -O2 -flto bar.c
8947 gcc -o myprog -flto -O2 foo.o bar.o
8948 @end smallexample
8950 The first two invocations to GCC save a bytecode representation
8951 of GIMPLE into special ELF sections inside @file{foo.o} and
8952 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8953 @file{foo.o} and @file{bar.o}, merges the two files into a single
8954 internal image, and compiles the result as usual.  Since both
8955 @file{foo.o} and @file{bar.o} are merged into a single image, this
8956 causes all the interprocedural analyses and optimizations in GCC to
8957 work across the two files as if they were a single one.  This means,
8958 for example, that the inliner is able to inline functions in
8959 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8961 Another (simpler) way to enable link-time optimization is:
8963 @smallexample
8964 gcc -o myprog -flto -O2 foo.c bar.c
8965 @end smallexample
8967 The above generates bytecode for @file{foo.c} and @file{bar.c},
8968 merges them together into a single GIMPLE representation and optimizes
8969 them as usual to produce @file{myprog}.
8971 The only important thing to keep in mind is that to enable link-time
8972 optimizations you need to use the GCC driver to perform the link step.
8973 GCC then automatically performs link-time optimization if any of the
8974 objects involved were compiled with the @option{-flto} command-line option.  
8975 You generally
8976 should specify the optimization options to be used for link-time
8977 optimization though GCC tries to be clever at guessing an
8978 optimization level to use from the options used at compile time
8979 if you fail to specify one at link time.  You can always override
8980 the automatic decision to do link-time optimization
8981 by passing @option{-fno-lto} to the link command.
8983 To make whole program optimization effective, it is necessary to make
8984 certain whole program assumptions.  The compiler needs to know
8985 what functions and variables can be accessed by libraries and runtime
8986 outside of the link-time optimized unit.  When supported by the linker,
8987 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8988 to the compiler about used and externally visible symbols.  When
8989 the linker plugin is not available, @option{-fwhole-program} should be
8990 used to allow the compiler to make these assumptions, which leads
8991 to more aggressive optimization decisions.
8993 When @option{-fuse-linker-plugin} is not enabled, when a file is
8994 compiled with @option{-flto}, the generated object file is larger than
8995 a regular object file because it contains GIMPLE bytecodes and the usual
8996 final code (see @option{-ffat-lto-objects}.  This means that
8997 object files with LTO information can be linked as normal object
8998 files; if @option{-fno-lto} is passed to the linker, no
8999 interprocedural optimizations are applied.  Note that when
9000 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
9001 but you cannot perform a regular, non-LTO link on them.
9003 Additionally, the optimization flags used to compile individual files
9004 are not necessarily related to those used at link time.  For instance,
9006 @smallexample
9007 gcc -c -O0 -ffat-lto-objects -flto foo.c
9008 gcc -c -O0 -ffat-lto-objects -flto bar.c
9009 gcc -o myprog -O3 foo.o bar.o
9010 @end smallexample
9012 This produces individual object files with unoptimized assembler
9013 code, but the resulting binary @file{myprog} is optimized at
9014 @option{-O3}.  If, instead, the final binary is generated with
9015 @option{-fno-lto}, then @file{myprog} is not optimized.
9017 When producing the final binary, GCC only
9018 applies link-time optimizations to those files that contain bytecode.
9019 Therefore, you can mix and match object files and libraries with
9020 GIMPLE bytecodes and final object code.  GCC automatically selects
9021 which files to optimize in LTO mode and which files to link without
9022 further processing.
9024 There are some code generation flags preserved by GCC when
9025 generating bytecodes, as they need to be used during the final link
9026 stage.  Generally options specified at link time override those
9027 specified at compile time.
9029 If you do not specify an optimization level option @option{-O} at
9030 link time, then GCC uses the highest optimization level 
9031 used when compiling the object files.
9033 Currently, the following options and their settings are taken from
9034 the first object file that explicitly specifies them: 
9035 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
9036 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
9037 and all the @option{-m} target flags.
9039 Certain ABI-changing flags are required to match in all compilation units,
9040 and trying to override this at link time with a conflicting value
9041 is ignored.  This includes options such as @option{-freg-struct-return}
9042 and @option{-fpcc-struct-return}. 
9044 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
9045 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
9046 are passed through to the link stage and merged conservatively for
9047 conflicting translation units.  Specifically
9048 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
9049 precedence; and for example @option{-ffp-contract=off} takes precedence
9050 over @option{-ffp-contract=fast}.  You can override them at link time.
9052 If LTO encounters objects with C linkage declared with incompatible
9053 types in separate translation units to be linked together (undefined
9054 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
9055 issued.  The behavior is still undefined at run time.  Similar
9056 diagnostics may be raised for other languages.
9058 Another feature of LTO is that it is possible to apply interprocedural
9059 optimizations on files written in different languages:
9061 @smallexample
9062 gcc -c -flto foo.c
9063 g++ -c -flto bar.cc
9064 gfortran -c -flto baz.f90
9065 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
9066 @end smallexample
9068 Notice that the final link is done with @command{g++} to get the C++
9069 runtime libraries and @option{-lgfortran} is added to get the Fortran
9070 runtime libraries.  In general, when mixing languages in LTO mode, you
9071 should use the same link command options as when mixing languages in a
9072 regular (non-LTO) compilation.
9074 If object files containing GIMPLE bytecode are stored in a library archive, say
9075 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
9076 are using a linker with plugin support.  To create static libraries suitable
9077 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
9078 and @command{ranlib}; 
9079 to show the symbols of object files with GIMPLE bytecode, use
9080 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
9081 and @command{nm} have been compiled with plugin support.  At link time, use the the
9082 flag @option{-fuse-linker-plugin} to ensure that the library participates in
9083 the LTO optimization process:
9085 @smallexample
9086 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
9087 @end smallexample
9089 With the linker plugin enabled, the linker extracts the needed
9090 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
9091 to make them part of the aggregated GIMPLE image to be optimized.
9093 If you are not using a linker with plugin support and/or do not
9094 enable the linker plugin, then the objects inside @file{libfoo.a}
9095 are extracted and linked as usual, but they do not participate
9096 in the LTO optimization process.  In order to make a static library suitable
9097 for both LTO optimization and usual linkage, compile its object files with
9098 @option{-flto} @option{-ffat-lto-objects}.
9100 Link-time optimizations do not require the presence of the whole program to
9101 operate.  If the program does not require any symbols to be exported, it is
9102 possible to combine @option{-flto} and @option{-fwhole-program} to allow
9103 the interprocedural optimizers to use more aggressive assumptions which may
9104 lead to improved optimization opportunities.
9105 Use of @option{-fwhole-program} is not needed when linker plugin is
9106 active (see @option{-fuse-linker-plugin}).
9108 The current implementation of LTO makes no
9109 attempt to generate bytecode that is portable between different
9110 types of hosts.  The bytecode files are versioned and there is a
9111 strict version check, so bytecode files generated in one version of
9112 GCC do not work with an older or newer version of GCC.
9114 Link-time optimization does not work well with generation of debugging
9115 information.  Combining @option{-flto} with
9116 @option{-g} is currently experimental and expected to produce unexpected
9117 results.
9119 If you specify the optional @var{n}, the optimization and code
9120 generation done at link time is executed in parallel using @var{n}
9121 parallel jobs by utilizing an installed @command{make} program.  The
9122 environment variable @env{MAKE} may be used to override the program
9123 used.  The default value for @var{n} is 1.
9125 You can also specify @option{-flto=jobserver} to use GNU make's
9126 job server mode to determine the number of parallel jobs. This
9127 is useful when the Makefile calling GCC is already executing in parallel.
9128 You must prepend a @samp{+} to the command recipe in the parent Makefile
9129 for this to work.  This option likely only works if @env{MAKE} is
9130 GNU make.
9132 @item -flto-partition=@var{alg}
9133 @opindex flto-partition
9134 Specify the partitioning algorithm used by the link-time optimizer.
9135 The value is either @samp{1to1} to specify a partitioning mirroring
9136 the original source files or @samp{balanced} to specify partitioning
9137 into equally sized chunks (whenever possible) or @samp{max} to create
9138 new partition for every symbol where possible.  Specifying @samp{none}
9139 as an algorithm disables partitioning and streaming completely. 
9140 The default value is @samp{balanced}. While @samp{1to1} can be used
9141 as an workaround for various code ordering issues, the @samp{max}
9142 partitioning is intended for internal testing only.
9143 The value @samp{one} specifies that exactly one partition should be
9144 used while the value @samp{none} bypasses partitioning and executes
9145 the link-time optimization step directly from the WPA phase.
9147 @item -flto-odr-type-merging
9148 @opindex flto-odr-type-merging
9149 Enable streaming of mangled types names of C++ types and their unification
9150 at link time.  This increases size of LTO object files, but enables
9151 diagnostics about One Definition Rule violations.
9153 @item -flto-compression-level=@var{n}
9154 @opindex flto-compression-level
9155 This option specifies the level of compression used for intermediate
9156 language written to LTO object files, and is only meaningful in
9157 conjunction with LTO mode (@option{-flto}).  Valid
9158 values are 0 (no compression) to 9 (maximum compression).  Values
9159 outside this range are clamped to either 0 or 9.  If the option is not
9160 given, a default balanced compression setting is used.
9162 @item -fuse-linker-plugin
9163 @opindex fuse-linker-plugin
9164 Enables the use of a linker plugin during link-time optimization.  This
9165 option relies on plugin support in the linker, which is available in gold
9166 or in GNU ld 2.21 or newer.
9168 This option enables the extraction of object files with GIMPLE bytecode out
9169 of library archives. This improves the quality of optimization by exposing
9170 more code to the link-time optimizer.  This information specifies what
9171 symbols can be accessed externally (by non-LTO object or during dynamic
9172 linking).  Resulting code quality improvements on binaries (and shared
9173 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9174 See @option{-flto} for a description of the effect of this flag and how to
9175 use it.
9177 This option is enabled by default when LTO support in GCC is enabled
9178 and GCC was configured for use with
9179 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9181 @item -ffat-lto-objects
9182 @opindex ffat-lto-objects
9183 Fat LTO objects are object files that contain both the intermediate language
9184 and the object code. This makes them usable for both LTO linking and normal
9185 linking. This option is effective only when compiling with @option{-flto}
9186 and is ignored at link time.
9188 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9189 requires the complete toolchain to be aware of LTO. It requires a linker with
9190 linker plugin support for basic functionality.  Additionally,
9191 @command{nm}, @command{ar} and @command{ranlib}
9192 need to support linker plugins to allow a full-featured build environment
9193 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9194 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9195 to these tools. With non fat LTO makefiles need to be modified to use them.
9197 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9198 support.
9200 @item -fcompare-elim
9201 @opindex fcompare-elim
9202 After register allocation and post-register allocation instruction splitting,
9203 identify arithmetic instructions that compute processor flags similar to a
9204 comparison operation based on that arithmetic.  If possible, eliminate the
9205 explicit comparison operation.
9207 This pass only applies to certain targets that cannot explicitly represent
9208 the comparison operation before register allocation is complete.
9210 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9212 @item -fcprop-registers
9213 @opindex fcprop-registers
9214 After register allocation and post-register allocation instruction splitting,
9215 perform a copy-propagation pass to try to reduce scheduling dependencies
9216 and occasionally eliminate the copy.
9218 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9220 @item -fprofile-correction
9221 @opindex fprofile-correction
9222 Profiles collected using an instrumented binary for multi-threaded programs may
9223 be inconsistent due to missed counter updates. When this option is specified,
9224 GCC uses heuristics to correct or smooth out such inconsistencies. By
9225 default, GCC emits an error message when an inconsistent profile is detected.
9227 @item -fprofile-use
9228 @itemx -fprofile-use=@var{path}
9229 @opindex fprofile-use
9230 Enable profile feedback-directed optimizations, 
9231 and the following optimizations
9232 which are generally profitable only with profile feedback available:
9233 @option{-fbranch-probabilities}, @option{-fvpt},
9234 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9235 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9237 Before you can use this option, you must first generate profiling information.
9238 @xref{Instrumentation Options}, for information about the
9239 @option{-fprofile-generate} option.
9241 By default, GCC emits an error message if the feedback profiles do not
9242 match the source code.  This error can be turned into a warning by using
9243 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9244 code.
9246 If @var{path} is specified, GCC looks at the @var{path} to find
9247 the profile feedback data files. See @option{-fprofile-dir}.
9249 @item -fauto-profile
9250 @itemx -fauto-profile=@var{path}
9251 @opindex fauto-profile
9252 Enable sampling-based feedback-directed optimizations, 
9253 and the following optimizations
9254 which are generally profitable only with profile feedback available:
9255 @option{-fbranch-probabilities}, @option{-fvpt},
9256 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9257 @option{-ftree-vectorize},
9258 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9259 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9260 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9262 @var{path} is the name of a file containing AutoFDO profile information.
9263 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9265 Producing an AutoFDO profile data file requires running your program
9266 with the @command{perf} utility on a supported GNU/Linux target system.
9267 For more information, see @uref{https://perf.wiki.kernel.org/}.
9269 E.g.
9270 @smallexample
9271 perf record -e br_inst_retired:near_taken -b -o perf.data \
9272     -- your_program
9273 @end smallexample
9275 Then use the @command{create_gcov} tool to convert the raw profile data
9276 to a format that can be used by GCC.@  You must also supply the 
9277 unstripped binary for your program to this tool.  
9278 See @uref{https://github.com/google/autofdo}.
9280 E.g.
9281 @smallexample
9282 create_gcov --binary=your_program.unstripped --profile=perf.data \
9283     --gcov=profile.afdo
9284 @end smallexample
9285 @end table
9287 The following options control compiler behavior regarding floating-point 
9288 arithmetic.  These options trade off between speed and
9289 correctness.  All must be specifically enabled.
9291 @table @gcctabopt
9292 @item -ffloat-store
9293 @opindex ffloat-store
9294 Do not store floating-point variables in registers, and inhibit other
9295 options that might change whether a floating-point value is taken from a
9296 register or memory.
9298 @cindex floating-point precision
9299 This option prevents undesirable excess precision on machines such as
9300 the 68000 where the floating registers (of the 68881) keep more
9301 precision than a @code{double} is supposed to have.  Similarly for the
9302 x86 architecture.  For most programs, the excess precision does only
9303 good, but a few programs rely on the precise definition of IEEE floating
9304 point.  Use @option{-ffloat-store} for such programs, after modifying
9305 them to store all pertinent intermediate computations into variables.
9307 @item -fexcess-precision=@var{style}
9308 @opindex fexcess-precision
9309 This option allows further control over excess precision on machines
9310 where floating-point operations occur in a format with more precision or
9311 range than the IEEE standard and interchange floating-point types.  By
9312 default, @option{-fexcess-precision=fast} is in effect; this means that
9313 operations may be carried out in a wider precision than the types specified
9314 in the source if that would result in faster code, and it is unpredictable
9315 when rounding to the types specified in the source code takes place.
9316 When compiling C, if @option{-fexcess-precision=standard} is specified then
9317 excess precision follows the rules specified in ISO C99; in particular,
9318 both casts and assignments cause values to be rounded to their
9319 semantic types (whereas @option{-ffloat-store} only affects
9320 assignments).  This option is enabled by default for C if a strict
9321 conformance option such as @option{-std=c99} is used.
9322 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
9323 regardless of whether a strict conformance option is used.
9325 @opindex mfpmath
9326 @option{-fexcess-precision=standard} is not implemented for languages
9327 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
9328 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9329 semantics apply without excess precision, and in the latter, rounding
9330 is unpredictable.
9332 @item -ffast-math
9333 @opindex ffast-math
9334 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9335 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9336 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
9337 @option{-fexcess-precision=fast}.
9339 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9341 This option is not turned on by any @option{-O} option besides
9342 @option{-Ofast} since it can result in incorrect output for programs
9343 that depend on an exact implementation of IEEE or ISO rules/specifications
9344 for math functions. It may, however, yield faster code for programs
9345 that do not require the guarantees of these specifications.
9347 @item -fno-math-errno
9348 @opindex fno-math-errno
9349 Do not set @code{errno} after calling math functions that are executed
9350 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9351 IEEE exceptions for math error handling may want to use this flag
9352 for speed while maintaining IEEE arithmetic compatibility.
9354 This option is not turned on by any @option{-O} option since
9355 it can result in incorrect output for programs that depend on
9356 an exact implementation of IEEE or ISO rules/specifications for
9357 math functions. It may, however, yield faster code for programs
9358 that do not require the guarantees of these specifications.
9360 The default is @option{-fmath-errno}.
9362 On Darwin systems, the math library never sets @code{errno}.  There is
9363 therefore no reason for the compiler to consider the possibility that
9364 it might, and @option{-fno-math-errno} is the default.
9366 @item -funsafe-math-optimizations
9367 @opindex funsafe-math-optimizations
9369 Allow optimizations for floating-point arithmetic that (a) assume
9370 that arguments and results are valid and (b) may violate IEEE or
9371 ANSI standards.  When used at link time, it may include libraries
9372 or startup files that change the default FPU control word or other
9373 similar optimizations.
9375 This option is not turned on by any @option{-O} option since
9376 it can result in incorrect output for programs that depend on
9377 an exact implementation of IEEE or ISO rules/specifications for
9378 math functions. It may, however, yield faster code for programs
9379 that do not require the guarantees of these specifications.
9380 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9381 @option{-fassociative-math} and @option{-freciprocal-math}.
9383 The default is @option{-fno-unsafe-math-optimizations}.
9385 @item -fassociative-math
9386 @opindex fassociative-math
9388 Allow re-association of operands in series of floating-point operations.
9389 This violates the ISO C and C++ language standard by possibly changing
9390 computation result.  NOTE: re-ordering may change the sign of zero as
9391 well as ignore NaNs and inhibit or create underflow or overflow (and
9392 thus cannot be used on code that relies on rounding behavior like
9393 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9394 and thus may not be used when ordered comparisons are required.
9395 This option requires that both @option{-fno-signed-zeros} and
9396 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9397 much sense with @option{-frounding-math}. For Fortran the option
9398 is automatically enabled when both @option{-fno-signed-zeros} and
9399 @option{-fno-trapping-math} are in effect.
9401 The default is @option{-fno-associative-math}.
9403 @item -freciprocal-math
9404 @opindex freciprocal-math
9406 Allow the reciprocal of a value to be used instead of dividing by
9407 the value if this enables optimizations.  For example @code{x / y}
9408 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9409 is subject to common subexpression elimination.  Note that this loses
9410 precision and increases the number of flops operating on the value.
9412 The default is @option{-fno-reciprocal-math}.
9414 @item -ffinite-math-only
9415 @opindex ffinite-math-only
9416 Allow optimizations for floating-point arithmetic that assume
9417 that arguments and results are not NaNs or +-Infs.
9419 This option is not turned on by any @option{-O} option since
9420 it can result in incorrect output for programs that depend on
9421 an exact implementation of IEEE or ISO rules/specifications for
9422 math functions. It may, however, yield faster code for programs
9423 that do not require the guarantees of these specifications.
9425 The default is @option{-fno-finite-math-only}.
9427 @item -fno-signed-zeros
9428 @opindex fno-signed-zeros
9429 Allow optimizations for floating-point arithmetic that ignore the
9430 signedness of zero.  IEEE arithmetic specifies the behavior of
9431 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9432 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9433 This option implies that the sign of a zero result isn't significant.
9435 The default is @option{-fsigned-zeros}.
9437 @item -fno-trapping-math
9438 @opindex fno-trapping-math
9439 Compile code assuming that floating-point operations cannot generate
9440 user-visible traps.  These traps include division by zero, overflow,
9441 underflow, inexact result and invalid operation.  This option requires
9442 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9443 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9445 This option should never be turned on by any @option{-O} option since
9446 it can result in incorrect output for programs that depend on
9447 an exact implementation of IEEE or ISO rules/specifications for
9448 math functions.
9450 The default is @option{-ftrapping-math}.
9452 @item -frounding-math
9453 @opindex frounding-math
9454 Disable transformations and optimizations that assume default floating-point
9455 rounding behavior.  This is round-to-zero for all floating point
9456 to integer conversions, and round-to-nearest for all other arithmetic
9457 truncations.  This option should be specified for programs that change
9458 the FP rounding mode dynamically, or that may be executed with a
9459 non-default rounding mode.  This option disables constant folding of
9460 floating-point expressions at compile time (which may be affected by
9461 rounding mode) and arithmetic transformations that are unsafe in the
9462 presence of sign-dependent rounding modes.
9464 The default is @option{-fno-rounding-math}.
9466 This option is experimental and does not currently guarantee to
9467 disable all GCC optimizations that are affected by rounding mode.
9468 Future versions of GCC may provide finer control of this setting
9469 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9470 will be used to specify the default state for @code{FENV_ACCESS}.
9472 @item -fsignaling-nans
9473 @opindex fsignaling-nans
9474 Compile code assuming that IEEE signaling NaNs may generate user-visible
9475 traps during floating-point operations.  Setting this option disables
9476 optimizations that may change the number of exceptions visible with
9477 signaling NaNs.  This option implies @option{-ftrapping-math}.
9479 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9480 be defined.
9482 The default is @option{-fno-signaling-nans}.
9484 This option is experimental and does not currently guarantee to
9485 disable all GCC optimizations that affect signaling NaN behavior.
9487 @item -fno-fp-int-builtin-inexact
9488 @opindex fno-fp-int-builtin-inexact
9489 Do not allow the built-in functions @code{ceil}, @code{floor},
9490 @code{round} and @code{trunc}, and their @code{float} and @code{long
9491 double} variants, to generate code that raises the ``inexact''
9492 floating-point exception for noninteger arguments.  ISO C99 and C11
9493 allow these functions to raise the ``inexact'' exception, but ISO/IEC
9494 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
9495 functions to do so.
9497 The default is @option{-ffp-int-builtin-inexact}, allowing the
9498 exception to be raised.  This option does nothing unless
9499 @option{-ftrapping-math} is in effect.
9501 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
9502 generate a call to a library function then the ``inexact'' exception
9503 may be raised if the library implementation does not follow TS 18661.
9505 @item -fsingle-precision-constant
9506 @opindex fsingle-precision-constant
9507 Treat floating-point constants as single precision instead of
9508 implicitly converting them to double-precision constants.
9510 @item -fcx-limited-range
9511 @opindex fcx-limited-range
9512 When enabled, this option states that a range reduction step is not
9513 needed when performing complex division.  Also, there is no checking
9514 whether the result of a complex multiplication or division is @code{NaN
9515 + I*NaN}, with an attempt to rescue the situation in that case.  The
9516 default is @option{-fno-cx-limited-range}, but is enabled by
9517 @option{-ffast-math}.
9519 This option controls the default setting of the ISO C99
9520 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9521 all languages.
9523 @item -fcx-fortran-rules
9524 @opindex fcx-fortran-rules
9525 Complex multiplication and division follow Fortran rules.  Range
9526 reduction is done as part of complex division, but there is no checking
9527 whether the result of a complex multiplication or division is @code{NaN
9528 + I*NaN}, with an attempt to rescue the situation in that case.
9530 The default is @option{-fno-cx-fortran-rules}.
9532 @end table
9534 The following options control optimizations that may improve
9535 performance, but are not enabled by any @option{-O} options.  This
9536 section includes experimental options that may produce broken code.
9538 @table @gcctabopt
9539 @item -fbranch-probabilities
9540 @opindex fbranch-probabilities
9541 After running a program compiled with @option{-fprofile-arcs}
9542 (@pxref{Instrumentation Options}),
9543 you can compile it a second time using
9544 @option{-fbranch-probabilities}, to improve optimizations based on
9545 the number of times each branch was taken.  When a program
9546 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9547 counts to a file called @file{@var{sourcename}.gcda} for each source
9548 file.  The information in this data file is very dependent on the
9549 structure of the generated code, so you must use the same source code
9550 and the same optimization options for both compilations.
9552 With @option{-fbranch-probabilities}, GCC puts a
9553 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9554 These can be used to improve optimization.  Currently, they are only
9555 used in one place: in @file{reorg.c}, instead of guessing which path a
9556 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9557 exactly determine which path is taken more often.
9559 @item -fprofile-values
9560 @opindex fprofile-values
9561 If combined with @option{-fprofile-arcs}, it adds code so that some
9562 data about values of expressions in the program is gathered.
9564 With @option{-fbranch-probabilities}, it reads back the data gathered
9565 from profiling values of expressions for usage in optimizations.
9567 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9569 @item -fprofile-reorder-functions
9570 @opindex fprofile-reorder-functions
9571 Function reordering based on profile instrumentation collects
9572 first time of execution of a function and orders these functions
9573 in ascending order.
9575 Enabled with @option{-fprofile-use}.
9577 @item -fvpt
9578 @opindex fvpt
9579 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9580 to add code to gather information about values of expressions.
9582 With @option{-fbranch-probabilities}, it reads back the data gathered
9583 and actually performs the optimizations based on them.
9584 Currently the optimizations include specialization of division operations
9585 using the knowledge about the value of the denominator.
9587 @item -frename-registers
9588 @opindex frename-registers
9589 Attempt to avoid false dependencies in scheduled code by making use
9590 of registers left over after register allocation.  This optimization
9591 most benefits processors with lots of registers.  Depending on the
9592 debug information format adopted by the target, however, it can
9593 make debugging impossible, since variables no longer stay in
9594 a ``home register''.
9596 Enabled by default with @option{-funroll-loops}.
9598 @item -fschedule-fusion
9599 @opindex fschedule-fusion
9600 Performs a target dependent pass over the instruction stream to schedule
9601 instructions of same type together because target machine can execute them
9602 more efficiently if they are adjacent to each other in the instruction flow.
9604 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9606 @item -ftracer
9607 @opindex ftracer
9608 Perform tail duplication to enlarge superblock size.  This transformation
9609 simplifies the control flow of the function allowing other optimizations to do
9610 a better job.
9612 Enabled with @option{-fprofile-use}.
9614 @item -funroll-loops
9615 @opindex funroll-loops
9616 Unroll loops whose number of iterations can be determined at compile time or
9617 upon entry to the loop.  @option{-funroll-loops} implies
9618 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9619 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9620 a small constant number of iterations).  This option makes code larger, and may
9621 or may not make it run faster.
9623 Enabled with @option{-fprofile-use}.
9625 @item -funroll-all-loops
9626 @opindex funroll-all-loops
9627 Unroll all loops, even if their number of iterations is uncertain when
9628 the loop is entered.  This usually makes programs run more slowly.
9629 @option{-funroll-all-loops} implies the same options as
9630 @option{-funroll-loops}.
9632 @item -fpeel-loops
9633 @opindex fpeel-loops
9634 Peels loops for which there is enough information that they do not
9635 roll much (from profile feedback or static analysis).  It also turns on
9636 complete loop peeling (i.e.@: complete removal of loops with small constant
9637 number of iterations).
9639 Enabled with @option{-O3} and/or @option{-fprofile-use}.
9641 @item -fmove-loop-invariants
9642 @opindex fmove-loop-invariants
9643 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9644 at level @option{-O1}
9646 @item -fsplit-loops
9647 @opindex fsplit-loops
9648 Split a loop into two if it contains a condition that's always true
9649 for one side of the iteration space and false for the other.
9651 @item -funswitch-loops
9652 @opindex funswitch-loops
9653 Move branches with loop invariant conditions out of the loop, with duplicates
9654 of the loop on both branches (modified according to result of the condition).
9656 @item -ffunction-sections
9657 @itemx -fdata-sections
9658 @opindex ffunction-sections
9659 @opindex fdata-sections
9660 Place each function or data item into its own section in the output
9661 file if the target supports arbitrary sections.  The name of the
9662 function or the name of the data item determines the section's name
9663 in the output file.
9665 Use these options on systems where the linker can perform optimizations
9666 to improve locality of reference in the instruction space.  Most systems
9667 using the ELF object format and SPARC processors running Solaris 2 have
9668 linkers with such optimizations.  AIX may have these optimizations in
9669 the future.
9671 Only use these options when there are significant benefits from doing
9672 so.  When you specify these options, the assembler and linker
9673 create larger object and executable files and are also slower.
9674 You cannot use @command{gprof} on all systems if you
9675 specify this option, and you may have problems with debugging if
9676 you specify both this option and @option{-g}.
9678 @item -fbranch-target-load-optimize
9679 @opindex fbranch-target-load-optimize
9680 Perform branch target register load optimization before prologue / epilogue
9681 threading.
9682 The use of target registers can typically be exposed only during reload,
9683 thus hoisting loads out of loops and doing inter-block scheduling needs
9684 a separate optimization pass.
9686 @item -fbranch-target-load-optimize2
9687 @opindex fbranch-target-load-optimize2
9688 Perform branch target register load optimization after prologue / epilogue
9689 threading.
9691 @item -fbtr-bb-exclusive
9692 @opindex fbtr-bb-exclusive
9693 When performing branch target register load optimization, don't reuse
9694 branch target registers within any basic block.
9696 @item -fstdarg-opt
9697 @opindex fstdarg-opt
9698 Optimize the prologue of variadic argument functions with respect to usage of
9699 those arguments.
9701 @item -fsection-anchors
9702 @opindex fsection-anchors
9703 Try to reduce the number of symbolic address calculations by using
9704 shared ``anchor'' symbols to address nearby objects.  This transformation
9705 can help to reduce the number of GOT entries and GOT accesses on some
9706 targets.
9708 For example, the implementation of the following function @code{foo}:
9710 @smallexample
9711 static int a, b, c;
9712 int foo (void) @{ return a + b + c; @}
9713 @end smallexample
9715 @noindent
9716 usually calculates the addresses of all three variables, but if you
9717 compile it with @option{-fsection-anchors}, it accesses the variables
9718 from a common anchor point instead.  The effect is similar to the
9719 following pseudocode (which isn't valid C):
9721 @smallexample
9722 int foo (void)
9724   register int *xr = &x;
9725   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9727 @end smallexample
9729 Not all targets support this option.
9731 @item --param @var{name}=@var{value}
9732 @opindex param
9733 In some places, GCC uses various constants to control the amount of
9734 optimization that is done.  For example, GCC does not inline functions
9735 that contain more than a certain number of instructions.  You can
9736 control some of these constants on the command line using the
9737 @option{--param} option.
9739 The names of specific parameters, and the meaning of the values, are
9740 tied to the internals of the compiler, and are subject to change
9741 without notice in future releases.
9743 In each case, the @var{value} is an integer.  The allowable choices for
9744 @var{name} are:
9746 @table @gcctabopt
9747 @item predictable-branch-outcome
9748 When branch is predicted to be taken with probability lower than this threshold
9749 (in percent), then it is considered well predictable. The default is 10.
9751 @item max-rtl-if-conversion-insns
9752 RTL if-conversion tries to remove conditional branches around a block and
9753 replace them with conditionally executed instructions.  This parameter
9754 gives the maximum number of instructions in a block which should be
9755 considered for if-conversion.  The default is 10, though the compiler will
9756 also use other heuristics to decide whether if-conversion is likely to be
9757 profitable.
9759 @item max-rtl-if-conversion-predictable-cost
9760 @item max-rtl-if-conversion-unpredictable-cost
9761 RTL if-conversion will try to remove conditional branches around a block
9762 and replace them with conditionally executed instructions.  These parameters
9763 give the maximum permissible cost for the sequence that would be generated
9764 by if-conversion depending on whether the branch is statically determined
9765 to be predictable or not.  The units for this parameter are the same as
9766 those for the GCC internal seq_cost metric.  The compiler will try to
9767 provide a reasonable default for this parameter using the BRANCH_COST
9768 target macro.
9770 @item max-crossjump-edges
9771 The maximum number of incoming edges to consider for cross-jumping.
9772 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9773 the number of edges incoming to each block.  Increasing values mean
9774 more aggressive optimization, making the compilation time increase with
9775 probably small improvement in executable size.
9777 @item min-crossjump-insns
9778 The minimum number of instructions that must be matched at the end
9779 of two blocks before cross-jumping is performed on them.  This
9780 value is ignored in the case where all instructions in the block being
9781 cross-jumped from are matched.  The default value is 5.
9783 @item max-grow-copy-bb-insns
9784 The maximum code size expansion factor when copying basic blocks
9785 instead of jumping.  The expansion is relative to a jump instruction.
9786 The default value is 8.
9788 @item max-goto-duplication-insns
9789 The maximum number of instructions to duplicate to a block that jumps
9790 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9791 passes, GCC factors computed gotos early in the compilation process,
9792 and unfactors them as late as possible.  Only computed jumps at the
9793 end of a basic blocks with no more than max-goto-duplication-insns are
9794 unfactored.  The default value is 8.
9796 @item max-delay-slot-insn-search
9797 The maximum number of instructions to consider when looking for an
9798 instruction to fill a delay slot.  If more than this arbitrary number of
9799 instructions are searched, the time savings from filling the delay slot
9800 are minimal, so stop searching.  Increasing values mean more
9801 aggressive optimization, making the compilation time increase with probably
9802 small improvement in execution time.
9804 @item max-delay-slot-live-search
9805 When trying to fill delay slots, the maximum number of instructions to
9806 consider when searching for a block with valid live register
9807 information.  Increasing this arbitrarily chosen value means more
9808 aggressive optimization, increasing the compilation time.  This parameter
9809 should be removed when the delay slot code is rewritten to maintain the
9810 control-flow graph.
9812 @item max-gcse-memory
9813 The approximate maximum amount of memory that can be allocated in
9814 order to perform the global common subexpression elimination
9815 optimization.  If more memory than specified is required, the
9816 optimization is not done.
9818 @item max-gcse-insertion-ratio
9819 If the ratio of expression insertions to deletions is larger than this value
9820 for any expression, then RTL PRE inserts or removes the expression and thus
9821 leaves partially redundant computations in the instruction stream.  The default value is 20.
9823 @item max-pending-list-length
9824 The maximum number of pending dependencies scheduling allows
9825 before flushing the current state and starting over.  Large functions
9826 with few branches or calls can create excessively large lists which
9827 needlessly consume memory and resources.
9829 @item max-modulo-backtrack-attempts
9830 The maximum number of backtrack attempts the scheduler should make
9831 when modulo scheduling a loop.  Larger values can exponentially increase
9832 compilation time.
9834 @item max-inline-insns-single
9835 Several parameters control the tree inliner used in GCC@.
9836 This number sets the maximum number of instructions (counted in GCC's
9837 internal representation) in a single function that the tree inliner
9838 considers for inlining.  This only affects functions declared
9839 inline and methods implemented in a class declaration (C++).
9840 The default value is 400.
9842 @item max-inline-insns-auto
9843 When you use @option{-finline-functions} (included in @option{-O3}),
9844 a lot of functions that would otherwise not be considered for inlining
9845 by the compiler are investigated.  To those functions, a different
9846 (more restrictive) limit compared to functions declared inline can
9847 be applied.
9848 The default value is 40.
9850 @item inline-min-speedup
9851 When estimated performance improvement of caller + callee runtime exceeds this
9852 threshold (in percent), the function can be inlined regardless of the limit on
9853 @option{--param max-inline-insns-single} and @option{--param
9854 max-inline-insns-auto}.
9856 @item large-function-insns
9857 The limit specifying really large functions.  For functions larger than this
9858 limit after inlining, inlining is constrained by
9859 @option{--param large-function-growth}.  This parameter is useful primarily
9860 to avoid extreme compilation time caused by non-linear algorithms used by the
9861 back end.
9862 The default value is 2700.
9864 @item large-function-growth
9865 Specifies maximal growth of large function caused by inlining in percents.
9866 The default value is 100 which limits large function growth to 2.0 times
9867 the original size.
9869 @item large-unit-insns
9870 The limit specifying large translation unit.  Growth caused by inlining of
9871 units larger than this limit is limited by @option{--param inline-unit-growth}.
9872 For small units this might be too tight.
9873 For example, consider a unit consisting of function A
9874 that is inline and B that just calls A three times.  If B is small relative to
9875 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9876 large units consisting of small inlineable functions, however, the overall unit
9877 growth limit is needed to avoid exponential explosion of code size.  Thus for
9878 smaller units, the size is increased to @option{--param large-unit-insns}
9879 before applying @option{--param inline-unit-growth}.  The default is 10000.
9881 @item inline-unit-growth
9882 Specifies maximal overall growth of the compilation unit caused by inlining.
9883 The default value is 20 which limits unit growth to 1.2 times the original
9884 size. Cold functions (either marked cold via an attribute or by profile
9885 feedback) are not accounted into the unit size.
9887 @item ipcp-unit-growth
9888 Specifies maximal overall growth of the compilation unit caused by
9889 interprocedural constant propagation.  The default value is 10 which limits
9890 unit growth to 1.1 times the original size.
9892 @item large-stack-frame
9893 The limit specifying large stack frames.  While inlining the algorithm is trying
9894 to not grow past this limit too much.  The default value is 256 bytes.
9896 @item large-stack-frame-growth
9897 Specifies maximal growth of large stack frames caused by inlining in percents.
9898 The default value is 1000 which limits large stack frame growth to 11 times
9899 the original size.
9901 @item max-inline-insns-recursive
9902 @itemx max-inline-insns-recursive-auto
9903 Specifies the maximum number of instructions an out-of-line copy of a
9904 self-recursive inline
9905 function can grow into by performing recursive inlining.
9907 @option{--param max-inline-insns-recursive} applies to functions
9908 declared inline.
9909 For functions not declared inline, recursive inlining
9910 happens only when @option{-finline-functions} (included in @option{-O3}) is
9911 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
9912 default value is 450.
9914 @item max-inline-recursive-depth
9915 @itemx max-inline-recursive-depth-auto
9916 Specifies the maximum recursion depth used for recursive inlining.
9918 @option{--param max-inline-recursive-depth} applies to functions
9919 declared inline.  For functions not declared inline, recursive inlining
9920 happens only when @option{-finline-functions} (included in @option{-O3}) is
9921 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
9922 default value is 8.
9924 @item min-inline-recursive-probability
9925 Recursive inlining is profitable only for function having deep recursion
9926 in average and can hurt for function having little recursion depth by
9927 increasing the prologue size or complexity of function body to other
9928 optimizers.
9930 When profile feedback is available (see @option{-fprofile-generate}) the actual
9931 recursion depth can be guessed from the probability that function recurses
9932 via a given call expression.  This parameter limits inlining only to call
9933 expressions whose probability exceeds the given threshold (in percents).
9934 The default value is 10.
9936 @item early-inlining-insns
9937 Specify growth that the early inliner can make.  In effect it increases
9938 the amount of inlining for code having a large abstraction penalty.
9939 The default value is 14.
9941 @item max-early-inliner-iterations
9942 Limit of iterations of the early inliner.  This basically bounds
9943 the number of nested indirect calls the early inliner can resolve.
9944 Deeper chains are still handled by late inlining.
9946 @item comdat-sharing-probability
9947 Probability (in percent) that C++ inline function with comdat visibility
9948 are shared across multiple compilation units.  The default value is 20.
9950 @item profile-func-internal-id
9951 A parameter to control whether to use function internal id in profile
9952 database lookup. If the value is 0, the compiler uses an id that
9953 is based on function assembler name and filename, which makes old profile
9954 data more tolerant to source changes such as function reordering etc.
9955 The default value is 0.
9957 @item min-vect-loop-bound
9958 The minimum number of iterations under which loops are not vectorized
9959 when @option{-ftree-vectorize} is used.  The number of iterations after
9960 vectorization needs to be greater than the value specified by this option
9961 to allow vectorization.  The default value is 0.
9963 @item gcse-cost-distance-ratio
9964 Scaling factor in calculation of maximum distance an expression
9965 can be moved by GCSE optimizations.  This is currently supported only in the
9966 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9967 is with simple expressions, i.e., the expressions that have cost
9968 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9969 hoisting of simple expressions.  The default value is 10.
9971 @item gcse-unrestricted-cost
9972 Cost, roughly measured as the cost of a single typical machine
9973 instruction, at which GCSE optimizations do not constrain
9974 the distance an expression can travel.  This is currently
9975 supported only in the code hoisting pass.  The lesser the cost,
9976 the more aggressive code hoisting is.  Specifying 0 
9977 allows all expressions to travel unrestricted distances.
9978 The default value is 3.
9980 @item max-hoist-depth
9981 The depth of search in the dominator tree for expressions to hoist.
9982 This is used to avoid quadratic behavior in hoisting algorithm.
9983 The value of 0 does not limit on the search, but may slow down compilation
9984 of huge functions.  The default value is 30.
9986 @item max-tail-merge-comparisons
9987 The maximum amount of similar bbs to compare a bb with.  This is used to
9988 avoid quadratic behavior in tree tail merging.  The default value is 10.
9990 @item max-tail-merge-iterations
9991 The maximum amount of iterations of the pass over the function.  This is used to
9992 limit compilation time in tree tail merging.  The default value is 2.
9994 @item store-merging-allow-unaligned
9995 Allow the store merging pass to introduce unaligned stores if it is legal to
9996 do so.  The default value is 1.
9998 @item max-stores-to-merge
9999 The maximum number of stores to attempt to merge into wider stores in the store
10000 merging pass.  The minimum value is 2 and the default is 64.
10002 @item max-unrolled-insns
10003 The maximum number of instructions that a loop may have to be unrolled.
10004 If a loop is unrolled, this parameter also determines how many times
10005 the loop code is unrolled.
10007 @item max-average-unrolled-insns
10008 The maximum number of instructions biased by probabilities of their execution
10009 that a loop may have to be unrolled.  If a loop is unrolled,
10010 this parameter also determines how many times the loop code is unrolled.
10012 @item max-unroll-times
10013 The maximum number of unrollings of a single loop.
10015 @item max-peeled-insns
10016 The maximum number of instructions that a loop may have to be peeled.
10017 If a loop is peeled, this parameter also determines how many times
10018 the loop code is peeled.
10020 @item max-peel-times
10021 The maximum number of peelings of a single loop.
10023 @item max-peel-branches
10024 The maximum number of branches on the hot path through the peeled sequence.
10026 @item max-completely-peeled-insns
10027 The maximum number of insns of a completely peeled loop.
10029 @item max-completely-peel-times
10030 The maximum number of iterations of a loop to be suitable for complete peeling.
10032 @item max-completely-peel-loop-nest-depth
10033 The maximum depth of a loop nest suitable for complete peeling.
10035 @item max-unswitch-insns
10036 The maximum number of insns of an unswitched loop.
10038 @item max-unswitch-level
10039 The maximum number of branches unswitched in a single loop.
10041 @item max-loop-headers-insns
10042 The maximum number of insns in loop header duplicated by the copy loop headers
10043 pass.
10045 @item lim-expensive
10046 The minimum cost of an expensive expression in the loop invariant motion.
10048 @item iv-consider-all-candidates-bound
10049 Bound on number of candidates for induction variables, below which
10050 all candidates are considered for each use in induction variable
10051 optimizations.  If there are more candidates than this,
10052 only the most relevant ones are considered to avoid quadratic time complexity.
10054 @item iv-max-considered-uses
10055 The induction variable optimizations give up on loops that contain more
10056 induction variable uses.
10058 @item iv-always-prune-cand-set-bound
10059 If the number of candidates in the set is smaller than this value,
10060 always try to remove unnecessary ivs from the set
10061 when adding a new one.
10063 @item avg-loop-niter
10064 Average number of iterations of a loop.
10066 @item dse-max-object-size
10067 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
10068 Larger values may result in larger compilation times.
10070 @item scev-max-expr-size
10071 Bound on size of expressions used in the scalar evolutions analyzer.
10072 Large expressions slow the analyzer.
10074 @item scev-max-expr-complexity
10075 Bound on the complexity of the expressions in the scalar evolutions analyzer.
10076 Complex expressions slow the analyzer.
10078 @item max-tree-if-conversion-phi-args
10079 Maximum number of arguments in a PHI supported by TREE if conversion
10080 unless the loop is marked with simd pragma.
10082 @item vect-max-version-for-alignment-checks
10083 The maximum number of run-time checks that can be performed when
10084 doing loop versioning for alignment in the vectorizer.
10086 @item vect-max-version-for-alias-checks
10087 The maximum number of run-time checks that can be performed when
10088 doing loop versioning for alias in the vectorizer.
10090 @item vect-max-peeling-for-alignment
10091 The maximum number of loop peels to enhance access alignment
10092 for vectorizer. Value -1 means no limit.
10094 @item max-iterations-to-track
10095 The maximum number of iterations of a loop the brute-force algorithm
10096 for analysis of the number of iterations of the loop tries to evaluate.
10098 @item hot-bb-count-ws-permille
10099 A basic block profile count is considered hot if it contributes to 
10100 the given permillage (i.e. 0...1000) of the entire profiled execution.
10102 @item hot-bb-frequency-fraction
10103 Select fraction of the entry block frequency of executions of basic block in
10104 function given basic block needs to have to be considered hot.
10106 @item max-predicted-iterations
10107 The maximum number of loop iterations we predict statically.  This is useful
10108 in cases where a function contains a single loop with known bound and
10109 another loop with unknown bound.
10110 The known number of iterations is predicted correctly, while
10111 the unknown number of iterations average to roughly 10.  This means that the
10112 loop without bounds appears artificially cold relative to the other one.
10114 @item builtin-expect-probability
10115 Control the probability of the expression having the specified value. This
10116 parameter takes a percentage (i.e. 0 ... 100) as input.
10117 The default probability of 90 is obtained empirically.
10119 @item align-threshold
10121 Select fraction of the maximal frequency of executions of a basic block in
10122 a function to align the basic block.
10124 @item align-loop-iterations
10126 A loop expected to iterate at least the selected number of iterations is
10127 aligned.
10129 @item tracer-dynamic-coverage
10130 @itemx tracer-dynamic-coverage-feedback
10132 This value is used to limit superblock formation once the given percentage of
10133 executed instructions is covered.  This limits unnecessary code size
10134 expansion.
10136 The @option{tracer-dynamic-coverage-feedback} parameter
10137 is used only when profile
10138 feedback is available.  The real profiles (as opposed to statically estimated
10139 ones) are much less balanced allowing the threshold to be larger value.
10141 @item tracer-max-code-growth
10142 Stop tail duplication once code growth has reached given percentage.  This is
10143 a rather artificial limit, as most of the duplicates are eliminated later in
10144 cross jumping, so it may be set to much higher values than is the desired code
10145 growth.
10147 @item tracer-min-branch-ratio
10149 Stop reverse growth when the reverse probability of best edge is less than this
10150 threshold (in percent).
10152 @item tracer-min-branch-probability
10153 @itemx tracer-min-branch-probability-feedback
10155 Stop forward growth if the best edge has probability lower than this
10156 threshold.
10158 Similarly to @option{tracer-dynamic-coverage} two parameters are
10159 provided.  @option{tracer-min-branch-probability-feedback} is used for
10160 compilation with profile feedback and @option{tracer-min-branch-probability}
10161 compilation without.  The value for compilation with profile feedback
10162 needs to be more conservative (higher) in order to make tracer
10163 effective.
10165 @item max-cse-path-length
10167 The maximum number of basic blocks on path that CSE considers.
10168 The default is 10.
10170 @item max-cse-insns
10171 The maximum number of instructions CSE processes before flushing.
10172 The default is 1000.
10174 @item ggc-min-expand
10176 GCC uses a garbage collector to manage its own memory allocation.  This
10177 parameter specifies the minimum percentage by which the garbage
10178 collector's heap should be allowed to expand between collections.
10179 Tuning this may improve compilation speed; it has no effect on code
10180 generation.
10182 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10183 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10184 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10185 GCC is not able to calculate RAM on a particular platform, the lower
10186 bound of 30% is used.  Setting this parameter and
10187 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10188 every opportunity.  This is extremely slow, but can be useful for
10189 debugging.
10191 @item ggc-min-heapsize
10193 Minimum size of the garbage collector's heap before it begins bothering
10194 to collect garbage.  The first collection occurs after the heap expands
10195 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10196 tuning this may improve compilation speed, and has no effect on code
10197 generation.
10199 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10200 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10201 with a lower bound of 4096 (four megabytes) and an upper bound of
10202 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10203 particular platform, the lower bound is used.  Setting this parameter
10204 very large effectively disables garbage collection.  Setting this
10205 parameter and @option{ggc-min-expand} to zero causes a full collection
10206 to occur at every opportunity.
10208 @item max-reload-search-insns
10209 The maximum number of instruction reload should look backward for equivalent
10210 register.  Increasing values mean more aggressive optimization, making the
10211 compilation time increase with probably slightly better performance.
10212 The default value is 100.
10214 @item max-cselib-memory-locations
10215 The maximum number of memory locations cselib should take into account.
10216 Increasing values mean more aggressive optimization, making the compilation time
10217 increase with probably slightly better performance.  The default value is 500.
10219 @item max-sched-ready-insns
10220 The maximum number of instructions ready to be issued the scheduler should
10221 consider at any given time during the first scheduling pass.  Increasing
10222 values mean more thorough searches, making the compilation time increase
10223 with probably little benefit.  The default value is 100.
10225 @item max-sched-region-blocks
10226 The maximum number of blocks in a region to be considered for
10227 interblock scheduling.  The default value is 10.
10229 @item max-pipeline-region-blocks
10230 The maximum number of blocks in a region to be considered for
10231 pipelining in the selective scheduler.  The default value is 15.
10233 @item max-sched-region-insns
10234 The maximum number of insns in a region to be considered for
10235 interblock scheduling.  The default value is 100.
10237 @item max-pipeline-region-insns
10238 The maximum number of insns in a region to be considered for
10239 pipelining in the selective scheduler.  The default value is 200.
10241 @item min-spec-prob
10242 The minimum probability (in percents) of reaching a source block
10243 for interblock speculative scheduling.  The default value is 40.
10245 @item max-sched-extend-regions-iters
10246 The maximum number of iterations through CFG to extend regions.
10247 A value of 0 (the default) disables region extensions.
10249 @item max-sched-insn-conflict-delay
10250 The maximum conflict delay for an insn to be considered for speculative motion.
10251 The default value is 3.
10253 @item sched-spec-prob-cutoff
10254 The minimal probability of speculation success (in percents), so that
10255 speculative insns are scheduled.
10256 The default value is 40.
10258 @item sched-state-edge-prob-cutoff
10259 The minimum probability an edge must have for the scheduler to save its
10260 state across it.
10261 The default value is 10.
10263 @item sched-mem-true-dep-cost
10264 Minimal distance (in CPU cycles) between store and load targeting same
10265 memory locations.  The default value is 1.
10267 @item selsched-max-lookahead
10268 The maximum size of the lookahead window of selective scheduling.  It is a
10269 depth of search for available instructions.
10270 The default value is 50.
10272 @item selsched-max-sched-times
10273 The maximum number of times that an instruction is scheduled during
10274 selective scheduling.  This is the limit on the number of iterations
10275 through which the instruction may be pipelined.  The default value is 2.
10277 @item selsched-insns-to-rename
10278 The maximum number of best instructions in the ready list that are considered
10279 for renaming in the selective scheduler.  The default value is 2.
10281 @item sms-min-sc
10282 The minimum value of stage count that swing modulo scheduler
10283 generates.  The default value is 2.
10285 @item max-last-value-rtl
10286 The maximum size measured as number of RTLs that can be recorded in an expression
10287 in combiner for a pseudo register as last known value of that register.  The default
10288 is 10000.
10290 @item max-combine-insns
10291 The maximum number of instructions the RTL combiner tries to combine.
10292 The default value is 2 at @option{-Og} and 4 otherwise.
10294 @item integer-share-limit
10295 Small integer constants can use a shared data structure, reducing the
10296 compiler's memory usage and increasing its speed.  This sets the maximum
10297 value of a shared integer constant.  The default value is 256.
10299 @item ssp-buffer-size
10300 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10301 protection when @option{-fstack-protection} is used.
10303 @item min-size-for-stack-sharing
10304 The minimum size of variables taking part in stack slot sharing when not
10305 optimizing. The default value is 32.
10307 @item max-jump-thread-duplication-stmts
10308 Maximum number of statements allowed in a block that needs to be
10309 duplicated when threading jumps.
10311 @item max-fields-for-field-sensitive
10312 Maximum number of fields in a structure treated in
10313 a field sensitive manner during pointer analysis.  The default is zero
10314 for @option{-O0} and @option{-O1},
10315 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10317 @item prefetch-latency
10318 Estimate on average number of instructions that are executed before
10319 prefetch finishes.  The distance prefetched ahead is proportional
10320 to this constant.  Increasing this number may also lead to less
10321 streams being prefetched (see @option{simultaneous-prefetches}).
10323 @item simultaneous-prefetches
10324 Maximum number of prefetches that can run at the same time.
10326 @item l1-cache-line-size
10327 The size of cache line in L1 cache, in bytes.
10329 @item l1-cache-size
10330 The size of L1 cache, in kilobytes.
10332 @item l2-cache-size
10333 The size of L2 cache, in kilobytes.
10335 @item min-insn-to-prefetch-ratio
10336 The minimum ratio between the number of instructions and the
10337 number of prefetches to enable prefetching in a loop.
10339 @item prefetch-min-insn-to-mem-ratio
10340 The minimum ratio between the number of instructions and the
10341 number of memory references to enable prefetching in a loop.
10343 @item use-canonical-types
10344 Whether the compiler should use the ``canonical'' type system.  By
10345 default, this should always be 1, which uses a more efficient internal
10346 mechanism for comparing types in C++ and Objective-C++.  However, if
10347 bugs in the canonical type system are causing compilation failures,
10348 set this value to 0 to disable canonical types.
10350 @item switch-conversion-max-branch-ratio
10351 Switch initialization conversion refuses to create arrays that are
10352 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10353 branches in the switch.
10355 @item max-partial-antic-length
10356 Maximum length of the partial antic set computed during the tree
10357 partial redundancy elimination optimization (@option{-ftree-pre}) when
10358 optimizing at @option{-O3} and above.  For some sorts of source code
10359 the enhanced partial redundancy elimination optimization can run away,
10360 consuming all of the memory available on the host machine.  This
10361 parameter sets a limit on the length of the sets that are computed,
10362 which prevents the runaway behavior.  Setting a value of 0 for
10363 this parameter allows an unlimited set length.
10365 @item sccvn-max-scc-size
10366 Maximum size of a strongly connected component (SCC) during SCCVN
10367 processing.  If this limit is hit, SCCVN processing for the whole
10368 function is not done and optimizations depending on it are
10369 disabled.  The default maximum SCC size is 10000.
10371 @item sccvn-max-alias-queries-per-access
10372 Maximum number of alias-oracle queries we perform when looking for
10373 redundancies for loads and stores.  If this limit is hit the search
10374 is aborted and the load or store is not considered redundant.  The
10375 number of queries is algorithmically limited to the number of
10376 stores on all paths from the load to the function entry.
10377 The default maximum number of queries is 1000.
10379 @item ira-max-loops-num
10380 IRA uses regional register allocation by default.  If a function
10381 contains more loops than the number given by this parameter, only at most
10382 the given number of the most frequently-executed loops form regions
10383 for regional register allocation.  The default value of the
10384 parameter is 100.
10386 @item ira-max-conflict-table-size 
10387 Although IRA uses a sophisticated algorithm to compress the conflict
10388 table, the table can still require excessive amounts of memory for
10389 huge functions.  If the conflict table for a function could be more
10390 than the size in MB given by this parameter, the register allocator
10391 instead uses a faster, simpler, and lower-quality
10392 algorithm that does not require building a pseudo-register conflict table.  
10393 The default value of the parameter is 2000.
10395 @item ira-loop-reserved-regs
10396 IRA can be used to evaluate more accurate register pressure in loops
10397 for decisions to move loop invariants (see @option{-O3}).  The number
10398 of available registers reserved for some other purposes is given
10399 by this parameter.  The default value of the parameter is 2, which is
10400 the minimal number of registers needed by typical instructions.
10401 This value is the best found from numerous experiments.
10403 @item lra-inheritance-ebb-probability-cutoff
10404 LRA tries to reuse values reloaded in registers in subsequent insns.
10405 This optimization is called inheritance.  EBB is used as a region to
10406 do this optimization.  The parameter defines a minimal fall-through
10407 edge probability in percentage used to add BB to inheritance EBB in
10408 LRA.  The default value of the parameter is 40.  The value was chosen
10409 from numerous runs of SPEC2000 on x86-64.
10411 @item loop-invariant-max-bbs-in-loop
10412 Loop invariant motion can be very expensive, both in compilation time and
10413 in amount of needed compile-time memory, with very large loops.  Loops
10414 with more basic blocks than this parameter won't have loop invariant
10415 motion optimization performed on them.  The default value of the
10416 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10418 @item loop-max-datarefs-for-datadeps
10419 Building data dependencies is expensive for very large loops.  This
10420 parameter limits the number of data references in loops that are
10421 considered for data dependence analysis.  These large loops are no
10422 handled by the optimizations using loop data dependencies.
10423 The default value is 1000.
10425 @item max-vartrack-size
10426 Sets a maximum number of hash table slots to use during variable
10427 tracking dataflow analysis of any function.  If this limit is exceeded
10428 with variable tracking at assignments enabled, analysis for that
10429 function is retried without it, after removing all debug insns from
10430 the function.  If the limit is exceeded even without debug insns, var
10431 tracking analysis is completely disabled for the function.  Setting
10432 the parameter to zero makes it unlimited.
10434 @item max-vartrack-expr-depth
10435 Sets a maximum number of recursion levels when attempting to map
10436 variable names or debug temporaries to value expressions.  This trades
10437 compilation time for more complete debug information.  If this is set too
10438 low, value expressions that are available and could be represented in
10439 debug information may end up not being used; setting this higher may
10440 enable the compiler to find more complex debug expressions, but compile
10441 time and memory use may grow.  The default is 12.
10443 @item min-nondebug-insn-uid
10444 Use uids starting at this parameter for nondebug insns.  The range below
10445 the parameter is reserved exclusively for debug insns created by
10446 @option{-fvar-tracking-assignments}, but debug insns may get
10447 (non-overlapping) uids above it if the reserved range is exhausted.
10449 @item ipa-sra-ptr-growth-factor
10450 IPA-SRA replaces a pointer to an aggregate with one or more new
10451 parameters only when their cumulative size is less or equal to
10452 @option{ipa-sra-ptr-growth-factor} times the size of the original
10453 pointer parameter.
10455 @item sra-max-scalarization-size-Ospeed
10456 @item sra-max-scalarization-size-Osize
10457 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10458 replace scalar parts of aggregates with uses of independent scalar
10459 variables.  These parameters control the maximum size, in storage units,
10460 of aggregate which is considered for replacement when compiling for
10461 speed
10462 (@option{sra-max-scalarization-size-Ospeed}) or size
10463 (@option{sra-max-scalarization-size-Osize}) respectively.
10465 @item tm-max-aggregate-size
10466 When making copies of thread-local variables in a transaction, this
10467 parameter specifies the size in bytes after which variables are
10468 saved with the logging functions as opposed to save/restore code
10469 sequence pairs.  This option only applies when using
10470 @option{-fgnu-tm}.
10472 @item graphite-max-nb-scop-params
10473 To avoid exponential effects in the Graphite loop transforms, the
10474 number of parameters in a Static Control Part (SCoP) is bounded.  The
10475 default value is 10 parameters.  A variable whose value is unknown at
10476 compilation time and defined outside a SCoP is a parameter of the SCoP.
10478 @item graphite-max-bbs-per-function
10479 To avoid exponential effects in the detection of SCoPs, the size of
10480 the functions analyzed by Graphite is bounded.  The default value is
10481 100 basic blocks.
10483 @item loop-block-tile-size
10484 Loop blocking or strip mining transforms, enabled with
10485 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10486 loop in the loop nest by a given number of iterations.  The strip
10487 length can be changed using the @option{loop-block-tile-size}
10488 parameter.  The default value is 51 iterations.
10490 @item loop-unroll-jam-size
10491 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
10492 default value is 4.
10494 @item loop-unroll-jam-depth
10495 Specify the dimension to be unrolled (counting from the most inner loop)
10496 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
10498 @item ipa-cp-value-list-size
10499 IPA-CP attempts to track all possible values and types passed to a function's
10500 parameter in order to propagate them and perform devirtualization.
10501 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10502 stores per one formal parameter of a function.
10504 @item ipa-cp-eval-threshold
10505 IPA-CP calculates its own score of cloning profitability heuristics
10506 and performs those cloning opportunities with scores that exceed
10507 @option{ipa-cp-eval-threshold}.
10509 @item ipa-cp-recursion-penalty
10510 Percentage penalty the recursive functions will receive when they
10511 are evaluated for cloning.
10513 @item ipa-cp-single-call-penalty
10514 Percentage penalty functions containing a single call to another
10515 function will receive when they are evaluated for cloning.
10518 @item ipa-max-agg-items
10519 IPA-CP is also capable to propagate a number of scalar values passed
10520 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10521 number of such values per one parameter.
10523 @item ipa-cp-loop-hint-bonus
10524 When IPA-CP determines that a cloning candidate would make the number
10525 of iterations of a loop known, it adds a bonus of
10526 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10527 the candidate.
10529 @item ipa-cp-array-index-hint-bonus
10530 When IPA-CP determines that a cloning candidate would make the index of
10531 an array access known, it adds a bonus of
10532 @option{ipa-cp-array-index-hint-bonus} to the profitability
10533 score of the candidate.
10535 @item ipa-max-aa-steps
10536 During its analysis of function bodies, IPA-CP employs alias analysis
10537 in order to track values pointed to by function parameters.  In order
10538 not spend too much time analyzing huge functions, it gives up and
10539 consider all memory clobbered after examining
10540 @option{ipa-max-aa-steps} statements modifying memory.
10542 @item lto-partitions
10543 Specify desired number of partitions produced during WHOPR compilation.
10544 The number of partitions should exceed the number of CPUs used for compilation.
10545 The default value is 32.
10547 @item lto-min-partition
10548 Size of minimal partition for WHOPR (in estimated instructions).
10549 This prevents expenses of splitting very small programs into too many
10550 partitions.
10552 @item lto-max-partition
10553 Size of max partition for WHOPR (in estimated instructions).
10554 to provide an upper bound for individual size of partition.
10555 Meant to be used only with balanced partitioning.
10557 @item cxx-max-namespaces-for-diagnostic-help
10558 The maximum number of namespaces to consult for suggestions when C++
10559 name lookup fails for an identifier.  The default is 1000.
10561 @item sink-frequency-threshold
10562 The maximum relative execution frequency (in percents) of the target block
10563 relative to a statement's original block to allow statement sinking of a
10564 statement.  Larger numbers result in more aggressive statement sinking.
10565 The default value is 75.  A small positive adjustment is applied for
10566 statements with memory operands as those are even more profitable so sink.
10568 @item max-stores-to-sink
10569 The maximum number of conditional store pairs that can be sunk.  Set to 0
10570 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10571 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10573 @item allow-store-data-races
10574 Allow optimizers to introduce new data races on stores.
10575 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10576 at optimization level @option{-Ofast}.
10578 @item case-values-threshold
10579 The smallest number of different values for which it is best to use a
10580 jump-table instead of a tree of conditional branches.  If the value is
10581 0, use the default for the machine.  The default is 0.
10583 @item tree-reassoc-width
10584 Set the maximum number of instructions executed in parallel in
10585 reassociated tree. This parameter overrides target dependent
10586 heuristics used by default if has non zero value.
10588 @item sched-pressure-algorithm
10589 Choose between the two available implementations of
10590 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10591 and is the more likely to prevent instructions from being reordered.
10592 Algorithm 2 was designed to be a compromise between the relatively
10593 conservative approach taken by algorithm 1 and the rather aggressive
10594 approach taken by the default scheduler.  It relies more heavily on
10595 having a regular register file and accurate register pressure classes.
10596 See @file{haifa-sched.c} in the GCC sources for more details.
10598 The default choice depends on the target.
10600 @item max-slsr-cand-scan
10601 Set the maximum number of existing candidates that are considered when
10602 seeking a basis for a new straight-line strength reduction candidate.
10604 @item asan-globals
10605 Enable buffer overflow detection for global objects.  This kind
10606 of protection is enabled by default if you are using
10607 @option{-fsanitize=address} option.
10608 To disable global objects protection use @option{--param asan-globals=0}.
10610 @item asan-stack
10611 Enable buffer overflow detection for stack objects.  This kind of
10612 protection is enabled by default when using @option{-fsanitize=address}.
10613 To disable stack protection use @option{--param asan-stack=0} option.
10615 @item asan-instrument-reads
10616 Enable buffer overflow detection for memory reads.  This kind of
10617 protection is enabled by default when using @option{-fsanitize=address}.
10618 To disable memory reads protection use
10619 @option{--param asan-instrument-reads=0}.
10621 @item asan-instrument-writes
10622 Enable buffer overflow detection for memory writes.  This kind of
10623 protection is enabled by default when using @option{-fsanitize=address}.
10624 To disable memory writes protection use
10625 @option{--param asan-instrument-writes=0} option.
10627 @item asan-memintrin
10628 Enable detection for built-in functions.  This kind of protection
10629 is enabled by default when using @option{-fsanitize=address}.
10630 To disable built-in functions protection use
10631 @option{--param asan-memintrin=0}.
10633 @item asan-use-after-return
10634 Enable detection of use-after-return.  This kind of protection
10635 is enabled by default when using the @option{-fsanitize=address} option.
10636 To disable it use @option{--param asan-use-after-return=0}.
10638 Note: By default the check is disabled at run time.  To enable it,
10639 add @code{detect_stack_use_after_return=1} to the environment variable
10640 @env{ASAN_OPTIONS}.
10642 @item asan-instrumentation-with-call-threshold
10643 If number of memory accesses in function being instrumented
10644 is greater or equal to this number, use callbacks instead of inline checks.
10645 E.g. to disable inline code use
10646 @option{--param asan-instrumentation-with-call-threshold=0}.
10648 @item use-after-scope-direct-emission-threshold
10649 If the size of a local variable in bytes is smaller or equal to this
10650 number, directly poison (or unpoison) shadow memory instead of using
10651 run-time callbacks.  The default value is 256.
10653 @item chkp-max-ctor-size
10654 Static constructors generated by Pointer Bounds Checker may become very
10655 large and significantly increase compile time at optimization level
10656 @option{-O1} and higher.  This parameter is a maximum number of statements
10657 in a single generated constructor.  Default value is 5000.
10659 @item max-fsm-thread-path-insns
10660 Maximum number of instructions to copy when duplicating blocks on a
10661 finite state automaton jump thread path.  The default is 100.
10663 @item max-fsm-thread-length
10664 Maximum number of basic blocks on a finite state automaton jump thread
10665 path.  The default is 10.
10667 @item max-fsm-thread-paths
10668 Maximum number of new jump thread paths to create for a finite state
10669 automaton.  The default is 50.
10671 @item parloops-chunk-size
10672 Chunk size of omp schedule for loops parallelized by parloops.  The default
10673 is 0.
10675 @item parloops-schedule
10676 Schedule type of omp schedule for loops parallelized by parloops (static,
10677 dynamic, guided, auto, runtime).  The default is static.
10679 @item max-ssa-name-query-depth
10680 Maximum depth of recursion when querying properties of SSA names in things
10681 like fold routines.  One level of recursion corresponds to following a
10682 use-def chain.
10684 @item hsa-gen-debug-stores
10685 Enable emission of special debug stores within HSA kernels which are
10686 then read and reported by libgomp plugin.  Generation of these stores
10687 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
10688 enable it.
10690 @item max-speculative-devirt-maydefs
10691 The maximum number of may-defs we analyze when looking for a must-def
10692 specifying the dynamic type of an object that invokes a virtual call
10693 we may be able to devirtualize speculatively.
10695 @item max-vrp-switch-assertions
10696 The maximum number of assertions to add along the default edge of a switch
10697 statement during VRP.  The default is 10.
10698 @end table
10699 @end table
10701 @node Instrumentation Options
10702 @section Program Instrumentation Options
10703 @cindex instrumentation options
10704 @cindex program instrumentation options
10705 @cindex run-time error checking options
10706 @cindex profiling options
10707 @cindex options, program instrumentation
10708 @cindex options, run-time error checking
10709 @cindex options, profiling
10711 GCC supports a number of command-line options that control adding
10712 run-time instrumentation to the code it normally generates.  
10713 For example, one purpose of instrumentation is collect profiling
10714 statistics for use in finding program hot spots, code coverage
10715 analysis, or profile-guided optimizations.
10716 Another class of program instrumentation is adding run-time checking 
10717 to detect programming errors like invalid pointer
10718 dereferences or out-of-bounds array accesses, as well as deliberately
10719 hostile attacks such as stack smashing or C++ vtable hijacking.
10720 There is also a general hook which can be used to implement other
10721 forms of tracing or function-level instrumentation for debug or
10722 program analysis purposes.
10724 @table @gcctabopt
10725 @cindex @command{prof}
10726 @item -p
10727 @opindex p
10728 Generate extra code to write profile information suitable for the
10729 analysis program @command{prof}.  You must use this option when compiling
10730 the source files you want data about, and you must also use it when
10731 linking.
10733 @cindex @command{gprof}
10734 @item -pg
10735 @opindex pg
10736 Generate extra code to write profile information suitable for the
10737 analysis program @command{gprof}.  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 @item -fprofile-arcs
10742 @opindex fprofile-arcs
10743 Add code so that program flow @dfn{arcs} are instrumented.  During
10744 execution the program records how many times each branch and call is
10745 executed and how many times it is taken or returns.  On targets that support
10746 constructors with priority support, profiling properly handles constructors,
10747 destructors and C++ constructors (and destructors) of classes which are used
10748 as a type of a global variable.
10750 When the compiled
10751 program exits it saves this data to a file called
10752 @file{@var{auxname}.gcda} for each source file.  The data may be used for
10753 profile-directed optimizations (@option{-fbranch-probabilities}), or for
10754 test coverage analysis (@option{-ftest-coverage}).  Each object file's
10755 @var{auxname} is generated from the name of the output file, if
10756 explicitly specified and it is not the final executable, otherwise it is
10757 the basename of the source file.  In both cases any suffix is removed
10758 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
10759 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
10760 @xref{Cross-profiling}.
10762 @cindex @command{gcov}
10763 @item --coverage
10764 @opindex coverage
10766 This option is used to compile and link code instrumented for coverage
10767 analysis.  The option is a synonym for @option{-fprofile-arcs}
10768 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
10769 linking).  See the documentation for those options for more details.
10771 @itemize
10773 @item
10774 Compile the source files with @option{-fprofile-arcs} plus optimization
10775 and code generation options.  For test coverage analysis, use the
10776 additional @option{-ftest-coverage} option.  You do not need to profile
10777 every source file in a program.
10779 @item
10780 Compile the source files additionally with @option{-fprofile-abs-path}
10781 to create absolute path names in the @file{.gcno} files.  This allows
10782 @command{gcov} to find the correct sources in projects where compilations
10783 occur with different working directories.
10785 @item
10786 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
10787 (the latter implies the former).
10789 @item
10790 Run the program on a representative workload to generate the arc profile
10791 information.  This may be repeated any number of times.  You can run
10792 concurrent instances of your program, and provided that the file system
10793 supports locking, the data files will be correctly updated.  Also
10794 @code{fork} calls are detected and correctly handled (double counting
10795 will not happen).
10797 @item
10798 For profile-directed optimizations, compile the source files again with
10799 the same optimization and code generation options plus
10800 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
10801 Control Optimization}).
10803 @item
10804 For test coverage analysis, use @command{gcov} to produce human readable
10805 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
10806 @command{gcov} documentation for further information.
10808 @end itemize
10810 With @option{-fprofile-arcs}, for each function of your program GCC
10811 creates a program flow graph, then finds a spanning tree for the graph.
10812 Only arcs that are not on the spanning tree have to be instrumented: the
10813 compiler adds code to count the number of times that these arcs are
10814 executed.  When an arc is the only exit or only entrance to a block, the
10815 instrumentation code can be added to the block; otherwise, a new basic
10816 block must be created to hold the instrumentation code.
10818 @need 2000
10819 @item -ftest-coverage
10820 @opindex ftest-coverage
10821 Produce a notes file that the @command{gcov} code-coverage utility
10822 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
10823 show program coverage.  Each source file's note file is called
10824 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
10825 above for a description of @var{auxname} and instructions on how to
10826 generate test coverage data.  Coverage data matches the source files
10827 more closely if you do not optimize.
10829 @item -fprofile-abs-path
10830 @opindex fprofile-abs-path
10831 Automatically convert relative source file names to absolute path names
10832 in the @file{.gcno} files.  This allows @command{gcov} to find the correct
10833 sources in projects where compilations occur with different working
10834 directories.
10836 @item -fprofile-dir=@var{path}
10837 @opindex fprofile-dir
10839 Set the directory to search for the profile data files in to @var{path}.
10840 This option affects only the profile data generated by
10841 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
10842 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
10843 and its related options.  Both absolute and relative paths can be used.
10844 By default, GCC uses the current directory as @var{path}, thus the
10845 profile data file appears in the same directory as the object file.
10847 @item -fprofile-generate
10848 @itemx -fprofile-generate=@var{path}
10849 @opindex fprofile-generate
10851 Enable options usually used for instrumenting application to produce
10852 profile useful for later recompilation with profile feedback based
10853 optimization.  You must use @option{-fprofile-generate} both when
10854 compiling and when linking your program.
10856 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
10858 If @var{path} is specified, GCC looks at the @var{path} to find
10859 the profile feedback data files. See @option{-fprofile-dir}.
10861 To optimize the program based on the collected profile information, use
10862 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
10864 @item -fprofile-update=@var{method}
10865 @opindex fprofile-update
10867 Alter the update method for an application instrumented for profile
10868 feedback based optimization.  The @var{method} argument should be one of
10869 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
10870 The first one is useful for single-threaded applications,
10871 while the second one prevents profile corruption by emitting thread-safe code.
10873 @strong{Warning:} When an application does not properly join all threads
10874 (or creates an detached thread), a profile file can be still corrupted.
10876 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
10877 when supported by a target, or to @samp{single} otherwise.  The GCC driver
10878 automatically selects @samp{prefer-atomic} when @option{-pthread}
10879 is present in the command line.
10881 @item -fsanitize=address
10882 @opindex fsanitize=address
10883 Enable AddressSanitizer, a fast memory error detector.
10884 Memory access instructions are instrumented to detect
10885 out-of-bounds and use-after-free bugs.
10886 The option enables @option{-fsanitize-address-use-after-scope}.
10887 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
10888 more details.  The run-time behavior can be influenced using the
10889 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
10890 the available options are shown at startup of the instrumented program.  See
10891 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
10892 for a list of supported options.
10893 The option cannot be combined with @option{-fsanitize=thread}
10894 and/or @option{-fcheck-pointer-bounds}.
10896 @item -fsanitize=kernel-address
10897 @opindex fsanitize=kernel-address
10898 Enable AddressSanitizer for Linux kernel.
10899 See @uref{https://github.com/google/kasan/wiki} for more details.
10900 The option cannot be combined with @option{-fcheck-pointer-bounds}.
10902 @item -fsanitize=thread
10903 @opindex fsanitize=thread
10904 Enable ThreadSanitizer, a fast data race detector.
10905 Memory access instructions are instrumented to detect
10906 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
10907 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
10908 environment variable; see
10909 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
10910 supported options.
10911 The option cannot be combined with @option{-fsanitize=address},
10912 @option{-fsanitize=leak} and/or @option{-fcheck-pointer-bounds}.
10914 Note that sanitized atomic builtins cannot throw exceptions when
10915 operating on invalid memory addresses with non-call exceptions
10916 (@option{-fnon-call-exceptions}).
10918 @item -fsanitize=leak
10919 @opindex fsanitize=leak
10920 Enable LeakSanitizer, a memory leak detector.
10921 This option only matters for linking of executables and
10922 the executable is linked against a library that overrides @code{malloc}
10923 and other allocator functions.  See
10924 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
10925 details.  The run-time behavior can be influenced using the
10926 @env{LSAN_OPTIONS} environment variable.
10927 The option cannot be combined with @option{-fsanitize=thread}.
10929 @item -fsanitize=undefined
10930 @opindex fsanitize=undefined
10931 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
10932 Various computations are instrumented to detect undefined behavior
10933 at runtime.  Current suboptions are:
10935 @table @gcctabopt
10937 @item -fsanitize=shift
10938 @opindex fsanitize=shift
10939 This option enables checking that the result of a shift operation is
10940 not undefined.  Note that what exactly is considered undefined differs
10941 slightly between C and C++, as well as between ISO C90 and C99, etc.
10942 This option has two suboptions, @option{-fsanitize=shift-base} and
10943 @option{-fsanitize=shift-exponent}.
10945 @item -fsanitize=shift-exponent
10946 @opindex fsanitize=shift-exponent
10947 This option enables checking that the second argument of a shift operation
10948 is not negative and is smaller than the precision of the promoted first
10949 argument.
10951 @item -fsanitize=shift-base
10952 @opindex fsanitize=shift-base
10953 If the second argument of a shift operation is within range, check that the
10954 result of a shift operation is not undefined.  Note that what exactly is
10955 considered undefined differs slightly between C and C++, as well as between
10956 ISO C90 and C99, etc.
10958 @item -fsanitize=integer-divide-by-zero
10959 @opindex fsanitize=integer-divide-by-zero
10960 Detect integer division by zero as well as @code{INT_MIN / -1} division.
10962 @item -fsanitize=unreachable
10963 @opindex fsanitize=unreachable
10964 With this option, the compiler turns the @code{__builtin_unreachable}
10965 call into a diagnostics message call instead.  When reaching the
10966 @code{__builtin_unreachable} call, the behavior is undefined.
10968 @item -fsanitize=vla-bound
10969 @opindex fsanitize=vla-bound
10970 This option instructs the compiler to check that the size of a variable
10971 length array is positive.
10973 @item -fsanitize=null
10974 @opindex fsanitize=null
10975 This option enables pointer checking.  Particularly, the application
10976 built with this option turned on will issue an error message when it
10977 tries to dereference a NULL pointer, or if a reference (possibly an
10978 rvalue reference) is bound to a NULL pointer, or if a method is invoked
10979 on an object pointed by a NULL pointer.
10981 @item -fsanitize=return
10982 @opindex fsanitize=return
10983 This option enables return statement checking.  Programs
10984 built with this option turned on will issue an error message
10985 when the end of a non-void function is reached without actually
10986 returning a value.  This option works in C++ only.
10988 @item -fsanitize=signed-integer-overflow
10989 @opindex fsanitize=signed-integer-overflow
10990 This option enables signed integer overflow checking.  We check that
10991 the result of @code{+}, @code{*}, and both unary and binary @code{-}
10992 does not overflow in the signed arithmetics.  Note, integer promotion
10993 rules must be taken into account.  That is, the following is not an
10994 overflow:
10995 @smallexample
10996 signed char a = SCHAR_MAX;
10997 a++;
10998 @end smallexample
11000 @item -fsanitize=bounds
11001 @opindex fsanitize=bounds
11002 This option enables instrumentation of array bounds.  Various out of bounds
11003 accesses are detected.  Flexible array members, flexible array member-like
11004 arrays, and initializers of variables with static storage are not instrumented.
11005 The option cannot be combined with @option{-fcheck-pointer-bounds}.
11007 @item -fsanitize=bounds-strict
11008 @opindex fsanitize=bounds-strict
11009 This option enables strict instrumentation of array bounds.  Most out of bounds
11010 accesses are detected, including flexible array members and flexible array
11011 member-like arrays.  Initializers of variables with static storage are not
11012 instrumented.  The option cannot be combined
11013 with @option{-fcheck-pointer-bounds}.
11015 @item -fsanitize=alignment
11016 @opindex fsanitize=alignment
11018 This option enables checking of alignment of pointers when they are
11019 dereferenced, or when a reference is bound to insufficiently aligned target,
11020 or when a method or constructor is invoked on insufficiently aligned object.
11022 @item -fsanitize=object-size
11023 @opindex fsanitize=object-size
11024 This option enables instrumentation of memory references using the
11025 @code{__builtin_object_size} function.  Various out of bounds pointer
11026 accesses are detected.
11028 @item -fsanitize=float-divide-by-zero
11029 @opindex fsanitize=float-divide-by-zero
11030 Detect floating-point division by zero.  Unlike other similar options,
11031 @option{-fsanitize=float-divide-by-zero} is not enabled by
11032 @option{-fsanitize=undefined}, since floating-point division by zero can
11033 be a legitimate way of obtaining infinities and NaNs.
11035 @item -fsanitize=float-cast-overflow
11036 @opindex fsanitize=float-cast-overflow
11037 This option enables floating-point type to integer conversion checking.
11038 We check that the result of the conversion does not overflow.
11039 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
11040 not enabled by @option{-fsanitize=undefined}.
11041 This option does not work well with @code{FE_INVALID} exceptions enabled.
11043 @item -fsanitize=nonnull-attribute
11044 @opindex fsanitize=nonnull-attribute
11046 This option enables instrumentation of calls, checking whether null values
11047 are not passed to arguments marked as requiring a non-null value by the
11048 @code{nonnull} function attribute.
11050 @item -fsanitize=returns-nonnull-attribute
11051 @opindex fsanitize=returns-nonnull-attribute
11053 This option enables instrumentation of return statements in functions
11054 marked with @code{returns_nonnull} function attribute, to detect returning
11055 of null values from such functions.
11057 @item -fsanitize=bool
11058 @opindex fsanitize=bool
11060 This option enables instrumentation of loads from bool.  If a value other
11061 than 0/1 is loaded, a run-time error is issued.
11063 @item -fsanitize=enum
11064 @opindex fsanitize=enum
11066 This option enables instrumentation of loads from an enum type.  If
11067 a value outside the range of values for the enum type is loaded,
11068 a run-time error is issued.
11070 @item -fsanitize=vptr
11071 @opindex fsanitize=vptr
11073 This option enables instrumentation of C++ member function calls, member
11074 accesses and some conversions between pointers to base and derived classes,
11075 to verify the referenced object has the correct dynamic type.
11077 @item -fsanitize=pointer-overflow
11078 @opindex fsanitize=pointer-overflow
11080 This option enables instrumentation of pointer arithmetics.  If the pointer
11081 arithmetics overflows, a run-time error is issued.
11083 @end table
11085 While @option{-ftrapv} causes traps for signed overflows to be emitted,
11086 @option{-fsanitize=undefined} gives a diagnostic message.
11087 This currently works only for the C family of languages.
11089 @item -fno-sanitize=all
11090 @opindex fno-sanitize=all
11092 This option disables all previously enabled sanitizers.
11093 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
11094 together.
11096 @item -fasan-shadow-offset=@var{number}
11097 @opindex fasan-shadow-offset
11098 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
11099 It is useful for experimenting with different shadow memory layouts in
11100 Kernel AddressSanitizer.
11102 @item -fsanitize-sections=@var{s1},@var{s2},...
11103 @opindex fsanitize-sections
11104 Sanitize global variables in selected user-defined sections.  @var{si} may
11105 contain wildcards.
11107 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
11108 @opindex fsanitize-recover
11109 @opindex fno-sanitize-recover
11110 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
11111 mentioned in comma-separated list of @var{opts}.  Enabling this option
11112 for a sanitizer component causes it to attempt to continue
11113 running the program as if no error happened.  This means multiple
11114 runtime errors can be reported in a single program run, and the exit
11115 code of the program may indicate success even when errors
11116 have been reported.  The @option{-fno-sanitize-recover=} option
11117 can be used to alter
11118 this behavior: only the first detected error is reported
11119 and program then exits with a non-zero exit code.
11121 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
11122 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
11123 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
11124 @option{-fsanitize=bounds-strict},
11125 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
11126 For these sanitizers error recovery is turned on by default,
11127 except @option{-fsanitize=address}, for which this feature is experimental.
11128 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
11129 accepted, the former enables recovery for all sanitizers that support it,
11130 the latter disables recovery for all sanitizers that support it.
11132 Even if a recovery mode is turned on the compiler side, it needs to be also
11133 enabled on the runtime library side, otherwise the failures are still fatal.
11134 The runtime library defaults to @code{halt_on_error=0} for
11135 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
11136 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
11137 setting the @code{halt_on_error} flag in the corresponding environment variable.
11139 Syntax without an explicit @var{opts} parameter is deprecated.  It is
11140 equivalent to specifying an @var{opts} list of:
11142 @smallexample
11143 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
11144 @end smallexample
11146 @item -fsanitize-address-use-after-scope
11147 @opindex fsanitize-address-use-after-scope
11148 Enable sanitization of local variables to detect use-after-scope bugs.
11149 The option sets @option{-fstack-reuse} to @samp{none}.
11151 @item -fsanitize-undefined-trap-on-error
11152 @opindex fsanitize-undefined-trap-on-error
11153 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
11154 report undefined behavior using @code{__builtin_trap} rather than
11155 a @code{libubsan} library routine.  The advantage of this is that the
11156 @code{libubsan} library is not needed and is not linked in, so this
11157 is usable even in freestanding environments.
11159 @item -fsanitize-coverage=trace-pc
11160 @opindex fsanitize-coverage=trace-pc
11161 Enable coverage-guided fuzzing code instrumentation.
11162 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
11164 @item -fbounds-check
11165 @opindex fbounds-check
11166 For front ends that support it, generate additional code to check that
11167 indices used to access arrays are within the declared range.  This is
11168 currently only supported by the Fortran front end, where this option
11169 defaults to false.
11171 @item -fcheck-pointer-bounds
11172 @opindex fcheck-pointer-bounds
11173 @opindex fno-check-pointer-bounds
11174 @cindex Pointer Bounds Checker options
11175 Enable Pointer Bounds Checker instrumentation.  Each memory reference
11176 is instrumented with checks of the pointer used for memory access against
11177 bounds associated with that pointer.  
11179 Currently there
11180 is only an implementation for Intel MPX available, thus x86 GNU/Linux target
11181 and @option{-mmpx} are required to enable this feature.  
11182 MPX-based instrumentation requires
11183 a runtime library to enable MPX in hardware and handle bounds
11184 violation signals.  By default when @option{-fcheck-pointer-bounds}
11185 and @option{-mmpx} options are used to link a program, the GCC driver
11186 links against the @file{libmpx} and @file{libmpxwrappers} libraries.
11187 Bounds checking on calls to dynamic libraries requires a linker
11188 with @option{-z bndplt} support; if GCC was configured with a linker
11189 without support for this option (including the Gold linker and older
11190 versions of ld), a warning is given if you link with @option{-mmpx}
11191 without also specifying @option{-static}, since the overall effectiveness
11192 of the bounds checking protection is reduced.
11193 See also @option{-static-libmpxwrappers}.
11195 MPX-based instrumentation
11196 may be used for debugging and also may be included in production code
11197 to increase program security.  Depending on usage, you may
11198 have different requirements for the runtime library.  The current version
11199 of the MPX runtime library is more oriented for use as a debugging
11200 tool.  MPX runtime library usage implies @option{-lpthread}.  See
11201 also @option{-static-libmpx}.  The runtime library  behavior can be
11202 influenced using various @env{CHKP_RT_*} environment variables.  See
11203 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
11204 for more details.
11206 Generated instrumentation may be controlled by various
11207 @option{-fchkp-*} options and by the @code{bnd_variable_size}
11208 structure field attribute (@pxref{Type Attributes}) and
11209 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
11210 (@pxref{Function Attributes}).  GCC also provides a number of built-in
11211 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
11212 Bounds Checker builtins}, for more information.
11214 @item -fchkp-check-incomplete-type
11215 @opindex fchkp-check-incomplete-type
11216 @opindex fno-chkp-check-incomplete-type
11217 Generate pointer bounds checks for variables with incomplete type.
11218 Enabled by default.
11220 @item -fchkp-narrow-bounds
11221 @opindex fchkp-narrow-bounds
11222 @opindex fno-chkp-narrow-bounds
11223 Controls bounds used by Pointer Bounds Checker for pointers to object
11224 fields.  If narrowing is enabled then field bounds are used.  Otherwise
11225 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
11226 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
11228 @item -fchkp-first-field-has-own-bounds
11229 @opindex fchkp-first-field-has-own-bounds
11230 @opindex fno-chkp-first-field-has-own-bounds
11231 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
11232 first field in the structure.  By default a pointer to the first field has
11233 the same bounds as a pointer to the whole structure.
11235 @item -fchkp-flexible-struct-trailing-arrays
11236 @opindex fchkp-flexible-struct-trailing-arrays
11237 @opindex fno-chkp-flexible-struct-trailing-arrays
11238 Forces Pointer Bounds Checker to treat all trailing arrays in structures as
11239 possibly flexible.  By default only array fields with zero length or that are
11240 marked with attribute bnd_variable_size are treated as flexible.
11242 @item -fchkp-narrow-to-innermost-array
11243 @opindex fchkp-narrow-to-innermost-array
11244 @opindex fno-chkp-narrow-to-innermost-array
11245 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
11246 case of nested static array access.  By default this option is disabled and
11247 bounds of the outermost array are used.
11249 @item -fchkp-optimize
11250 @opindex fchkp-optimize
11251 @opindex fno-chkp-optimize
11252 Enables Pointer Bounds Checker optimizations.  Enabled by default at
11253 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
11255 @item -fchkp-use-fast-string-functions
11256 @opindex fchkp-use-fast-string-functions
11257 @opindex fno-chkp-use-fast-string-functions
11258 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
11259 by Pointer Bounds Checker.  Disabled by default.
11261 @item -fchkp-use-nochk-string-functions
11262 @opindex fchkp-use-nochk-string-functions
11263 @opindex fno-chkp-use-nochk-string-functions
11264 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
11265 by Pointer Bounds Checker.  Disabled by default.
11267 @item -fchkp-use-static-bounds
11268 @opindex fchkp-use-static-bounds
11269 @opindex fno-chkp-use-static-bounds
11270 Allow Pointer Bounds Checker to generate static bounds holding
11271 bounds of static variables.  Enabled by default.
11273 @item -fchkp-use-static-const-bounds
11274 @opindex fchkp-use-static-const-bounds
11275 @opindex fno-chkp-use-static-const-bounds
11276 Use statically-initialized bounds for constant bounds instead of
11277 generating them each time they are required.  By default enabled when
11278 @option{-fchkp-use-static-bounds} is enabled.
11280 @item -fchkp-treat-zero-dynamic-size-as-infinite
11281 @opindex fchkp-treat-zero-dynamic-size-as-infinite
11282 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
11283 With this option, objects with incomplete type whose
11284 dynamically-obtained size is zero are treated as having infinite size
11285 instead by Pointer Bounds
11286 Checker.  This option may be helpful if a program is linked with a library
11287 missing size information for some symbols.  Disabled by default.
11289 @item -fchkp-check-read
11290 @opindex fchkp-check-read
11291 @opindex fno-chkp-check-read
11292 Instructs Pointer Bounds Checker to generate checks for all read
11293 accesses to memory.  Enabled by default.
11295 @item -fchkp-check-write
11296 @opindex fchkp-check-write
11297 @opindex fno-chkp-check-write
11298 Instructs Pointer Bounds Checker to generate checks for all write
11299 accesses to memory.  Enabled by default.
11301 @item -fchkp-store-bounds
11302 @opindex fchkp-store-bounds
11303 @opindex fno-chkp-store-bounds
11304 Instructs Pointer Bounds Checker to generate bounds stores for
11305 pointer writes.  Enabled by default.
11307 @item -fchkp-instrument-calls
11308 @opindex fchkp-instrument-calls
11309 @opindex fno-chkp-instrument-calls
11310 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
11311 Enabled by default.
11313 @item -fchkp-instrument-marked-only
11314 @opindex fchkp-instrument-marked-only
11315 @opindex fno-chkp-instrument-marked-only
11316 Instructs Pointer Bounds Checker to instrument only functions
11317 marked with the @code{bnd_instrument} attribute
11318 (@pxref{Function Attributes}).  Disabled by default.
11320 @item -fchkp-use-wrappers
11321 @opindex fchkp-use-wrappers
11322 @opindex fno-chkp-use-wrappers
11323 Allows Pointer Bounds Checker to replace calls to built-in functions
11324 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
11325 is used to link a program, the GCC driver automatically links
11326 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
11327 Enabled by default.
11329 @item -fstack-protector
11330 @opindex fstack-protector
11331 Emit extra code to check for buffer overflows, such as stack smashing
11332 attacks.  This is done by adding a guard variable to functions with
11333 vulnerable objects.  This includes functions that call @code{alloca}, and
11334 functions with buffers larger than 8 bytes.  The guards are initialized
11335 when a function is entered and then checked when the function exits.
11336 If a guard check fails, an error message is printed and the program exits.
11338 @item -fstack-protector-all
11339 @opindex fstack-protector-all
11340 Like @option{-fstack-protector} except that all functions are protected.
11342 @item -fstack-protector-strong
11343 @opindex fstack-protector-strong
11344 Like @option{-fstack-protector} but includes additional functions to
11345 be protected --- those that have local array definitions, or have
11346 references to local frame addresses.
11348 @item -fstack-protector-explicit
11349 @opindex fstack-protector-explicit
11350 Like @option{-fstack-protector} but only protects those functions which
11351 have the @code{stack_protect} attribute.
11353 @item -fstack-check
11354 @opindex fstack-check
11355 Generate code to verify that you do not go beyond the boundary of the
11356 stack.  You should specify this flag if you are running in an
11357 environment with multiple threads, but you only rarely need to specify it in
11358 a single-threaded environment since stack overflow is automatically
11359 detected on nearly all systems if there is only one stack.
11361 Note that this switch does not actually cause checking to be done; the
11362 operating system or the language runtime must do that.  The switch causes
11363 generation of code to ensure that they see the stack being extended.
11365 You can additionally specify a string parameter: @samp{no} means no
11366 checking, @samp{generic} means force the use of old-style checking,
11367 @samp{specific} means use the best checking method and is equivalent
11368 to bare @option{-fstack-check}.
11370 Old-style checking is a generic mechanism that requires no specific
11371 target support in the compiler but comes with the following drawbacks:
11373 @enumerate
11374 @item
11375 Modified allocation strategy for large objects: they are always
11376 allocated dynamically if their size exceeds a fixed threshold.
11378 @item
11379 Fixed limit on the size of the static frame of functions: when it is
11380 topped by a particular function, stack checking is not reliable and
11381 a warning is issued by the compiler.
11383 @item
11384 Inefficiency: because of both the modified allocation strategy and the
11385 generic implementation, code performance is hampered.
11386 @end enumerate
11388 Note that old-style stack checking is also the fallback method for
11389 @samp{specific} if no target support has been added in the compiler.
11391 @item -fstack-limit-register=@var{reg}
11392 @itemx -fstack-limit-symbol=@var{sym}
11393 @itemx -fno-stack-limit
11394 @opindex fstack-limit-register
11395 @opindex fstack-limit-symbol
11396 @opindex fno-stack-limit
11397 Generate code to ensure that the stack does not grow beyond a certain value,
11398 either the value of a register or the address of a symbol.  If a larger
11399 stack is required, a signal is raised at run time.  For most targets,
11400 the signal is raised before the stack overruns the boundary, so
11401 it is possible to catch the signal without taking special precautions.
11403 For instance, if the stack starts at absolute address @samp{0x80000000}
11404 and grows downwards, you can use the flags
11405 @option{-fstack-limit-symbol=__stack_limit} and
11406 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
11407 of 128KB@.  Note that this may only work with the GNU linker.
11409 You can locally override stack limit checking by using the
11410 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
11412 @item -fsplit-stack
11413 @opindex fsplit-stack
11414 Generate code to automatically split the stack before it overflows.
11415 The resulting program has a discontiguous stack which can only
11416 overflow if the program is unable to allocate any more memory.  This
11417 is most useful when running threaded programs, as it is no longer
11418 necessary to calculate a good stack size to use for each thread.  This
11419 is currently only implemented for the x86 targets running
11420 GNU/Linux.
11422 When code compiled with @option{-fsplit-stack} calls code compiled
11423 without @option{-fsplit-stack}, there may not be much stack space
11424 available for the latter code to run.  If compiling all code,
11425 including library code, with @option{-fsplit-stack} is not an option,
11426 then the linker can fix up these calls so that the code compiled
11427 without @option{-fsplit-stack} always has a large stack.  Support for
11428 this is implemented in the gold linker in GNU binutils release 2.21
11429 and later.
11431 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
11432 @opindex fvtable-verify
11433 This option is only available when compiling C++ code.
11434 It turns on (or off, if using @option{-fvtable-verify=none}) the security
11435 feature that verifies at run time, for every virtual call, that
11436 the vtable pointer through which the call is made is valid for the type of
11437 the object, and has not been corrupted or overwritten.  If an invalid vtable
11438 pointer is detected at run time, an error is reported and execution of the
11439 program is immediately halted.
11441 This option causes run-time data structures to be built at program startup,
11442 which are used for verifying the vtable pointers.  
11443 The options @samp{std} and @samp{preinit}
11444 control the timing of when these data structures are built.  In both cases the
11445 data structures are built before execution reaches @code{main}.  Using
11446 @option{-fvtable-verify=std} causes the data structures to be built after
11447 shared libraries have been loaded and initialized.
11448 @option{-fvtable-verify=preinit} causes them to be built before shared
11449 libraries have been loaded and initialized.
11451 If this option appears multiple times in the command line with different
11452 values specified, @samp{none} takes highest priority over both @samp{std} and
11453 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
11455 @item -fvtv-debug
11456 @opindex fvtv-debug
11457 When used in conjunction with @option{-fvtable-verify=std} or 
11458 @option{-fvtable-verify=preinit}, causes debug versions of the 
11459 runtime functions for the vtable verification feature to be called.  
11460 This flag also causes the compiler to log information about which 
11461 vtable pointers it finds for each class.
11462 This information is written to a file named @file{vtv_set_ptr_data.log} 
11463 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
11464 if that is defined or the current working directory otherwise.
11466 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
11467 file, be sure to delete any existing one.
11469 @item -fvtv-counts
11470 @opindex fvtv-counts
11471 This is a debugging flag.  When used in conjunction with
11472 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
11473 causes the compiler to keep track of the total number of virtual calls
11474 it encounters and the number of verifications it inserts.  It also
11475 counts the number of calls to certain run-time library functions
11476 that it inserts and logs this information for each compilation unit.
11477 The compiler writes this information to a file named
11478 @file{vtv_count_data.log} in the directory named by the environment
11479 variable @env{VTV_LOGS_DIR} if that is defined or the current working
11480 directory otherwise.  It also counts the size of the vtable pointer sets
11481 for each class, and writes this information to @file{vtv_class_set_sizes.log}
11482 in the same directory.
11484 Note:  This feature @emph{appends} data to the log files.  To get fresh log
11485 files, be sure to delete any existing ones.
11487 @item -finstrument-functions
11488 @opindex finstrument-functions
11489 Generate instrumentation calls for entry and exit to functions.  Just
11490 after function entry and just before function exit, the following
11491 profiling functions are called with the address of the current
11492 function and its call site.  (On some platforms,
11493 @code{__builtin_return_address} does not work beyond the current
11494 function, so the call site information may not be available to the
11495 profiling functions otherwise.)
11497 @smallexample
11498 void __cyg_profile_func_enter (void *this_fn,
11499                                void *call_site);
11500 void __cyg_profile_func_exit  (void *this_fn,
11501                                void *call_site);
11502 @end smallexample
11504 The first argument is the address of the start of the current function,
11505 which may be looked up exactly in the symbol table.
11507 This instrumentation is also done for functions expanded inline in other
11508 functions.  The profiling calls indicate where, conceptually, the
11509 inline function is entered and exited.  This means that addressable
11510 versions of such functions must be available.  If all your uses of a
11511 function are expanded inline, this may mean an additional expansion of
11512 code size.  If you use @code{extern inline} in your C code, an
11513 addressable version of such functions must be provided.  (This is
11514 normally the case anyway, but if you get lucky and the optimizer always
11515 expands the functions inline, you might have gotten away without
11516 providing static copies.)
11518 A function may be given the attribute @code{no_instrument_function}, in
11519 which case this instrumentation is not done.  This can be used, for
11520 example, for the profiling functions listed above, high-priority
11521 interrupt routines, and any functions from which the profiling functions
11522 cannot safely be called (perhaps signal handlers, if the profiling
11523 routines generate output or allocate memory).
11525 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
11526 @opindex finstrument-functions-exclude-file-list
11528 Set the list of functions that are excluded from instrumentation (see
11529 the description of @option{-finstrument-functions}).  If the file that
11530 contains a function definition matches with one of @var{file}, then
11531 that function is not instrumented.  The match is done on substrings:
11532 if the @var{file} parameter is a substring of the file name, it is
11533 considered to be a match.
11535 For example:
11537 @smallexample
11538 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
11539 @end smallexample
11541 @noindent
11542 excludes any inline function defined in files whose pathnames
11543 contain @file{/bits/stl} or @file{include/sys}.
11545 If, for some reason, you want to include letter @samp{,} in one of
11546 @var{sym}, write @samp{\,}. For example,
11547 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
11548 (note the single quote surrounding the option).
11550 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
11551 @opindex finstrument-functions-exclude-function-list
11553 This is similar to @option{-finstrument-functions-exclude-file-list},
11554 but this option sets the list of function names to be excluded from
11555 instrumentation.  The function name to be matched is its user-visible
11556 name, such as @code{vector<int> blah(const vector<int> &)}, not the
11557 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
11558 match is done on substrings: if the @var{sym} parameter is a substring
11559 of the function name, it is considered to be a match.  For C99 and C++
11560 extended identifiers, the function name must be given in UTF-8, not
11561 using universal character names.
11563 @item -fpatchable-function-entry=@var{N}[,@var{M}]
11564 @opindex fpatchable-function-entry
11565 Generate @var{N} NOPs right at the beginning
11566 of each function, with the function entry point before the @var{M}th NOP.
11567 If @var{M} is omitted, it defaults to @code{0} so the
11568 function entry points to the address just at the first NOP.
11569 The NOP instructions reserve extra space which can be used to patch in
11570 any desired instrumentation at run time, provided that the code segment
11571 is writable.  The amount of space is controllable indirectly via
11572 the number of NOPs; the NOP instruction used corresponds to the instruction
11573 emitted by the internal GCC back-end interface @code{gen_nop}.  This behavior
11574 is target-specific and may also depend on the architecture variant and/or
11575 other compilation options.
11577 For run-time identification, the starting addresses of these areas,
11578 which correspond to their respective function entries minus @var{M},
11579 are additionally collected in the @code{__patchable_function_entries}
11580 section of the resulting binary.
11582 Note that the value of @code{__attribute__ ((patchable_function_entry
11583 (N,M)))} takes precedence over command-line option
11584 @option{-fpatchable-function-entry=N,M}.  This can be used to increase
11585 the area size or to remove it completely on a single function.
11586 If @code{N=0}, no pad location is recorded.
11588 The NOP instructions are inserted at---and maybe before, depending on
11589 @var{M}---the function entry address, even before the prologue.
11591 @end table
11594 @node Preprocessor Options
11595 @section Options Controlling the Preprocessor
11596 @cindex preprocessor options
11597 @cindex options, preprocessor
11599 These options control the C preprocessor, which is run on each C source
11600 file before actual compilation.
11602 If you use the @option{-E} option, nothing is done except preprocessing.
11603 Some of these options make sense only together with @option{-E} because
11604 they cause the preprocessor output to be unsuitable for actual
11605 compilation.
11607 In addition to the options listed here, there are a number of options 
11608 to control search paths for include files documented in 
11609 @ref{Directory Options}.  
11610 Options to control preprocessor diagnostics are listed in 
11611 @ref{Warning Options}.
11613 @table @gcctabopt
11614 @include cppopts.texi
11616 @item -Wp,@var{option}
11617 @opindex Wp
11618 You can use @option{-Wp,@var{option}} to bypass the compiler driver
11619 and pass @var{option} directly through to the preprocessor.  If
11620 @var{option} contains commas, it is split into multiple options at the
11621 commas.  However, many options are modified, translated or interpreted
11622 by the compiler driver before being passed to the preprocessor, and
11623 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
11624 interface is undocumented and subject to change, so whenever possible
11625 you should avoid using @option{-Wp} and let the driver handle the
11626 options instead.
11628 @item -Xpreprocessor @var{option}
11629 @opindex Xpreprocessor
11630 Pass @var{option} as an option to the preprocessor.  You can use this to
11631 supply system-specific preprocessor options that GCC does not 
11632 recognize.
11634 If you want to pass an option that takes an argument, you must use
11635 @option{-Xpreprocessor} twice, once for the option and once for the argument.
11637 @item -no-integrated-cpp
11638 @opindex no-integrated-cpp
11639 Perform preprocessing as a separate pass before compilation.
11640 By default, GCC performs preprocessing as an integrated part of
11641 input tokenization and parsing.
11642 If this option is provided, the appropriate language front end
11643 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11644 and Objective-C, respectively) is instead invoked twice,
11645 once for preprocessing only and once for actual compilation
11646 of the preprocessed input.
11647 This option may be useful in conjunction with the @option{-B} or
11648 @option{-wrapper} options to specify an alternate preprocessor or
11649 perform additional processing of the program source between
11650 normal preprocessing and compilation.
11652 @end table
11654 @node Assembler Options
11655 @section Passing Options to the Assembler
11657 @c prevent bad page break with this line
11658 You can pass options to the assembler.
11660 @table @gcctabopt
11661 @item -Wa,@var{option}
11662 @opindex Wa
11663 Pass @var{option} as an option to the assembler.  If @var{option}
11664 contains commas, it is split into multiple options at the commas.
11666 @item -Xassembler @var{option}
11667 @opindex Xassembler
11668 Pass @var{option} as an option to the assembler.  You can use this to
11669 supply system-specific assembler options that GCC does not
11670 recognize.
11672 If you want to pass an option that takes an argument, you must use
11673 @option{-Xassembler} twice, once for the option and once for the argument.
11675 @end table
11677 @node Link Options
11678 @section Options for Linking
11679 @cindex link options
11680 @cindex options, linking
11682 These options come into play when the compiler links object files into
11683 an executable output file.  They are meaningless if the compiler is
11684 not doing a link step.
11686 @table @gcctabopt
11687 @cindex file names
11688 @item @var{object-file-name}
11689 A file name that does not end in a special recognized suffix is
11690 considered to name an object file or library.  (Object files are
11691 distinguished from libraries by the linker according to the file
11692 contents.)  If linking is done, these object files are used as input
11693 to the linker.
11695 @item -c
11696 @itemx -S
11697 @itemx -E
11698 @opindex c
11699 @opindex S
11700 @opindex E
11701 If any of these options is used, then the linker is not run, and
11702 object file names should not be used as arguments.  @xref{Overall
11703 Options}.
11705 @item -fuse-ld=bfd
11706 @opindex fuse-ld=bfd
11707 Use the @command{bfd} linker instead of the default linker.
11709 @item -fuse-ld=gold
11710 @opindex fuse-ld=gold
11711 Use the @command{gold} linker instead of the default linker.
11713 @cindex Libraries
11714 @item -l@var{library}
11715 @itemx -l @var{library}
11716 @opindex l
11717 Search the library named @var{library} when linking.  (The second
11718 alternative with the library as a separate argument is only for
11719 POSIX compliance and is not recommended.)
11721 It makes a difference where in the command you write this option; the
11722 linker searches and processes libraries and object files in the order they
11723 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11724 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11725 to functions in @samp{z}, those functions may not be loaded.
11727 The linker searches a standard list of directories for the library,
11728 which is actually a file named @file{lib@var{library}.a}.  The linker
11729 then uses this file as if it had been specified precisely by name.
11731 The directories searched include several standard system directories
11732 plus any that you specify with @option{-L}.
11734 Normally the files found this way are library files---archive files
11735 whose members are object files.  The linker handles an archive file by
11736 scanning through it for members which define symbols that have so far
11737 been referenced but not defined.  But if the file that is found is an
11738 ordinary object file, it is linked in the usual fashion.  The only
11739 difference between using an @option{-l} option and specifying a file name
11740 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11741 and searches several directories.
11743 @item -lobjc
11744 @opindex lobjc
11745 You need this special case of the @option{-l} option in order to
11746 link an Objective-C or Objective-C++ program.
11748 @item -nostartfiles
11749 @opindex nostartfiles
11750 Do not use the standard system startup files when linking.
11751 The standard system libraries are used normally, unless @option{-nostdlib}
11752 or @option{-nodefaultlibs} is used.
11754 @item -nodefaultlibs
11755 @opindex nodefaultlibs
11756 Do not use the standard system libraries when linking.
11757 Only the libraries you specify are passed to the linker, and options
11758 specifying linkage of the system libraries, such as @option{-static-libgcc}
11759 or @option{-shared-libgcc}, are ignored.  
11760 The standard startup files are used normally, unless @option{-nostartfiles}
11761 is used.  
11763 The compiler may generate calls to @code{memcmp},
11764 @code{memset}, @code{memcpy} and @code{memmove}.
11765 These entries are usually resolved by entries in
11766 libc.  These entry points should be supplied through some other
11767 mechanism when this option is specified.
11769 @item -nostdlib
11770 @opindex nostdlib
11771 Do not use the standard system startup files or libraries when linking.
11772 No startup files and only the libraries you specify are passed to
11773 the linker, and options specifying linkage of the system libraries, such as
11774 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11776 The compiler may generate calls to @code{memcmp}, @code{memset},
11777 @code{memcpy} and @code{memmove}.
11778 These entries are usually resolved by entries in
11779 libc.  These entry points should be supplied through some other
11780 mechanism when this option is specified.
11782 @cindex @option{-lgcc}, use with @option{-nostdlib}
11783 @cindex @option{-nostdlib} and unresolved references
11784 @cindex unresolved references and @option{-nostdlib}
11785 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11786 @cindex @option{-nodefaultlibs} and unresolved references
11787 @cindex unresolved references and @option{-nodefaultlibs}
11788 One of the standard libraries bypassed by @option{-nostdlib} and
11789 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11790 which GCC uses to overcome shortcomings of particular machines, or special
11791 needs for some languages.
11792 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11793 Collection (GCC) Internals},
11794 for more discussion of @file{libgcc.a}.)
11795 In most cases, you need @file{libgcc.a} even when you want to avoid
11796 other standard libraries.  In other words, when you specify @option{-nostdlib}
11797 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11798 This ensures that you have no unresolved references to internal GCC
11799 library subroutines.
11800 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11801 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11802 GNU Compiler Collection (GCC) Internals}.)
11804 @item -pie
11805 @opindex pie
11806 Produce a position independent executable on targets that support it.
11807 For predictable results, you must also specify the same set of options
11808 used for compilation (@option{-fpie}, @option{-fPIE},
11809 or model suboptions) when you specify this linker option.
11811 @item -no-pie
11812 @opindex no-pie
11813 Don't produce a position independent executable.
11815 @item -pthread
11816 @opindex pthread
11817 Link with the POSIX threads library.  This option is supported on 
11818 GNU/Linux targets, most other Unix derivatives, and also on 
11819 x86 Cygwin and MinGW targets.  On some targets this option also sets 
11820 flags for the preprocessor, so it should be used consistently for both
11821 compilation and linking.
11823 @item -rdynamic
11824 @opindex rdynamic
11825 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11826 that support it. This instructs the linker to add all symbols, not
11827 only used ones, to the dynamic symbol table. This option is needed
11828 for some uses of @code{dlopen} or to allow obtaining backtraces
11829 from within a program.
11831 @item -s
11832 @opindex s
11833 Remove all symbol table and relocation information from the executable.
11835 @item -static
11836 @opindex static
11837 On systems that support dynamic linking, this prevents linking with the shared
11838 libraries.  On other systems, this option has no effect.
11840 @item -shared
11841 @opindex shared
11842 Produce a shared object which can then be linked with other objects to
11843 form an executable.  Not all systems support this option.  For predictable
11844 results, you must also specify the same set of options used for compilation
11845 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11846 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11847 needs to build supplementary stub code for constructors to work.  On
11848 multi-libbed systems, @samp{gcc -shared} must select the correct support
11849 libraries to link against.  Failing to supply the correct flags may lead
11850 to subtle defects.  Supplying them in cases where they are not necessary
11851 is innocuous.}
11853 @item -shared-libgcc
11854 @itemx -static-libgcc
11855 @opindex shared-libgcc
11856 @opindex static-libgcc
11857 On systems that provide @file{libgcc} as a shared library, these options
11858 force the use of either the shared or static version, respectively.
11859 If no shared version of @file{libgcc} was built when the compiler was
11860 configured, these options have no effect.
11862 There are several situations in which an application should use the
11863 shared @file{libgcc} instead of the static version.  The most common
11864 of these is when the application wishes to throw and catch exceptions
11865 across different shared libraries.  In that case, each of the libraries
11866 as well as the application itself should use the shared @file{libgcc}.
11868 Therefore, the G++ and driver automatically adds @option{-shared-libgcc}
11869  whenever you build a shared library or a main executable, because C++
11870  programs typically use exceptions, so this is the right thing to do.
11872 If, instead, you use the GCC driver to create shared libraries, you may
11873 find that they are not always linked with the shared @file{libgcc}.
11874 If GCC finds, at its configuration time, that you have a non-GNU linker
11875 or a GNU linker that does not support option @option{--eh-frame-hdr},
11876 it links the shared version of @file{libgcc} into shared libraries
11877 by default.  Otherwise, it takes advantage of the linker and optimizes
11878 away the linking with the shared version of @file{libgcc}, linking with
11879 the static version of libgcc by default.  This allows exceptions to
11880 propagate through such shared libraries, without incurring relocation
11881 costs at library load time.
11883 However, if a library or main executable is supposed to throw or catch
11884 exceptions, you must link it using the G++ driver, as appropriate
11885 for the languages used in the program, or using the option
11886 @option{-shared-libgcc}, such that it is linked with the shared
11887 @file{libgcc}.
11889 @item -static-libasan
11890 @opindex static-libasan
11891 When the @option{-fsanitize=address} option is used to link a program,
11892 the GCC driver automatically links against @option{libasan}.  If
11893 @file{libasan} is available as a shared library, and the @option{-static}
11894 option is not used, then this links against the shared version of
11895 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11896 driver to link @file{libasan} statically, without necessarily linking
11897 other libraries statically.
11899 @item -static-libtsan
11900 @opindex static-libtsan
11901 When the @option{-fsanitize=thread} option is used to link a program,
11902 the GCC driver automatically links against @option{libtsan}.  If
11903 @file{libtsan} is available as a shared library, and the @option{-static}
11904 option is not used, then this links against the shared version of
11905 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11906 driver to link @file{libtsan} statically, without necessarily linking
11907 other libraries statically.
11909 @item -static-liblsan
11910 @opindex static-liblsan
11911 When the @option{-fsanitize=leak} option is used to link a program,
11912 the GCC driver automatically links against @option{liblsan}.  If
11913 @file{liblsan} is available as a shared library, and the @option{-static}
11914 option is not used, then this links against the shared version of
11915 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11916 driver to link @file{liblsan} statically, without necessarily linking
11917 other libraries statically.
11919 @item -static-libubsan
11920 @opindex static-libubsan
11921 When the @option{-fsanitize=undefined} option is used to link a program,
11922 the GCC driver automatically links against @option{libubsan}.  If
11923 @file{libubsan} is available as a shared library, and the @option{-static}
11924 option is not used, then this links against the shared version of
11925 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11926 driver to link @file{libubsan} statically, without necessarily linking
11927 other libraries statically.
11929 @item -static-libmpx
11930 @opindex static-libmpx
11931 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11932 used to link a program, the GCC driver automatically links against
11933 @file{libmpx}.  If @file{libmpx} is available as a shared library,
11934 and the @option{-static} option is not used, then this links against
11935 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11936 option directs the GCC driver to link @file{libmpx} statically,
11937 without necessarily linking other libraries statically.
11939 @item -static-libmpxwrappers
11940 @opindex static-libmpxwrappers
11941 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
11942 to link a program without also using @option{-fno-chkp-use-wrappers}, the
11943 GCC driver automatically links against @file{libmpxwrappers}.  If
11944 @file{libmpxwrappers} is available as a shared library, and the
11945 @option{-static} option is not used, then this links against the shared
11946 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11947 option directs the GCC driver to link @file{libmpxwrappers} statically,
11948 without necessarily linking other libraries statically.
11950 @item -static-libstdc++
11951 @opindex static-libstdc++
11952 When the @command{g++} program is used to link a C++ program, it
11953 normally automatically links against @option{libstdc++}.  If
11954 @file{libstdc++} is available as a shared library, and the
11955 @option{-static} option is not used, then this links against the
11956 shared version of @file{libstdc++}.  That is normally fine.  However, it
11957 is sometimes useful to freeze the version of @file{libstdc++} used by
11958 the program without going all the way to a fully static link.  The
11959 @option{-static-libstdc++} option directs the @command{g++} driver to
11960 link @file{libstdc++} statically, without necessarily linking other
11961 libraries statically.
11963 @item -symbolic
11964 @opindex symbolic
11965 Bind references to global symbols when building a shared object.  Warn
11966 about any unresolved references (unless overridden by the link editor
11967 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11968 this option.
11970 @item -T @var{script}
11971 @opindex T
11972 @cindex linker script
11973 Use @var{script} as the linker script.  This option is supported by most
11974 systems using the GNU linker.  On some targets, such as bare-board
11975 targets without an operating system, the @option{-T} option may be required
11976 when linking to avoid references to undefined symbols.
11978 @item -Xlinker @var{option}
11979 @opindex Xlinker
11980 Pass @var{option} as an option to the linker.  You can use this to
11981 supply system-specific linker options that GCC does not recognize.
11983 If you want to pass an option that takes a separate argument, you must use
11984 @option{-Xlinker} twice, once for the option and once for the argument.
11985 For example, to pass @option{-assert definitions}, you must write
11986 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
11987 @option{-Xlinker "-assert definitions"}, because this passes the entire
11988 string as a single argument, which is not what the linker expects.
11990 When using the GNU linker, it is usually more convenient to pass
11991 arguments to linker options using the @option{@var{option}=@var{value}}
11992 syntax than as separate arguments.  For example, you can specify
11993 @option{-Xlinker -Map=output.map} rather than
11994 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
11995 this syntax for command-line options.
11997 @item -Wl,@var{option}
11998 @opindex Wl
11999 Pass @var{option} as an option to the linker.  If @var{option} contains
12000 commas, it is split into multiple options at the commas.  You can use this
12001 syntax to pass an argument to the option.
12002 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
12003 linker.  When using the GNU linker, you can also get the same effect with
12004 @option{-Wl,-Map=output.map}.
12006 @item -u @var{symbol}
12007 @opindex u
12008 Pretend the symbol @var{symbol} is undefined, to force linking of
12009 library modules to define it.  You can use @option{-u} multiple times with
12010 different symbols to force loading of additional library modules.
12012 @item -z @var{keyword}
12013 @opindex z
12014 @option{-z} is passed directly on to the linker along with the keyword
12015 @var{keyword}. See the section in the documentation of your linker for
12016 permitted values and their meanings.
12017 @end table
12019 @node Directory Options
12020 @section Options for Directory Search
12021 @cindex directory options
12022 @cindex options, directory search
12023 @cindex search path
12025 These options specify directories to search for header files, for
12026 libraries and for parts of the compiler:
12028 @table @gcctabopt
12029 @include cppdiropts.texi
12031 @item -iplugindir=@var{dir}
12032 @opindex iplugindir=
12033 Set the directory to search for plugins that are passed
12034 by @option{-fplugin=@var{name}} instead of
12035 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
12036 to be used by the user, but only passed by the driver.
12038 @item -L@var{dir}
12039 @opindex L
12040 Add directory @var{dir} to the list of directories to be searched
12041 for @option{-l}.
12043 @item -B@var{prefix}
12044 @opindex B
12045 This option specifies where to find the executables, libraries,
12046 include files, and data files of the compiler itself.
12048 The compiler driver program runs one or more of the subprograms
12049 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
12050 @var{prefix} as a prefix for each program it tries to run, both with and
12051 without @samp{@var{machine}/@var{version}/} for the corresponding target
12052 machine and compiler version.
12054 For each subprogram to be run, the compiler driver first tries the
12055 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
12056 is not specified, the driver tries two standard prefixes, 
12057 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
12058 those results in a file name that is found, the unmodified program
12059 name is searched for using the directories specified in your
12060 @env{PATH} environment variable.
12062 The compiler checks to see if the path provided by @option{-B}
12063 refers to a directory, and if necessary it adds a directory
12064 separator character at the end of the path.
12066 @option{-B} prefixes that effectively specify directory names also apply
12067 to libraries in the linker, because the compiler translates these
12068 options into @option{-L} options for the linker.  They also apply to
12069 include files in the preprocessor, because the compiler translates these
12070 options into @option{-isystem} options for the preprocessor.  In this case,
12071 the compiler appends @samp{include} to the prefix.
12073 The runtime support file @file{libgcc.a} can also be searched for using
12074 the @option{-B} prefix, if needed.  If it is not found there, the two
12075 standard prefixes above are tried, and that is all.  The file is left
12076 out of the link if it is not found by those means.
12078 Another way to specify a prefix much like the @option{-B} prefix is to use
12079 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
12080 Variables}.
12082 As a special kludge, if the path provided by @option{-B} is
12083 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
12084 9, then it is replaced by @file{[dir/]include}.  This is to help
12085 with boot-strapping the compiler.
12087 @item -no-canonical-prefixes
12088 @opindex no-canonical-prefixes
12089 Do not expand any symbolic links, resolve references to @samp{/../}
12090 or @samp{/./}, or make the path absolute when generating a relative
12091 prefix.
12093 @item --sysroot=@var{dir}
12094 @opindex sysroot
12095 Use @var{dir} as the logical root directory for headers and libraries.
12096 For example, if the compiler normally searches for headers in
12097 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
12098 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
12100 If you use both this option and the @option{-isysroot} option, then
12101 the @option{--sysroot} option applies to libraries, but the
12102 @option{-isysroot} option applies to header files.
12104 The GNU linker (beginning with version 2.16) has the necessary support
12105 for this option.  If your linker does not support this option, the
12106 header file aspect of @option{--sysroot} still works, but the
12107 library aspect does not.
12109 @item --no-sysroot-suffix
12110 @opindex no-sysroot-suffix
12111 For some targets, a suffix is added to the root directory specified
12112 with @option{--sysroot}, depending on the other options used, so that
12113 headers may for example be found in
12114 @file{@var{dir}/@var{suffix}/usr/include} instead of
12115 @file{@var{dir}/usr/include}.  This option disables the addition of
12116 such a suffix.
12118 @end table
12120 @node Code Gen Options
12121 @section Options for Code Generation Conventions
12122 @cindex code generation conventions
12123 @cindex options, code generation
12124 @cindex run-time options
12126 These machine-independent options control the interface conventions
12127 used in code generation.
12129 Most of them have both positive and negative forms; the negative form
12130 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
12131 one of the forms is listed---the one that is not the default.  You
12132 can figure out the other form by either removing @samp{no-} or adding
12135 @table @gcctabopt
12136 @item -fstack-reuse=@var{reuse-level}
12137 @opindex fstack_reuse
12138 This option controls stack space reuse for user declared local/auto variables
12139 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
12140 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
12141 local variables and temporaries, @samp{named_vars} enables the reuse only for
12142 user defined local variables with names, and @samp{none} disables stack reuse
12143 completely. The default value is @samp{all}. The option is needed when the
12144 program extends the lifetime of a scoped local variable or a compiler generated
12145 temporary beyond the end point defined by the language.  When a lifetime of
12146 a variable ends, and if the variable lives in memory, the optimizing compiler
12147 has the freedom to reuse its stack space with other temporaries or scoped
12148 local variables whose live range does not overlap with it. Legacy code extending
12149 local lifetime is likely to break with the stack reuse optimization.
12151 For example,
12153 @smallexample
12154    int *p;
12155    @{
12156      int local1;
12158      p = &local1;
12159      local1 = 10;
12160      ....
12161    @}
12162    @{
12163       int local2;
12164       local2 = 20;
12165       ...
12166    @}
12168    if (*p == 10)  // out of scope use of local1
12169      @{
12171      @}
12172 @end smallexample
12174 Another example:
12175 @smallexample
12177    struct A
12178    @{
12179        A(int k) : i(k), j(k) @{ @}
12180        int i;
12181        int j;
12182    @};
12184    A *ap;
12186    void foo(const A& ar)
12187    @{
12188       ap = &ar;
12189    @}
12191    void bar()
12192    @{
12193       foo(A(10)); // temp object's lifetime ends when foo returns
12195       @{
12196         A a(20);
12197         ....
12198       @}
12199       ap->i+= 10;  // ap references out of scope temp whose space
12200                    // is reused with a. What is the value of ap->i?
12201    @}
12203 @end smallexample
12205 The lifetime of a compiler generated temporary is well defined by the C++
12206 standard. When a lifetime of a temporary ends, and if the temporary lives
12207 in memory, the optimizing compiler has the freedom to reuse its stack
12208 space with other temporaries or scoped local variables whose live range
12209 does not overlap with it. However some of the legacy code relies on
12210 the behavior of older compilers in which temporaries' stack space is
12211 not reused, the aggressive stack reuse can lead to runtime errors. This
12212 option is used to control the temporary stack reuse optimization.
12214 @item -ftrapv
12215 @opindex ftrapv
12216 This option generates traps for signed overflow on addition, subtraction,
12217 multiplication operations.
12218 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12219 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12220 @option{-fwrapv} being effective.  Note that only active options override, so
12221 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12222 results in @option{-ftrapv} being effective.
12224 @item -fwrapv
12225 @opindex fwrapv
12226 This option instructs the compiler to assume that signed arithmetic
12227 overflow of addition, subtraction and multiplication wraps around
12228 using twos-complement representation.  This flag enables some optimizations
12229 and disables others.
12230 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12231 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12232 @option{-fwrapv} being effective.  Note that only active options override, so
12233 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12234 results in @option{-ftrapv} being effective.
12236 @item -fexceptions
12237 @opindex fexceptions
12238 Enable exception handling.  Generates extra code needed to propagate
12239 exceptions.  For some targets, this implies GCC generates frame
12240 unwind information for all functions, which can produce significant data
12241 size overhead, although it does not affect execution.  If you do not
12242 specify this option, GCC enables it by default for languages like
12243 C++ that normally require exception handling, and disables it for
12244 languages like C that do not normally require it.  However, you may need
12245 to enable this option when compiling C code that needs to interoperate
12246 properly with exception handlers written in C++.  You may also wish to
12247 disable this option if you are compiling older C++ programs that don't
12248 use exception handling.
12250 @item -fnon-call-exceptions
12251 @opindex fnon-call-exceptions
12252 Generate code that allows trapping instructions to throw exceptions.
12253 Note that this requires platform-specific runtime support that does
12254 not exist everywhere.  Moreover, it only allows @emph{trapping}
12255 instructions to throw exceptions, i.e.@: memory references or floating-point
12256 instructions.  It does not allow exceptions to be thrown from
12257 arbitrary signal handlers such as @code{SIGALRM}.
12259 @item -fdelete-dead-exceptions
12260 @opindex fdelete-dead-exceptions
12261 Consider that instructions that may throw exceptions but don't otherwise
12262 contribute to the execution of the program can be optimized away.
12263 This option is enabled by default for the Ada front end, as permitted by
12264 the Ada language specification.
12265 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
12267 @item -funwind-tables
12268 @opindex funwind-tables
12269 Similar to @option{-fexceptions}, except that it just generates any needed
12270 static data, but does not affect the generated code in any other way.
12271 You normally do not need to enable this option; instead, a language processor
12272 that needs this handling enables it on your behalf.
12274 @item -fasynchronous-unwind-tables
12275 @opindex fasynchronous-unwind-tables
12276 Generate unwind table in DWARF format, if supported by target machine.  The
12277 table is exact at each instruction boundary, so it can be used for stack
12278 unwinding from asynchronous events (such as debugger or garbage collector).
12280 @item -fno-gnu-unique
12281 @opindex fno-gnu-unique
12282 On systems with recent GNU assembler and C library, the C++ compiler
12283 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
12284 of template static data members and static local variables in inline
12285 functions are unique even in the presence of @code{RTLD_LOCAL}; this
12286 is necessary to avoid problems with a library used by two different
12287 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
12288 therefore disagreeing with the other one about the binding of the
12289 symbol.  But this causes @code{dlclose} to be ignored for affected
12290 DSOs; if your program relies on reinitialization of a DSO via
12291 @code{dlclose} and @code{dlopen}, you can use
12292 @option{-fno-gnu-unique}.
12294 @item -fpcc-struct-return
12295 @opindex fpcc-struct-return
12296 Return ``short'' @code{struct} and @code{union} values in memory like
12297 longer ones, rather than in registers.  This convention is less
12298 efficient, but it has the advantage of allowing intercallability between
12299 GCC-compiled files and files compiled with other compilers, particularly
12300 the Portable C Compiler (pcc).
12302 The precise convention for returning structures in memory depends
12303 on the target configuration macros.
12305 Short structures and unions are those whose size and alignment match
12306 that of some integer type.
12308 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
12309 switch is not binary compatible with code compiled with the
12310 @option{-freg-struct-return} switch.
12311 Use it to conform to a non-default application binary interface.
12313 @item -freg-struct-return
12314 @opindex freg-struct-return
12315 Return @code{struct} and @code{union} values in registers when possible.
12316 This is more efficient for small structures than
12317 @option{-fpcc-struct-return}.
12319 If you specify neither @option{-fpcc-struct-return} nor
12320 @option{-freg-struct-return}, GCC defaults to whichever convention is
12321 standard for the target.  If there is no standard convention, GCC
12322 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
12323 the principal compiler.  In those cases, we can choose the standard, and
12324 we chose the more efficient register return alternative.
12326 @strong{Warning:} code compiled with the @option{-freg-struct-return}
12327 switch is not binary compatible with code compiled with the
12328 @option{-fpcc-struct-return} switch.
12329 Use it to conform to a non-default application binary interface.
12331 @item -fshort-enums
12332 @opindex fshort-enums
12333 Allocate to an @code{enum} type only as many bytes as it needs for the
12334 declared range of possible values.  Specifically, the @code{enum} type
12335 is equivalent to the smallest integer type that has enough room.
12337 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
12338 code that is not binary compatible with code generated without that switch.
12339 Use it to conform to a non-default application binary interface.
12341 @item -fshort-wchar
12342 @opindex fshort-wchar
12343 Override the underlying type for @code{wchar_t} to be @code{short
12344 unsigned int} instead of the default for the target.  This option is
12345 useful for building programs to run under WINE@.
12347 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
12348 code that is not binary compatible with code generated without that switch.
12349 Use it to conform to a non-default application binary interface.
12351 @item -fno-common
12352 @opindex fno-common
12353 @cindex tentative definitions
12354 In C code, this option controls the placement of global variables 
12355 defined without an initializer, known as @dfn{tentative definitions} 
12356 in the C standard.  Tentative definitions are distinct from declarations 
12357 of a variable with the @code{extern} keyword, which do not allocate storage.
12359 Unix C compilers have traditionally allocated storage for
12360 uninitialized global variables in a common block.  This allows the
12361 linker to resolve all tentative definitions of the same variable
12362 in different compilation units to the same object, or to a non-tentative
12363 definition.  
12364 This is the behavior specified by @option{-fcommon}, and is the default for 
12365 GCC on most targets.  
12366 On the other hand, this behavior is not required by ISO
12367 C, and on some targets may carry a speed or code size penalty on
12368 variable references.
12370 The @option{-fno-common} option specifies that the compiler should instead
12371 place uninitialized global variables in the data section of the object file.
12372 This inhibits the merging of tentative definitions by the linker so
12373 you get a multiple-definition error if the same 
12374 variable is defined in more than one compilation unit.
12375 Compiling with @option{-fno-common} is useful on targets for which
12376 it provides better performance, or if you wish to verify that the
12377 program will work on other systems that always treat uninitialized
12378 variable definitions this way.
12380 @item -fno-ident
12381 @opindex fno-ident
12382 Ignore the @code{#ident} directive.
12384 @item -finhibit-size-directive
12385 @opindex finhibit-size-directive
12386 Don't output a @code{.size} assembler directive, or anything else that
12387 would cause trouble if the function is split in the middle, and the
12388 two halves are placed at locations far apart in memory.  This option is
12389 used when compiling @file{crtstuff.c}; you should not need to use it
12390 for anything else.
12392 @item -fverbose-asm
12393 @opindex fverbose-asm
12394 Put extra commentary information in the generated assembly code to
12395 make it more readable.  This option is generally only of use to those
12396 who actually need to read the generated assembly code (perhaps while
12397 debugging the compiler itself).
12399 @option{-fno-verbose-asm}, the default, causes the
12400 extra information to be omitted and is useful when comparing two assembler
12401 files.
12403 The added comments include:
12405 @itemize @bullet
12407 @item
12408 information on the compiler version and command-line options,
12410 @item
12411 the source code lines associated with the assembly instructions,
12412 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
12414 @item
12415 hints on which high-level expressions correspond to
12416 the various assembly instruction operands.
12418 @end itemize
12420 For example, given this C source file:
12422 @smallexample
12423 int test (int n)
12425   int i;
12426   int total = 0;
12428   for (i = 0; i < n; i++)
12429     total += i * i;
12431   return total;
12433 @end smallexample
12435 compiling to (x86_64) assembly via @option{-S} and emitting the result
12436 direct to stdout via @option{-o} @option{-}
12438 @smallexample
12439 gcc -S test.c -fverbose-asm -Os -o -
12440 @end smallexample
12442 gives output similar to this:
12444 @smallexample
12445         .file   "test.c"
12446 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
12447   [...snip...]
12448 # options passed:
12449   [...snip...]
12451         .text
12452         .globl  test
12453         .type   test, @@function
12454 test:
12455 .LFB0:
12456         .cfi_startproc
12457 # test.c:4:   int total = 0;
12458         xorl    %eax, %eax      # <retval>
12459 # test.c:6:   for (i = 0; i < n; i++)
12460         xorl    %edx, %edx      # i
12461 .L2:
12462 # test.c:6:   for (i = 0; i < n; i++)
12463         cmpl    %edi, %edx      # n, i
12464         jge     .L5     #,
12465 # test.c:7:     total += i * i;
12466         movl    %edx, %ecx      # i, tmp92
12467         imull   %edx, %ecx      # i, tmp92
12468 # test.c:6:   for (i = 0; i < n; i++)
12469         incl    %edx    # i
12470 # test.c:7:     total += i * i;
12471         addl    %ecx, %eax      # tmp92, <retval>
12472         jmp     .L2     #
12473 .L5:
12474 # test.c:10: @}
12475         ret
12476         .cfi_endproc
12477 .LFE0:
12478         .size   test, .-test
12479         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
12480         .section        .note.GNU-stack,"",@@progbits
12481 @end smallexample
12483 The comments are intended for humans rather than machines and hence the
12484 precise format of the comments is subject to change.
12486 @item -frecord-gcc-switches
12487 @opindex frecord-gcc-switches
12488 This switch causes the command line used to invoke the
12489 compiler to be recorded into the object file that is being created.
12490 This switch is only implemented on some targets and the exact format
12491 of the recording is target and binary file format dependent, but it
12492 usually takes the form of a section containing ASCII text.  This
12493 switch is related to the @option{-fverbose-asm} switch, but that
12494 switch only records information in the assembler output file as
12495 comments, so it never reaches the object file.
12496 See also @option{-grecord-gcc-switches} for another
12497 way of storing compiler options into the object file.
12499 @item -fpic
12500 @opindex fpic
12501 @cindex global offset table
12502 @cindex PIC
12503 Generate position-independent code (PIC) suitable for use in a shared
12504 library, if supported for the target machine.  Such code accesses all
12505 constant addresses through a global offset table (GOT)@.  The dynamic
12506 loader resolves the GOT entries when the program starts (the dynamic
12507 loader is not part of GCC; it is part of the operating system).  If
12508 the GOT size for the linked executable exceeds a machine-specific
12509 maximum size, you get an error message from the linker indicating that
12510 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
12511 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
12512 on the m68k and RS/6000.  The x86 has no such limit.)
12514 Position-independent code requires special support, and therefore works
12515 only on certain machines.  For the x86, GCC supports PIC for System V
12516 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
12517 position-independent.
12519 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12520 are defined to 1.
12522 @item -fPIC
12523 @opindex fPIC
12524 If supported for the target machine, emit position-independent code,
12525 suitable for dynamic linking and avoiding any limit on the size of the
12526 global offset table.  This option makes a difference on AArch64, m68k,
12527 PowerPC and SPARC@.
12529 Position-independent code requires special support, and therefore works
12530 only on certain machines.
12532 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12533 are defined to 2.
12535 @item -fpie
12536 @itemx -fPIE
12537 @opindex fpie
12538 @opindex fPIE
12539 These options are similar to @option{-fpic} and @option{-fPIC}, but
12540 generated position independent code can be only linked into executables.
12541 Usually these options are used when @option{-pie} GCC option is
12542 used during linking.
12544 @option{-fpie} and @option{-fPIE} both define the macros
12545 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
12546 for @option{-fpie} and 2 for @option{-fPIE}.
12548 @item -fno-plt
12549 @opindex fno-plt
12550 Do not use the PLT for external function calls in position-independent code.
12551 Instead, load the callee address at call sites from the GOT and branch to it.
12552 This leads to more efficient code by eliminating PLT stubs and exposing
12553 GOT loads to optimizations.  On architectures such as 32-bit x86 where
12554 PLT stubs expect the GOT pointer in a specific register, this gives more
12555 register allocation freedom to the compiler.
12556 Lazy binding requires use of the PLT; 
12557 with @option{-fno-plt} all external symbols are resolved at load time.
12559 Alternatively, the function attribute @code{noplt} can be used to avoid calls
12560 through the PLT for specific external functions.
12562 In position-dependent code, a few targets also convert calls to
12563 functions that are marked to not use the PLT to use the GOT instead.
12565 @item -fno-jump-tables
12566 @opindex fno-jump-tables
12567 Do not use jump tables for switch statements even where it would be
12568 more efficient than other code generation strategies.  This option is
12569 of use in conjunction with @option{-fpic} or @option{-fPIC} for
12570 building code that forms part of a dynamic linker and cannot
12571 reference the address of a jump table.  On some targets, jump tables
12572 do not require a GOT and this option is not needed.
12574 @item -ffixed-@var{reg}
12575 @opindex ffixed
12576 Treat the register named @var{reg} as a fixed register; generated code
12577 should never refer to it (except perhaps as a stack pointer, frame
12578 pointer or in some other fixed role).
12580 @var{reg} must be the name of a register.  The register names accepted
12581 are machine-specific and are defined in the @code{REGISTER_NAMES}
12582 macro in the machine description macro file.
12584 This flag does not have a negative form, because it specifies a
12585 three-way choice.
12587 @item -fcall-used-@var{reg}
12588 @opindex fcall-used
12589 Treat the register named @var{reg} as an allocable register that is
12590 clobbered by function calls.  It may be allocated for temporaries or
12591 variables that do not live across a call.  Functions compiled this way
12592 do not save and restore the register @var{reg}.
12594 It is an error to use this flag with the frame pointer or stack pointer.
12595 Use of this flag for other registers that have fixed pervasive roles in
12596 the machine's execution model produces disastrous results.
12598 This flag does not have a negative form, because it specifies a
12599 three-way choice.
12601 @item -fcall-saved-@var{reg}
12602 @opindex fcall-saved
12603 Treat the register named @var{reg} as an allocable register saved by
12604 functions.  It may be allocated even for temporaries or variables that
12605 live across a call.  Functions compiled this way save and restore
12606 the register @var{reg} if they use it.
12608 It is an error to use this flag with the frame pointer or stack pointer.
12609 Use of this flag for other registers that have fixed pervasive roles in
12610 the machine's execution model produces disastrous results.
12612 A different sort of disaster results from the use of this flag for
12613 a register in which function values may be returned.
12615 This flag does not have a negative form, because it specifies a
12616 three-way choice.
12618 @item -fpack-struct[=@var{n}]
12619 @opindex fpack-struct
12620 Without a value specified, pack all structure members together without
12621 holes.  When a value is specified (which must be a small power of two), pack
12622 structure members according to this value, representing the maximum
12623 alignment (that is, objects with default alignment requirements larger than
12624 this are output potentially unaligned at the next fitting location.
12626 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
12627 code that is not binary compatible with code generated without that switch.
12628 Additionally, it makes the code suboptimal.
12629 Use it to conform to a non-default application binary interface.
12631 @item -fleading-underscore
12632 @opindex fleading-underscore
12633 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
12634 change the way C symbols are represented in the object file.  One use
12635 is to help link with legacy assembly code.
12637 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
12638 generate code that is not binary compatible with code generated without that
12639 switch.  Use it to conform to a non-default application binary interface.
12640 Not all targets provide complete support for this switch.
12642 @item -ftls-model=@var{model}
12643 @opindex ftls-model
12644 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
12645 The @var{model} argument should be one of @samp{global-dynamic},
12646 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
12647 Note that the choice is subject to optimization: the compiler may use
12648 a more efficient model for symbols not visible outside of the translation
12649 unit, or if @option{-fpic} is not given on the command line.
12651 The default without @option{-fpic} is @samp{initial-exec}; with
12652 @option{-fpic} the default is @samp{global-dynamic}.
12654 @item -ftrampolines
12655 @opindex ftrampolines
12656 For targets that normally need trampolines for nested functions, always
12657 generate them instead of using descriptors.  Otherwise, for targets that
12658 do not need them, like for example HP-PA or IA-64, do nothing.
12660 A trampoline is a small piece of code that is created at run time on the
12661 stack when the address of a nested function is taken, and is used to call
12662 the nested function indirectly.  Therefore, it requires the stack to be
12663 made executable in order for the program to work properly.
12665 @option{-fno-trampolines} is enabled by default on a language by language
12666 basis to let the compiler avoid generating them, if it computes that this
12667 is safe, and replace them with descriptors.  Descriptors are made up of data
12668 only, but the generated code must be prepared to deal with them.  As of this
12669 writing, @option{-fno-trampolines} is enabled by default only for Ada.
12671 Moreover, code compiled with @option{-ftrampolines} and code compiled with
12672 @option{-fno-trampolines} are not binary compatible if nested functions are
12673 present.  This option must therefore be used on a program-wide basis and be
12674 manipulated with extreme care.
12676 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
12677 @opindex fvisibility
12678 Set the default ELF image symbol visibility to the specified option---all
12679 symbols are marked with this unless overridden within the code.
12680 Using this feature can very substantially improve linking and
12681 load times of shared object libraries, produce more optimized
12682 code, provide near-perfect API export and prevent symbol clashes.
12683 It is @strong{strongly} recommended that you use this in any shared objects
12684 you distribute.
12686 Despite the nomenclature, @samp{default} always means public; i.e.,
12687 available to be linked against from outside the shared object.
12688 @samp{protected} and @samp{internal} are pretty useless in real-world
12689 usage so the only other commonly used option is @samp{hidden}.
12690 The default if @option{-fvisibility} isn't specified is
12691 @samp{default}, i.e., make every symbol public.
12693 A good explanation of the benefits offered by ensuring ELF
12694 symbols have the correct visibility is given by ``How To Write
12695 Shared Libraries'' by Ulrich Drepper (which can be found at
12696 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
12697 solution made possible by this option to marking things hidden when
12698 the default is public is to make the default hidden and mark things
12699 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
12700 and @code{__attribute__ ((visibility("default")))} instead of
12701 @code{__declspec(dllexport)} you get almost identical semantics with
12702 identical syntax.  This is a great boon to those working with
12703 cross-platform projects.
12705 For those adding visibility support to existing code, you may find
12706 @code{#pragma GCC visibility} of use.  This works by you enclosing
12707 the declarations you wish to set visibility for with (for example)
12708 @code{#pragma GCC visibility push(hidden)} and
12709 @code{#pragma GCC visibility pop}.
12710 Bear in mind that symbol visibility should be viewed @strong{as
12711 part of the API interface contract} and thus all new code should
12712 always specify visibility when it is not the default; i.e., declarations
12713 only for use within the local DSO should @strong{always} be marked explicitly
12714 as hidden as so to avoid PLT indirection overheads---making this
12715 abundantly clear also aids readability and self-documentation of the code.
12716 Note that due to ISO C++ specification requirements, @code{operator new} and
12717 @code{operator delete} must always be of default visibility.
12719 Be aware that headers from outside your project, in particular system
12720 headers and headers from any other library you use, may not be
12721 expecting to be compiled with visibility other than the default.  You
12722 may need to explicitly say @code{#pragma GCC visibility push(default)}
12723 before including any such headers.
12725 @code{extern} declarations are not affected by @option{-fvisibility}, so
12726 a lot of code can be recompiled with @option{-fvisibility=hidden} with
12727 no modifications.  However, this means that calls to @code{extern}
12728 functions with no explicit visibility use the PLT, so it is more
12729 effective to use @code{__attribute ((visibility))} and/or
12730 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
12731 declarations should be treated as hidden.
12733 Note that @option{-fvisibility} does affect C++ vague linkage
12734 entities. This means that, for instance, an exception class that is
12735 be thrown between DSOs must be explicitly marked with default
12736 visibility so that the @samp{type_info} nodes are unified between
12737 the DSOs.
12739 An overview of these techniques, their benefits and how to use them
12740 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
12742 @item -fstrict-volatile-bitfields
12743 @opindex fstrict-volatile-bitfields
12744 This option should be used if accesses to volatile bit-fields (or other
12745 structure fields, although the compiler usually honors those types
12746 anyway) should use a single access of the width of the
12747 field's type, aligned to a natural alignment if possible.  For
12748 example, targets with memory-mapped peripheral registers might require
12749 all such accesses to be 16 bits wide; with this flag you can
12750 declare all peripheral bit-fields as @code{unsigned short} (assuming short
12751 is 16 bits on these targets) to force GCC to use 16-bit accesses
12752 instead of, perhaps, a more efficient 32-bit access.
12754 If this option is disabled, the compiler uses the most efficient
12755 instruction.  In the previous example, that might be a 32-bit load
12756 instruction, even though that accesses bytes that do not contain
12757 any portion of the bit-field, or memory-mapped registers unrelated to
12758 the one being updated.
12760 In some cases, such as when the @code{packed} attribute is applied to a 
12761 structure field, it may not be possible to access the field with a single
12762 read or write that is correctly aligned for the target machine.  In this
12763 case GCC falls back to generating multiple accesses rather than code that 
12764 will fault or truncate the result at run time.
12766 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
12767 not allowed to touch non bit-field members.  It is therefore recommended
12768 to define all bits of the field's type as bit-field members.
12770 The default value of this option is determined by the application binary
12771 interface for the target processor.
12773 @item -fsync-libcalls
12774 @opindex fsync-libcalls
12775 This option controls whether any out-of-line instance of the @code{__sync}
12776 family of functions may be used to implement the C++11 @code{__atomic}
12777 family of functions.
12779 The default value of this option is enabled, thus the only useful form
12780 of the option is @option{-fno-sync-libcalls}.  This option is used in
12781 the implementation of the @file{libatomic} runtime library.
12783 @end table
12785 @node Developer Options
12786 @section GCC Developer Options
12787 @cindex developer options
12788 @cindex debugging GCC
12789 @cindex debug dump options
12790 @cindex dump options
12791 @cindex compilation statistics
12793 This section describes command-line options that are primarily of
12794 interest to GCC developers, including options to support compiler
12795 testing and investigation of compiler bugs and compile-time
12796 performance problems.  This includes options that produce debug dumps
12797 at various points in the compilation; that print statistics such as
12798 memory use and execution time; and that print information about GCC's
12799 configuration, such as where it searches for libraries.  You should
12800 rarely need to use any of these options for ordinary compilation and
12801 linking tasks.
12803 @table @gcctabopt
12805 @item -d@var{letters}
12806 @itemx -fdump-rtl-@var{pass}
12807 @itemx -fdump-rtl-@var{pass}=@var{filename}
12808 @opindex d
12809 @opindex fdump-rtl-@var{pass}
12810 Says to make debugging dumps during compilation at times specified by
12811 @var{letters}.  This is used for debugging the RTL-based passes of the
12812 compiler.  The file names for most of the dumps are made by appending
12813 a pass number and a word to the @var{dumpname}, and the files are
12814 created in the directory of the output file.  In case of
12815 @option{=@var{filename}} option, the dump is output on the given file
12816 instead of the pass numbered dump files.  Note that the pass number is
12817 assigned as passes are registered into the pass manager.  Most passes
12818 are registered in the order that they will execute and for these passes
12819 the number corresponds to the pass execution order.  However, passes
12820 registered by plugins, passes specific to compilation targets, or
12821 passes that are otherwise registered after all the other passes are
12822 numbered higher than a pass named "final", even if they are executed
12823 earlier.  @var{dumpname} is generated from the name of the output
12824 file if explicitly specified and not an executable, otherwise it is
12825 the basename of the source file.  
12827 Some @option{-d@var{letters}} switches have different meaning when
12828 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
12829 for information about preprocessor-specific dump options.
12831 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
12832 @option{-d} option @var{letters}.  Here are the possible
12833 letters for use in @var{pass} and @var{letters}, and their meanings:
12835 @table @gcctabopt
12837 @item -fdump-rtl-alignments
12838 @opindex fdump-rtl-alignments
12839 Dump after branch alignments have been computed.
12841 @item -fdump-rtl-asmcons
12842 @opindex fdump-rtl-asmcons
12843 Dump after fixing rtl statements that have unsatisfied in/out constraints.
12845 @item -fdump-rtl-auto_inc_dec
12846 @opindex fdump-rtl-auto_inc_dec
12847 Dump after auto-inc-dec discovery.  This pass is only run on
12848 architectures that have auto inc or auto dec instructions.
12850 @item -fdump-rtl-barriers
12851 @opindex fdump-rtl-barriers
12852 Dump after cleaning up the barrier instructions.
12854 @item -fdump-rtl-bbpart
12855 @opindex fdump-rtl-bbpart
12856 Dump after partitioning hot and cold basic blocks.
12858 @item -fdump-rtl-bbro
12859 @opindex fdump-rtl-bbro
12860 Dump after block reordering.
12862 @item -fdump-rtl-btl1
12863 @itemx -fdump-rtl-btl2
12864 @opindex fdump-rtl-btl2
12865 @opindex fdump-rtl-btl2
12866 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
12867 after the two branch
12868 target load optimization passes.
12870 @item -fdump-rtl-bypass
12871 @opindex fdump-rtl-bypass
12872 Dump after jump bypassing and control flow optimizations.
12874 @item -fdump-rtl-combine
12875 @opindex fdump-rtl-combine
12876 Dump after the RTL instruction combination pass.
12878 @item -fdump-rtl-compgotos
12879 @opindex fdump-rtl-compgotos
12880 Dump after duplicating the computed gotos.
12882 @item -fdump-rtl-ce1
12883 @itemx -fdump-rtl-ce2
12884 @itemx -fdump-rtl-ce3
12885 @opindex fdump-rtl-ce1
12886 @opindex fdump-rtl-ce2
12887 @opindex fdump-rtl-ce3
12888 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
12889 @option{-fdump-rtl-ce3} enable dumping after the three
12890 if conversion passes.
12892 @item -fdump-rtl-cprop_hardreg
12893 @opindex fdump-rtl-cprop_hardreg
12894 Dump after hard register copy propagation.
12896 @item -fdump-rtl-csa
12897 @opindex fdump-rtl-csa
12898 Dump after combining stack adjustments.
12900 @item -fdump-rtl-cse1
12901 @itemx -fdump-rtl-cse2
12902 @opindex fdump-rtl-cse1
12903 @opindex fdump-rtl-cse2
12904 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
12905 the two common subexpression elimination passes.
12907 @item -fdump-rtl-dce
12908 @opindex fdump-rtl-dce
12909 Dump after the standalone dead code elimination passes.
12911 @item -fdump-rtl-dbr
12912 @opindex fdump-rtl-dbr
12913 Dump after delayed branch scheduling.
12915 @item -fdump-rtl-dce1
12916 @itemx -fdump-rtl-dce2
12917 @opindex fdump-rtl-dce1
12918 @opindex fdump-rtl-dce2
12919 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
12920 the two dead store elimination passes.
12922 @item -fdump-rtl-eh
12923 @opindex fdump-rtl-eh
12924 Dump after finalization of EH handling code.
12926 @item -fdump-rtl-eh_ranges
12927 @opindex fdump-rtl-eh_ranges
12928 Dump after conversion of EH handling range regions.
12930 @item -fdump-rtl-expand
12931 @opindex fdump-rtl-expand
12932 Dump after RTL generation.
12934 @item -fdump-rtl-fwprop1
12935 @itemx -fdump-rtl-fwprop2
12936 @opindex fdump-rtl-fwprop1
12937 @opindex fdump-rtl-fwprop2
12938 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
12939 dumping after the two forward propagation passes.
12941 @item -fdump-rtl-gcse1
12942 @itemx -fdump-rtl-gcse2
12943 @opindex fdump-rtl-gcse1
12944 @opindex fdump-rtl-gcse2
12945 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
12946 after global common subexpression elimination.
12948 @item -fdump-rtl-init-regs
12949 @opindex fdump-rtl-init-regs
12950 Dump after the initialization of the registers.
12952 @item -fdump-rtl-initvals
12953 @opindex fdump-rtl-initvals
12954 Dump after the computation of the initial value sets.
12956 @item -fdump-rtl-into_cfglayout
12957 @opindex fdump-rtl-into_cfglayout
12958 Dump after converting to cfglayout mode.
12960 @item -fdump-rtl-ira
12961 @opindex fdump-rtl-ira
12962 Dump after iterated register allocation.
12964 @item -fdump-rtl-jump
12965 @opindex fdump-rtl-jump
12966 Dump after the second jump optimization.
12968 @item -fdump-rtl-loop2
12969 @opindex fdump-rtl-loop2
12970 @option{-fdump-rtl-loop2} enables dumping after the rtl
12971 loop optimization passes.
12973 @item -fdump-rtl-mach
12974 @opindex fdump-rtl-mach
12975 Dump after performing the machine dependent reorganization pass, if that
12976 pass exists.
12978 @item -fdump-rtl-mode_sw
12979 @opindex fdump-rtl-mode_sw
12980 Dump after removing redundant mode switches.
12982 @item -fdump-rtl-rnreg
12983 @opindex fdump-rtl-rnreg
12984 Dump after register renumbering.
12986 @item -fdump-rtl-outof_cfglayout
12987 @opindex fdump-rtl-outof_cfglayout
12988 Dump after converting from cfglayout mode.
12990 @item -fdump-rtl-peephole2
12991 @opindex fdump-rtl-peephole2
12992 Dump after the peephole pass.
12994 @item -fdump-rtl-postreload
12995 @opindex fdump-rtl-postreload
12996 Dump after post-reload optimizations.
12998 @item -fdump-rtl-pro_and_epilogue
12999 @opindex fdump-rtl-pro_and_epilogue
13000 Dump after generating the function prologues and epilogues.
13002 @item -fdump-rtl-sched1
13003 @itemx -fdump-rtl-sched2
13004 @opindex fdump-rtl-sched1
13005 @opindex fdump-rtl-sched2
13006 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
13007 after the basic block scheduling passes.
13009 @item -fdump-rtl-ree
13010 @opindex fdump-rtl-ree
13011 Dump after sign/zero extension elimination.
13013 @item -fdump-rtl-seqabstr
13014 @opindex fdump-rtl-seqabstr
13015 Dump after common sequence discovery.
13017 @item -fdump-rtl-shorten
13018 @opindex fdump-rtl-shorten
13019 Dump after shortening branches.
13021 @item -fdump-rtl-sibling
13022 @opindex fdump-rtl-sibling
13023 Dump after sibling call optimizations.
13025 @item -fdump-rtl-split1
13026 @itemx -fdump-rtl-split2
13027 @itemx -fdump-rtl-split3
13028 @itemx -fdump-rtl-split4
13029 @itemx -fdump-rtl-split5
13030 @opindex fdump-rtl-split1
13031 @opindex fdump-rtl-split2
13032 @opindex fdump-rtl-split3
13033 @opindex fdump-rtl-split4
13034 @opindex fdump-rtl-split5
13035 These options enable dumping after five rounds of
13036 instruction splitting.
13038 @item -fdump-rtl-sms
13039 @opindex fdump-rtl-sms
13040 Dump after modulo scheduling.  This pass is only run on some
13041 architectures.
13043 @item -fdump-rtl-stack
13044 @opindex fdump-rtl-stack
13045 Dump after conversion from GCC's ``flat register file'' registers to the
13046 x87's stack-like registers.  This pass is only run on x86 variants.
13048 @item -fdump-rtl-subreg1
13049 @itemx -fdump-rtl-subreg2
13050 @opindex fdump-rtl-subreg1
13051 @opindex fdump-rtl-subreg2
13052 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
13053 the two subreg expansion passes.
13055 @item -fdump-rtl-unshare
13056 @opindex fdump-rtl-unshare
13057 Dump after all rtl has been unshared.
13059 @item -fdump-rtl-vartrack
13060 @opindex fdump-rtl-vartrack
13061 Dump after variable tracking.
13063 @item -fdump-rtl-vregs
13064 @opindex fdump-rtl-vregs
13065 Dump after converting virtual registers to hard registers.
13067 @item -fdump-rtl-web
13068 @opindex fdump-rtl-web
13069 Dump after live range splitting.
13071 @item -fdump-rtl-regclass
13072 @itemx -fdump-rtl-subregs_of_mode_init
13073 @itemx -fdump-rtl-subregs_of_mode_finish
13074 @itemx -fdump-rtl-dfinit
13075 @itemx -fdump-rtl-dfinish
13076 @opindex fdump-rtl-regclass
13077 @opindex fdump-rtl-subregs_of_mode_init
13078 @opindex fdump-rtl-subregs_of_mode_finish
13079 @opindex fdump-rtl-dfinit
13080 @opindex fdump-rtl-dfinish
13081 These dumps are defined but always produce empty files.
13083 @item -da
13084 @itemx -fdump-rtl-all
13085 @opindex da
13086 @opindex fdump-rtl-all
13087 Produce all the dumps listed above.
13089 @item -dA
13090 @opindex dA
13091 Annotate the assembler output with miscellaneous debugging information.
13093 @item -dD
13094 @opindex dD
13095 Dump all macro definitions, at the end of preprocessing, in addition to
13096 normal output.
13098 @item -dH
13099 @opindex dH
13100 Produce a core dump whenever an error occurs.
13102 @item -dp
13103 @opindex dp
13104 Annotate the assembler output with a comment indicating which
13105 pattern and alternative is used.  The length of each instruction is
13106 also printed.
13108 @item -dP
13109 @opindex dP
13110 Dump the RTL in the assembler output as a comment before each instruction.
13111 Also turns on @option{-dp} annotation.
13113 @item -dx
13114 @opindex dx
13115 Just generate RTL for a function instead of compiling it.  Usually used
13116 with @option{-fdump-rtl-expand}.
13117 @end table
13119 @item -fdump-noaddr
13120 @opindex fdump-noaddr
13121 When doing debugging dumps, suppress address output.  This makes it more
13122 feasible to use diff on debugging dumps for compiler invocations with
13123 different compiler binaries and/or different
13124 text / bss / data / heap / stack / dso start locations.
13126 @item -freport-bug
13127 @opindex freport-bug
13128 Collect and dump debug information into a temporary file if an
13129 internal compiler error (ICE) occurs.
13131 @item -fdump-unnumbered
13132 @opindex fdump-unnumbered
13133 When doing debugging dumps, suppress instruction numbers and address output.
13134 This makes it more feasible to use diff on debugging dumps for compiler
13135 invocations with different options, in particular with and without
13136 @option{-g}.
13138 @item -fdump-unnumbered-links
13139 @opindex fdump-unnumbered-links
13140 When doing debugging dumps (see @option{-d} option above), suppress
13141 instruction numbers for the links to the previous and next instructions
13142 in a sequence.
13144 @item -fdump-ipa-@var{switch}
13145 @opindex fdump-ipa
13146 Control the dumping at various stages of inter-procedural analysis
13147 language tree to a file.  The file name is generated by appending a
13148 switch specific suffix to the source file name, and the file is created
13149 in the same directory as the output file.  The following dumps are
13150 possible:
13152 @table @samp
13153 @item all
13154 Enables all inter-procedural analysis dumps.
13156 @item cgraph
13157 Dumps information about call-graph optimization, unused function removal,
13158 and inlining decisions.
13160 @item inline
13161 Dump after function inlining.
13163 @end table
13165 @item -fdump-lang-all
13166 @itemx -fdump-lang-@var{switch}
13167 @itemx -fdump-lang-@var{switch}-@var{options}
13168 @itemx -fdump-lang-@var{switch}-@var{options}=@var{filename}
13169 @opindex fdump-lang-all
13170 @opindex fdump-lang
13171 Control the dumping of language-specific information.  The @var{options}
13172 and @var{filename} portions behave as described in the
13173 @option{-fdump-tree} option.  The following @var{switch} values are
13174 accepted:
13176 @table @samp
13177 @item all
13179 Enable all language-specific dumps.
13181 @item class
13182 Dump class hierarchy information.  Virtual table information is emitted
13183 unless '@option{slim}' is specified.  This option is applicable to C++ only.
13185 @item raw
13186 Dump the raw internal tree data.  This option is applicable to C++ only.
13188 @end table
13190 @item -fdump-passes
13191 @opindex fdump-passes
13192 Print on @file{stderr} the list of optimization passes that are turned
13193 on and off by the current command-line options.
13195 @item -fdump-statistics-@var{option}
13196 @opindex fdump-statistics
13197 Enable and control dumping of pass statistics in a separate file.  The
13198 file name is generated by appending a suffix ending in
13199 @samp{.statistics} to the source file name, and the file is created in
13200 the same directory as the output file.  If the @samp{-@var{option}}
13201 form is used, @samp{-stats} causes counters to be summed over the
13202 whole compilation unit while @samp{-details} dumps every event as
13203 the passes generate them.  The default with no option is to sum
13204 counters for each function compiled.
13206 @item -fdump-tree-all
13207 @itemx -fdump-tree-@var{switch}
13208 @itemx -fdump-tree-@var{switch}-@var{options}
13209 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
13210 @opindex fdump-tree-all
13211 @opindex fdump-tree
13212 Control the dumping at various stages of processing the intermediate
13213 language tree to a file.  The file name is generated by appending a
13214 switch-specific suffix to the source file name, and the file is
13215 created in the same directory as the output file. In case of
13216 @option{=@var{filename}} option, the dump is output on the given file
13217 instead of the auto named dump files.  If the @samp{-@var{options}}
13218 form is used, @var{options} is a list of @samp{-} separated options
13219 which control the details of the dump.  Not all options are applicable
13220 to all dumps; those that are not meaningful are ignored.  The
13221 following options are available
13223 @table @samp
13224 @item address
13225 Print the address of each node.  Usually this is not meaningful as it
13226 changes according to the environment and source file.  Its primary use
13227 is for tying up a dump file with a debug environment.
13228 @item asmname
13229 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
13230 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
13231 use working backward from mangled names in the assembly file.
13232 @item slim
13233 When dumping front-end intermediate representations, inhibit dumping
13234 of members of a scope or body of a function merely because that scope
13235 has been reached.  Only dump such items when they are directly reachable
13236 by some other path.
13238 When dumping pretty-printed trees, this option inhibits dumping the
13239 bodies of control structures.
13241 When dumping RTL, print the RTL in slim (condensed) form instead of
13242 the default LISP-like representation.
13243 @item raw
13244 Print a raw representation of the tree.  By default, trees are
13245 pretty-printed into a C-like representation.
13246 @item details
13247 Enable more detailed dumps (not honored by every dump option). Also
13248 include information from the optimization passes.
13249 @item stats
13250 Enable dumping various statistics about the pass (not honored by every dump
13251 option).
13252 @item blocks
13253 Enable showing basic block boundaries (disabled in raw dumps).
13254 @item graph
13255 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
13256 dump a representation of the control flow graph suitable for viewing with
13257 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
13258 the file is pretty-printed as a subgraph, so that GraphViz can render them
13259 all in a single plot.
13261 This option currently only works for RTL dumps, and the RTL is always
13262 dumped in slim form.
13263 @item vops
13264 Enable showing virtual operands for every statement.
13265 @item lineno
13266 Enable showing line numbers for statements.
13267 @item uid
13268 Enable showing the unique ID (@code{DECL_UID}) for each variable.
13269 @item verbose
13270 Enable showing the tree dump for each statement.
13271 @item eh
13272 Enable showing the EH region number holding each statement.
13273 @item scev
13274 Enable showing scalar evolution analysis details.
13275 @item optimized
13276 Enable showing optimization information (only available in certain
13277 passes).
13278 @item missed
13279 Enable showing missed optimization information (only available in certain
13280 passes).
13281 @item note
13282 Enable other detailed optimization information (only available in
13283 certain passes).
13284 @item =@var{filename}
13285 Instead of an auto named dump file, output into the given file
13286 name. The file names @file{stdout} and @file{stderr} are treated
13287 specially and are considered already open standard streams. For
13288 example,
13290 @smallexample
13291 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
13292      -fdump-tree-pre=/dev/stderr file.c
13293 @end smallexample
13295 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
13296 output on to @file{stderr}. If two conflicting dump filenames are
13297 given for the same pass, then the latter option overrides the earlier
13298 one.
13300 @item all
13301 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
13302 and @option{lineno}.
13304 @item optall
13305 Turn on all optimization options, i.e., @option{optimized},
13306 @option{missed}, and @option{note}.
13307 @end table
13309 To determine what tree dumps are available or find the dump for a pass
13310 of interest follow the steps below.
13312 @enumerate
13313 @item
13314 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
13315 look for a code that corresponds to the pass you are interested in.
13316 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
13317 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
13318 The number at the end distinguishes distinct invocations of the same pass.
13319 @item
13320 To enable the creation of the dump file, append the pass code to
13321 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
13322 to enable the dump from the Early Value Range Propagation pass, invoke
13323 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
13324 specify the name of the dump file.  If you don't specify one, GCC
13325 creates as described below.
13326 @item
13327 Find the pass dump in a file whose name is composed of three components
13328 separated by a period: the name of the source file GCC was invoked to
13329 compile, a numeric suffix indicating the pass number followed by the
13330 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
13331 and finally the pass code.  For example, the Early VRP pass dump might
13332 be in a file named @file{myfile.c.038t.evrp} in the current working
13333 directory.  Note that the numeric codes are not stable and may change
13334 from one version of GCC to another.
13335 @end enumerate
13337 @item -fopt-info
13338 @itemx -fopt-info-@var{options}
13339 @itemx -fopt-info-@var{options}=@var{filename}
13340 @opindex fopt-info
13341 Controls optimization dumps from various optimization passes. If the
13342 @samp{-@var{options}} form is used, @var{options} is a list of
13343 @samp{-} separated option keywords to select the dump details and
13344 optimizations.  
13346 The @var{options} can be divided into two groups: options describing the
13347 verbosity of the dump, and options describing which optimizations
13348 should be included. The options from both the groups can be freely
13349 mixed as they are non-overlapping. However, in case of any conflicts,
13350 the later options override the earlier options on the command
13351 line. 
13353 The following options control the dump verbosity:
13355 @table @samp
13356 @item optimized
13357 Print information when an optimization is successfully applied. It is
13358 up to a pass to decide which information is relevant. For example, the
13359 vectorizer passes print the source location of loops which are
13360 successfully vectorized.
13361 @item missed
13362 Print information about missed optimizations. Individual passes
13363 control which information to include in the output. 
13364 @item note
13365 Print verbose information about optimizations, such as certain
13366 transformations, more detailed messages about decisions etc.
13367 @item all
13368 Print detailed optimization information. This includes
13369 @samp{optimized}, @samp{missed}, and @samp{note}.
13370 @end table
13372 One or more of the following option keywords can be used to describe a
13373 group of optimizations:
13375 @table @samp
13376 @item ipa
13377 Enable dumps from all interprocedural optimizations.
13378 @item loop
13379 Enable dumps from all loop optimizations.
13380 @item inline
13381 Enable dumps from all inlining optimizations.
13382 @item omp
13383 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
13384 @item vec
13385 Enable dumps from all vectorization optimizations.
13386 @item optall
13387 Enable dumps from all optimizations. This is a superset of
13388 the optimization groups listed above.
13389 @end table
13391 If @var{options} is
13392 omitted, it defaults to @samp{optimized-optall}, which means to dump all
13393 info about successful optimizations from all the passes.  
13395 If the @var{filename} is provided, then the dumps from all the
13396 applicable optimizations are concatenated into the @var{filename}.
13397 Otherwise the dump is output onto @file{stderr}. Though multiple
13398 @option{-fopt-info} options are accepted, only one of them can include
13399 a @var{filename}. If other filenames are provided then all but the
13400 first such option are ignored.
13402 Note that the output @var{filename} is overwritten
13403 in case of multiple translation units. If a combined output from
13404 multiple translation units is desired, @file{stderr} should be used
13405 instead.
13407 In the following example, the optimization info is output to
13408 @file{stderr}:
13410 @smallexample
13411 gcc -O3 -fopt-info
13412 @end smallexample
13414 This example:
13415 @smallexample
13416 gcc -O3 -fopt-info-missed=missed.all
13417 @end smallexample
13419 @noindent
13420 outputs missed optimization report from all the passes into
13421 @file{missed.all}, and this one:
13423 @smallexample
13424 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
13425 @end smallexample
13427 @noindent
13428 prints information about missed optimization opportunities from
13429 vectorization passes on @file{stderr}.  
13430 Note that @option{-fopt-info-vec-missed} is equivalent to 
13431 @option{-fopt-info-missed-vec}.  The order of the optimization group
13432 names and message types listed after @option{-fopt-info} does not matter.
13434 As another example,
13435 @smallexample
13436 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
13437 @end smallexample
13439 @noindent
13440 outputs information about missed optimizations as well as
13441 optimized locations from all the inlining passes into
13442 @file{inline.txt}.
13444 Finally, consider:
13446 @smallexample
13447 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
13448 @end smallexample
13450 @noindent
13451 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
13452 in conflict since only one output file is allowed. In this case, only
13453 the first option takes effect and the subsequent options are
13454 ignored. Thus only @file{vec.miss} is produced which contains
13455 dumps from the vectorizer about missed opportunities.
13457 @item -fsched-verbose=@var{n}
13458 @opindex fsched-verbose
13459 On targets that use instruction scheduling, this option controls the
13460 amount of debugging output the scheduler prints to the dump files.
13462 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
13463 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
13464 For @var{n} greater than one, it also output basic block probabilities,
13465 detailed ready list information and unit/insn info.  For @var{n} greater
13466 than two, it includes RTL at abort point, control-flow and regions info.
13467 And for @var{n} over four, @option{-fsched-verbose} also includes
13468 dependence info.
13472 @item -fenable-@var{kind}-@var{pass}
13473 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
13474 @opindex fdisable-
13475 @opindex fenable-
13477 This is a set of options that are used to explicitly disable/enable
13478 optimization passes.  These options are intended for use for debugging GCC.
13479 Compiler users should use regular options for enabling/disabling
13480 passes instead.
13482 @table @gcctabopt
13484 @item -fdisable-ipa-@var{pass}
13485 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
13486 statically invoked in the compiler multiple times, the pass name should be
13487 appended with a sequential number starting from 1.
13489 @item -fdisable-rtl-@var{pass}
13490 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
13491 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13492 statically invoked in the compiler multiple times, the pass name should be
13493 appended with a sequential number starting from 1.  @var{range-list} is a 
13494 comma-separated list of function ranges or assembler names.  Each range is a number
13495 pair separated by a colon.  The range is inclusive in both ends.  If the range
13496 is trivial, the number pair can be simplified as a single number.  If the
13497 function's call graph node's @var{uid} falls within one of the specified ranges,
13498 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
13499 function header of a dump file, and the pass names can be dumped by using
13500 option @option{-fdump-passes}.
13502 @item -fdisable-tree-@var{pass}
13503 @itemx -fdisable-tree-@var{pass}=@var{range-list}
13504 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
13505 option arguments.
13507 @item -fenable-ipa-@var{pass}
13508 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13509 statically invoked in the compiler multiple times, the pass name should be
13510 appended with a sequential number starting from 1.
13512 @item -fenable-rtl-@var{pass}
13513 @itemx -fenable-rtl-@var{pass}=@var{range-list}
13514 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
13515 description and examples.
13517 @item -fenable-tree-@var{pass}
13518 @itemx -fenable-tree-@var{pass}=@var{range-list}
13519 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
13520 of option arguments.
13522 @end table
13524 Here are some examples showing uses of these options.
13526 @smallexample
13528 # disable ccp1 for all functions
13529    -fdisable-tree-ccp1
13530 # disable complete unroll for function whose cgraph node uid is 1
13531    -fenable-tree-cunroll=1
13532 # disable gcse2 for functions at the following ranges [1,1],
13533 # [300,400], and [400,1000]
13534 # disable gcse2 for functions foo and foo2
13535    -fdisable-rtl-gcse2=foo,foo2
13536 # disable early inlining
13537    -fdisable-tree-einline
13538 # disable ipa inlining
13539    -fdisable-ipa-inline
13540 # enable tree full unroll
13541    -fenable-tree-unroll
13543 @end smallexample
13545 @item -fchecking
13546 @itemx -fchecking=@var{n}
13547 @opindex fchecking
13548 @opindex fno-checking
13549 Enable internal consistency checking.  The default depends on
13550 the compiler configuration.  @option{-fchecking=2} enables further
13551 internal consistency checking that might affect code generation.
13553 @item -frandom-seed=@var{string}
13554 @opindex frandom-seed
13555 This option provides a seed that GCC uses in place of
13556 random numbers in generating certain symbol names
13557 that have to be different in every compiled file.  It is also used to
13558 place unique stamps in coverage data files and the object files that
13559 produce them.  You can use the @option{-frandom-seed} option to produce
13560 reproducibly identical object files.
13562 The @var{string} can either be a number (decimal, octal or hex) or an
13563 arbitrary string (in which case it's converted to a number by
13564 computing CRC32).
13566 The @var{string} should be different for every file you compile.
13568 @item -save-temps
13569 @itemx -save-temps=cwd
13570 @opindex save-temps
13571 Store the usual ``temporary'' intermediate files permanently; place them
13572 in the current directory and name them based on the source file.  Thus,
13573 compiling @file{foo.c} with @option{-c -save-temps} produces files
13574 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
13575 preprocessed @file{foo.i} output file even though the compiler now
13576 normally uses an integrated preprocessor.
13578 When used in combination with the @option{-x} command-line option,
13579 @option{-save-temps} is sensible enough to avoid over writing an
13580 input source file with the same extension as an intermediate file.
13581 The corresponding intermediate file may be obtained by renaming the
13582 source file before using @option{-save-temps}.
13584 If you invoke GCC in parallel, compiling several different source
13585 files that share a common base name in different subdirectories or the
13586 same source file compiled for multiple output destinations, it is
13587 likely that the different parallel compilers will interfere with each
13588 other, and overwrite the temporary files.  For instance:
13590 @smallexample
13591 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
13592 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
13593 @end smallexample
13595 may result in @file{foo.i} and @file{foo.o} being written to
13596 simultaneously by both compilers.
13598 @item -save-temps=obj
13599 @opindex save-temps=obj
13600 Store the usual ``temporary'' intermediate files permanently.  If the
13601 @option{-o} option is used, the temporary files are based on the
13602 object file.  If the @option{-o} option is not used, the
13603 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
13605 For example:
13607 @smallexample
13608 gcc -save-temps=obj -c foo.c
13609 gcc -save-temps=obj -c bar.c -o dir/xbar.o
13610 gcc -save-temps=obj foobar.c -o dir2/yfoobar
13611 @end smallexample
13613 @noindent
13614 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
13615 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
13616 @file{dir2/yfoobar.o}.
13618 @item -time@r{[}=@var{file}@r{]}
13619 @opindex time
13620 Report the CPU time taken by each subprocess in the compilation
13621 sequence.  For C source files, this is the compiler proper and assembler
13622 (plus the linker if linking is done).
13624 Without the specification of an output file, the output looks like this:
13626 @smallexample
13627 # cc1 0.12 0.01
13628 # as 0.00 0.01
13629 @end smallexample
13631 The first number on each line is the ``user time'', that is time spent
13632 executing the program itself.  The second number is ``system time'',
13633 time spent executing operating system routines on behalf of the program.
13634 Both numbers are in seconds.
13636 With the specification of an output file, the output is appended to the
13637 named file, and it looks like this:
13639 @smallexample
13640 0.12 0.01 cc1 @var{options}
13641 0.00 0.01 as @var{options}
13642 @end smallexample
13644 The ``user time'' and the ``system time'' are moved before the program
13645 name, and the options passed to the program are displayed, so that one
13646 can later tell what file was being compiled, and with which options.
13648 @item -fdump-final-insns@r{[}=@var{file}@r{]}
13649 @opindex fdump-final-insns
13650 Dump the final internal representation (RTL) to @var{file}.  If the
13651 optional argument is omitted (or if @var{file} is @code{.}), the name
13652 of the dump file is determined by appending @code{.gkd} to the
13653 compilation output file name.
13655 @item -fcompare-debug@r{[}=@var{opts}@r{]}
13656 @opindex fcompare-debug
13657 @opindex fno-compare-debug
13658 If no error occurs during compilation, run the compiler a second time,
13659 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
13660 passed to the second compilation.  Dump the final internal
13661 representation in both compilations, and print an error if they differ.
13663 If the equal sign is omitted, the default @option{-gtoggle} is used.
13665 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
13666 and nonzero, implicitly enables @option{-fcompare-debug}.  If
13667 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
13668 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
13669 is used.
13671 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
13672 is equivalent to @option{-fno-compare-debug}, which disables the dumping
13673 of the final representation and the second compilation, preventing even
13674 @env{GCC_COMPARE_DEBUG} from taking effect.
13676 To verify full coverage during @option{-fcompare-debug} testing, set
13677 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
13678 which GCC rejects as an invalid option in any actual compilation
13679 (rather than preprocessing, assembly or linking).  To get just a
13680 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
13681 not overridden} will do.
13683 @item -fcompare-debug-second
13684 @opindex fcompare-debug-second
13685 This option is implicitly passed to the compiler for the second
13686 compilation requested by @option{-fcompare-debug}, along with options to
13687 silence warnings, and omitting other options that would cause
13688 side-effect compiler outputs to files or to the standard output.  Dump
13689 files and preserved temporary files are renamed so as to contain the
13690 @code{.gk} additional extension during the second compilation, to avoid
13691 overwriting those generated by the first.
13693 When this option is passed to the compiler driver, it causes the
13694 @emph{first} compilation to be skipped, which makes it useful for little
13695 other than debugging the compiler proper.
13697 @item -gtoggle
13698 @opindex gtoggle
13699 Turn off generation of debug info, if leaving out this option
13700 generates it, or turn it on at level 2 otherwise.  The position of this
13701 argument in the command line does not matter; it takes effect after all
13702 other options are processed, and it does so only once, no matter how
13703 many times it is given.  This is mainly intended to be used with
13704 @option{-fcompare-debug}.
13706 @item -fvar-tracking-assignments-toggle
13707 @opindex fvar-tracking-assignments-toggle
13708 @opindex fno-var-tracking-assignments-toggle
13709 Toggle @option{-fvar-tracking-assignments}, in the same way that
13710 @option{-gtoggle} toggles @option{-g}.
13712 @item -Q
13713 @opindex Q
13714 Makes the compiler print out each function name as it is compiled, and
13715 print some statistics about each pass when it finishes.
13717 @item -ftime-report
13718 @opindex ftime-report
13719 Makes the compiler print some statistics about the time consumed by each
13720 pass when it finishes.
13722 @item -ftime-report-details
13723 @opindex ftime-report-details
13724 Record the time consumed by infrastructure parts separately for each pass.
13726 @item -fira-verbose=@var{n}
13727 @opindex fira-verbose
13728 Control the verbosity of the dump file for the integrated register allocator.
13729 The default value is 5.  If the value @var{n} is greater or equal to 10,
13730 the dump output is sent to stderr using the same format as @var{n} minus 10.
13732 @item -flto-report
13733 @opindex flto-report
13734 Prints a report with internal details on the workings of the link-time
13735 optimizer.  The contents of this report vary from version to version.
13736 It is meant to be useful to GCC developers when processing object
13737 files in LTO mode (via @option{-flto}).
13739 Disabled by default.
13741 @item -flto-report-wpa
13742 @opindex flto-report-wpa
13743 Like @option{-flto-report}, but only print for the WPA phase of Link
13744 Time Optimization.
13746 @item -fmem-report
13747 @opindex fmem-report
13748 Makes the compiler print some statistics about permanent memory
13749 allocation when it finishes.
13751 @item -fmem-report-wpa
13752 @opindex fmem-report-wpa
13753 Makes the compiler print some statistics about permanent memory
13754 allocation for the WPA phase only.
13756 @item -fpre-ipa-mem-report
13757 @opindex fpre-ipa-mem-report
13758 @item -fpost-ipa-mem-report
13759 @opindex fpost-ipa-mem-report
13760 Makes the compiler print some statistics about permanent memory
13761 allocation before or after interprocedural optimization.
13763 @item -fprofile-report
13764 @opindex fprofile-report
13765 Makes the compiler print some statistics about consistency of the
13766 (estimated) profile and effect of individual passes.
13768 @item -fstack-usage
13769 @opindex fstack-usage
13770 Makes the compiler output stack usage information for the program, on a
13771 per-function basis.  The filename for the dump is made by appending
13772 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
13773 the output file, if explicitly specified and it is not an executable,
13774 otherwise it is the basename of the source file.  An entry is made up
13775 of three fields:
13777 @itemize
13778 @item
13779 The name of the function.
13780 @item
13781 A number of bytes.
13782 @item
13783 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
13784 @end itemize
13786 The qualifier @code{static} means that the function manipulates the stack
13787 statically: a fixed number of bytes are allocated for the frame on function
13788 entry and released on function exit; no stack adjustments are otherwise made
13789 in the function.  The second field is this fixed number of bytes.
13791 The qualifier @code{dynamic} means that the function manipulates the stack
13792 dynamically: in addition to the static allocation described above, stack
13793 adjustments are made in the body of the function, for example to push/pop
13794 arguments around function calls.  If the qualifier @code{bounded} is also
13795 present, the amount of these adjustments is bounded at compile time and
13796 the second field is an upper bound of the total amount of stack used by
13797 the function.  If it is not present, the amount of these adjustments is
13798 not bounded at compile time and the second field only represents the
13799 bounded part.
13801 @item -fstats
13802 @opindex fstats
13803 Emit statistics about front-end processing at the end of the compilation.
13804 This option is supported only by the C++ front end, and
13805 the information is generally only useful to the G++ development team.
13807 @item -fdbg-cnt-list
13808 @opindex fdbg-cnt-list
13809 Print the name and the counter upper bound for all debug counters.
13812 @item -fdbg-cnt=@var{counter-value-list}
13813 @opindex fdbg-cnt
13814 Set the internal debug counter upper bound.  @var{counter-value-list}
13815 is a comma-separated list of @var{name}:@var{value} pairs
13816 which sets the upper bound of each debug counter @var{name} to @var{value}.
13817 All debug counters have the initial upper bound of @code{UINT_MAX};
13818 thus @code{dbg_cnt} returns true always unless the upper bound
13819 is set by this option.
13820 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
13821 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
13823 @item -print-file-name=@var{library}
13824 @opindex print-file-name
13825 Print the full absolute name of the library file @var{library} that
13826 would be used when linking---and don't do anything else.  With this
13827 option, GCC does not compile or link anything; it just prints the
13828 file name.
13830 @item -print-multi-directory
13831 @opindex print-multi-directory
13832 Print the directory name corresponding to the multilib selected by any
13833 other switches present in the command line.  This directory is supposed
13834 to exist in @env{GCC_EXEC_PREFIX}.
13836 @item -print-multi-lib
13837 @opindex print-multi-lib
13838 Print the mapping from multilib directory names to compiler switches
13839 that enable them.  The directory name is separated from the switches by
13840 @samp{;}, and each switch starts with an @samp{@@} instead of the
13841 @samp{-}, without spaces between multiple switches.  This is supposed to
13842 ease shell processing.
13844 @item -print-multi-os-directory
13845 @opindex print-multi-os-directory
13846 Print the path to OS libraries for the selected
13847 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
13848 present in the @file{lib} subdirectory and no multilibs are used, this is
13849 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
13850 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
13851 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
13852 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
13854 @item -print-multiarch
13855 @opindex print-multiarch
13856 Print the path to OS libraries for the selected multiarch,
13857 relative to some @file{lib} subdirectory.
13859 @item -print-prog-name=@var{program}
13860 @opindex print-prog-name
13861 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
13863 @item -print-libgcc-file-name
13864 @opindex print-libgcc-file-name
13865 Same as @option{-print-file-name=libgcc.a}.
13867 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
13868 but you do want to link with @file{libgcc.a}.  You can do:
13870 @smallexample
13871 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
13872 @end smallexample
13874 @item -print-search-dirs
13875 @opindex print-search-dirs
13876 Print the name of the configured installation directory and a list of
13877 program and library directories @command{gcc} searches---and don't do anything else.
13879 This is useful when @command{gcc} prints the error message
13880 @samp{installation problem, cannot exec cpp0: No such file or directory}.
13881 To resolve this you either need to put @file{cpp0} and the other compiler
13882 components where @command{gcc} expects to find them, or you can set the environment
13883 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
13884 Don't forget the trailing @samp{/}.
13885 @xref{Environment Variables}.
13887 @item -print-sysroot
13888 @opindex print-sysroot
13889 Print the target sysroot directory that is used during
13890 compilation.  This is the target sysroot specified either at configure
13891 time or using the @option{--sysroot} option, possibly with an extra
13892 suffix that depends on compilation options.  If no target sysroot is
13893 specified, the option prints nothing.
13895 @item -print-sysroot-headers-suffix
13896 @opindex print-sysroot-headers-suffix
13897 Print the suffix added to the target sysroot when searching for
13898 headers, or give an error if the compiler is not configured with such
13899 a suffix---and don't do anything else.
13901 @item -dumpmachine
13902 @opindex dumpmachine
13903 Print the compiler's target machine (for example,
13904 @samp{i686-pc-linux-gnu})---and don't do anything else.
13906 @item -dumpversion
13907 @opindex dumpversion
13908 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
13909 anything else.  This is the compiler version used in filesystem paths,
13910 specs, can be depending on how the compiler has been configured just
13911 a single number (major version), two numbers separated by dot (major and
13912 minor version) or three numbers separated by dots (major, minor and patchlevel
13913 version).
13915 @item -dumpfullversion
13916 @opindex dumpfullversion
13917 Print the full compiler version, always 3 numbers separated by dots,
13918 major, minor and patchlevel version.
13920 @item -dumpspecs
13921 @opindex dumpspecs
13922 Print the compiler's built-in specs---and don't do anything else.  (This
13923 is used when GCC itself is being built.)  @xref{Spec Files}.
13924 @end table
13926 @node Submodel Options
13927 @section Machine-Dependent Options
13928 @cindex submodel options
13929 @cindex specifying hardware config
13930 @cindex hardware models and configurations, specifying
13931 @cindex target-dependent options
13932 @cindex machine-dependent options
13934 Each target machine supported by GCC can have its own options---for
13935 example, to allow you to compile for a particular processor variant or
13936 ABI, or to control optimizations specific to that machine.  By
13937 convention, the names of machine-specific options start with
13938 @samp{-m}.
13940 Some configurations of the compiler also support additional target-specific
13941 options, usually for compatibility with other compilers on the same
13942 platform.
13944 @c This list is ordered alphanumerically by subsection name.
13945 @c It should be the same order and spelling as these options are listed
13946 @c in Machine Dependent Options
13948 @menu
13949 * AArch64 Options::
13950 * Adapteva Epiphany Options::
13951 * ARC Options::
13952 * ARM Options::
13953 * AVR Options::
13954 * Blackfin Options::
13955 * C6X Options::
13956 * CRIS Options::
13957 * CR16 Options::
13958 * Darwin Options::
13959 * DEC Alpha Options::
13960 * FR30 Options::
13961 * FT32 Options::
13962 * FRV Options::
13963 * GNU/Linux Options::
13964 * H8/300 Options::
13965 * HPPA Options::
13966 * IA-64 Options::
13967 * LM32 Options::
13968 * M32C Options::
13969 * M32R/D Options::
13970 * M680x0 Options::
13971 * MCore Options::
13972 * MeP Options::
13973 * MicroBlaze Options::
13974 * MIPS Options::
13975 * MMIX Options::
13976 * MN10300 Options::
13977 * Moxie Options::
13978 * MSP430 Options::
13979 * NDS32 Options::
13980 * Nios II Options::
13981 * Nvidia PTX Options::
13982 * PDP-11 Options::
13983 * picoChip Options::
13984 * PowerPC Options::
13985 * RISC-V Options::
13986 * RL78 Options::
13987 * RS/6000 and PowerPC Options::
13988 * RX Options::
13989 * S/390 and zSeries Options::
13990 * Score Options::
13991 * SH Options::
13992 * Solaris 2 Options::
13993 * SPARC Options::
13994 * SPU Options::
13995 * System V Options::
13996 * TILE-Gx Options::
13997 * TILEPro Options::
13998 * V850 Options::
13999 * VAX Options::
14000 * Visium Options::
14001 * VMS Options::
14002 * VxWorks Options::
14003 * x86 Options::
14004 * x86 Windows Options::
14005 * Xstormy16 Options::
14006 * Xtensa Options::
14007 * zSeries Options::
14008 @end menu
14010 @node AArch64 Options
14011 @subsection AArch64 Options
14012 @cindex AArch64 Options
14014 These options are defined for AArch64 implementations:
14016 @table @gcctabopt
14018 @item -mabi=@var{name}
14019 @opindex mabi
14020 Generate code for the specified data model.  Permissible values
14021 are @samp{ilp32} for SysV-like data model where int, long int and pointers
14022 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
14023 but long int and pointers are 64 bits.
14025 The default depends on the specific target configuration.  Note that
14026 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
14027 entire program with the same ABI, and link with a compatible set of libraries.
14029 @item -mbig-endian
14030 @opindex mbig-endian
14031 Generate big-endian code.  This is the default when GCC is configured for an
14032 @samp{aarch64_be-*-*} target.
14034 @item -mgeneral-regs-only
14035 @opindex mgeneral-regs-only
14036 Generate code which uses only the general-purpose registers.  This will prevent
14037 the compiler from using floating-point and Advanced SIMD registers but will not
14038 impose any restrictions on the assembler.
14040 @item -mlittle-endian
14041 @opindex mlittle-endian
14042 Generate little-endian code.  This is the default when GCC is configured for an
14043 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
14045 @item -mcmodel=tiny
14046 @opindex mcmodel=tiny
14047 Generate code for the tiny code model.  The program and its statically defined
14048 symbols must be within 1MB of each other.  Programs can be statically or
14049 dynamically linked.
14051 @item -mcmodel=small
14052 @opindex mcmodel=small
14053 Generate code for the small code model.  The program and its statically defined
14054 symbols must be within 4GB of each other.  Programs can be statically or
14055 dynamically linked.  This is the default code model.
14057 @item -mcmodel=large
14058 @opindex mcmodel=large
14059 Generate code for the large code model.  This makes no assumptions about
14060 addresses and sizes of sections.  Programs can be statically linked only.
14062 @item -mstrict-align
14063 @opindex mstrict-align
14064 Avoid generating memory accesses that may not be aligned on a natural object
14065 boundary as described in the architecture specification.
14067 @item -momit-leaf-frame-pointer
14068 @itemx -mno-omit-leaf-frame-pointer
14069 @opindex momit-leaf-frame-pointer
14070 @opindex mno-omit-leaf-frame-pointer
14071 Omit or keep the frame pointer in leaf functions.  The former behavior is the
14072 default.
14074 @item -mtls-dialect=desc
14075 @opindex mtls-dialect=desc
14076 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
14077 of TLS variables.  This is the default.
14079 @item -mtls-dialect=traditional
14080 @opindex mtls-dialect=traditional
14081 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
14082 of TLS variables.
14084 @item -mtls-size=@var{size}
14085 @opindex mtls-size
14086 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
14087 This option requires binutils 2.26 or newer.
14089 @item -mfix-cortex-a53-835769
14090 @itemx -mno-fix-cortex-a53-835769
14091 @opindex mfix-cortex-a53-835769
14092 @opindex mno-fix-cortex-a53-835769
14093 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
14094 This involves inserting a NOP instruction between memory instructions and
14095 64-bit integer multiply-accumulate instructions.
14097 @item -mfix-cortex-a53-843419
14098 @itemx -mno-fix-cortex-a53-843419
14099 @opindex mfix-cortex-a53-843419
14100 @opindex mno-fix-cortex-a53-843419
14101 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
14102 This erratum workaround is made at link time and this will only pass the
14103 corresponding flag to the linker.
14105 @item -mlow-precision-recip-sqrt
14106 @item -mno-low-precision-recip-sqrt
14107 @opindex mlow-precision-recip-sqrt
14108 @opindex mno-low-precision-recip-sqrt
14109 Enable or disable the reciprocal square root approximation.
14110 This option only has an effect if @option{-ffast-math} or
14111 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14112 precision of reciprocal square root results to about 16 bits for
14113 single precision and to 32 bits for double precision.
14115 @item -mlow-precision-sqrt
14116 @item -mno-low-precision-sqrt
14117 @opindex -mlow-precision-sqrt
14118 @opindex -mno-low-precision-sqrt
14119 Enable or disable the square root approximation.
14120 This option only has an effect if @option{-ffast-math} or
14121 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14122 precision of square root results to about 16 bits for
14123 single precision and to 32 bits for double precision.
14124 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
14126 @item -mlow-precision-div
14127 @item -mno-low-precision-div
14128 @opindex -mlow-precision-div
14129 @opindex -mno-low-precision-div
14130 Enable or disable the division approximation.
14131 This option only has an effect if @option{-ffast-math} or
14132 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
14133 precision of division results to about 16 bits for
14134 single precision and to 32 bits for double precision.
14136 @item -march=@var{name}
14137 @opindex march
14138 Specify the name of the target architecture and, optionally, one or
14139 more feature modifiers.  This option has the form
14140 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
14142 The permissible values for @var{arch} are @samp{armv8-a},
14143 @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a} or @var{native}.
14145 The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler
14146 support for the ARMv8.3-A architecture extensions.
14148 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
14149 support for the ARMv8.2-A architecture extensions.
14151 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
14152 support for the ARMv8.1-A architecture extension.  In particular, it
14153 enables the @samp{+crc}, @samp{+lse}, and @samp{+rdma} features.
14155 The value @samp{native} is available on native AArch64 GNU/Linux and
14156 causes the compiler to pick the architecture of the host system.  This
14157 option has no effect if the compiler is unable to recognize the
14158 architecture of the host system,
14160 The permissible values for @var{feature} are listed in the sub-section
14161 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
14162 Feature Modifiers}.  Where conflicting feature modifiers are
14163 specified, the right-most feature is used.
14165 GCC uses @var{name} to determine what kind of instructions it can emit
14166 when generating assembly code.  If @option{-march} is specified
14167 without either of @option{-mtune} or @option{-mcpu} also being
14168 specified, the code is tuned to perform well across a range of target
14169 processors implementing the target architecture.
14171 @item -mtune=@var{name}
14172 @opindex mtune
14173 Specify the name of the target processor for which GCC should tune the
14174 performance of the code.  Permissible values for this option are:
14175 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
14176 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
14177 @samp{exynos-m1}, @samp{falkor}, @samp{qdf24xx},
14178 @samp{xgene1}, @samp{vulcan}, @samp{thunderx},
14179 @samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81},
14180 @samp{thunderxt83}, @samp{thunderx2t99}, @samp{cortex-a57.cortex-a53},
14181 @samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35},
14182 @samp{cortex-a73.cortex-a53}, @samp{cortex-a75.cortex-a55},
14183 @samp{native}.
14185 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
14186 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53},
14187 @samp{cortex-a75.cortex-a55} specify that GCC should tune for a
14188 big.LITTLE system.
14190 Additionally on native AArch64 GNU/Linux systems the value
14191 @samp{native} tunes performance to the host system.  This option has no effect
14192 if the compiler is unable to recognize the processor of the host system.
14194 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
14195 are specified, the code is tuned to perform well across a range
14196 of target processors.
14198 This option cannot be suffixed by feature modifiers.
14200 @item -mcpu=@var{name}
14201 @opindex mcpu
14202 Specify the name of the target processor, optionally suffixed by one
14203 or more feature modifiers.  This option has the form
14204 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
14205 the permissible values for @var{cpu} are the same as those available
14206 for @option{-mtune}.  The permissible values for @var{feature} are
14207 documented in the sub-section on
14208 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
14209 Feature Modifiers}.  Where conflicting feature modifiers are
14210 specified, the right-most feature is used.
14212 GCC uses @var{name} to determine what kind of instructions it can emit when
14213 generating assembly code (as if by @option{-march}) and to determine
14214 the target processor for which to tune for performance (as if
14215 by @option{-mtune}).  Where this option is used in conjunction
14216 with @option{-march} or @option{-mtune}, those options take precedence
14217 over the appropriate part of this option.
14219 @item -moverride=@var{string}
14220 @opindex moverride
14221 Override tuning decisions made by the back-end in response to a
14222 @option{-mtune=} switch.  The syntax, semantics, and accepted values
14223 for @var{string} in this option are not guaranteed to be consistent
14224 across releases.
14226 This option is only intended to be useful when developing GCC.
14228 @item -mpc-relative-literal-loads
14229 @itemx -mno-pc-relative-literal-loads
14230 @opindex mpc-relative-literal-loads
14231 @opindex mno-pc-relative-literal-loads
14232 Enable or disable PC-relative literal loads.  With this option literal pools are
14233 accessed using a single instruction and emitted after each function.  This
14234 limits the maximum size of functions to 1MB.  This is enabled by default for
14235 @option{-mcmodel=tiny}.
14237 @item -msign-return-address=@var{scope}
14238 @opindex msign-return-address
14239 Select the function scope on which return address signing will be applied.
14240 Permissible values are @samp{none}, which disables return address signing,
14241 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
14242 functions, and @samp{all}, which enables pointer signing for all functions.  The
14243 default value is @samp{none}.
14245 @end table
14247 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
14248 @anchor{aarch64-feature-modifiers}
14249 @cindex @option{-march} feature modifiers
14250 @cindex @option{-mcpu} feature modifiers
14251 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
14252 the following and their inverses @option{no@var{feature}}:
14254 @table @samp
14255 @item crc
14256 Enable CRC extension.  This is on by default for
14257 @option{-march=armv8.1-a}.
14258 @item crypto
14259 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
14260 instructions.
14261 @item fp
14262 Enable floating-point instructions.  This is on by default for all possible
14263 values for options @option{-march} and @option{-mcpu}.
14264 @item simd
14265 Enable Advanced SIMD instructions.  This also enables floating-point
14266 instructions.  This is on by default for all possible values for options
14267 @option{-march} and @option{-mcpu}.
14268 @item lse
14269 Enable Large System Extension instructions.  This is on by default for
14270 @option{-march=armv8.1-a}.
14271 @item rdma
14272 Enable Round Double Multiply Accumulate instructions.  This is on by default
14273 for @option{-march=armv8.1-a}.
14274 @item fp16
14275 Enable FP16 extension.  This also enables floating-point instructions.
14276 @item rcpc
14277 Enable the RcPc extension.  This does not change code generation from GCC,
14278 but is passed on to the assembler, enabling inline asm statements to use
14279 instructions from the RcPc extension.
14281 @end table
14283 Feature @option{crypto} implies @option{simd}, which implies @option{fp}.
14284 Conversely, @option{nofp} implies @option{nosimd}, which implies
14285 @option{nocrypto}.
14287 @node Adapteva Epiphany Options
14288 @subsection Adapteva Epiphany Options
14290 These @samp{-m} options are defined for Adapteva Epiphany:
14292 @table @gcctabopt
14293 @item -mhalf-reg-file
14294 @opindex mhalf-reg-file
14295 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
14296 That allows code to run on hardware variants that lack these registers.
14298 @item -mprefer-short-insn-regs
14299 @opindex mprefer-short-insn-regs
14300 Preferentially allocate registers that allow short instruction generation.
14301 This can result in increased instruction count, so this may either reduce or
14302 increase overall code size.
14304 @item -mbranch-cost=@var{num}
14305 @opindex mbranch-cost
14306 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14307 This cost is only a heuristic and is not guaranteed to produce
14308 consistent results across releases.
14310 @item -mcmove
14311 @opindex mcmove
14312 Enable the generation of conditional moves.
14314 @item -mnops=@var{num}
14315 @opindex mnops
14316 Emit @var{num} NOPs before every other generated instruction.
14318 @item -mno-soft-cmpsf
14319 @opindex mno-soft-cmpsf
14320 For single-precision floating-point comparisons, emit an @code{fsub} instruction
14321 and test the flags.  This is faster than a software comparison, but can
14322 get incorrect results in the presence of NaNs, or when two different small
14323 numbers are compared such that their difference is calculated as zero.
14324 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
14325 software comparisons.
14327 @item -mstack-offset=@var{num}
14328 @opindex mstack-offset
14329 Set the offset between the top of the stack and the stack pointer.
14330 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
14331 can be used by leaf functions without stack allocation.
14332 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
14333 Note also that this option changes the ABI; compiling a program with a
14334 different stack offset than the libraries have been compiled with
14335 generally does not work.
14336 This option can be useful if you want to evaluate if a different stack
14337 offset would give you better code, but to actually use a different stack
14338 offset to build working programs, it is recommended to configure the
14339 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
14341 @item -mno-round-nearest
14342 @opindex mno-round-nearest
14343 Make the scheduler assume that the rounding mode has been set to
14344 truncating.  The default is @option{-mround-nearest}.
14346 @item -mlong-calls
14347 @opindex mlong-calls
14348 If not otherwise specified by an attribute, assume all calls might be beyond
14349 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
14350 function address into a register before performing a (otherwise direct) call.
14351 This is the default.
14353 @item -mshort-calls
14354 @opindex short-calls
14355 If not otherwise specified by an attribute, assume all direct calls are
14356 in the range of the @code{b} / @code{bl} instructions, so use these instructions
14357 for direct calls.  The default is @option{-mlong-calls}.
14359 @item -msmall16
14360 @opindex msmall16
14361 Assume addresses can be loaded as 16-bit unsigned values.  This does not
14362 apply to function addresses for which @option{-mlong-calls} semantics
14363 are in effect.
14365 @item -mfp-mode=@var{mode}
14366 @opindex mfp-mode
14367 Set the prevailing mode of the floating-point unit.
14368 This determines the floating-point mode that is provided and expected
14369 at function call and return time.  Making this mode match the mode you
14370 predominantly need at function start can make your programs smaller and
14371 faster by avoiding unnecessary mode switches.
14373 @var{mode} can be set to one the following values:
14375 @table @samp
14376 @item caller
14377 Any mode at function entry is valid, and retained or restored when
14378 the function returns, and when it calls other functions.
14379 This mode is useful for compiling libraries or other compilation units
14380 you might want to incorporate into different programs with different
14381 prevailing FPU modes, and the convenience of being able to use a single
14382 object file outweighs the size and speed overhead for any extra
14383 mode switching that might be needed, compared with what would be needed
14384 with a more specific choice of prevailing FPU mode.
14386 @item truncate
14387 This is the mode used for floating-point calculations with
14388 truncating (i.e.@: round towards zero) rounding mode.  That includes
14389 conversion from floating point to integer.
14391 @item round-nearest
14392 This is the mode used for floating-point calculations with
14393 round-to-nearest-or-even rounding mode.
14395 @item int
14396 This is the mode used to perform integer calculations in the FPU, e.g.@:
14397 integer multiply, or integer multiply-and-accumulate.
14398 @end table
14400 The default is @option{-mfp-mode=caller}
14402 @item -mnosplit-lohi
14403 @itemx -mno-postinc
14404 @itemx -mno-postmodify
14405 @opindex mnosplit-lohi
14406 @opindex mno-postinc
14407 @opindex mno-postmodify
14408 Code generation tweaks that disable, respectively, splitting of 32-bit
14409 loads, generation of post-increment addresses, and generation of
14410 post-modify addresses.  The defaults are @option{msplit-lohi},
14411 @option{-mpost-inc}, and @option{-mpost-modify}.
14413 @item -mnovect-double
14414 @opindex mno-vect-double
14415 Change the preferred SIMD mode to SImode.  The default is
14416 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
14418 @item -max-vect-align=@var{num}
14419 @opindex max-vect-align
14420 The maximum alignment for SIMD vector mode types.
14421 @var{num} may be 4 or 8.  The default is 8.
14422 Note that this is an ABI change, even though many library function
14423 interfaces are unaffected if they don't use SIMD vector modes
14424 in places that affect size and/or alignment of relevant types.
14426 @item -msplit-vecmove-early
14427 @opindex msplit-vecmove-early
14428 Split vector moves into single word moves before reload.  In theory this
14429 can give better register allocation, but so far the reverse seems to be
14430 generally the case.
14432 @item -m1reg-@var{reg}
14433 @opindex m1reg-
14434 Specify a register to hold the constant @minus{}1, which makes loading small negative
14435 constants and certain bitmasks faster.
14436 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
14437 which specify use of that register as a fixed register,
14438 and @samp{none}, which means that no register is used for this
14439 purpose.  The default is @option{-m1reg-none}.
14441 @end table
14443 @node ARC Options
14444 @subsection ARC Options
14445 @cindex ARC options
14447 The following options control the architecture variant for which code
14448 is being compiled:
14450 @c architecture variants
14451 @table @gcctabopt
14453 @item -mbarrel-shifter
14454 @opindex mbarrel-shifter
14455 Generate instructions supported by barrel shifter.  This is the default
14456 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
14458 @item -mcpu=@var{cpu}
14459 @opindex mcpu
14460 Set architecture type, register usage, and instruction scheduling
14461 parameters for @var{cpu}.  There are also shortcut alias options
14462 available for backward compatibility and convenience.  Supported
14463 values for @var{cpu} are
14465 @table @samp
14466 @opindex mA6
14467 @opindex mARC600
14468 @item arc600
14469 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
14471 @item arc601
14472 @opindex mARC601
14473 Compile for ARC601.  Alias: @option{-mARC601}.
14475 @item arc700
14476 @opindex mA7
14477 @opindex mARC700
14478 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
14479 This is the default when configured with @option{--with-cpu=arc700}@.
14481 @item arcem
14482 Compile for ARC EM.
14484 @item archs
14485 Compile for ARC HS.
14487 @item em
14488 Compile for ARC EM CPU with no hardware extensions.
14490 @item em4
14491 Compile for ARC EM4 CPU.
14493 @item em4_dmips
14494 Compile for ARC EM4 DMIPS CPU.
14496 @item em4_fpus
14497 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
14498 extension.
14500 @item em4_fpuda
14501 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
14502 double assist instructions.
14504 @item hs
14505 Compile for ARC HS CPU with no hardware extensions except the atomic
14506 instructions.
14508 @item hs34
14509 Compile for ARC HS34 CPU.
14511 @item hs38
14512 Compile for ARC HS38 CPU.
14514 @item hs38_linux
14515 Compile for ARC HS38 CPU with all hardware extensions on.
14517 @item arc600_norm
14518 Compile for ARC 600 CPU with @code{norm} instructions enabled.
14520 @item arc600_mul32x16
14521 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
14522 instructions enabled.
14524 @item arc600_mul64
14525 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
14526 instructions enabled.
14528 @item arc601_norm
14529 Compile for ARC 601 CPU with @code{norm} instructions enabled.
14531 @item arc601_mul32x16
14532 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
14533 instructions enabled.
14535 @item arc601_mul64
14536 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
14537 instructions enabled.
14539 @item nps400
14540 Compile for ARC 700 on NPS400 chip.
14542 @end table
14544 @item -mdpfp
14545 @opindex mdpfp
14546 @itemx -mdpfp-compact
14547 @opindex mdpfp-compact
14548 Generate double-precision FPX instructions, tuned for the compact
14549 implementation.
14551 @item -mdpfp-fast
14552 @opindex mdpfp-fast
14553 Generate double-precision FPX instructions, tuned for the fast
14554 implementation.
14556 @item -mno-dpfp-lrsr
14557 @opindex mno-dpfp-lrsr
14558 Disable @code{lr} and @code{sr} instructions from using FPX extension
14559 aux registers.
14561 @item -mea
14562 @opindex mea
14563 Generate extended arithmetic instructions.  Currently only
14564 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
14565 supported.  This is always enabled for @option{-mcpu=ARC700}.
14567 @item -mno-mpy
14568 @opindex mno-mpy
14569 Do not generate @code{mpy}-family instructions for ARC700.  This option is
14570 deprecated.
14572 @item -mmul32x16
14573 @opindex mmul32x16
14574 Generate 32x16-bit multiply and multiply-accumulate instructions.
14576 @item -mmul64
14577 @opindex mmul64
14578 Generate @code{mul64} and @code{mulu64} instructions.  
14579 Only valid for @option{-mcpu=ARC600}.
14581 @item -mnorm
14582 @opindex mnorm
14583 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
14584 is in effect.
14586 @item -mspfp
14587 @opindex mspfp
14588 @itemx -mspfp-compact
14589 @opindex mspfp-compact
14590 Generate single-precision FPX instructions, tuned for the compact
14591 implementation.
14593 @item -mspfp-fast
14594 @opindex mspfp-fast
14595 Generate single-precision FPX instructions, tuned for the fast
14596 implementation.
14598 @item -msimd
14599 @opindex msimd
14600 Enable generation of ARC SIMD instructions via target-specific
14601 builtins.  Only valid for @option{-mcpu=ARC700}.
14603 @item -msoft-float
14604 @opindex msoft-float
14605 This option ignored; it is provided for compatibility purposes only.
14606 Software floating-point code is emitted by default, and this default
14607 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
14608 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
14609 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
14611 @item -mswap
14612 @opindex mswap
14613 Generate @code{swap} instructions.
14615 @item -matomic
14616 @opindex matomic
14617 This enables use of the locked load/store conditional extension to implement
14618 atomic memory built-in functions.  Not available for ARC 6xx or ARC
14619 EM cores.
14621 @item -mdiv-rem
14622 @opindex mdiv-rem
14623 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
14625 @item -mcode-density
14626 @opindex mcode-density
14627 Enable code density instructions for ARC EM.  
14628 This option is on by default for ARC HS.
14630 @item -mll64
14631 @opindex mll64
14632 Enable double load/store operations for ARC HS cores.
14634 @item -mtp-regno=@var{regno}
14635 @opindex mtp-regno
14636 Specify thread pointer register number.
14638 @item -mmpy-option=@var{multo}
14639 @opindex mmpy-option
14640 Compile ARCv2 code with a multiplier design option.  You can specify 
14641 the option using either a string or numeric value for @var{multo}.  
14642 @samp{wlh1} is the default value.  The recognized values are:
14644 @table @samp
14645 @item 0
14646 @itemx none
14647 No multiplier available.
14649 @item 1
14650 @itemx w
14651 16x16 multiplier, fully pipelined.
14652 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
14654 @item 2
14655 @itemx wlh1
14656 32x32 multiplier, fully
14657 pipelined (1 stage).  The following instructions are additionally
14658 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14660 @item 3
14661 @itemx wlh2
14662 32x32 multiplier, fully pipelined
14663 (2 stages).  The following instructions are additionally enabled: @code{mpy},
14664 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14666 @item 4
14667 @itemx wlh3
14668 Two 16x16 multipliers, blocking,
14669 sequential.  The following instructions are additionally enabled: @code{mpy},
14670 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14672 @item 5
14673 @itemx wlh4
14674 One 16x16 multiplier, blocking,
14675 sequential.  The following instructions are additionally enabled: @code{mpy},
14676 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14678 @item 6
14679 @itemx wlh5
14680 One 32x4 multiplier, blocking,
14681 sequential.  The following instructions are additionally enabled: @code{mpy},
14682 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14684 @item 7
14685 @itemx plus_dmpy
14686 ARC HS SIMD support.
14688 @item 8
14689 @itemx plus_macd
14690 ARC HS SIMD support.
14692 @item 9
14693 @itemx plus_qmacw
14694 ARC HS SIMD support.
14696 @end table
14698 This option is only available for ARCv2 cores@.
14700 @item -mfpu=@var{fpu}
14701 @opindex mfpu
14702 Enables support for specific floating-point hardware extensions for ARCv2
14703 cores.  Supported values for @var{fpu} are:
14705 @table @samp
14707 @item fpus
14708 Enables support for single-precision floating-point hardware
14709 extensions@.
14711 @item fpud
14712 Enables support for double-precision floating-point hardware
14713 extensions.  The single-precision floating-point extension is also
14714 enabled.  Not available for ARC EM@.
14716 @item fpuda
14717 Enables support for double-precision floating-point hardware
14718 extensions using double-precision assist instructions.  The single-precision
14719 floating-point extension is also enabled.  This option is
14720 only available for ARC EM@.
14722 @item fpuda_div
14723 Enables support for double-precision floating-point hardware
14724 extensions using double-precision assist instructions.
14725 The single-precision floating-point, square-root, and divide 
14726 extensions are also enabled.  This option is
14727 only available for ARC EM@.
14729 @item fpuda_fma
14730 Enables support for double-precision floating-point hardware
14731 extensions using double-precision assist instructions.
14732 The single-precision floating-point and fused multiply and add 
14733 hardware extensions are also enabled.  This option is
14734 only available for ARC EM@.
14736 @item fpuda_all
14737 Enables support for double-precision floating-point hardware
14738 extensions using double-precision assist instructions.
14739 All single-precision floating-point hardware extensions are also
14740 enabled.  This option is only available for ARC EM@.
14742 @item fpus_div
14743 Enables support for single-precision floating-point, square-root and divide 
14744 hardware extensions@.
14746 @item fpud_div
14747 Enables support for double-precision floating-point, square-root and divide 
14748 hardware extensions.  This option
14749 includes option @samp{fpus_div}. Not available for ARC EM@.
14751 @item fpus_fma
14752 Enables support for single-precision floating-point and 
14753 fused multiply and add hardware extensions@.
14755 @item fpud_fma
14756 Enables support for double-precision floating-point and 
14757 fused multiply and add hardware extensions.  This option
14758 includes option @samp{fpus_fma}.  Not available for ARC EM@.
14760 @item fpus_all
14761 Enables support for all single-precision floating-point hardware
14762 extensions@.
14764 @item fpud_all
14765 Enables support for all single- and double-precision floating-point
14766 hardware extensions.  Not available for ARC EM@.
14768 @end table
14770 @item -mirq-ctrl-saved=@var{register-range}, @var{blink}, @var{lp_count}
14771 @opindex mirq-ctrl-saved
14772 Specifies general-purposes registers that the processor automatically
14773 saves/restores on interrupt entry and exit.  @var{register-range} is
14774 specified as two registers separated by a dash.  The register range
14775 always starts with @code{r0}, the upper limit is @code{fp} register.
14776 @var{blink} and @var{lp_count} are optional.  This option is only
14777 valid for ARC EM and ARC HS cores.
14779 @item -mrgf-banked-regs=@var{number}
14780 @opindex mrgf-banked-regs
14781 Specifies the number of registers replicated in second register bank
14782 on entry to fast interrupt.  Fast interrupts are interrupts with the
14783 highest priority level P0.  These interrupts save only PC and STATUS32
14784 registers to avoid memory transactions during interrupt entry and exit
14785 sequences.  Use this option when you are using fast interrupts in an
14786 ARC V2 family processor.  Permitted values are 4, 8, 16, and 32.
14788 @item -mlpc-width=@var{width}
14789 @opindex mlpc-width
14790 Specify the width of the @code{lp_count} register.  Valid values for
14791 @var{width} are 8, 16, 20, 24, 28 and 32 bits.  The default width is
14792 fixed to 32 bits.  If the width is less than 32, the compiler does not
14793 attempt to transform loops in your program to use the zero-delay loop
14794 mechanism unless it is known that the @code{lp_count} register can
14795 hold the required loop-counter value.  Depending on the width
14796 specified, the compiler and run-time library might continue to use the
14797 loop mechanism for various needs.  This option defines macro
14798 @code{__ARC_LPC_WIDTH__} with the value of @var{width}.
14800 @end table
14802 The following options are passed through to the assembler, and also
14803 define preprocessor macro symbols.
14805 @c Flags used by the assembler, but for which we define preprocessor
14806 @c macro symbols as well.
14807 @table @gcctabopt
14808 @item -mdsp-packa
14809 @opindex mdsp-packa
14810 Passed down to the assembler to enable the DSP Pack A extensions.
14811 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
14812 deprecated.
14814 @item -mdvbf
14815 @opindex mdvbf
14816 Passed down to the assembler to enable the dual Viterbi butterfly
14817 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
14818 option is deprecated.
14820 @c ARC700 4.10 extension instruction
14821 @item -mlock
14822 @opindex mlock
14823 Passed down to the assembler to enable the locked load/store
14824 conditional extension.  Also sets the preprocessor symbol
14825 @code{__Xlock}.
14827 @item -mmac-d16
14828 @opindex mmac-d16
14829 Passed down to the assembler.  Also sets the preprocessor symbol
14830 @code{__Xxmac_d16}.  This option is deprecated.
14832 @item -mmac-24
14833 @opindex mmac-24
14834 Passed down to the assembler.  Also sets the preprocessor symbol
14835 @code{__Xxmac_24}.  This option is deprecated.
14837 @c ARC700 4.10 extension instruction
14838 @item -mrtsc
14839 @opindex mrtsc
14840 Passed down to the assembler to enable the 64-bit time-stamp counter
14841 extension instruction.  Also sets the preprocessor symbol
14842 @code{__Xrtsc}.  This option is deprecated.
14844 @c ARC700 4.10 extension instruction
14845 @item -mswape
14846 @opindex mswape
14847 Passed down to the assembler to enable the swap byte ordering
14848 extension instruction.  Also sets the preprocessor symbol
14849 @code{__Xswape}.
14851 @item -mtelephony
14852 @opindex mtelephony
14853 Passed down to the assembler to enable dual- and single-operand
14854 instructions for telephony.  Also sets the preprocessor symbol
14855 @code{__Xtelephony}.  This option is deprecated.
14857 @item -mxy
14858 @opindex mxy
14859 Passed down to the assembler to enable the XY memory extension.  Also
14860 sets the preprocessor symbol @code{__Xxy}.
14862 @end table
14864 The following options control how the assembly code is annotated:
14866 @c Assembly annotation options
14867 @table @gcctabopt
14868 @item -misize
14869 @opindex misize
14870 Annotate assembler instructions with estimated addresses.
14872 @item -mannotate-align
14873 @opindex mannotate-align
14874 Explain what alignment considerations lead to the decision to make an
14875 instruction short or long.
14877 @end table
14879 The following options are passed through to the linker:
14881 @c options passed through to the linker
14882 @table @gcctabopt
14883 @item -marclinux
14884 @opindex marclinux
14885 Passed through to the linker, to specify use of the @code{arclinux} emulation.
14886 This option is enabled by default in tool chains built for
14887 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
14888 when profiling is not requested.
14890 @item -marclinux_prof
14891 @opindex marclinux_prof
14892 Passed through to the linker, to specify use of the
14893 @code{arclinux_prof} emulation.  This option is enabled by default in
14894 tool chains built for @w{@code{arc-linux-uclibc}} and
14895 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
14897 @end table
14899 The following options control the semantics of generated code:
14901 @c semantically relevant code generation options
14902 @table @gcctabopt
14903 @item -mlong-calls
14904 @opindex mlong-calls
14905 Generate calls as register indirect calls, thus providing access
14906 to the full 32-bit address range.
14908 @item -mmedium-calls
14909 @opindex mmedium-calls
14910 Don't use less than 25-bit addressing range for calls, which is the
14911 offset available for an unconditional branch-and-link
14912 instruction.  Conditional execution of function calls is suppressed, to
14913 allow use of the 25-bit range, rather than the 21-bit range with
14914 conditional branch-and-link.  This is the default for tool chains built
14915 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
14917 @item -G @var{num}
14918 @opindex G
14919 Put definitions of externally-visible data in a small data section if
14920 that data is no bigger than @var{num} bytes.  The default value of
14921 @var{num} is 4 for any ARC configuration, or 8 when we have double
14922 load/store operations.
14924 @item -mno-sdata
14925 @opindex mno-sdata
14926 Do not generate sdata references.  This is the default for tool chains
14927 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
14928 targets.
14930 @item -mvolatile-cache
14931 @opindex mvolatile-cache
14932 Use ordinarily cached memory accesses for volatile references.  This is the
14933 default.
14935 @item -mno-volatile-cache
14936 @opindex mno-volatile-cache
14937 Enable cache bypass for volatile references.
14939 @end table
14941 The following options fine tune code generation:
14942 @c code generation tuning options
14943 @table @gcctabopt
14944 @item -malign-call
14945 @opindex malign-call
14946 Do alignment optimizations for call instructions.
14948 @item -mauto-modify-reg
14949 @opindex mauto-modify-reg
14950 Enable the use of pre/post modify with register displacement.
14952 @item -mbbit-peephole
14953 @opindex mbbit-peephole
14954 Enable bbit peephole2.
14956 @item -mno-brcc
14957 @opindex mno-brcc
14958 This option disables a target-specific pass in @file{arc_reorg} to
14959 generate compare-and-branch (@code{br@var{cc}}) instructions.  
14960 It has no effect on
14961 generation of these instructions driven by the combiner pass.
14963 @item -mcase-vector-pcrel
14964 @opindex mcase-vector-pcrel
14965 Use PC-relative switch case tables to enable case table shortening.
14966 This is the default for @option{-Os}.
14968 @item -mcompact-casesi
14969 @opindex mcompact-casesi
14970 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
14971 and only available for ARCv1 cores.
14973 @item -mno-cond-exec
14974 @opindex mno-cond-exec
14975 Disable the ARCompact-specific pass to generate conditional 
14976 execution instructions.
14978 Due to delay slot scheduling and interactions between operand numbers,
14979 literal sizes, instruction lengths, and the support for conditional execution,
14980 the target-independent pass to generate conditional execution is often lacking,
14981 so the ARC port has kept a special pass around that tries to find more
14982 conditional execution generation opportunities after register allocation,
14983 branch shortening, and delay slot scheduling have been done.  This pass
14984 generally, but not always, improves performance and code size, at the cost of
14985 extra compilation time, which is why there is an option to switch it off.
14986 If you have a problem with call instructions exceeding their allowable
14987 offset range because they are conditionalized, you should consider using
14988 @option{-mmedium-calls} instead.
14990 @item -mearly-cbranchsi
14991 @opindex mearly-cbranchsi
14992 Enable pre-reload use of the @code{cbranchsi} pattern.
14994 @item -mexpand-adddi
14995 @opindex mexpand-adddi
14996 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
14997 @code{add.f}, @code{adc} etc.  This option is deprecated.
14999 @item -mindexed-loads
15000 @opindex mindexed-loads
15001 Enable the use of indexed loads.  This can be problematic because some
15002 optimizers then assume that indexed stores exist, which is not
15003 the case.
15005 @opindex mlra
15006 Enable Local Register Allocation.  This is still experimental for ARC,
15007 so by default the compiler uses standard reload
15008 (i.e. @option{-mno-lra}).
15010 @item -mlra-priority-none
15011 @opindex mlra-priority-none
15012 Don't indicate any priority for target registers.
15014 @item -mlra-priority-compact
15015 @opindex mlra-priority-compact
15016 Indicate target register priority for r0..r3 / r12..r15.
15018 @item -mlra-priority-noncompact
15019 @opindex mlra-priority-noncompact
15020 Reduce target register priority for r0..r3 / r12..r15.
15022 @item -mno-millicode
15023 @opindex mno-millicode
15024 When optimizing for size (using @option{-Os}), prologues and epilogues
15025 that have to save or restore a large number of registers are often
15026 shortened by using call to a special function in libgcc; this is
15027 referred to as a @emph{millicode} call.  As these calls can pose
15028 performance issues, and/or cause linking issues when linking in a
15029 nonstandard way, this option is provided to turn off millicode call
15030 generation.
15032 @item -mmixed-code
15033 @opindex mmixed-code
15034 Tweak register allocation to help 16-bit instruction generation.
15035 This generally has the effect of decreasing the average instruction size
15036 while increasing the instruction count.
15038 @item -mq-class
15039 @opindex mq-class
15040 Enable @samp{q} instruction alternatives.
15041 This is the default for @option{-Os}.
15043 @item -mRcq
15044 @opindex mRcq
15045 Enable @samp{Rcq} constraint handling.  
15046 Most short code generation depends on this.
15047 This is the default.
15049 @item -mRcw
15050 @opindex mRcw
15051 Enable @samp{Rcw} constraint handling.  
15052 Most ccfsm condexec mostly depends on this.
15053 This is the default.
15055 @item -msize-level=@var{level}
15056 @opindex msize-level
15057 Fine-tune size optimization with regards to instruction lengths and alignment.
15058 The recognized values for @var{level} are:
15059 @table @samp
15060 @item 0
15061 No size optimization.  This level is deprecated and treated like @samp{1}.
15063 @item 1
15064 Short instructions are used opportunistically.
15066 @item 2
15067 In addition, alignment of loops and of code after barriers are dropped.
15069 @item 3
15070 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
15072 @end table
15074 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
15075 the behavior when this is not set is equivalent to level @samp{1}.
15077 @item -mtune=@var{cpu}
15078 @opindex mtune
15079 Set instruction scheduling parameters for @var{cpu}, overriding any implied
15080 by @option{-mcpu=}.
15082 Supported values for @var{cpu} are
15084 @table @samp
15085 @item ARC600
15086 Tune for ARC600 CPU.
15088 @item ARC601
15089 Tune for ARC601 CPU.
15091 @item ARC700
15092 Tune for ARC700 CPU with standard multiplier block.
15094 @item ARC700-xmac
15095 Tune for ARC700 CPU with XMAC block.
15097 @item ARC725D
15098 Tune for ARC725D CPU.
15100 @item ARC750D
15101 Tune for ARC750D CPU.
15103 @end table
15105 @item -mmultcost=@var{num}
15106 @opindex mmultcost
15107 Cost to assume for a multiply instruction, with @samp{4} being equal to a
15108 normal instruction.
15110 @item -munalign-prob-threshold=@var{probability}
15111 @opindex munalign-prob-threshold
15112 Set probability threshold for unaligning branches.
15113 When tuning for @samp{ARC700} and optimizing for speed, branches without
15114 filled delay slot are preferably emitted unaligned and long, unless
15115 profiling indicates that the probability for the branch to be taken
15116 is below @var{probability}.  @xref{Cross-profiling}.
15117 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
15119 @end table
15121 The following options are maintained for backward compatibility, but
15122 are now deprecated and will be removed in a future release:
15124 @c Deprecated options
15125 @table @gcctabopt
15127 @item -margonaut
15128 @opindex margonaut
15129 Obsolete FPX.
15131 @item -mbig-endian
15132 @opindex mbig-endian
15133 @itemx -EB
15134 @opindex EB
15135 Compile code for big-endian targets.  Use of these options is now
15136 deprecated.  Big-endian code is supported by configuring GCC to build
15137 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
15138 for which big endian is the default.
15140 @item -mlittle-endian
15141 @opindex mlittle-endian
15142 @itemx -EL
15143 @opindex EL
15144 Compile code for little-endian targets.  Use of these options is now
15145 deprecated.  Little-endian code is supported by configuring GCC to build 
15146 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
15147 for which little endian is the default.
15149 @item -mbarrel_shifter
15150 @opindex mbarrel_shifter
15151 Replaced by @option{-mbarrel-shifter}.
15153 @item -mdpfp_compact
15154 @opindex mdpfp_compact
15155 Replaced by @option{-mdpfp-compact}.
15157 @item -mdpfp_fast
15158 @opindex mdpfp_fast
15159 Replaced by @option{-mdpfp-fast}.
15161 @item -mdsp_packa
15162 @opindex mdsp_packa
15163 Replaced by @option{-mdsp-packa}.
15165 @item -mEA
15166 @opindex mEA
15167 Replaced by @option{-mea}.
15169 @item -mmac_24
15170 @opindex mmac_24
15171 Replaced by @option{-mmac-24}.
15173 @item -mmac_d16
15174 @opindex mmac_d16
15175 Replaced by @option{-mmac-d16}.
15177 @item -mspfp_compact
15178 @opindex mspfp_compact
15179 Replaced by @option{-mspfp-compact}.
15181 @item -mspfp_fast
15182 @opindex mspfp_fast
15183 Replaced by @option{-mspfp-fast}.
15185 @item -mtune=@var{cpu}
15186 @opindex mtune
15187 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
15188 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
15189 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
15191 @item -multcost=@var{num}
15192 @opindex multcost
15193 Replaced by @option{-mmultcost}.
15195 @end table
15197 @node ARM Options
15198 @subsection ARM Options
15199 @cindex ARM options
15201 These @samp{-m} options are defined for the ARM port:
15203 @table @gcctabopt
15204 @item -mabi=@var{name}
15205 @opindex mabi
15206 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
15207 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
15209 @item -mapcs-frame
15210 @opindex mapcs-frame
15211 Generate a stack frame that is compliant with the ARM Procedure Call
15212 Standard for all functions, even if this is not strictly necessary for
15213 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
15214 with this option causes the stack frames not to be generated for
15215 leaf functions.  The default is @option{-mno-apcs-frame}.
15216 This option is deprecated.
15218 @item -mapcs
15219 @opindex mapcs
15220 This is a synonym for @option{-mapcs-frame} and is deprecated.
15222 @ignore
15223 @c not currently implemented
15224 @item -mapcs-stack-check
15225 @opindex mapcs-stack-check
15226 Generate code to check the amount of stack space available upon entry to
15227 every function (that actually uses some stack space).  If there is
15228 insufficient space available then either the function
15229 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
15230 called, depending upon the amount of stack space required.  The runtime
15231 system is required to provide these functions.  The default is
15232 @option{-mno-apcs-stack-check}, since this produces smaller code.
15234 @c not currently implemented
15235 @item -mapcs-reentrant
15236 @opindex mapcs-reentrant
15237 Generate reentrant, position-independent code.  The default is
15238 @option{-mno-apcs-reentrant}.
15239 @end ignore
15241 @item -mthumb-interwork
15242 @opindex mthumb-interwork
15243 Generate code that supports calling between the ARM and Thumb
15244 instruction sets.  Without this option, on pre-v5 architectures, the
15245 two instruction sets cannot be reliably used inside one program.  The
15246 default is @option{-mno-thumb-interwork}, since slightly larger code
15247 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
15248 configurations this option is meaningless.
15250 @item -mno-sched-prolog
15251 @opindex mno-sched-prolog
15252 Prevent the reordering of instructions in the function prologue, or the
15253 merging of those instruction with the instructions in the function's
15254 body.  This means that all functions start with a recognizable set
15255 of instructions (or in fact one of a choice from a small set of
15256 different function prologues), and this information can be used to
15257 locate the start of functions inside an executable piece of code.  The
15258 default is @option{-msched-prolog}.
15260 @item -mfloat-abi=@var{name}
15261 @opindex mfloat-abi
15262 Specifies which floating-point ABI to use.  Permissible values
15263 are: @samp{soft}, @samp{softfp} and @samp{hard}.
15265 Specifying @samp{soft} causes GCC to generate output containing
15266 library calls for floating-point operations.
15267 @samp{softfp} allows the generation of code using hardware floating-point
15268 instructions, but still uses the soft-float calling conventions.
15269 @samp{hard} allows generation of floating-point instructions
15270 and uses FPU-specific calling conventions.
15272 The default depends on the specific target configuration.  Note that
15273 the hard-float and soft-float ABIs are not link-compatible; you must
15274 compile your entire program with the same ABI, and link with a
15275 compatible set of libraries.
15277 @item -mlittle-endian
15278 @opindex mlittle-endian
15279 Generate code for a processor running in little-endian mode.  This is
15280 the default for all standard configurations.
15282 @item -mbig-endian
15283 @opindex mbig-endian
15284 Generate code for a processor running in big-endian mode; the default is
15285 to compile code for a little-endian processor.
15287 @item -mbe8
15288 @itemx -mbe32
15289 @opindex mbe8
15290 When linking a big-endian image select between BE8 and BE32 formats.
15291 The option has no effect for little-endian images and is ignored.  The
15292 default is dependent on the selected target architecture.  For ARMv6
15293 and later architectures the default is BE8, for older architectures
15294 the default is BE32.  BE32 format has been deprecated by ARM.
15296 @item -march=@var{name}@r{[}+extension@dots{}@r{]}
15297 @opindex march
15298 This specifies the name of the target ARM architecture.  GCC uses this
15299 name to determine what kind of instructions it can emit when generating
15300 assembly code.  This option can be used in conjunction with or instead
15301 of the @option{-mcpu=} option.
15303 Permissible names are:
15304 @samp{armv4t},
15305 @samp{armv5t}, @samp{armv5te},
15306 @samp{armv6}, @samp{armv6j}, @samp{armv6k}, @samp{armv6kz}, @samp{armv6t2},
15307 @samp{armv6z}, @samp{armv6zk},
15308 @samp{armv7}, @samp{armv7-a}, @samp{armv7ve}, 
15309 @samp{armv8-a}, @samp{armv8.1-a}, @samp{armv8.2-a},
15310 @samp{armv7-r},
15311 @samp{armv8-r},
15312 @samp{armv6-m}, @samp{armv6s-m},
15313 @samp{armv7-m}, @samp{armv7e-m},
15314 @samp{armv8-m.base}, @samp{armv8-m.main},
15315 @samp{iwmmxt} and @samp{iwmmxt2}.
15317 Additionally, the following architectures, which lack support for the
15318 Thumb exection state, are recognized but support is deprecated:
15319 @samp{armv2}, @samp{armv2a}, @samp{armv3}, @samp{armv3m},
15320 @samp{armv4}, @samp{armv5} and @samp{armv5e}.
15322 Many of the architectures support extensions.  These can be added by
15323 appending @samp{+@var{extension}} to the architecture name.  Extension
15324 options are processed in order and capabilities accumulate.  An extension
15325 will also enable any necessary base extensions
15326 upon which it depends.  For example, the @samp{+crypto} extension
15327 will always enable the @samp{+simd} extension.  The exception to the
15328 additive construction is for extensions that are prefixed with
15329 @samp{+no@dots{}}: these extensions disable the specified option and
15330 any other extensions that may depend on the presence of that
15331 extension.
15333 For example, @samp{-march=armv7-a+simd+nofp+vfpv4} is equivalent to
15334 writing @samp{-march=armv7-a+vfpv4} since the @samp{+simd} option is
15335 entirely disabled by the @samp{+nofp} option that follows it.
15337 Most extension names are generically named, but have an effect that is
15338 dependent upon the architecture to which it is applied.  For example,
15339 the @samp{+simd} option can be applied to both @samp{armv7-a} and
15340 @samp{armv8-a} architectures, but will enable the original ARMv7
15341 Advanced SIMD (Neon) extensions for @samp{armv7-a} and the ARMv8-a
15342 variant for @samp{armv8-a}.
15344 The table below lists the supported extensions for each architecture.
15345 Architectures not mentioned do not support any extensions.
15347 @table @samp
15348 @item  armv5e
15349 @itemx armv5te
15350 @itemx armv6
15351 @itemx armv6j
15352 @itemx armv6k
15353 @itemx armv6kz
15354 @itemx armv6t2
15355 @itemx armv6z
15356 @itemx armv6zk
15357 @table @samp
15358 @item +fp
15359 The VFPv2 floating-point instructions.  The extension @samp{+vfpv2} can be
15360 used as an alias for this extension.
15362 @item +nofp
15363 Disable the floating-point instructions.
15364 @end table
15366 @item armv7
15367 The common subset of the ARMv7-A, ARMv7-R and ARMv7-M architectures.
15368 @table @samp
15369 @item +fp
15370 The VFPv3 floating-point instructions, with 16 double-precision
15371 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
15372 for this extension.  Note that floating-point is not supported by the
15373 base ARMv7-M architecture, but is compatible with both the ARMv7-A and
15374 ARMv7-R architectures.
15376 @item +nofp
15377 Disable the floating-point instructions.
15378 @end table
15380 @item armv7-a
15381 @table @samp
15382 @item +fp
15383 The VFPv3 floating-point instructions, with 16 double-precision
15384 registers.  The extension @samp{+vfpv3-d16} can be used as an alias
15385 for this extension.
15387 @item +simd
15388 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
15389 The extensions @samp{+neon} and @samp{+neon-vfpv3} can be used as aliases
15390 for this extension.
15392 @item +vfpv3
15393 The VFPv3 floating-point instructions, with 32 double-precision
15394 registers.
15396 @item +vfpv3-d16-fp16
15397 The VFPv3 floating-point instructions, with 16 double-precision
15398 registers and the half-precision floating-point conversion operations.
15400 @item +vfpv3-fp16
15401 The VFPv3 floating-point instructions, with 32 double-precision
15402 registers and the half-precision floating-point conversion operations.
15404 @item +vfpv4-d16
15405 The VFPv4 floating-point instructions, with 16 double-precision
15406 registers.
15408 @item +vfpv4
15409 The VFPv4 floating-point instructions, with 32 double-precision
15410 registers.
15412 @item +neon-fp16
15413 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
15414 the half-precision floating-point conversion operations.
15416 @item +neon-vfpv4
15417 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.
15419 @item +nosimd
15420 Disable the Advanced SIMD instructions (does not disable floating point).
15422 @item +nofp
15423 Disable the floating-point and Advanced SIMD instructions.
15424 @end table
15426 @item armv7ve
15427 The extended version of the ARMv7-A architecture with support for
15428 virtualization.
15429 @table @samp
15430 @item +fp
15431 The VFPv4 floating-point instructions, with 16 double-precision registers.
15432 The extension @samp{+vfpv4-d16} can be used as an alias for this extension.
15434 @item +simd
15435 The Advanced SIMD (Neon) v2 and the VFPv4 floating-point instructions.  The
15436 extension @samp{+neon-vfpv4} can be used as an alias for this extension.
15438 @item +vfpv3-d16
15439 The VFPv3 floating-point instructions, with 16 double-precision
15440 registers.
15442 @item +vfpv3
15443 The VFPv3 floating-point instructions, with 32 double-precision
15444 registers.
15446 @item +vfpv3-d16-fp16
15447 The VFPv3 floating-point instructions, with 16 double-precision
15448 registers and the half-precision floating-point conversion operations.
15450 @item +vfpv3-fp16
15451 The VFPv3 floating-point instructions, with 32 double-precision
15452 registers and the half-precision floating-point conversion operations.
15454 @item +vfpv4-d16
15455 The VFPv4 floating-point instructions, with 16 double-precision
15456 registers.
15458 @item +vfpv4
15459 The VFPv4 floating-point instructions, with 32 double-precision
15460 registers.
15462 @item +neon
15463 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions.
15464 The extension @samp{+neon-vfpv3} can be used as an alias for this extension.
15466 @item +neon-fp16
15467 The Advanced SIMD (Neon) v1 and the VFPv3 floating-point instructions, with
15468 the half-precision floating-point conversion operations.
15470 @item +nosimd
15471 Disable the Advanced SIMD instructions (does not disable floating point).
15473 @item +nofp
15474 Disable the floating-point and Advanced SIMD instructions.
15475 @end table
15477 @item armv8-a
15478 @table @samp
15479 @item +crc
15480 The Cyclic Redundancy Check (CRC) instructions.
15481 @item +simd
15482 The ARMv8 Advanced SIMD and floating-point instructions.
15483 @item +crypto
15484 The cryptographic instructions.
15485 @item +nocrypto
15486 Disable the cryptographic isntructions.
15487 @item +nofp
15488 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15489 @end table
15491 @item armv8.1-a
15492 @table @samp
15493 @item +simd
15494 The ARMv8.1 Advanced SIMD and floating-point instructions.
15496 @item +crypto
15497 The cryptographic instructions.  This also enables the Advanced SIMD and
15498 floating-point instructions.
15500 @item +nocrypto
15501 Disable the cryptographic isntructions.
15503 @item +nofp
15504 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15505 @end table
15507 @item armv8.2-a
15508 @table @samp
15509 @item +fp16
15510 The half-precision floating-point data processing instructions.
15511 This also enables the Advanced SIMD and floating-point instructions.
15513 @item +simd
15514 The ARMv8.1 Advanced SIMD and floating-point instructions.
15516 @item +crypto
15517 The cryptographic instructions.  This also enables the Advanced SIMD and
15518 floating-point instructions.
15520 @item +nocrypto
15521 Disable the cryptographic extension.
15523 @item +nofp
15524 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15525 @end table
15527 @item armv7-r
15528 @table @samp
15529 @item +fp.sp
15530 The single-precision VFPv3 floating-point instructions.  The extension
15531 @samp{+vfpv3xd} can be used as an alias for this extension.
15533 @item +fp
15534 The VFPv3 floating-point instructions with 16 double-precision registers.
15535 The extension +vfpv3-d16 can be used as an alias for this extension.
15537 @item +nofp
15538 Disable the floating-point extension.
15540 @item +idiv
15541 The ARM-state integer division instructions.
15543 @item +noidiv
15544 Disable the ARM-state integer division extension.
15545 @end table
15547 @item armv7e-m
15548 @table @samp
15549 @item +fp
15550 The single-precision VFPv4 floating-point instructions.
15552 @item +fpv5
15553 The single-precision FPv5 floating-point instructions.
15555 @item +fp.dp
15556 The single- and double-precision FPv5 floating-point instructions.
15558 @item +nofp
15559 Disable the floating-point extensions.
15560 @end table
15562 @item  armv8-m.main
15563 @table @samp
15564 @item +dsp
15565 The DSP instructions.
15567 @item +nodsp
15568 Disable the DSP extension.
15570 @item +fp
15571 The single-precision floating-point instructions.
15573 @item +fp.dp
15574 The single- and double-precision floating-point instructions.
15576 @item +nofp
15577 Disable the floating-point extension.
15578 @end table
15580 @item armv8-r
15581 @table @samp
15582 @item +crc
15583 The Cyclic Redundancy Check (CRC) instructions.
15584 @item +fp.sp
15585 The single-precision FPv5 floating-point instructions.
15586 @item +simd
15587 The ARMv8 Advanced SIMD and floating-point instructions.
15588 @item +crypto
15589 The cryptographic instructions.
15590 @item +nocrypto
15591 Disable the cryptographic isntructions.
15592 @item +nofp
15593 Disable the floating-point, Advanced SIMD and cryptographic instructions.
15594 @end table
15596 @end table
15598 @option{-march=native} causes the compiler to auto-detect the architecture
15599 of the build computer.  At present, this feature is only supported on
15600 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15601 is unsuccessful the option has no effect.
15603 @item -mtune=@var{name}
15604 @opindex mtune
15605 This option specifies the name of the target ARM processor for
15606 which GCC should tune the performance of the code.
15607 For some ARM implementations better performance can be obtained by using
15608 this option.
15609 Permissible names are: @samp{arm2}, @samp{arm250},
15610 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
15611 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
15612 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
15613 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
15614 @samp{arm720},
15615 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
15616 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
15617 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
15618 @samp{strongarm1110},
15619 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
15620 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
15621 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
15622 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
15623 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
15624 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
15625 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
15626 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
15627 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
15628 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55},
15629 @samp{cortex-a57}, @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75},
15630 @samp{cortex-r4}, @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7},
15631 @samp{cortex-r8}, @samp{cortex-r52},
15632 @samp{cortex-m33},
15633 @samp{cortex-m23},
15634 @samp{cortex-m7},
15635 @samp{cortex-m4},
15636 @samp{cortex-m3},
15637 @samp{cortex-m1},
15638 @samp{cortex-m0},
15639 @samp{cortex-m0plus},
15640 @samp{cortex-m1.small-multiply},
15641 @samp{cortex-m0.small-multiply},
15642 @samp{cortex-m0plus.small-multiply},
15643 @samp{exynos-m1},
15644 @samp{marvell-pj4},
15645 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
15646 @samp{fa526}, @samp{fa626},
15647 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
15648 @samp{xgene1}.
15650 Additionally, this option can specify that GCC should tune the performance
15651 of the code for a big.LITTLE system.  Permissible names are:
15652 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
15653 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15654 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53},
15655 @samp{cortex-a75.cortex-a55}.
15657 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
15658 performance for a blend of processors within architecture @var{arch}.
15659 The aim is to generate code that run well on the current most popular
15660 processors, balancing between optimizations that benefit some CPUs in the
15661 range, and avoiding performance pitfalls of other CPUs.  The effects of
15662 this option may change in future GCC versions as CPU models come and go.
15664 @option{-mtune} permits the same extension options as @option{-mcpu}, but
15665 the extension options do not affect the tuning of the generated code.
15667 @option{-mtune=native} causes the compiler to auto-detect the CPU
15668 of the build computer.  At present, this feature is only supported on
15669 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
15670 unsuccessful the option has no effect.
15672 @item -mcpu=@var{name}@r{[}+extension@dots{}@r{]}
15673 @opindex mcpu
15674 This specifies the name of the target ARM processor.  GCC uses this name
15675 to derive the name of the target ARM architecture (as if specified
15676 by @option{-march}) and the ARM processor type for which to tune for
15677 performance (as if specified by @option{-mtune}).  Where this option
15678 is used in conjunction with @option{-march} or @option{-mtune},
15679 those options take precedence over the appropriate part of this option.
15681 Many of the supported CPUs implement optional architectural
15682 extensions.  Where this is so the architectural extensions are
15683 normally enabled by default.  If implementations that lack the
15684 extension exist, then the extension syntax can be used to disable
15685 those extensions that have been omitted.  For floating-point and
15686 Advanced SIMD (Neon) instructions, the settings of the options
15687 @option{-mfloat-abi} and @option{-mfpu} must also be considered:
15688 floating-point and Advanced SIMD instructions will only be used if
15689 @option{-mfloat-abi} is not set to @samp{soft}; and any setting of
15690 @option{-mfpu} other than @samp{auto} will override the available
15691 floating-point and SIMD extension instructions.
15693 For example, @samp{cortex-a9} can be found in three major
15694 configurations: integer only, with just a floating-point unit or with
15695 floating-point and Advanced SIMD.  The default is to enable all the
15696 instructions, but the extensions @samp{+nosimd} and @samp{+nofp} can
15697 be used to disable just the SIMD or both the SIMD and floating-point
15698 instructions respectively.
15700 Permissible names for this option are the same as those for
15701 @option{-mtune}.
15703 The following extension options are common to the listed CPUs:
15705 @table @samp
15706 @item  +nofp
15707 Disables the floating-point instructions on @samp{arm9e},
15708 @samp{arm946e-s}, @samp{arm966e-s}, @samp{arm968e-s}, @samp{arm10e},
15709 @samp{arm1020e}, @samp{arm1022e}, @samp{arm926ej-s},
15710 @samp{arm1026ej-s}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
15711 @samp{cortex-m4}, @samp{cortex-m7} and @samp{cortex-m33}.
15712 Disables the floating-point and SIMD instructions on
15713 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7},
15714 @samp{cortex-a8}, @samp{cortex-a9}, @samp{cortex-a12},
15715 @samp{cortex-a15}, @samp{cortex-a17}, @samp{cortex-a15.cortex-a7},
15716 @samp{cortex-a17.cortex-a7}, @samp{cortex-a32}, @samp{cortex-a35},
15717 @samp{cortex-a53} and @samp{cortex-a55}.
15719 @item +nofp.dp
15720 Disables the double-precision component of the floating-point instructions
15721 on @samp{cortex-r5}, @samp{cortex-r52} and @samp{cortex-m7}.
15723 @item +nosimd
15724 Disables the SIMD (but not floating-point) instructions on
15725 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}
15726 and @samp{cortex-a9}.
15728 @item +crypto
15729 Enables the cryptographic instructions on @samp{cortex-a32},
15730 @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a55}, @samp{cortex-a57},
15731 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-a75}, @samp{exynos-m1},
15732 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15733 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53} and
15734 @samp{cortex-a75.cortex-a55}.
15735 @end table
15737 Additionally the @samp{generic-armv7-a} pseudo target defaults to
15738 VFPv3 with 16 double-precision registers.  It supports the following
15739 extension options: @samp{vfpv3-d16}, @samp{vfpv3},
15740 @samp{vfpv3-d16-fp16}, @samp{vfpv3-fp16}, @samp{vfpv4-d16},
15741 @samp{vfpv4}, @samp{neon}, @samp{neon-vfpv3}, @samp{neon-fp16},
15742 @samp{neon-vfpv4}.  The meanings are the same as for the extensions to
15743 @option{-march=armv7-a}.
15745 @option{-mcpu=generic-@var{arch}} is also permissible, and is
15746 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
15747 See @option{-mtune} for more information.
15749 @option{-mcpu=native} causes the compiler to auto-detect the CPU
15750 of the build computer.  At present, this feature is only supported on
15751 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15752 is unsuccessful the option has no effect.
15754 @item -mfpu=@var{name}
15755 @opindex mfpu
15756 This specifies what floating-point hardware (or hardware emulation) is
15757 available on the target.  Permissible names are: @samp{auto}, @samp{vfpv2},
15758 @samp{vfpv3},
15759 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
15760 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
15761 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
15762 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
15763 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
15764 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
15765 is an alias for @samp{vfpv2}.
15767 The setting @samp{auto} is the default and is special.  It causes the
15768 compiler to select the floating-point and Advanced SIMD instructions
15769 based on the settings of @option{-mcpu} and @option{-march}.
15771 If the selected floating-point hardware includes the NEON extension
15772 (e.g. @option{-mfpu=neon}), note that floating-point
15773 operations are not generated by GCC's auto-vectorization pass unless
15774 @option{-funsafe-math-optimizations} is also specified.  This is
15775 because NEON hardware does not fully implement the IEEE 754 standard for
15776 floating-point arithmetic (in particular denormal values are treated as
15777 zero), so the use of NEON instructions may lead to a loss of precision.
15779 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}).
15781 @item -mfp16-format=@var{name}
15782 @opindex mfp16-format
15783 Specify the format of the @code{__fp16} half-precision floating-point type.
15784 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
15785 the default is @samp{none}, in which case the @code{__fp16} type is not
15786 defined.  @xref{Half-Precision}, for more information.
15788 @item -mstructure-size-boundary=@var{n}
15789 @opindex mstructure-size-boundary
15790 The sizes of all structures and unions are rounded up to a multiple
15791 of the number of bits set by this option.  Permissible values are 8, 32
15792 and 64.  The default value varies for different toolchains.  For the COFF
15793 targeted toolchain the default value is 8.  A value of 64 is only allowed
15794 if the underlying ABI supports it.
15796 Specifying a larger number can produce faster, more efficient code, but
15797 can also increase the size of the program.  Different values are potentially
15798 incompatible.  Code compiled with one value cannot necessarily expect to
15799 work with code or libraries compiled with another value, if they exchange
15800 information using structures or unions.
15802 This option is deprecated.
15804 @item -mabort-on-noreturn
15805 @opindex mabort-on-noreturn
15806 Generate a call to the function @code{abort} at the end of a
15807 @code{noreturn} function.  It is executed if the function tries to
15808 return.
15810 @item -mlong-calls
15811 @itemx -mno-long-calls
15812 @opindex mlong-calls
15813 @opindex mno-long-calls
15814 Tells the compiler to perform function calls by first loading the
15815 address of the function into a register and then performing a subroutine
15816 call on this register.  This switch is needed if the target function
15817 lies outside of the 64-megabyte addressing range of the offset-based
15818 version of subroutine call instruction.
15820 Even if this switch is enabled, not all function calls are turned
15821 into long calls.  The heuristic is that static functions, functions
15822 that have the @code{short_call} attribute, functions that are inside
15823 the scope of a @code{#pragma no_long_calls} directive, and functions whose
15824 definitions have already been compiled within the current compilation
15825 unit are not turned into long calls.  The exceptions to this rule are
15826 that weak function definitions, functions with the @code{long_call}
15827 attribute or the @code{section} attribute, and functions that are within
15828 the scope of a @code{#pragma long_calls} directive are always
15829 turned into long calls.
15831 This feature is not enabled by default.  Specifying
15832 @option{-mno-long-calls} restores the default behavior, as does
15833 placing the function calls within the scope of a @code{#pragma
15834 long_calls_off} directive.  Note these switches have no effect on how
15835 the compiler generates code to handle function calls via function
15836 pointers.
15838 @item -msingle-pic-base
15839 @opindex msingle-pic-base
15840 Treat the register used for PIC addressing as read-only, rather than
15841 loading it in the prologue for each function.  The runtime system is
15842 responsible for initializing this register with an appropriate value
15843 before execution begins.
15845 @item -mpic-register=@var{reg}
15846 @opindex mpic-register
15847 Specify the register to be used for PIC addressing.
15848 For standard PIC base case, the default is any suitable register
15849 determined by compiler.  For single PIC base case, the default is
15850 @samp{R9} if target is EABI based or stack-checking is enabled,
15851 otherwise the default is @samp{R10}.
15853 @item -mpic-data-is-text-relative
15854 @opindex mpic-data-is-text-relative
15855 Assume that the displacement between the text and data segments is fixed
15856 at static link time.  This permits using PC-relative addressing
15857 operations to access data known to be in the data segment.  For
15858 non-VxWorks RTP targets, this option is enabled by default.  When
15859 disabled on such targets, it will enable @option{-msingle-pic-base} by
15860 default.
15862 @item -mpoke-function-name
15863 @opindex mpoke-function-name
15864 Write the name of each function into the text section, directly
15865 preceding the function prologue.  The generated code is similar to this:
15867 @smallexample
15868      t0
15869          .ascii "arm_poke_function_name", 0
15870          .align
15871      t1
15872          .word 0xff000000 + (t1 - t0)
15873      arm_poke_function_name
15874          mov     ip, sp
15875          stmfd   sp!, @{fp, ip, lr, pc@}
15876          sub     fp, ip, #4
15877 @end smallexample
15879 When performing a stack backtrace, code can inspect the value of
15880 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
15881 location @code{pc - 12} and the top 8 bits are set, then we know that
15882 there is a function name embedded immediately preceding this location
15883 and has length @code{((pc[-3]) & 0xff000000)}.
15885 @item -mthumb
15886 @itemx -marm
15887 @opindex marm
15888 @opindex mthumb
15890 Select between generating code that executes in ARM and Thumb
15891 states.  The default for most configurations is to generate code
15892 that executes in ARM state, but the default can be changed by
15893 configuring GCC with the @option{--with-mode=}@var{state}
15894 configure option.
15896 You can also override the ARM and Thumb mode for each function
15897 by using the @code{target("thumb")} and @code{target("arm")} function attributes
15898 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
15900 @item -mtpcs-frame
15901 @opindex mtpcs-frame
15902 Generate a stack frame that is compliant with the Thumb Procedure Call
15903 Standard for all non-leaf functions.  (A leaf function is one that does
15904 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
15906 @item -mtpcs-leaf-frame
15907 @opindex mtpcs-leaf-frame
15908 Generate a stack frame that is compliant with the Thumb Procedure Call
15909 Standard for all leaf functions.  (A leaf function is one that does
15910 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
15912 @item -mcallee-super-interworking
15913 @opindex mcallee-super-interworking
15914 Gives all externally visible functions in the file being compiled an ARM
15915 instruction set header which switches to Thumb mode before executing the
15916 rest of the function.  This allows these functions to be called from
15917 non-interworking code.  This option is not valid in AAPCS configurations
15918 because interworking is enabled by default.
15920 @item -mcaller-super-interworking
15921 @opindex mcaller-super-interworking
15922 Allows calls via function pointers (including virtual functions) to
15923 execute correctly regardless of whether the target code has been
15924 compiled for interworking or not.  There is a small overhead in the cost
15925 of executing a function pointer if this option is enabled.  This option
15926 is not valid in AAPCS configurations because interworking is enabled
15927 by default.
15929 @item -mtp=@var{name}
15930 @opindex mtp
15931 Specify the access model for the thread local storage pointer.  The valid
15932 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
15933 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
15934 (supported in the arm6k architecture), and @samp{auto}, which uses the
15935 best available method for the selected processor.  The default setting is
15936 @samp{auto}.
15938 @item -mtls-dialect=@var{dialect}
15939 @opindex mtls-dialect
15940 Specify the dialect to use for accessing thread local storage.  Two
15941 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
15942 @samp{gnu} dialect selects the original GNU scheme for supporting
15943 local and global dynamic TLS models.  The @samp{gnu2} dialect
15944 selects the GNU descriptor scheme, which provides better performance
15945 for shared libraries.  The GNU descriptor scheme is compatible with
15946 the original scheme, but does require new assembler, linker and
15947 library support.  Initial and local exec TLS models are unaffected by
15948 this option and always use the original scheme.
15950 @item -mword-relocations
15951 @opindex mword-relocations
15952 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
15953 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
15954 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
15955 is specified.
15957 @item -mfix-cortex-m3-ldrd
15958 @opindex mfix-cortex-m3-ldrd
15959 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
15960 with overlapping destination and base registers are used.  This option avoids
15961 generating these instructions.  This option is enabled by default when
15962 @option{-mcpu=cortex-m3} is specified.
15964 @item -munaligned-access
15965 @itemx -mno-unaligned-access
15966 @opindex munaligned-access
15967 @opindex mno-unaligned-access
15968 Enables (or disables) reading and writing of 16- and 32- bit values
15969 from addresses that are not 16- or 32- bit aligned.  By default
15970 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
15971 ARMv8-M Baseline architectures, and enabled for all other
15972 architectures.  If unaligned access is not enabled then words in packed
15973 data structures are accessed a byte at a time.
15975 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
15976 generated object file to either true or false, depending upon the
15977 setting of this option.  If unaligned access is enabled then the
15978 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
15979 defined.
15981 @item -mneon-for-64bits
15982 @opindex mneon-for-64bits
15983 Enables using Neon to handle scalar 64-bits operations. This is
15984 disabled by default since the cost of moving data from core registers
15985 to Neon is high.
15987 @item -mslow-flash-data
15988 @opindex mslow-flash-data
15989 Assume loading data from flash is slower than fetching instruction.
15990 Therefore literal load is minimized for better performance.
15991 This option is only supported when compiling for ARMv7 M-profile and
15992 off by default.
15994 @item -masm-syntax-unified
15995 @opindex masm-syntax-unified
15996 Assume inline assembler is using unified asm syntax.  The default is
15997 currently off which implies divided syntax.  This option has no impact
15998 on Thumb2. However, this may change in future releases of GCC.
15999 Divided syntax should be considered deprecated.
16001 @item -mrestrict-it
16002 @opindex mrestrict-it
16003 Restricts generation of IT blocks to conform to the rules of ARMv8.
16004 IT blocks can only contain a single 16-bit instruction from a select
16005 set of instructions. This option is on by default for ARMv8 Thumb mode.
16007 @item -mprint-tune-info
16008 @opindex mprint-tune-info
16009 Print CPU tuning information as comment in assembler file.  This is
16010 an option used only for regression testing of the compiler and not
16011 intended for ordinary use in compiling code.  This option is disabled
16012 by default.
16014 @item -mpure-code
16015 @opindex mpure-code
16016 Do not allow constant data to be placed in code sections.
16017 Additionally, when compiling for ELF object format give all text sections the
16018 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
16019 is only available when generating non-pic code for M-profile targets with the
16020 MOVT instruction.
16022 @item -mcmse
16023 @opindex mcmse
16024 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
16025 Development Tools Engineering Specification", which can be found on
16026 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
16027 @end table
16029 @node AVR Options
16030 @subsection AVR Options
16031 @cindex AVR Options
16033 These options are defined for AVR implementations:
16035 @table @gcctabopt
16036 @item -mmcu=@var{mcu}
16037 @opindex mmcu
16038 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
16040 The default for this option is@tie{}@samp{avr2}.
16042 GCC supports the following AVR devices and ISAs:
16044 @include avr-mmcu.texi
16046 @item -mabsdata
16047 @opindex mabsdata
16049 Assume that all data in static storage can be accessed by LDS / STS
16050 instructions.  This option has only an effect on reduced Tiny devices like
16051 ATtiny40.  See also the @code{absdata}
16052 @ref{AVR Variable Attributes,variable attribute}.
16054 @item -maccumulate-args
16055 @opindex maccumulate-args
16056 Accumulate outgoing function arguments and acquire/release the needed
16057 stack space for outgoing function arguments once in function
16058 prologue/epilogue.  Without this option, outgoing arguments are pushed
16059 before calling a function and popped afterwards.
16061 Popping the arguments after the function call can be expensive on
16062 AVR so that accumulating the stack space might lead to smaller
16063 executables because arguments need not be removed from the
16064 stack after such a function call.
16066 This option can lead to reduced code size for functions that perform
16067 several calls to functions that get their arguments on the stack like
16068 calls to printf-like functions.
16070 @item -mbranch-cost=@var{cost}
16071 @opindex mbranch-cost
16072 Set the branch costs for conditional branch instructions to
16073 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
16074 integers. The default branch cost is 0.
16076 @item -mcall-prologues
16077 @opindex mcall-prologues
16078 Functions prologues/epilogues are expanded as calls to appropriate
16079 subroutines.  Code size is smaller.
16081 @item -mgas-isr-prologues
16082 @opindex mgas-isr-prologues
16083 Interrupt service routines (ISRs) may use the @code{__gcc_isr} pseudo
16084 instruction supported by GNU Binutils.
16085 If this option is on, the feature can still be disabled for individual
16086 ISRs by means of the @ref{AVR Function Attributes,,@code{no_gccisr}}
16087 function attribute.  This feature is activated per default
16088 if optimization is on (but not with @option{-Og}, @pxref{Optimize Options}),
16089 and if GNU Binutils support @w{@uref{https://sourceware.org/PR21683,PR21683}}.
16091 @item -mint8
16092 @opindex mint8
16093 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
16094 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
16095 and @code{long long} is 4 bytes.  Please note that this option does not
16096 conform to the C standards, but it results in smaller code
16097 size.
16099 @item -mn-flash=@var{num}
16100 @opindex mn-flash
16101 Assume that the flash memory has a size of 
16102 @var{num} times 64@tie{}KiB.
16104 @item -mno-interrupts
16105 @opindex mno-interrupts
16106 Generated code is not compatible with hardware interrupts.
16107 Code size is smaller.
16109 @item -mrelax
16110 @opindex mrelax
16111 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
16112 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
16113 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
16114 the assembler's command line and the @option{--relax} option to the
16115 linker's command line.
16117 Jump relaxing is performed by the linker because jump offsets are not
16118 known before code is located. Therefore, the assembler code generated by the
16119 compiler is the same, but the instructions in the executable may
16120 differ from instructions in the assembler code.
16122 Relaxing must be turned on if linker stubs are needed, see the
16123 section on @code{EIND} and linker stubs below.
16125 @item -mrmw
16126 @opindex mrmw
16127 Assume that the device supports the Read-Modify-Write
16128 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
16130 @item -mshort-calls
16131 @opindex mshort-calls
16133 Assume that @code{RJMP} and @code{RCALL} can target the whole
16134 program memory.
16136 This option is used internally for multilib selection.  It is
16137 not an optimization option, and you don't need to set it by hand.
16139 @item -msp8
16140 @opindex msp8
16141 Treat the stack pointer register as an 8-bit register,
16142 i.e.@: assume the high byte of the stack pointer is zero.
16143 In general, you don't need to set this option by hand.
16145 This option is used internally by the compiler to select and
16146 build multilibs for architectures @code{avr2} and @code{avr25}.
16147 These architectures mix devices with and without @code{SPH}.
16148 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
16149 the compiler driver adds or removes this option from the compiler
16150 proper's command line, because the compiler then knows if the device
16151 or architecture has an 8-bit stack pointer and thus no @code{SPH}
16152 register or not.
16154 @item -mstrict-X
16155 @opindex mstrict-X
16156 Use address register @code{X} in a way proposed by the hardware.  This means
16157 that @code{X} is only used in indirect, post-increment or
16158 pre-decrement addressing.
16160 Without this option, the @code{X} register may be used in the same way
16161 as @code{Y} or @code{Z} which then is emulated by additional
16162 instructions.  
16163 For example, loading a value with @code{X+const} addressing with a
16164 small non-negative @code{const < 64} to a register @var{Rn} is
16165 performed as
16167 @example
16168 adiw r26, const   ; X += const
16169 ld   @var{Rn}, X        ; @var{Rn} = *X
16170 sbiw r26, const   ; X -= const
16171 @end example
16173 @item -mtiny-stack
16174 @opindex mtiny-stack
16175 Only change the lower 8@tie{}bits of the stack pointer.
16177 @item -mfract-convert-truncate
16178 @opindex mfract-convert-truncate
16179 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
16181 @item -nodevicelib
16182 @opindex nodevicelib
16183 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
16185 @item -Waddr-space-convert
16186 @opindex Waddr-space-convert
16187 Warn about conversions between address spaces in the case where the
16188 resulting address space is not contained in the incoming address space.
16190 @item -Wmisspelled-isr
16191 @opindex Wmisspelled-isr
16192 Warn if the ISR is misspelled, i.e. without __vector prefix.
16193 Enabled by default.
16194 @end table
16196 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
16197 @cindex @code{EIND}
16198 Pointers in the implementation are 16@tie{}bits wide.
16199 The address of a function or label is represented as word address so
16200 that indirect jumps and calls can target any code address in the
16201 range of 64@tie{}Ki words.
16203 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
16204 bytes of program memory space, there is a special function register called
16205 @code{EIND} that serves as most significant part of the target address
16206 when @code{EICALL} or @code{EIJMP} instructions are used.
16208 Indirect jumps and calls on these devices are handled as follows by
16209 the compiler and are subject to some limitations:
16211 @itemize @bullet
16213 @item
16214 The compiler never sets @code{EIND}.
16216 @item
16217 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
16218 instructions or might read @code{EIND} directly in order to emulate an
16219 indirect call/jump by means of a @code{RET} instruction.
16221 @item
16222 The compiler assumes that @code{EIND} never changes during the startup
16223 code or during the application. In particular, @code{EIND} is not
16224 saved/restored in function or interrupt service routine
16225 prologue/epilogue.
16227 @item
16228 For indirect calls to functions and computed goto, the linker
16229 generates @emph{stubs}. Stubs are jump pads sometimes also called
16230 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
16231 The stub contains a direct jump to the desired address.
16233 @item
16234 Linker relaxation must be turned on so that the linker generates
16235 the stubs correctly in all situations. See the compiler option
16236 @option{-mrelax} and the linker option @option{--relax}.
16237 There are corner cases where the linker is supposed to generate stubs
16238 but aborts without relaxation and without a helpful error message.
16240 @item
16241 The default linker script is arranged for code with @code{EIND = 0}.
16242 If code is supposed to work for a setup with @code{EIND != 0}, a custom
16243 linker script has to be used in order to place the sections whose
16244 name start with @code{.trampolines} into the segment where @code{EIND}
16245 points to.
16247 @item
16248 The startup code from libgcc never sets @code{EIND}.
16249 Notice that startup code is a blend of code from libgcc and AVR-LibC.
16250 For the impact of AVR-LibC on @code{EIND}, see the
16251 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
16253 @item
16254 It is legitimate for user-specific startup code to set up @code{EIND}
16255 early, for example by means of initialization code located in
16256 section @code{.init3}. Such code runs prior to general startup code
16257 that initializes RAM and calls constructors, but after the bit
16258 of startup code from AVR-LibC that sets @code{EIND} to the segment
16259 where the vector table is located.
16260 @example
16261 #include <avr/io.h>
16263 static void
16264 __attribute__((section(".init3"),naked,used,no_instrument_function))
16265 init3_set_eind (void)
16267   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
16268                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
16270 @end example
16272 @noindent
16273 The @code{__trampolines_start} symbol is defined in the linker script.
16275 @item
16276 Stubs are generated automatically by the linker if
16277 the following two conditions are met:
16278 @itemize @minus
16280 @item The address of a label is taken by means of the @code{gs} modifier
16281 (short for @emph{generate stubs}) like so:
16282 @example
16283 LDI r24, lo8(gs(@var{func}))
16284 LDI r25, hi8(gs(@var{func}))
16285 @end example
16286 @item The final location of that label is in a code segment
16287 @emph{outside} the segment where the stubs are located.
16288 @end itemize
16290 @item
16291 The compiler emits such @code{gs} modifiers for code labels in the
16292 following situations:
16293 @itemize @minus
16294 @item Taking address of a function or code label.
16295 @item Computed goto.
16296 @item If prologue-save function is used, see @option{-mcall-prologues}
16297 command-line option.
16298 @item Switch/case dispatch tables. If you do not want such dispatch
16299 tables you can specify the @option{-fno-jump-tables} command-line option.
16300 @item C and C++ constructors/destructors called during startup/shutdown.
16301 @item If the tools hit a @code{gs()} modifier explained above.
16302 @end itemize
16304 @item
16305 Jumping to non-symbolic addresses like so is @emph{not} supported:
16307 @example
16308 int main (void)
16310     /* Call function at word address 0x2 */
16311     return ((int(*)(void)) 0x2)();
16313 @end example
16315 Instead, a stub has to be set up, i.e.@: the function has to be called
16316 through a symbol (@code{func_4} in the example):
16318 @example
16319 int main (void)
16321     extern int func_4 (void);
16323     /* Call function at byte address 0x4 */
16324     return func_4();
16326 @end example
16328 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
16329 Alternatively, @code{func_4} can be defined in the linker script.
16330 @end itemize
16332 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
16333 @cindex @code{RAMPD}
16334 @cindex @code{RAMPX}
16335 @cindex @code{RAMPY}
16336 @cindex @code{RAMPZ}
16337 Some AVR devices support memories larger than the 64@tie{}KiB range
16338 that can be accessed with 16-bit pointers.  To access memory locations
16339 outside this 64@tie{}KiB range, the content of a @code{RAMP}
16340 register is used as high part of the address:
16341 The @code{X}, @code{Y}, @code{Z} address register is concatenated
16342 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
16343 register, respectively, to get a wide address. Similarly,
16344 @code{RAMPD} is used together with direct addressing.
16346 @itemize
16347 @item
16348 The startup code initializes the @code{RAMP} special function
16349 registers with zero.
16351 @item
16352 If a @ref{AVR Named Address Spaces,named address space} other than
16353 generic or @code{__flash} is used, then @code{RAMPZ} is set
16354 as needed before the operation.
16356 @item
16357 If the device supports RAM larger than 64@tie{}KiB and the compiler
16358 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
16359 is reset to zero after the operation.
16361 @item
16362 If the device comes with a specific @code{RAMP} register, the ISR
16363 prologue/epilogue saves/restores that SFR and initializes it with
16364 zero in case the ISR code might (implicitly) use it.
16366 @item
16367 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
16368 If you use inline assembler to read from locations outside the
16369 16-bit address range and change one of the @code{RAMP} registers,
16370 you must reset it to zero after the access.
16372 @end itemize
16374 @subsubsection AVR Built-in Macros
16376 GCC defines several built-in macros so that the user code can test
16377 for the presence or absence of features.  Almost any of the following
16378 built-in macros are deduced from device capabilities and thus
16379 triggered by the @option{-mmcu=} command-line option.
16381 For even more AVR-specific built-in macros see
16382 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
16384 @table @code
16386 @item __AVR_ARCH__
16387 Build-in macro that resolves to a decimal number that identifies the
16388 architecture and depends on the @option{-mmcu=@var{mcu}} option.
16389 Possible values are:
16391 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
16392 @code{4}, @code{5}, @code{51}, @code{6}
16394 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
16395 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
16397 respectively and
16399 @code{100},
16400 @code{102}, @code{103}, @code{104},
16401 @code{105}, @code{106}, @code{107}
16403 for @var{mcu}=@code{avrtiny},
16404 @code{avrxmega2}, @code{avrxmega3}, @code{avrxmega4},
16405 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
16406 If @var{mcu} specifies a device, this built-in macro is set
16407 accordingly. For example, with @option{-mmcu=atmega8} the macro is
16408 defined to @code{4}.
16410 @item __AVR_@var{Device}__
16411 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
16412 the device's name. For example, @option{-mmcu=atmega8} defines the
16413 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
16414 @code{__AVR_ATtiny261A__}, etc.
16416 The built-in macros' names follow
16417 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
16418 the device name as from the AVR user manual. The difference between
16419 @var{Device} in the built-in macro and @var{device} in
16420 @option{-mmcu=@var{device}} is that the latter is always lowercase.
16422 If @var{device} is not a device but only a core architecture like
16423 @samp{avr51}, this macro is not defined.
16425 @item __AVR_DEVICE_NAME__
16426 Setting @option{-mmcu=@var{device}} defines this built-in macro to
16427 the device's name. For example, with @option{-mmcu=atmega8} the macro
16428 is defined to @code{atmega8}.
16430 If @var{device} is not a device but only a core architecture like
16431 @samp{avr51}, this macro is not defined.
16433 @item __AVR_XMEGA__
16434 The device / architecture belongs to the XMEGA family of devices.
16436 @item __AVR_HAVE_ELPM__
16437 The device has the @code{ELPM} instruction.
16439 @item __AVR_HAVE_ELPMX__
16440 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
16441 R@var{n},Z+} instructions.
16443 @item __AVR_HAVE_MOVW__
16444 The device has the @code{MOVW} instruction to perform 16-bit
16445 register-register moves.
16447 @item __AVR_HAVE_LPMX__
16448 The device has the @code{LPM R@var{n},Z} and
16449 @code{LPM R@var{n},Z+} instructions.
16451 @item __AVR_HAVE_MUL__
16452 The device has a hardware multiplier. 
16454 @item __AVR_HAVE_JMP_CALL__
16455 The device has the @code{JMP} and @code{CALL} instructions.
16456 This is the case for devices with more than 8@tie{}KiB of program
16457 memory.
16459 @item __AVR_HAVE_EIJMP_EICALL__
16460 @itemx __AVR_3_BYTE_PC__
16461 The device has the @code{EIJMP} and @code{EICALL} instructions.
16462 This is the case for devices with more than 128@tie{}KiB of program memory.
16463 This also means that the program counter
16464 (PC) is 3@tie{}bytes wide.
16466 @item __AVR_2_BYTE_PC__
16467 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
16468 with up to 128@tie{}KiB of program memory.
16470 @item __AVR_HAVE_8BIT_SP__
16471 @itemx __AVR_HAVE_16BIT_SP__
16472 The stack pointer (SP) register is treated as 8-bit respectively
16473 16-bit register by the compiler.
16474 The definition of these macros is affected by @option{-mtiny-stack}.
16476 @item __AVR_HAVE_SPH__
16477 @itemx __AVR_SP8__
16478 The device has the SPH (high part of stack pointer) special function
16479 register or has an 8-bit stack pointer, respectively.
16480 The definition of these macros is affected by @option{-mmcu=} and
16481 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
16482 by @option{-msp8}.
16484 @item __AVR_HAVE_RAMPD__
16485 @itemx __AVR_HAVE_RAMPX__
16486 @itemx __AVR_HAVE_RAMPY__
16487 @itemx __AVR_HAVE_RAMPZ__
16488 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
16489 @code{RAMPZ} special function register, respectively.
16491 @item __NO_INTERRUPTS__
16492 This macro reflects the @option{-mno-interrupts} command-line option.
16494 @item __AVR_ERRATA_SKIP__
16495 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
16496 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
16497 instructions because of a hardware erratum.  Skip instructions are
16498 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
16499 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
16500 set.
16502 @item __AVR_ISA_RMW__
16503 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
16505 @item __AVR_SFR_OFFSET__=@var{offset}
16506 Instructions that can address I/O special function registers directly
16507 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
16508 address as if addressed by an instruction to access RAM like @code{LD}
16509 or @code{STS}. This offset depends on the device architecture and has
16510 to be subtracted from the RAM address in order to get the
16511 respective I/O@tie{}address.
16513 @item __AVR_SHORT_CALLS__
16514 The @option{-mshort-calls} command line option is set.
16516 @item __AVR_PM_BASE_ADDRESS__=@var{addr}
16517 Some devices support reading from flash memory by means of @code{LD*}
16518 instructions.  The flash memory is seen in the data address space
16519 at an offset of @code{__AVR_PM_BASE_ADDRESS__}.  If this macro
16520 is not defined, this feature is not available.  If defined,
16521 the address space is linear and there is no need to put
16522 @code{.rodata} into RAM.  This is handled by the default linker
16523 description file, and is currently available for
16524 @code{avrtiny} and @code{avrxmega3}.  Even more convenient,
16525 there is no need to use address spaces like @code{__flash} or
16526 features like attribute @code{progmem} and @code{pgm_read_*}.
16528 @item __WITH_AVRLIBC__
16529 The compiler is configured to be used together with AVR-Libc.
16530 See the @option{--with-avrlibc} configure option.
16532 @end table
16534 @node Blackfin Options
16535 @subsection Blackfin Options
16536 @cindex Blackfin Options
16538 @table @gcctabopt
16539 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
16540 @opindex mcpu=
16541 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
16542 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
16543 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
16544 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
16545 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
16546 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
16547 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
16548 @samp{bf561}, @samp{bf592}.
16550 The optional @var{sirevision} specifies the silicon revision of the target
16551 Blackfin processor.  Any workarounds available for the targeted silicon revision
16552 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
16553 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
16554 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
16555 hexadecimal digits representing the major and minor numbers in the silicon
16556 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
16557 is not defined.  If @var{sirevision} is @samp{any}, the
16558 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
16559 If this optional @var{sirevision} is not used, GCC assumes the latest known
16560 silicon revision of the targeted Blackfin processor.
16562 GCC defines a preprocessor macro for the specified @var{cpu}.
16563 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
16564 provided by libgloss to be linked in if @option{-msim} is not given.
16566 Without this option, @samp{bf532} is used as the processor by default.
16568 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
16569 only the preprocessor macro is defined.
16571 @item -msim
16572 @opindex msim
16573 Specifies that the program will be run on the simulator.  This causes
16574 the simulator BSP provided by libgloss to be linked in.  This option
16575 has effect only for @samp{bfin-elf} toolchain.
16576 Certain other options, such as @option{-mid-shared-library} and
16577 @option{-mfdpic}, imply @option{-msim}.
16579 @item -momit-leaf-frame-pointer
16580 @opindex momit-leaf-frame-pointer
16581 Don't keep the frame pointer in a register for leaf functions.  This
16582 avoids the instructions to save, set up and restore frame pointers and
16583 makes an extra register available in leaf functions.  The option
16584 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
16585 which might make debugging harder.
16587 @item -mspecld-anomaly
16588 @opindex mspecld-anomaly
16589 When enabled, the compiler ensures that the generated code does not
16590 contain speculative loads after jump instructions. If this option is used,
16591 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
16593 @item -mno-specld-anomaly
16594 @opindex mno-specld-anomaly
16595 Don't generate extra code to prevent speculative loads from occurring.
16597 @item -mcsync-anomaly
16598 @opindex mcsync-anomaly
16599 When enabled, the compiler ensures that the generated code does not
16600 contain CSYNC or SSYNC instructions too soon after conditional branches.
16601 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
16603 @item -mno-csync-anomaly
16604 @opindex mno-csync-anomaly
16605 Don't generate extra code to prevent CSYNC or SSYNC instructions from
16606 occurring too soon after a conditional branch.
16608 @item -mlow-64k
16609 @opindex mlow-64k
16610 When enabled, the compiler is free to take advantage of the knowledge that
16611 the entire program fits into the low 64k of memory.
16613 @item -mno-low-64k
16614 @opindex mno-low-64k
16615 Assume that the program is arbitrarily large.  This is the default.
16617 @item -mstack-check-l1
16618 @opindex mstack-check-l1
16619 Do stack checking using information placed into L1 scratchpad memory by the
16620 uClinux kernel.
16622 @item -mid-shared-library
16623 @opindex mid-shared-library
16624 Generate code that supports shared libraries via the library ID method.
16625 This allows for execute in place and shared libraries in an environment
16626 without virtual memory management.  This option implies @option{-fPIC}.
16627 With a @samp{bfin-elf} target, this option implies @option{-msim}.
16629 @item -mno-id-shared-library
16630 @opindex mno-id-shared-library
16631 Generate code that doesn't assume ID-based shared libraries are being used.
16632 This is the default.
16634 @item -mleaf-id-shared-library
16635 @opindex mleaf-id-shared-library
16636 Generate code that supports shared libraries via the library ID method,
16637 but assumes that this library or executable won't link against any other
16638 ID shared libraries.  That allows the compiler to use faster code for jumps
16639 and calls.
16641 @item -mno-leaf-id-shared-library
16642 @opindex mno-leaf-id-shared-library
16643 Do not assume that the code being compiled won't link against any ID shared
16644 libraries.  Slower code is generated for jump and call insns.
16646 @item -mshared-library-id=n
16647 @opindex mshared-library-id
16648 Specifies the identification number of the ID-based shared library being
16649 compiled.  Specifying a value of 0 generates more compact code; specifying
16650 other values forces the allocation of that number to the current
16651 library but is no more space- or time-efficient than omitting this option.
16653 @item -msep-data
16654 @opindex msep-data
16655 Generate code that allows the data segment to be located in a different
16656 area of memory from the text segment.  This allows for execute in place in
16657 an environment without virtual memory management by eliminating relocations
16658 against the text section.
16660 @item -mno-sep-data
16661 @opindex mno-sep-data
16662 Generate code that assumes that the data segment follows the text segment.
16663 This is the default.
16665 @item -mlong-calls
16666 @itemx -mno-long-calls
16667 @opindex mlong-calls
16668 @opindex mno-long-calls
16669 Tells the compiler to perform function calls by first loading the
16670 address of the function into a register and then performing a subroutine
16671 call on this register.  This switch is needed if the target function
16672 lies outside of the 24-bit addressing range of the offset-based
16673 version of subroutine call instruction.
16675 This feature is not enabled by default.  Specifying
16676 @option{-mno-long-calls} restores the default behavior.  Note these
16677 switches have no effect on how the compiler generates code to handle
16678 function calls via function pointers.
16680 @item -mfast-fp
16681 @opindex mfast-fp
16682 Link with the fast floating-point library. This library relaxes some of
16683 the IEEE floating-point standard's rules for checking inputs against
16684 Not-a-Number (NAN), in the interest of performance.
16686 @item -minline-plt
16687 @opindex minline-plt
16688 Enable inlining of PLT entries in function calls to functions that are
16689 not known to bind locally.  It has no effect without @option{-mfdpic}.
16691 @item -mmulticore
16692 @opindex mmulticore
16693 Build a standalone application for multicore Blackfin processors. 
16694 This option causes proper start files and link scripts supporting 
16695 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
16696 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
16698 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
16699 selects the one-application-per-core programming model.  Without
16700 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
16701 programming model is used. In this model, the main function of Core B
16702 should be named as @code{coreb_main}.
16704 If this option is not used, the single-core application programming
16705 model is used.
16707 @item -mcorea
16708 @opindex mcorea
16709 Build a standalone application for Core A of BF561 when using
16710 the one-application-per-core programming model. Proper start files
16711 and link scripts are used to support Core A, and the macro
16712 @code{__BFIN_COREA} is defined.
16713 This option can only be used in conjunction with @option{-mmulticore}.
16715 @item -mcoreb
16716 @opindex mcoreb
16717 Build a standalone application for Core B of BF561 when using
16718 the one-application-per-core programming model. Proper start files
16719 and link scripts are used to support Core B, and the macro
16720 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
16721 should be used instead of @code{main}. 
16722 This option can only be used in conjunction with @option{-mmulticore}.
16724 @item -msdram
16725 @opindex msdram
16726 Build a standalone application for SDRAM. Proper start files and
16727 link scripts are used to put the application into SDRAM, and the macro
16728 @code{__BFIN_SDRAM} is defined.
16729 The loader should initialize SDRAM before loading the application.
16731 @item -micplb
16732 @opindex micplb
16733 Assume that ICPLBs are enabled at run time.  This has an effect on certain
16734 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
16735 are enabled; for standalone applications the default is off.
16736 @end table
16738 @node C6X Options
16739 @subsection C6X Options
16740 @cindex C6X Options
16742 @table @gcctabopt
16743 @item -march=@var{name}
16744 @opindex march
16745 This specifies the name of the target architecture.  GCC uses this
16746 name to determine what kind of instructions it can emit when generating
16747 assembly code.  Permissible names are: @samp{c62x},
16748 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
16750 @item -mbig-endian
16751 @opindex mbig-endian
16752 Generate code for a big-endian target.
16754 @item -mlittle-endian
16755 @opindex mlittle-endian
16756 Generate code for a little-endian target.  This is the default.
16758 @item -msim
16759 @opindex msim
16760 Choose startup files and linker script suitable for the simulator.
16762 @item -msdata=default
16763 @opindex msdata=default
16764 Put small global and static data in the @code{.neardata} section,
16765 which is pointed to by register @code{B14}.  Put small uninitialized
16766 global and static data in the @code{.bss} section, which is adjacent
16767 to the @code{.neardata} section.  Put small read-only data into the
16768 @code{.rodata} section.  The corresponding sections used for large
16769 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
16771 @item -msdata=all
16772 @opindex msdata=all
16773 Put all data, not just small objects, into the sections reserved for
16774 small data, and use addressing relative to the @code{B14} register to
16775 access them.
16777 @item -msdata=none
16778 @opindex msdata=none
16779 Make no use of the sections reserved for small data, and use absolute
16780 addresses to access all data.  Put all initialized global and static
16781 data in the @code{.fardata} section, and all uninitialized data in the
16782 @code{.far} section.  Put all constant data into the @code{.const}
16783 section.
16784 @end table
16786 @node CRIS Options
16787 @subsection CRIS Options
16788 @cindex CRIS Options
16790 These options are defined specifically for the CRIS ports.
16792 @table @gcctabopt
16793 @item -march=@var{architecture-type}
16794 @itemx -mcpu=@var{architecture-type}
16795 @opindex march
16796 @opindex mcpu
16797 Generate code for the specified architecture.  The choices for
16798 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
16799 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
16800 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
16801 @samp{v10}.
16803 @item -mtune=@var{architecture-type}
16804 @opindex mtune
16805 Tune to @var{architecture-type} everything applicable about the generated
16806 code, except for the ABI and the set of available instructions.  The
16807 choices for @var{architecture-type} are the same as for
16808 @option{-march=@var{architecture-type}}.
16810 @item -mmax-stack-frame=@var{n}
16811 @opindex mmax-stack-frame
16812 Warn when the stack frame of a function exceeds @var{n} bytes.
16814 @item -metrax4
16815 @itemx -metrax100
16816 @opindex metrax4
16817 @opindex metrax100
16818 The options @option{-metrax4} and @option{-metrax100} are synonyms for
16819 @option{-march=v3} and @option{-march=v8} respectively.
16821 @item -mmul-bug-workaround
16822 @itemx -mno-mul-bug-workaround
16823 @opindex mmul-bug-workaround
16824 @opindex mno-mul-bug-workaround
16825 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
16826 models where it applies.  This option is active by default.
16828 @item -mpdebug
16829 @opindex mpdebug
16830 Enable CRIS-specific verbose debug-related information in the assembly
16831 code.  This option also has the effect of turning off the @samp{#NO_APP}
16832 formatted-code indicator to the assembler at the beginning of the
16833 assembly file.
16835 @item -mcc-init
16836 @opindex mcc-init
16837 Do not use condition-code results from previous instruction; always emit
16838 compare and test instructions before use of condition codes.
16840 @item -mno-side-effects
16841 @opindex mno-side-effects
16842 Do not emit instructions with side effects in addressing modes other than
16843 post-increment.
16845 @item -mstack-align
16846 @itemx -mno-stack-align
16847 @itemx -mdata-align
16848 @itemx -mno-data-align
16849 @itemx -mconst-align
16850 @itemx -mno-const-align
16851 @opindex mstack-align
16852 @opindex mno-stack-align
16853 @opindex mdata-align
16854 @opindex mno-data-align
16855 @opindex mconst-align
16856 @opindex mno-const-align
16857 These options (@samp{no-} options) arrange (eliminate arrangements) for the
16858 stack frame, individual data and constants to be aligned for the maximum
16859 single data access size for the chosen CPU model.  The default is to
16860 arrange for 32-bit alignment.  ABI details such as structure layout are
16861 not affected by these options.
16863 @item -m32-bit
16864 @itemx -m16-bit
16865 @itemx -m8-bit
16866 @opindex m32-bit
16867 @opindex m16-bit
16868 @opindex m8-bit
16869 Similar to the stack- data- and const-align options above, these options
16870 arrange for stack frame, writable data and constants to all be 32-bit,
16871 16-bit or 8-bit aligned.  The default is 32-bit alignment.
16873 @item -mno-prologue-epilogue
16874 @itemx -mprologue-epilogue
16875 @opindex mno-prologue-epilogue
16876 @opindex mprologue-epilogue
16877 With @option{-mno-prologue-epilogue}, the normal function prologue and
16878 epilogue which set up the stack frame are omitted and no return
16879 instructions or return sequences are generated in the code.  Use this
16880 option only together with visual inspection of the compiled code: no
16881 warnings or errors are generated when call-saved registers must be saved,
16882 or storage for local variables needs to be allocated.
16884 @item -mno-gotplt
16885 @itemx -mgotplt
16886 @opindex mno-gotplt
16887 @opindex mgotplt
16888 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
16889 instruction sequences that load addresses for functions from the PLT part
16890 of the GOT rather than (traditional on other architectures) calls to the
16891 PLT@.  The default is @option{-mgotplt}.
16893 @item -melf
16894 @opindex melf
16895 Legacy no-op option only recognized with the cris-axis-elf and
16896 cris-axis-linux-gnu targets.
16898 @item -mlinux
16899 @opindex mlinux
16900 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
16902 @item -sim
16903 @opindex sim
16904 This option, recognized for the cris-axis-elf, arranges
16905 to link with input-output functions from a simulator library.  Code,
16906 initialized data and zero-initialized data are allocated consecutively.
16908 @item -sim2
16909 @opindex sim2
16910 Like @option{-sim}, but pass linker options to locate initialized data at
16911 0x40000000 and zero-initialized data at 0x80000000.
16912 @end table
16914 @node CR16 Options
16915 @subsection CR16 Options
16916 @cindex CR16 Options
16918 These options are defined specifically for the CR16 ports.
16920 @table @gcctabopt
16922 @item -mmac
16923 @opindex mmac
16924 Enable the use of multiply-accumulate instructions. Disabled by default.
16926 @item -mcr16cplus
16927 @itemx -mcr16c
16928 @opindex mcr16cplus
16929 @opindex mcr16c
16930 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
16931 is default.
16933 @item -msim
16934 @opindex msim
16935 Links the library libsim.a which is in compatible with simulator. Applicable
16936 to ELF compiler only.
16938 @item -mint32
16939 @opindex mint32
16940 Choose integer type as 32-bit wide.
16942 @item -mbit-ops
16943 @opindex mbit-ops
16944 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
16946 @item -mdata-model=@var{model}
16947 @opindex mdata-model
16948 Choose a data model. The choices for @var{model} are @samp{near},
16949 @samp{far} or @samp{medium}. @samp{medium} is default.
16950 However, @samp{far} is not valid with @option{-mcr16c}, as the
16951 CR16C architecture does not support the far data model.
16952 @end table
16954 @node Darwin Options
16955 @subsection Darwin Options
16956 @cindex Darwin options
16958 These options are defined for all architectures running the Darwin operating
16959 system.
16961 FSF GCC on Darwin does not create ``fat'' object files; it creates
16962 an object file for the single architecture that GCC was built to
16963 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
16964 @option{-arch} options are used; it does so by running the compiler or
16965 linker multiple times and joining the results together with
16966 @file{lipo}.
16968 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
16969 @samp{i686}) is determined by the flags that specify the ISA
16970 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
16971 @option{-force_cpusubtype_ALL} option can be used to override this.
16973 The Darwin tools vary in their behavior when presented with an ISA
16974 mismatch.  The assembler, @file{as}, only permits instructions to
16975 be used that are valid for the subtype of the file it is generating,
16976 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
16977 The linker for shared libraries, @file{/usr/bin/libtool}, fails
16978 and prints an error if asked to create a shared library with a less
16979 restrictive subtype than its input files (for instance, trying to put
16980 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
16981 for executables, @command{ld}, quietly gives the executable the most
16982 restrictive subtype of any of its input files.
16984 @table @gcctabopt
16985 @item -F@var{dir}
16986 @opindex F
16987 Add the framework directory @var{dir} to the head of the list of
16988 directories to be searched for header files.  These directories are
16989 interleaved with those specified by @option{-I} options and are
16990 scanned in a left-to-right order.
16992 A framework directory is a directory with frameworks in it.  A
16993 framework is a directory with a @file{Headers} and/or
16994 @file{PrivateHeaders} directory contained directly in it that ends
16995 in @file{.framework}.  The name of a framework is the name of this
16996 directory excluding the @file{.framework}.  Headers associated with
16997 the framework are found in one of those two directories, with
16998 @file{Headers} being searched first.  A subframework is a framework
16999 directory that is in a framework's @file{Frameworks} directory.
17000 Includes of subframework headers can only appear in a header of a
17001 framework that contains the subframework, or in a sibling subframework
17002 header.  Two subframeworks are siblings if they occur in the same
17003 framework.  A subframework should not have the same name as a
17004 framework; a warning is issued if this is violated.  Currently a
17005 subframework cannot have subframeworks; in the future, the mechanism
17006 may be extended to support this.  The standard frameworks can be found
17007 in @file{/System/Library/Frameworks} and
17008 @file{/Library/Frameworks}.  An example include looks like
17009 @code{#include <Framework/header.h>}, where @file{Framework} denotes
17010 the name of the framework and @file{header.h} is found in the
17011 @file{PrivateHeaders} or @file{Headers} directory.
17013 @item -iframework@var{dir}
17014 @opindex iframework
17015 Like @option{-F} except the directory is a treated as a system
17016 directory.  The main difference between this @option{-iframework} and
17017 @option{-F} is that with @option{-iframework} the compiler does not
17018 warn about constructs contained within header files found via
17019 @var{dir}.  This option is valid only for the C family of languages.
17021 @item -gused
17022 @opindex gused
17023 Emit debugging information for symbols that are used.  For stabs
17024 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
17025 This is by default ON@.
17027 @item -gfull
17028 @opindex gfull
17029 Emit debugging information for all symbols and types.
17031 @item -mmacosx-version-min=@var{version}
17032 The earliest version of MacOS X that this executable will run on
17033 is @var{version}.  Typical values of @var{version} include @code{10.1},
17034 @code{10.2}, and @code{10.3.9}.
17036 If the compiler was built to use the system's headers by default,
17037 then the default for this option is the system version on which the
17038 compiler is running, otherwise the default is to make choices that
17039 are compatible with as many systems and code bases as possible.
17041 @item -mkernel
17042 @opindex mkernel
17043 Enable kernel development mode.  The @option{-mkernel} option sets
17044 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
17045 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
17046 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
17047 applicable.  This mode also sets @option{-mno-altivec},
17048 @option{-msoft-float}, @option{-fno-builtin} and
17049 @option{-mlong-branch} for PowerPC targets.
17051 @item -mone-byte-bool
17052 @opindex mone-byte-bool
17053 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
17054 By default @code{sizeof(bool)} is @code{4} when compiling for
17055 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
17056 option has no effect on x86.
17058 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
17059 to generate code that is not binary compatible with code generated
17060 without that switch.  Using this switch may require recompiling all
17061 other modules in a program, including system libraries.  Use this
17062 switch to conform to a non-default data model.
17064 @item -mfix-and-continue
17065 @itemx -ffix-and-continue
17066 @itemx -findirect-data
17067 @opindex mfix-and-continue
17068 @opindex ffix-and-continue
17069 @opindex findirect-data
17070 Generate code suitable for fast turnaround development, such as to
17071 allow GDB to dynamically load @file{.o} files into already-running
17072 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
17073 are provided for backwards compatibility.
17075 @item -all_load
17076 @opindex all_load
17077 Loads all members of static archive libraries.
17078 See man ld(1) for more information.
17080 @item -arch_errors_fatal
17081 @opindex arch_errors_fatal
17082 Cause the errors having to do with files that have the wrong architecture
17083 to be fatal.
17085 @item -bind_at_load
17086 @opindex bind_at_load
17087 Causes the output file to be marked such that the dynamic linker will
17088 bind all undefined references when the file is loaded or launched.
17090 @item -bundle
17091 @opindex bundle
17092 Produce a Mach-o bundle format file.
17093 See man ld(1) for more information.
17095 @item -bundle_loader @var{executable}
17096 @opindex bundle_loader
17097 This option specifies the @var{executable} that will load the build
17098 output file being linked.  See man ld(1) for more information.
17100 @item -dynamiclib
17101 @opindex dynamiclib
17102 When passed this option, GCC produces a dynamic library instead of
17103 an executable when linking, using the Darwin @file{libtool} command.
17105 @item -force_cpusubtype_ALL
17106 @opindex force_cpusubtype_ALL
17107 This causes GCC's output file to have the @samp{ALL} subtype, instead of
17108 one controlled by the @option{-mcpu} or @option{-march} option.
17110 @item -allowable_client  @var{client_name}
17111 @itemx -client_name
17112 @itemx -compatibility_version
17113 @itemx -current_version
17114 @itemx -dead_strip
17115 @itemx -dependency-file
17116 @itemx -dylib_file
17117 @itemx -dylinker_install_name
17118 @itemx -dynamic
17119 @itemx -exported_symbols_list
17120 @itemx -filelist
17121 @need 800
17122 @itemx -flat_namespace
17123 @itemx -force_flat_namespace
17124 @itemx -headerpad_max_install_names
17125 @itemx -image_base
17126 @itemx -init
17127 @itemx -install_name
17128 @itemx -keep_private_externs
17129 @itemx -multi_module
17130 @itemx -multiply_defined
17131 @itemx -multiply_defined_unused
17132 @need 800
17133 @itemx -noall_load
17134 @itemx -no_dead_strip_inits_and_terms
17135 @itemx -nofixprebinding
17136 @itemx -nomultidefs
17137 @itemx -noprebind
17138 @itemx -noseglinkedit
17139 @itemx -pagezero_size
17140 @itemx -prebind
17141 @itemx -prebind_all_twolevel_modules
17142 @itemx -private_bundle
17143 @need 800
17144 @itemx -read_only_relocs
17145 @itemx -sectalign
17146 @itemx -sectobjectsymbols
17147 @itemx -whyload
17148 @itemx -seg1addr
17149 @itemx -sectcreate
17150 @itemx -sectobjectsymbols
17151 @itemx -sectorder
17152 @itemx -segaddr
17153 @itemx -segs_read_only_addr
17154 @need 800
17155 @itemx -segs_read_write_addr
17156 @itemx -seg_addr_table
17157 @itemx -seg_addr_table_filename
17158 @itemx -seglinkedit
17159 @itemx -segprot
17160 @itemx -segs_read_only_addr
17161 @itemx -segs_read_write_addr
17162 @itemx -single_module
17163 @itemx -static
17164 @itemx -sub_library
17165 @need 800
17166 @itemx -sub_umbrella
17167 @itemx -twolevel_namespace
17168 @itemx -umbrella
17169 @itemx -undefined
17170 @itemx -unexported_symbols_list
17171 @itemx -weak_reference_mismatches
17172 @itemx -whatsloaded
17173 @opindex allowable_client
17174 @opindex client_name
17175 @opindex compatibility_version
17176 @opindex current_version
17177 @opindex dead_strip
17178 @opindex dependency-file
17179 @opindex dylib_file
17180 @opindex dylinker_install_name
17181 @opindex dynamic
17182 @opindex exported_symbols_list
17183 @opindex filelist
17184 @opindex flat_namespace
17185 @opindex force_flat_namespace
17186 @opindex headerpad_max_install_names
17187 @opindex image_base
17188 @opindex init
17189 @opindex install_name
17190 @opindex keep_private_externs
17191 @opindex multi_module
17192 @opindex multiply_defined
17193 @opindex multiply_defined_unused
17194 @opindex noall_load
17195 @opindex no_dead_strip_inits_and_terms
17196 @opindex nofixprebinding
17197 @opindex nomultidefs
17198 @opindex noprebind
17199 @opindex noseglinkedit
17200 @opindex pagezero_size
17201 @opindex prebind
17202 @opindex prebind_all_twolevel_modules
17203 @opindex private_bundle
17204 @opindex read_only_relocs
17205 @opindex sectalign
17206 @opindex sectobjectsymbols
17207 @opindex whyload
17208 @opindex seg1addr
17209 @opindex sectcreate
17210 @opindex sectobjectsymbols
17211 @opindex sectorder
17212 @opindex segaddr
17213 @opindex segs_read_only_addr
17214 @opindex segs_read_write_addr
17215 @opindex seg_addr_table
17216 @opindex seg_addr_table_filename
17217 @opindex seglinkedit
17218 @opindex segprot
17219 @opindex segs_read_only_addr
17220 @opindex segs_read_write_addr
17221 @opindex single_module
17222 @opindex static
17223 @opindex sub_library
17224 @opindex sub_umbrella
17225 @opindex twolevel_namespace
17226 @opindex umbrella
17227 @opindex undefined
17228 @opindex unexported_symbols_list
17229 @opindex weak_reference_mismatches
17230 @opindex whatsloaded
17231 These options are passed to the Darwin linker.  The Darwin linker man page
17232 describes them in detail.
17233 @end table
17235 @node DEC Alpha Options
17236 @subsection DEC Alpha Options
17238 These @samp{-m} options are defined for the DEC Alpha implementations:
17240 @table @gcctabopt
17241 @item -mno-soft-float
17242 @itemx -msoft-float
17243 @opindex mno-soft-float
17244 @opindex msoft-float
17245 Use (do not use) the hardware floating-point instructions for
17246 floating-point operations.  When @option{-msoft-float} is specified,
17247 functions in @file{libgcc.a} are used to perform floating-point
17248 operations.  Unless they are replaced by routines that emulate the
17249 floating-point operations, or compiled in such a way as to call such
17250 emulations routines, these routines issue floating-point
17251 operations.   If you are compiling for an Alpha without floating-point
17252 operations, you must ensure that the library is built so as not to call
17253 them.
17255 Note that Alpha implementations without floating-point operations are
17256 required to have floating-point registers.
17258 @item -mfp-reg
17259 @itemx -mno-fp-regs
17260 @opindex mfp-reg
17261 @opindex mno-fp-regs
17262 Generate code that uses (does not use) the floating-point register set.
17263 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
17264 register set is not used, floating-point operands are passed in integer
17265 registers as if they were integers and floating-point results are passed
17266 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
17267 so any function with a floating-point argument or return value called by code
17268 compiled with @option{-mno-fp-regs} must also be compiled with that
17269 option.
17271 A typical use of this option is building a kernel that does not use,
17272 and hence need not save and restore, any floating-point registers.
17274 @item -mieee
17275 @opindex mieee
17276 The Alpha architecture implements floating-point hardware optimized for
17277 maximum performance.  It is mostly compliant with the IEEE floating-point
17278 standard.  However, for full compliance, software assistance is
17279 required.  This option generates code fully IEEE-compliant code
17280 @emph{except} that the @var{inexact-flag} is not maintained (see below).
17281 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
17282 defined during compilation.  The resulting code is less efficient but is
17283 able to correctly support denormalized numbers and exceptional IEEE
17284 values such as not-a-number and plus/minus infinity.  Other Alpha
17285 compilers call this option @option{-ieee_with_no_inexact}.
17287 @item -mieee-with-inexact
17288 @opindex mieee-with-inexact
17289 This is like @option{-mieee} except the generated code also maintains
17290 the IEEE @var{inexact-flag}.  Turning on this option causes the
17291 generated code to implement fully-compliant IEEE math.  In addition to
17292 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
17293 macro.  On some Alpha implementations the resulting code may execute
17294 significantly slower than the code generated by default.  Since there is
17295 very little code that depends on the @var{inexact-flag}, you should
17296 normally not specify this option.  Other Alpha compilers call this
17297 option @option{-ieee_with_inexact}.
17299 @item -mfp-trap-mode=@var{trap-mode}
17300 @opindex mfp-trap-mode
17301 This option controls what floating-point related traps are enabled.
17302 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
17303 The trap mode can be set to one of four values:
17305 @table @samp
17306 @item n
17307 This is the default (normal) setting.  The only traps that are enabled
17308 are the ones that cannot be disabled in software (e.g., division by zero
17309 trap).
17311 @item u
17312 In addition to the traps enabled by @samp{n}, underflow traps are enabled
17313 as well.
17315 @item su
17316 Like @samp{u}, but the instructions are marked to be safe for software
17317 completion (see Alpha architecture manual for details).
17319 @item sui
17320 Like @samp{su}, but inexact traps are enabled as well.
17321 @end table
17323 @item -mfp-rounding-mode=@var{rounding-mode}
17324 @opindex mfp-rounding-mode
17325 Selects the IEEE rounding mode.  Other Alpha compilers call this option
17326 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
17329 @table @samp
17330 @item n
17331 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
17332 the nearest machine number or towards the even machine number in case
17333 of a tie.
17335 @item m
17336 Round towards minus infinity.
17338 @item c
17339 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
17341 @item d
17342 Dynamic rounding mode.  A field in the floating-point control register
17343 (@var{fpcr}, see Alpha architecture reference manual) controls the
17344 rounding mode in effect.  The C library initializes this register for
17345 rounding towards plus infinity.  Thus, unless your program modifies the
17346 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
17347 @end table
17349 @item -mtrap-precision=@var{trap-precision}
17350 @opindex mtrap-precision
17351 In the Alpha architecture, floating-point traps are imprecise.  This
17352 means without software assistance it is impossible to recover from a
17353 floating trap and program execution normally needs to be terminated.
17354 GCC can generate code that can assist operating system trap handlers
17355 in determining the exact location that caused a floating-point trap.
17356 Depending on the requirements of an application, different levels of
17357 precisions can be selected:
17359 @table @samp
17360 @item p
17361 Program precision.  This option is the default and means a trap handler
17362 can only identify which program caused a floating-point exception.
17364 @item f
17365 Function precision.  The trap handler can determine the function that
17366 caused a floating-point exception.
17368 @item i
17369 Instruction precision.  The trap handler can determine the exact
17370 instruction that caused a floating-point exception.
17371 @end table
17373 Other Alpha compilers provide the equivalent options called
17374 @option{-scope_safe} and @option{-resumption_safe}.
17376 @item -mieee-conformant
17377 @opindex mieee-conformant
17378 This option marks the generated code as IEEE conformant.  You must not
17379 use this option unless you also specify @option{-mtrap-precision=i} and either
17380 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
17381 is to emit the line @samp{.eflag 48} in the function prologue of the
17382 generated assembly file.
17384 @item -mbuild-constants
17385 @opindex mbuild-constants
17386 Normally GCC examines a 32- or 64-bit integer constant to
17387 see if it can construct it from smaller constants in two or three
17388 instructions.  If it cannot, it outputs the constant as a literal and
17389 generates code to load it from the data segment at run time.
17391 Use this option to require GCC to construct @emph{all} integer constants
17392 using code, even if it takes more instructions (the maximum is six).
17394 You typically use this option to build a shared library dynamic
17395 loader.  Itself a shared library, it must relocate itself in memory
17396 before it can find the variables and constants in its own data segment.
17398 @item -mbwx
17399 @itemx -mno-bwx
17400 @itemx -mcix
17401 @itemx -mno-cix
17402 @itemx -mfix
17403 @itemx -mno-fix
17404 @itemx -mmax
17405 @itemx -mno-max
17406 @opindex mbwx
17407 @opindex mno-bwx
17408 @opindex mcix
17409 @opindex mno-cix
17410 @opindex mfix
17411 @opindex mno-fix
17412 @opindex mmax
17413 @opindex mno-max
17414 Indicate whether GCC should generate code to use the optional BWX,
17415 CIX, FIX and MAX instruction sets.  The default is to use the instruction
17416 sets supported by the CPU type specified via @option{-mcpu=} option or that
17417 of the CPU on which GCC was built if none is specified.
17419 @item -mfloat-vax
17420 @itemx -mfloat-ieee
17421 @opindex mfloat-vax
17422 @opindex mfloat-ieee
17423 Generate code that uses (does not use) VAX F and G floating-point
17424 arithmetic instead of IEEE single and double precision.
17426 @item -mexplicit-relocs
17427 @itemx -mno-explicit-relocs
17428 @opindex mexplicit-relocs
17429 @opindex mno-explicit-relocs
17430 Older Alpha assemblers provided no way to generate symbol relocations
17431 except via assembler macros.  Use of these macros does not allow
17432 optimal instruction scheduling.  GNU binutils as of version 2.12
17433 supports a new syntax that allows the compiler to explicitly mark
17434 which relocations should apply to which instructions.  This option
17435 is mostly useful for debugging, as GCC detects the capabilities of
17436 the assembler when it is built and sets the default accordingly.
17438 @item -msmall-data
17439 @itemx -mlarge-data
17440 @opindex msmall-data
17441 @opindex mlarge-data
17442 When @option{-mexplicit-relocs} is in effect, static data is
17443 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
17444 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
17445 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
17446 16-bit relocations off of the @code{$gp} register.  This limits the
17447 size of the small data area to 64KB, but allows the variables to be
17448 directly accessed via a single instruction.
17450 The default is @option{-mlarge-data}.  With this option the data area
17451 is limited to just below 2GB@.  Programs that require more than 2GB of
17452 data must use @code{malloc} or @code{mmap} to allocate the data in the
17453 heap instead of in the program's data segment.
17455 When generating code for shared libraries, @option{-fpic} implies
17456 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
17458 @item -msmall-text
17459 @itemx -mlarge-text
17460 @opindex msmall-text
17461 @opindex mlarge-text
17462 When @option{-msmall-text} is used, the compiler assumes that the
17463 code of the entire program (or shared library) fits in 4MB, and is
17464 thus reachable with a branch instruction.  When @option{-msmall-data}
17465 is used, the compiler can assume that all local symbols share the
17466 same @code{$gp} value, and thus reduce the number of instructions
17467 required for a function call from 4 to 1.
17469 The default is @option{-mlarge-text}.
17471 @item -mcpu=@var{cpu_type}
17472 @opindex mcpu
17473 Set the instruction set and instruction scheduling parameters for
17474 machine type @var{cpu_type}.  You can specify either the @samp{EV}
17475 style name or the corresponding chip number.  GCC supports scheduling
17476 parameters for the EV4, EV5 and EV6 family of processors and
17477 chooses the default values for the instruction set from the processor
17478 you specify.  If you do not specify a processor type, GCC defaults
17479 to the processor on which the compiler was built.
17481 Supported values for @var{cpu_type} are
17483 @table @samp
17484 @item ev4
17485 @itemx ev45
17486 @itemx 21064
17487 Schedules as an EV4 and has no instruction set extensions.
17489 @item ev5
17490 @itemx 21164
17491 Schedules as an EV5 and has no instruction set extensions.
17493 @item ev56
17494 @itemx 21164a
17495 Schedules as an EV5 and supports the BWX extension.
17497 @item pca56
17498 @itemx 21164pc
17499 @itemx 21164PC
17500 Schedules as an EV5 and supports the BWX and MAX extensions.
17502 @item ev6
17503 @itemx 21264
17504 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
17506 @item ev67
17507 @itemx 21264a
17508 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
17509 @end table
17511 Native toolchains also support the value @samp{native},
17512 which selects the best architecture option for the host processor.
17513 @option{-mcpu=native} has no effect if GCC does not recognize
17514 the processor.
17516 @item -mtune=@var{cpu_type}
17517 @opindex mtune
17518 Set only the instruction scheduling parameters for machine type
17519 @var{cpu_type}.  The instruction set is not changed.
17521 Native toolchains also support the value @samp{native},
17522 which selects the best architecture option for the host processor.
17523 @option{-mtune=native} has no effect if GCC does not recognize
17524 the processor.
17526 @item -mmemory-latency=@var{time}
17527 @opindex mmemory-latency
17528 Sets the latency the scheduler should assume for typical memory
17529 references as seen by the application.  This number is highly
17530 dependent on the memory access patterns used by the application
17531 and the size of the external cache on the machine.
17533 Valid options for @var{time} are
17535 @table @samp
17536 @item @var{number}
17537 A decimal number representing clock cycles.
17539 @item L1
17540 @itemx L2
17541 @itemx L3
17542 @itemx main
17543 The compiler contains estimates of the number of clock cycles for
17544 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
17545 (also called Dcache, Scache, and Bcache), as well as to main memory.
17546 Note that L3 is only valid for EV5.
17548 @end table
17549 @end table
17551 @node FR30 Options
17552 @subsection FR30 Options
17553 @cindex FR30 Options
17555 These options are defined specifically for the FR30 port.
17557 @table @gcctabopt
17559 @item -msmall-model
17560 @opindex msmall-model
17561 Use the small address space model.  This can produce smaller code, but
17562 it does assume that all symbolic values and addresses fit into a
17563 20-bit range.
17565 @item -mno-lsim
17566 @opindex mno-lsim
17567 Assume that runtime support has been provided and so there is no need
17568 to include the simulator library (@file{libsim.a}) on the linker
17569 command line.
17571 @end table
17573 @node FT32 Options
17574 @subsection FT32 Options
17575 @cindex FT32 Options
17577 These options are defined specifically for the FT32 port.
17579 @table @gcctabopt
17581 @item -msim
17582 @opindex msim
17583 Specifies that the program will be run on the simulator.  This causes
17584 an alternate runtime startup and library to be linked.
17585 You must not use this option when generating programs that will run on
17586 real hardware; you must provide your own runtime library for whatever
17587 I/O functions are needed.
17589 @item -mlra
17590 @opindex mlra
17591 Enable Local Register Allocation.  This is still experimental for FT32,
17592 so by default the compiler uses standard reload.
17594 @item -mnodiv
17595 @opindex mnodiv
17596 Do not use div and mod instructions.
17598 @end table
17600 @node FRV Options
17601 @subsection FRV Options
17602 @cindex FRV Options
17604 @table @gcctabopt
17605 @item -mgpr-32
17606 @opindex mgpr-32
17608 Only use the first 32 general-purpose registers.
17610 @item -mgpr-64
17611 @opindex mgpr-64
17613 Use all 64 general-purpose registers.
17615 @item -mfpr-32
17616 @opindex mfpr-32
17618 Use only the first 32 floating-point registers.
17620 @item -mfpr-64
17621 @opindex mfpr-64
17623 Use all 64 floating-point registers.
17625 @item -mhard-float
17626 @opindex mhard-float
17628 Use hardware instructions for floating-point operations.
17630 @item -msoft-float
17631 @opindex msoft-float
17633 Use library routines for floating-point operations.
17635 @item -malloc-cc
17636 @opindex malloc-cc
17638 Dynamically allocate condition code registers.
17640 @item -mfixed-cc
17641 @opindex mfixed-cc
17643 Do not try to dynamically allocate condition code registers, only
17644 use @code{icc0} and @code{fcc0}.
17646 @item -mdword
17647 @opindex mdword
17649 Change ABI to use double word insns.
17651 @item -mno-dword
17652 @opindex mno-dword
17654 Do not use double word instructions.
17656 @item -mdouble
17657 @opindex mdouble
17659 Use floating-point double instructions.
17661 @item -mno-double
17662 @opindex mno-double
17664 Do not use floating-point double instructions.
17666 @item -mmedia
17667 @opindex mmedia
17669 Use media instructions.
17671 @item -mno-media
17672 @opindex mno-media
17674 Do not use media instructions.
17676 @item -mmuladd
17677 @opindex mmuladd
17679 Use multiply and add/subtract instructions.
17681 @item -mno-muladd
17682 @opindex mno-muladd
17684 Do not use multiply and add/subtract instructions.
17686 @item -mfdpic
17687 @opindex mfdpic
17689 Select the FDPIC ABI, which uses function descriptors to represent
17690 pointers to functions.  Without any PIC/PIE-related options, it
17691 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
17692 assumes GOT entries and small data are within a 12-bit range from the
17693 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
17694 are computed with 32 bits.
17695 With a @samp{bfin-elf} target, this option implies @option{-msim}.
17697 @item -minline-plt
17698 @opindex minline-plt
17700 Enable inlining of PLT entries in function calls to functions that are
17701 not known to bind locally.  It has no effect without @option{-mfdpic}.
17702 It's enabled by default if optimizing for speed and compiling for
17703 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
17704 optimization option such as @option{-O3} or above is present in the
17705 command line.
17707 @item -mTLS
17708 @opindex mTLS
17710 Assume a large TLS segment when generating thread-local code.
17712 @item -mtls
17713 @opindex mtls
17715 Do not assume a large TLS segment when generating thread-local code.
17717 @item -mgprel-ro
17718 @opindex mgprel-ro
17720 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
17721 that is known to be in read-only sections.  It's enabled by default,
17722 except for @option{-fpic} or @option{-fpie}: even though it may help
17723 make the global offset table smaller, it trades 1 instruction for 4.
17724 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
17725 one of which may be shared by multiple symbols, and it avoids the need
17726 for a GOT entry for the referenced symbol, so it's more likely to be a
17727 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
17729 @item -multilib-library-pic
17730 @opindex multilib-library-pic
17732 Link with the (library, not FD) pic libraries.  It's implied by
17733 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
17734 @option{-fpic} without @option{-mfdpic}.  You should never have to use
17735 it explicitly.
17737 @item -mlinked-fp
17738 @opindex mlinked-fp
17740 Follow the EABI requirement of always creating a frame pointer whenever
17741 a stack frame is allocated.  This option is enabled by default and can
17742 be disabled with @option{-mno-linked-fp}.
17744 @item -mlong-calls
17745 @opindex mlong-calls
17747 Use indirect addressing to call functions outside the current
17748 compilation unit.  This allows the functions to be placed anywhere
17749 within the 32-bit address space.
17751 @item -malign-labels
17752 @opindex malign-labels
17754 Try to align labels to an 8-byte boundary by inserting NOPs into the
17755 previous packet.  This option only has an effect when VLIW packing
17756 is enabled.  It doesn't create new packets; it merely adds NOPs to
17757 existing ones.
17759 @item -mlibrary-pic
17760 @opindex mlibrary-pic
17762 Generate position-independent EABI code.
17764 @item -macc-4
17765 @opindex macc-4
17767 Use only the first four media accumulator registers.
17769 @item -macc-8
17770 @opindex macc-8
17772 Use all eight media accumulator registers.
17774 @item -mpack
17775 @opindex mpack
17777 Pack VLIW instructions.
17779 @item -mno-pack
17780 @opindex mno-pack
17782 Do not pack VLIW instructions.
17784 @item -mno-eflags
17785 @opindex mno-eflags
17787 Do not mark ABI switches in e_flags.
17789 @item -mcond-move
17790 @opindex mcond-move
17792 Enable the use of conditional-move instructions (default).
17794 This switch is mainly for debugging the compiler and will likely be removed
17795 in a future version.
17797 @item -mno-cond-move
17798 @opindex mno-cond-move
17800 Disable the use of conditional-move instructions.
17802 This switch is mainly for debugging the compiler and will likely be removed
17803 in a future version.
17805 @item -mscc
17806 @opindex mscc
17808 Enable the use of conditional set instructions (default).
17810 This switch is mainly for debugging the compiler and will likely be removed
17811 in a future version.
17813 @item -mno-scc
17814 @opindex mno-scc
17816 Disable the use of conditional set instructions.
17818 This switch is mainly for debugging the compiler and will likely be removed
17819 in a future version.
17821 @item -mcond-exec
17822 @opindex mcond-exec
17824 Enable the use of conditional execution (default).
17826 This switch is mainly for debugging the compiler and will likely be removed
17827 in a future version.
17829 @item -mno-cond-exec
17830 @opindex mno-cond-exec
17832 Disable the use of conditional execution.
17834 This switch is mainly for debugging the compiler and will likely be removed
17835 in a future version.
17837 @item -mvliw-branch
17838 @opindex mvliw-branch
17840 Run a pass to pack branches into VLIW instructions (default).
17842 This switch is mainly for debugging the compiler and will likely be removed
17843 in a future version.
17845 @item -mno-vliw-branch
17846 @opindex mno-vliw-branch
17848 Do not run a pass to pack branches into VLIW instructions.
17850 This switch is mainly for debugging the compiler and will likely be removed
17851 in a future version.
17853 @item -mmulti-cond-exec
17854 @opindex mmulti-cond-exec
17856 Enable optimization of @code{&&} and @code{||} in conditional execution
17857 (default).
17859 This switch is mainly for debugging the compiler and will likely be removed
17860 in a future version.
17862 @item -mno-multi-cond-exec
17863 @opindex mno-multi-cond-exec
17865 Disable optimization of @code{&&} and @code{||} in conditional execution.
17867 This switch is mainly for debugging the compiler and will likely be removed
17868 in a future version.
17870 @item -mnested-cond-exec
17871 @opindex mnested-cond-exec
17873 Enable nested conditional execution optimizations (default).
17875 This switch is mainly for debugging the compiler and will likely be removed
17876 in a future version.
17878 @item -mno-nested-cond-exec
17879 @opindex mno-nested-cond-exec
17881 Disable nested conditional execution optimizations.
17883 This switch is mainly for debugging the compiler and will likely be removed
17884 in a future version.
17886 @item -moptimize-membar
17887 @opindex moptimize-membar
17889 This switch removes redundant @code{membar} instructions from the
17890 compiler-generated code.  It is enabled by default.
17892 @item -mno-optimize-membar
17893 @opindex mno-optimize-membar
17895 This switch disables the automatic removal of redundant @code{membar}
17896 instructions from the generated code.
17898 @item -mtomcat-stats
17899 @opindex mtomcat-stats
17901 Cause gas to print out tomcat statistics.
17903 @item -mcpu=@var{cpu}
17904 @opindex mcpu
17906 Select the processor type for which to generate code.  Possible values are
17907 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
17908 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
17910 @end table
17912 @node GNU/Linux Options
17913 @subsection GNU/Linux Options
17915 These @samp{-m} options are defined for GNU/Linux targets:
17917 @table @gcctabopt
17918 @item -mglibc
17919 @opindex mglibc
17920 Use the GNU C library.  This is the default except
17921 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
17922 @samp{*-*-linux-*android*} targets.
17924 @item -muclibc
17925 @opindex muclibc
17926 Use uClibc C library.  This is the default on
17927 @samp{*-*-linux-*uclibc*} targets.
17929 @item -mmusl
17930 @opindex mmusl
17931 Use the musl C library.  This is the default on
17932 @samp{*-*-linux-*musl*} targets.
17934 @item -mbionic
17935 @opindex mbionic
17936 Use Bionic C library.  This is the default on
17937 @samp{*-*-linux-*android*} targets.
17939 @item -mandroid
17940 @opindex mandroid
17941 Compile code compatible with Android platform.  This is the default on
17942 @samp{*-*-linux-*android*} targets.
17944 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
17945 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
17946 this option makes the GCC driver pass Android-specific options to the linker.
17947 Finally, this option causes the preprocessor macro @code{__ANDROID__}
17948 to be defined.
17950 @item -tno-android-cc
17951 @opindex tno-android-cc
17952 Disable compilation effects of @option{-mandroid}, i.e., do not enable
17953 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
17954 @option{-fno-rtti} by default.
17956 @item -tno-android-ld
17957 @opindex tno-android-ld
17958 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
17959 linking options to the linker.
17961 @end table
17963 @node H8/300 Options
17964 @subsection H8/300 Options
17966 These @samp{-m} options are defined for the H8/300 implementations:
17968 @table @gcctabopt
17969 @item -mrelax
17970 @opindex mrelax
17971 Shorten some address references at link time, when possible; uses the
17972 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
17973 ld, Using ld}, for a fuller description.
17975 @item -mh
17976 @opindex mh
17977 Generate code for the H8/300H@.
17979 @item -ms
17980 @opindex ms
17981 Generate code for the H8S@.
17983 @item -mn
17984 @opindex mn
17985 Generate code for the H8S and H8/300H in the normal mode.  This switch
17986 must be used either with @option{-mh} or @option{-ms}.
17988 @item -ms2600
17989 @opindex ms2600
17990 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
17992 @item -mexr
17993 @opindex mexr
17994 Extended registers are stored on stack before execution of function
17995 with monitor attribute. Default option is @option{-mexr}.
17996 This option is valid only for H8S targets.
17998 @item -mno-exr
17999 @opindex mno-exr
18000 Extended registers are not stored on stack before execution of function 
18001 with monitor attribute. Default option is @option{-mno-exr}. 
18002 This option is valid only for H8S targets.
18004 @item -mint32
18005 @opindex mint32
18006 Make @code{int} data 32 bits by default.
18008 @item -malign-300
18009 @opindex malign-300
18010 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
18011 The default for the H8/300H and H8S is to align longs and floats on
18012 4-byte boundaries.
18013 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
18014 This option has no effect on the H8/300.
18015 @end table
18017 @node HPPA Options
18018 @subsection HPPA Options
18019 @cindex HPPA Options
18021 These @samp{-m} options are defined for the HPPA family of computers:
18023 @table @gcctabopt
18024 @item -march=@var{architecture-type}
18025 @opindex march
18026 Generate code for the specified architecture.  The choices for
18027 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
18028 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
18029 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
18030 architecture option for your machine.  Code compiled for lower numbered
18031 architectures runs on higher numbered architectures, but not the
18032 other way around.
18034 @item -mpa-risc-1-0
18035 @itemx -mpa-risc-1-1
18036 @itemx -mpa-risc-2-0
18037 @opindex mpa-risc-1-0
18038 @opindex mpa-risc-1-1
18039 @opindex mpa-risc-2-0
18040 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
18042 @item -mcaller-copies
18043 @opindex mcaller-copies
18044 The caller copies function arguments passed by hidden reference.  This
18045 option should be used with care as it is not compatible with the default
18046 32-bit runtime.  However, only aggregates larger than eight bytes are
18047 passed by hidden reference and the option provides better compatibility
18048 with OpenMP.
18050 @item -mjump-in-delay
18051 @opindex mjump-in-delay
18052 This option is ignored and provided for compatibility purposes only.
18054 @item -mdisable-fpregs
18055 @opindex mdisable-fpregs
18056 Prevent floating-point registers from being used in any manner.  This is
18057 necessary for compiling kernels that perform lazy context switching of
18058 floating-point registers.  If you use this option and attempt to perform
18059 floating-point operations, the compiler aborts.
18061 @item -mdisable-indexing
18062 @opindex mdisable-indexing
18063 Prevent the compiler from using indexing address modes.  This avoids some
18064 rather obscure problems when compiling MIG generated code under MACH@.
18066 @item -mno-space-regs
18067 @opindex mno-space-regs
18068 Generate code that assumes the target has no space registers.  This allows
18069 GCC to generate faster indirect calls and use unscaled index address modes.
18071 Such code is suitable for level 0 PA systems and kernels.
18073 @item -mfast-indirect-calls
18074 @opindex mfast-indirect-calls
18075 Generate code that assumes calls never cross space boundaries.  This
18076 allows GCC to emit code that performs faster indirect calls.
18078 This option does not work in the presence of shared libraries or nested
18079 functions.
18081 @item -mfixed-range=@var{register-range}
18082 @opindex mfixed-range
18083 Generate code treating the given register range as fixed registers.
18084 A fixed register is one that the register allocator cannot use.  This is
18085 useful when compiling kernel code.  A register range is specified as
18086 two registers separated by a dash.  Multiple register ranges can be
18087 specified separated by a comma.
18089 @item -mlong-load-store
18090 @opindex mlong-load-store
18091 Generate 3-instruction load and store sequences as sometimes required by
18092 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
18093 the HP compilers.
18095 @item -mportable-runtime
18096 @opindex mportable-runtime
18097 Use the portable calling conventions proposed by HP for ELF systems.
18099 @item -mgas
18100 @opindex mgas
18101 Enable the use of assembler directives only GAS understands.
18103 @item -mschedule=@var{cpu-type}
18104 @opindex mschedule
18105 Schedule code according to the constraints for the machine type
18106 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
18107 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
18108 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
18109 proper scheduling option for your machine.  The default scheduling is
18110 @samp{8000}.
18112 @item -mlinker-opt
18113 @opindex mlinker-opt
18114 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
18115 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
18116 linkers in which they give bogus error messages when linking some programs.
18118 @item -msoft-float
18119 @opindex msoft-float
18120 Generate output containing library calls for floating point.
18121 @strong{Warning:} the requisite libraries are not available for all HPPA
18122 targets.  Normally the facilities of the machine's usual C compiler are
18123 used, but this cannot be done directly in cross-compilation.  You must make
18124 your own arrangements to provide suitable library functions for
18125 cross-compilation.
18127 @option{-msoft-float} changes the calling convention in the output file;
18128 therefore, it is only useful if you compile @emph{all} of a program with
18129 this option.  In particular, you need to compile @file{libgcc.a}, the
18130 library that comes with GCC, with @option{-msoft-float} in order for
18131 this to work.
18133 @item -msio
18134 @opindex msio
18135 Generate the predefine, @code{_SIO}, for server IO@.  The default is
18136 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
18137 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
18138 options are available under HP-UX and HI-UX@.
18140 @item -mgnu-ld
18141 @opindex mgnu-ld
18142 Use options specific to GNU @command{ld}.
18143 This passes @option{-shared} to @command{ld} when
18144 building a shared library.  It is the default when GCC is configured,
18145 explicitly or implicitly, with the GNU linker.  This option does not
18146 affect which @command{ld} is called; it only changes what parameters
18147 are passed to that @command{ld}.
18148 The @command{ld} that is called is determined by the
18149 @option{--with-ld} configure option, GCC's program search path, and
18150 finally by the user's @env{PATH}.  The linker used by GCC can be printed
18151 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
18152 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
18154 @item -mhp-ld
18155 @opindex mhp-ld
18156 Use options specific to HP @command{ld}.
18157 This passes @option{-b} to @command{ld} when building
18158 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
18159 links.  It is the default when GCC is configured, explicitly or
18160 implicitly, with the HP linker.  This option does not affect
18161 which @command{ld} is called; it only changes what parameters are passed to that
18162 @command{ld}.
18163 The @command{ld} that is called is determined by the @option{--with-ld}
18164 configure option, GCC's program search path, and finally by the user's
18165 @env{PATH}.  The linker used by GCC can be printed using @samp{which
18166 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
18167 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
18169 @item -mlong-calls
18170 @opindex mno-long-calls
18171 Generate code that uses long call sequences.  This ensures that a call
18172 is always able to reach linker generated stubs.  The default is to generate
18173 long calls only when the distance from the call site to the beginning
18174 of the function or translation unit, as the case may be, exceeds a
18175 predefined limit set by the branch type being used.  The limits for
18176 normal calls are 7,600,000 and 240,000 bytes, respectively for the
18177 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
18178 240,000 bytes.
18180 Distances are measured from the beginning of functions when using the
18181 @option{-ffunction-sections} option, or when using the @option{-mgas}
18182 and @option{-mno-portable-runtime} options together under HP-UX with
18183 the SOM linker.
18185 It is normally not desirable to use this option as it degrades
18186 performance.  However, it may be useful in large applications,
18187 particularly when partial linking is used to build the application.
18189 The types of long calls used depends on the capabilities of the
18190 assembler and linker, and the type of code being generated.  The
18191 impact on systems that support long absolute calls, and long pic
18192 symbol-difference or pc-relative calls should be relatively small.
18193 However, an indirect call is used on 32-bit ELF systems in pic code
18194 and it is quite long.
18196 @item -munix=@var{unix-std}
18197 @opindex march
18198 Generate compiler predefines and select a startfile for the specified
18199 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
18200 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
18201 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
18202 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
18203 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
18204 and later.
18206 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
18207 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
18208 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
18209 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
18210 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
18211 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
18213 It is @emph{important} to note that this option changes the interfaces
18214 for various library routines.  It also affects the operational behavior
18215 of the C library.  Thus, @emph{extreme} care is needed in using this
18216 option.
18218 Library code that is intended to operate with more than one UNIX
18219 standard must test, set and restore the variable @code{__xpg4_extended_mask}
18220 as appropriate.  Most GNU software doesn't provide this capability.
18222 @item -nolibdld
18223 @opindex nolibdld
18224 Suppress the generation of link options to search libdld.sl when the
18225 @option{-static} option is specified on HP-UX 10 and later.
18227 @item -static
18228 @opindex static
18229 The HP-UX implementation of setlocale in libc has a dependency on
18230 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
18231 when the @option{-static} option is specified, special link options
18232 are needed to resolve this dependency.
18234 On HP-UX 10 and later, the GCC driver adds the necessary options to
18235 link with libdld.sl when the @option{-static} option is specified.
18236 This causes the resulting binary to be dynamic.  On the 64-bit port,
18237 the linkers generate dynamic binaries by default in any case.  The
18238 @option{-nolibdld} option can be used to prevent the GCC driver from
18239 adding these link options.
18241 @item -threads
18242 @opindex threads
18243 Add support for multithreading with the @dfn{dce thread} library
18244 under HP-UX@.  This option sets flags for both the preprocessor and
18245 linker.
18246 @end table
18248 @node IA-64 Options
18249 @subsection IA-64 Options
18250 @cindex IA-64 Options
18252 These are the @samp{-m} options defined for the Intel IA-64 architecture.
18254 @table @gcctabopt
18255 @item -mbig-endian
18256 @opindex mbig-endian
18257 Generate code for a big-endian target.  This is the default for HP-UX@.
18259 @item -mlittle-endian
18260 @opindex mlittle-endian
18261 Generate code for a little-endian target.  This is the default for AIX5
18262 and GNU/Linux.
18264 @item -mgnu-as
18265 @itemx -mno-gnu-as
18266 @opindex mgnu-as
18267 @opindex mno-gnu-as
18268 Generate (or don't) code for the GNU assembler.  This is the default.
18269 @c Also, this is the default if the configure option @option{--with-gnu-as}
18270 @c is used.
18272 @item -mgnu-ld
18273 @itemx -mno-gnu-ld
18274 @opindex mgnu-ld
18275 @opindex mno-gnu-ld
18276 Generate (or don't) code for the GNU linker.  This is the default.
18277 @c Also, this is the default if the configure option @option{--with-gnu-ld}
18278 @c is used.
18280 @item -mno-pic
18281 @opindex mno-pic
18282 Generate code that does not use a global pointer register.  The result
18283 is not position independent code, and violates the IA-64 ABI@.
18285 @item -mvolatile-asm-stop
18286 @itemx -mno-volatile-asm-stop
18287 @opindex mvolatile-asm-stop
18288 @opindex mno-volatile-asm-stop
18289 Generate (or don't) a stop bit immediately before and after volatile asm
18290 statements.
18292 @item -mregister-names
18293 @itemx -mno-register-names
18294 @opindex mregister-names
18295 @opindex mno-register-names
18296 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
18297 the stacked registers.  This may make assembler output more readable.
18299 @item -mno-sdata
18300 @itemx -msdata
18301 @opindex mno-sdata
18302 @opindex msdata
18303 Disable (or enable) optimizations that use the small data section.  This may
18304 be useful for working around optimizer bugs.
18306 @item -mconstant-gp
18307 @opindex mconstant-gp
18308 Generate code that uses a single constant global pointer value.  This is
18309 useful when compiling kernel code.
18311 @item -mauto-pic
18312 @opindex mauto-pic
18313 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
18314 This is useful when compiling firmware code.
18316 @item -minline-float-divide-min-latency
18317 @opindex minline-float-divide-min-latency
18318 Generate code for inline divides of floating-point values
18319 using the minimum latency algorithm.
18321 @item -minline-float-divide-max-throughput
18322 @opindex minline-float-divide-max-throughput
18323 Generate code for inline divides of floating-point values
18324 using the maximum throughput algorithm.
18326 @item -mno-inline-float-divide
18327 @opindex mno-inline-float-divide
18328 Do not generate inline code for divides of floating-point values.
18330 @item -minline-int-divide-min-latency
18331 @opindex minline-int-divide-min-latency
18332 Generate code for inline divides of integer values
18333 using the minimum latency algorithm.
18335 @item -minline-int-divide-max-throughput
18336 @opindex minline-int-divide-max-throughput
18337 Generate code for inline divides of integer values
18338 using the maximum throughput algorithm.
18340 @item -mno-inline-int-divide
18341 @opindex mno-inline-int-divide
18342 Do not generate inline code for divides of integer values.
18344 @item -minline-sqrt-min-latency
18345 @opindex minline-sqrt-min-latency
18346 Generate code for inline square roots
18347 using the minimum latency algorithm.
18349 @item -minline-sqrt-max-throughput
18350 @opindex minline-sqrt-max-throughput
18351 Generate code for inline square roots
18352 using the maximum throughput algorithm.
18354 @item -mno-inline-sqrt
18355 @opindex mno-inline-sqrt
18356 Do not generate inline code for @code{sqrt}.
18358 @item -mfused-madd
18359 @itemx -mno-fused-madd
18360 @opindex mfused-madd
18361 @opindex mno-fused-madd
18362 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
18363 instructions.  The default is to use these instructions.
18365 @item -mno-dwarf2-asm
18366 @itemx -mdwarf2-asm
18367 @opindex mno-dwarf2-asm
18368 @opindex mdwarf2-asm
18369 Don't (or do) generate assembler code for the DWARF line number debugging
18370 info.  This may be useful when not using the GNU assembler.
18372 @item -mearly-stop-bits
18373 @itemx -mno-early-stop-bits
18374 @opindex mearly-stop-bits
18375 @opindex mno-early-stop-bits
18376 Allow stop bits to be placed earlier than immediately preceding the
18377 instruction that triggered the stop bit.  This can improve instruction
18378 scheduling, but does not always do so.
18380 @item -mfixed-range=@var{register-range}
18381 @opindex mfixed-range
18382 Generate code treating the given register range as fixed registers.
18383 A fixed register is one that the register allocator cannot use.  This is
18384 useful when compiling kernel code.  A register range is specified as
18385 two registers separated by a dash.  Multiple register ranges can be
18386 specified separated by a comma.
18388 @item -mtls-size=@var{tls-size}
18389 @opindex mtls-size
18390 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
18393 @item -mtune=@var{cpu-type}
18394 @opindex mtune
18395 Tune the instruction scheduling for a particular CPU, Valid values are
18396 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
18397 and @samp{mckinley}.
18399 @item -milp32
18400 @itemx -mlp64
18401 @opindex milp32
18402 @opindex mlp64
18403 Generate code for a 32-bit or 64-bit environment.
18404 The 32-bit environment sets int, long and pointer to 32 bits.
18405 The 64-bit environment sets int to 32 bits and long and pointer
18406 to 64 bits.  These are HP-UX specific flags.
18408 @item -mno-sched-br-data-spec
18409 @itemx -msched-br-data-spec
18410 @opindex mno-sched-br-data-spec
18411 @opindex msched-br-data-spec
18412 (Dis/En)able data speculative scheduling before reload.
18413 This results in generation of @code{ld.a} instructions and
18414 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
18415 The default setting is disabled.
18417 @item -msched-ar-data-spec
18418 @itemx -mno-sched-ar-data-spec
18419 @opindex msched-ar-data-spec
18420 @opindex mno-sched-ar-data-spec
18421 (En/Dis)able data speculative scheduling after reload.
18422 This results in generation of @code{ld.a} instructions and
18423 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
18424 The default setting is enabled.
18426 @item -mno-sched-control-spec
18427 @itemx -msched-control-spec
18428 @opindex mno-sched-control-spec
18429 @opindex msched-control-spec
18430 (Dis/En)able control speculative scheduling.  This feature is
18431 available only during region scheduling (i.e.@: before reload).
18432 This results in generation of the @code{ld.s} instructions and
18433 the corresponding check instructions @code{chk.s}.
18434 The default setting is disabled.
18436 @item -msched-br-in-data-spec
18437 @itemx -mno-sched-br-in-data-spec
18438 @opindex msched-br-in-data-spec
18439 @opindex mno-sched-br-in-data-spec
18440 (En/Dis)able speculative scheduling of the instructions that
18441 are dependent on the data speculative loads before reload.
18442 This is effective only with @option{-msched-br-data-spec} enabled.
18443 The default setting is enabled.
18445 @item -msched-ar-in-data-spec
18446 @itemx -mno-sched-ar-in-data-spec
18447 @opindex msched-ar-in-data-spec
18448 @opindex mno-sched-ar-in-data-spec
18449 (En/Dis)able speculative scheduling of the instructions that
18450 are dependent on the data speculative loads after reload.
18451 This is effective only with @option{-msched-ar-data-spec} enabled.
18452 The default setting is enabled.
18454 @item -msched-in-control-spec
18455 @itemx -mno-sched-in-control-spec
18456 @opindex msched-in-control-spec
18457 @opindex mno-sched-in-control-spec
18458 (En/Dis)able speculative scheduling of the instructions that
18459 are dependent on the control speculative loads.
18460 This is effective only with @option{-msched-control-spec} enabled.
18461 The default setting is enabled.
18463 @item -mno-sched-prefer-non-data-spec-insns
18464 @itemx -msched-prefer-non-data-spec-insns
18465 @opindex mno-sched-prefer-non-data-spec-insns
18466 @opindex msched-prefer-non-data-spec-insns
18467 If enabled, data-speculative instructions are chosen for schedule
18468 only if there are no other choices at the moment.  This makes
18469 the use of the data speculation much more conservative.
18470 The default setting is disabled.
18472 @item -mno-sched-prefer-non-control-spec-insns
18473 @itemx -msched-prefer-non-control-spec-insns
18474 @opindex mno-sched-prefer-non-control-spec-insns
18475 @opindex msched-prefer-non-control-spec-insns
18476 If enabled, control-speculative instructions are chosen for schedule
18477 only if there are no other choices at the moment.  This makes
18478 the use of the control speculation much more conservative.
18479 The default setting is disabled.
18481 @item -mno-sched-count-spec-in-critical-path
18482 @itemx -msched-count-spec-in-critical-path
18483 @opindex mno-sched-count-spec-in-critical-path
18484 @opindex msched-count-spec-in-critical-path
18485 If enabled, speculative dependencies are considered during
18486 computation of the instructions priorities.  This makes the use of the
18487 speculation a bit more conservative.
18488 The default setting is disabled.
18490 @item -msched-spec-ldc
18491 @opindex msched-spec-ldc
18492 Use a simple data speculation check.  This option is on by default.
18494 @item -msched-control-spec-ldc
18495 @opindex msched-spec-ldc
18496 Use a simple check for control speculation.  This option is on by default.
18498 @item -msched-stop-bits-after-every-cycle
18499 @opindex msched-stop-bits-after-every-cycle
18500 Place a stop bit after every cycle when scheduling.  This option is on
18501 by default.
18503 @item -msched-fp-mem-deps-zero-cost
18504 @opindex msched-fp-mem-deps-zero-cost
18505 Assume that floating-point stores and loads are not likely to cause a conflict
18506 when placed into the same instruction group.  This option is disabled by
18507 default.
18509 @item -msel-sched-dont-check-control-spec
18510 @opindex msel-sched-dont-check-control-spec
18511 Generate checks for control speculation in selective scheduling.
18512 This flag is disabled by default.
18514 @item -msched-max-memory-insns=@var{max-insns}
18515 @opindex msched-max-memory-insns
18516 Limit on the number of memory insns per instruction group, giving lower
18517 priority to subsequent memory insns attempting to schedule in the same
18518 instruction group. Frequently useful to prevent cache bank conflicts.
18519 The default value is 1.
18521 @item -msched-max-memory-insns-hard-limit
18522 @opindex msched-max-memory-insns-hard-limit
18523 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
18524 disallowing more than that number in an instruction group.
18525 Otherwise, the limit is ``soft'', meaning that non-memory operations
18526 are preferred when the limit is reached, but memory operations may still
18527 be scheduled.
18529 @end table
18531 @node LM32 Options
18532 @subsection LM32 Options
18533 @cindex LM32 options
18535 These @option{-m} options are defined for the LatticeMico32 architecture:
18537 @table @gcctabopt
18538 @item -mbarrel-shift-enabled
18539 @opindex mbarrel-shift-enabled
18540 Enable barrel-shift instructions.
18542 @item -mdivide-enabled
18543 @opindex mdivide-enabled
18544 Enable divide and modulus instructions.
18546 @item -mmultiply-enabled
18547 @opindex multiply-enabled
18548 Enable multiply instructions.
18550 @item -msign-extend-enabled
18551 @opindex msign-extend-enabled
18552 Enable sign extend instructions.
18554 @item -muser-enabled
18555 @opindex muser-enabled
18556 Enable user-defined instructions.
18558 @end table
18560 @node M32C Options
18561 @subsection M32C Options
18562 @cindex M32C options
18564 @table @gcctabopt
18565 @item -mcpu=@var{name}
18566 @opindex mcpu=
18567 Select the CPU for which code is generated.  @var{name} may be one of
18568 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
18569 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
18570 the M32C/80 series.
18572 @item -msim
18573 @opindex msim
18574 Specifies that the program will be run on the simulator.  This causes
18575 an alternate runtime library to be linked in which supports, for
18576 example, file I/O@.  You must not use this option when generating
18577 programs that will run on real hardware; you must provide your own
18578 runtime library for whatever I/O functions are needed.
18580 @item -memregs=@var{number}
18581 @opindex memregs=
18582 Specifies the number of memory-based pseudo-registers GCC uses
18583 during code generation.  These pseudo-registers are used like real
18584 registers, so there is a tradeoff between GCC's ability to fit the
18585 code into available registers, and the performance penalty of using
18586 memory instead of registers.  Note that all modules in a program must
18587 be compiled with the same value for this option.  Because of that, you
18588 must not use this option with GCC's default runtime libraries.
18590 @end table
18592 @node M32R/D Options
18593 @subsection M32R/D Options
18594 @cindex M32R/D options
18596 These @option{-m} options are defined for Renesas M32R/D architectures:
18598 @table @gcctabopt
18599 @item -m32r2
18600 @opindex m32r2
18601 Generate code for the M32R/2@.
18603 @item -m32rx
18604 @opindex m32rx
18605 Generate code for the M32R/X@.
18607 @item -m32r
18608 @opindex m32r
18609 Generate code for the M32R@.  This is the default.
18611 @item -mmodel=small
18612 @opindex mmodel=small
18613 Assume all objects live in the lower 16MB of memory (so that their addresses
18614 can be loaded with the @code{ld24} instruction), and assume all subroutines
18615 are reachable with the @code{bl} instruction.
18616 This is the default.
18618 The addressability of a particular object can be set with the
18619 @code{model} attribute.
18621 @item -mmodel=medium
18622 @opindex mmodel=medium
18623 Assume objects may be anywhere in the 32-bit address space (the compiler
18624 generates @code{seth/add3} instructions to load their addresses), and
18625 assume all subroutines are reachable with the @code{bl} instruction.
18627 @item -mmodel=large
18628 @opindex mmodel=large
18629 Assume objects may be anywhere in the 32-bit address space (the compiler
18630 generates @code{seth/add3} instructions to load their addresses), and
18631 assume subroutines may not be reachable with the @code{bl} instruction
18632 (the compiler generates the much slower @code{seth/add3/jl}
18633 instruction sequence).
18635 @item -msdata=none
18636 @opindex msdata=none
18637 Disable use of the small data area.  Variables are put into
18638 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
18639 @code{section} attribute has been specified).
18640 This is the default.
18642 The small data area consists of sections @code{.sdata} and @code{.sbss}.
18643 Objects may be explicitly put in the small data area with the
18644 @code{section} attribute using one of these sections.
18646 @item -msdata=sdata
18647 @opindex msdata=sdata
18648 Put small global and static data in the small data area, but do not
18649 generate special code to reference them.
18651 @item -msdata=use
18652 @opindex msdata=use
18653 Put small global and static data in the small data area, and generate
18654 special instructions to reference them.
18656 @item -G @var{num}
18657 @opindex G
18658 @cindex smaller data references
18659 Put global and static objects less than or equal to @var{num} bytes
18660 into the small data or BSS sections instead of the normal data or BSS
18661 sections.  The default value of @var{num} is 8.
18662 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
18663 for this option to have any effect.
18665 All modules should be compiled with the same @option{-G @var{num}} value.
18666 Compiling with different values of @var{num} may or may not work; if it
18667 doesn't the linker gives an error message---incorrect code is not
18668 generated.
18670 @item -mdebug
18671 @opindex mdebug
18672 Makes the M32R-specific code in the compiler display some statistics
18673 that might help in debugging programs.
18675 @item -malign-loops
18676 @opindex malign-loops
18677 Align all loops to a 32-byte boundary.
18679 @item -mno-align-loops
18680 @opindex mno-align-loops
18681 Do not enforce a 32-byte alignment for loops.  This is the default.
18683 @item -missue-rate=@var{number}
18684 @opindex missue-rate=@var{number}
18685 Issue @var{number} instructions per cycle.  @var{number} can only be 1
18686 or 2.
18688 @item -mbranch-cost=@var{number}
18689 @opindex mbranch-cost=@var{number}
18690 @var{number} can only be 1 or 2.  If it is 1 then branches are
18691 preferred over conditional code, if it is 2, then the opposite applies.
18693 @item -mflush-trap=@var{number}
18694 @opindex mflush-trap=@var{number}
18695 Specifies the trap number to use to flush the cache.  The default is
18696 12.  Valid numbers are between 0 and 15 inclusive.
18698 @item -mno-flush-trap
18699 @opindex mno-flush-trap
18700 Specifies that the cache cannot be flushed by using a trap.
18702 @item -mflush-func=@var{name}
18703 @opindex mflush-func=@var{name}
18704 Specifies the name of the operating system function to call to flush
18705 the cache.  The default is @samp{_flush_cache}, but a function call
18706 is only used if a trap is not available.
18708 @item -mno-flush-func
18709 @opindex mno-flush-func
18710 Indicates that there is no OS function for flushing the cache.
18712 @end table
18714 @node M680x0 Options
18715 @subsection M680x0 Options
18716 @cindex M680x0 options
18718 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
18719 The default settings depend on which architecture was selected when
18720 the compiler was configured; the defaults for the most common choices
18721 are given below.
18723 @table @gcctabopt
18724 @item -march=@var{arch}
18725 @opindex march
18726 Generate code for a specific M680x0 or ColdFire instruction set
18727 architecture.  Permissible values of @var{arch} for M680x0
18728 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
18729 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
18730 architectures are selected according to Freescale's ISA classification
18731 and the permissible values are: @samp{isaa}, @samp{isaaplus},
18732 @samp{isab} and @samp{isac}.
18734 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
18735 code for a ColdFire target.  The @var{arch} in this macro is one of the
18736 @option{-march} arguments given above.
18738 When used together, @option{-march} and @option{-mtune} select code
18739 that runs on a family of similar processors but that is optimized
18740 for a particular microarchitecture.
18742 @item -mcpu=@var{cpu}
18743 @opindex mcpu
18744 Generate code for a specific M680x0 or ColdFire processor.
18745 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
18746 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
18747 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
18748 below, which also classifies the CPUs into families:
18750 @multitable @columnfractions 0.20 0.80
18751 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
18752 @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}
18753 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
18754 @item @samp{5206e} @tab @samp{5206e}
18755 @item @samp{5208} @tab @samp{5207} @samp{5208}
18756 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
18757 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
18758 @item @samp{5216} @tab @samp{5214} @samp{5216}
18759 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
18760 @item @samp{5225} @tab @samp{5224} @samp{5225}
18761 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
18762 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
18763 @item @samp{5249} @tab @samp{5249}
18764 @item @samp{5250} @tab @samp{5250}
18765 @item @samp{5271} @tab @samp{5270} @samp{5271}
18766 @item @samp{5272} @tab @samp{5272}
18767 @item @samp{5275} @tab @samp{5274} @samp{5275}
18768 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
18769 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
18770 @item @samp{5307} @tab @samp{5307}
18771 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
18772 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
18773 @item @samp{5407} @tab @samp{5407}
18774 @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}
18775 @end multitable
18777 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
18778 @var{arch} is compatible with @var{cpu}.  Other combinations of
18779 @option{-mcpu} and @option{-march} are rejected.
18781 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
18782 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
18783 where the value of @var{family} is given by the table above.
18785 @item -mtune=@var{tune}
18786 @opindex mtune
18787 Tune the code for a particular microarchitecture within the
18788 constraints set by @option{-march} and @option{-mcpu}.
18789 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
18790 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
18791 and @samp{cpu32}.  The ColdFire microarchitectures
18792 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
18794 You can also use @option{-mtune=68020-40} for code that needs
18795 to run relatively well on 68020, 68030 and 68040 targets.
18796 @option{-mtune=68020-60} is similar but includes 68060 targets
18797 as well.  These two options select the same tuning decisions as
18798 @option{-m68020-40} and @option{-m68020-60} respectively.
18800 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
18801 when tuning for 680x0 architecture @var{arch}.  It also defines
18802 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
18803 option is used.  If GCC is tuning for a range of architectures,
18804 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
18805 it defines the macros for every architecture in the range.
18807 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
18808 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
18809 of the arguments given above.
18811 @item -m68000
18812 @itemx -mc68000
18813 @opindex m68000
18814 @opindex mc68000
18815 Generate output for a 68000.  This is the default
18816 when the compiler is configured for 68000-based systems.
18817 It is equivalent to @option{-march=68000}.
18819 Use this option for microcontrollers with a 68000 or EC000 core,
18820 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
18822 @item -m68010
18823 @opindex m68010
18824 Generate output for a 68010.  This is the default
18825 when the compiler is configured for 68010-based systems.
18826 It is equivalent to @option{-march=68010}.
18828 @item -m68020
18829 @itemx -mc68020
18830 @opindex m68020
18831 @opindex mc68020
18832 Generate output for a 68020.  This is the default
18833 when the compiler is configured for 68020-based systems.
18834 It is equivalent to @option{-march=68020}.
18836 @item -m68030
18837 @opindex m68030
18838 Generate output for a 68030.  This is the default when the compiler is
18839 configured for 68030-based systems.  It is equivalent to
18840 @option{-march=68030}.
18842 @item -m68040
18843 @opindex m68040
18844 Generate output for a 68040.  This is the default when the compiler is
18845 configured for 68040-based systems.  It is equivalent to
18846 @option{-march=68040}.
18848 This option inhibits the use of 68881/68882 instructions that have to be
18849 emulated by software on the 68040.  Use this option if your 68040 does not
18850 have code to emulate those instructions.
18852 @item -m68060
18853 @opindex m68060
18854 Generate output for a 68060.  This is the default when the compiler is
18855 configured for 68060-based systems.  It is equivalent to
18856 @option{-march=68060}.
18858 This option inhibits the use of 68020 and 68881/68882 instructions that
18859 have to be emulated by software on the 68060.  Use this option if your 68060
18860 does not have code to emulate those instructions.
18862 @item -mcpu32
18863 @opindex mcpu32
18864 Generate output for a CPU32.  This is the default
18865 when the compiler is configured for CPU32-based systems.
18866 It is equivalent to @option{-march=cpu32}.
18868 Use this option for microcontrollers with a
18869 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
18870 68336, 68340, 68341, 68349 and 68360.
18872 @item -m5200
18873 @opindex m5200
18874 Generate output for a 520X ColdFire CPU@.  This is the default
18875 when the compiler is configured for 520X-based systems.
18876 It is equivalent to @option{-mcpu=5206}, and is now deprecated
18877 in favor of that option.
18879 Use this option for microcontroller with a 5200 core, including
18880 the MCF5202, MCF5203, MCF5204 and MCF5206.
18882 @item -m5206e
18883 @opindex m5206e
18884 Generate output for a 5206e ColdFire CPU@.  The option is now
18885 deprecated in favor of the equivalent @option{-mcpu=5206e}.
18887 @item -m528x
18888 @opindex m528x
18889 Generate output for a member of the ColdFire 528X family.
18890 The option is now deprecated in favor of the equivalent
18891 @option{-mcpu=528x}.
18893 @item -m5307
18894 @opindex m5307
18895 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
18896 in favor of the equivalent @option{-mcpu=5307}.
18898 @item -m5407
18899 @opindex m5407
18900 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
18901 in favor of the equivalent @option{-mcpu=5407}.
18903 @item -mcfv4e
18904 @opindex mcfv4e
18905 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
18906 This includes use of hardware floating-point instructions.
18907 The option is equivalent to @option{-mcpu=547x}, and is now
18908 deprecated in favor of that option.
18910 @item -m68020-40
18911 @opindex m68020-40
18912 Generate output for a 68040, without using any of the new instructions.
18913 This results in code that can run relatively efficiently on either a
18914 68020/68881 or a 68030 or a 68040.  The generated code does use the
18915 68881 instructions that are emulated on the 68040.
18917 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
18919 @item -m68020-60
18920 @opindex m68020-60
18921 Generate output for a 68060, without using any of the new instructions.
18922 This results in code that can run relatively efficiently on either a
18923 68020/68881 or a 68030 or a 68040.  The generated code does use the
18924 68881 instructions that are emulated on the 68060.
18926 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
18928 @item -mhard-float
18929 @itemx -m68881
18930 @opindex mhard-float
18931 @opindex m68881
18932 Generate floating-point instructions.  This is the default for 68020
18933 and above, and for ColdFire devices that have an FPU@.  It defines the
18934 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
18935 on ColdFire targets.
18937 @item -msoft-float
18938 @opindex msoft-float
18939 Do not generate floating-point instructions; use library calls instead.
18940 This is the default for 68000, 68010, and 68832 targets.  It is also
18941 the default for ColdFire devices that have no FPU.
18943 @item -mdiv
18944 @itemx -mno-div
18945 @opindex mdiv
18946 @opindex mno-div
18947 Generate (do not generate) ColdFire hardware divide and remainder
18948 instructions.  If @option{-march} is used without @option{-mcpu},
18949 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
18950 architectures.  Otherwise, the default is taken from the target CPU
18951 (either the default CPU, or the one specified by @option{-mcpu}).  For
18952 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
18953 @option{-mcpu=5206e}.
18955 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
18957 @item -mshort
18958 @opindex mshort
18959 Consider type @code{int} to be 16 bits wide, like @code{short int}.
18960 Additionally, parameters passed on the stack are also aligned to a
18961 16-bit boundary even on targets whose API mandates promotion to 32-bit.
18963 @item -mno-short
18964 @opindex mno-short
18965 Do not consider type @code{int} to be 16 bits wide.  This is the default.
18967 @item -mnobitfield
18968 @itemx -mno-bitfield
18969 @opindex mnobitfield
18970 @opindex mno-bitfield
18971 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
18972 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
18974 @item -mbitfield
18975 @opindex mbitfield
18976 Do use the bit-field instructions.  The @option{-m68020} option implies
18977 @option{-mbitfield}.  This is the default if you use a configuration
18978 designed for a 68020.
18980 @item -mrtd
18981 @opindex mrtd
18982 Use a different function-calling convention, in which functions
18983 that take a fixed number of arguments return with the @code{rtd}
18984 instruction, which pops their arguments while returning.  This
18985 saves one instruction in the caller since there is no need to pop
18986 the arguments there.
18988 This calling convention is incompatible with the one normally
18989 used on Unix, so you cannot use it if you need to call libraries
18990 compiled with the Unix compiler.
18992 Also, you must provide function prototypes for all functions that
18993 take variable numbers of arguments (including @code{printf});
18994 otherwise incorrect code is generated for calls to those
18995 functions.
18997 In addition, seriously incorrect code results if you call a
18998 function with too many arguments.  (Normally, extra arguments are
18999 harmlessly ignored.)
19001 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
19002 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
19004 @item -mno-rtd
19005 @opindex mno-rtd
19006 Do not use the calling conventions selected by @option{-mrtd}.
19007 This is the default.
19009 @item -malign-int
19010 @itemx -mno-align-int
19011 @opindex malign-int
19012 @opindex mno-align-int
19013 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
19014 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
19015 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
19016 Aligning variables on 32-bit boundaries produces code that runs somewhat
19017 faster on processors with 32-bit busses at the expense of more memory.
19019 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
19020 aligns structures containing the above types differently than
19021 most published application binary interface specifications for the m68k.
19023 @item -mpcrel
19024 @opindex mpcrel
19025 Use the pc-relative addressing mode of the 68000 directly, instead of
19026 using a global offset table.  At present, this option implies @option{-fpic},
19027 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
19028 not presently supported with @option{-mpcrel}, though this could be supported for
19029 68020 and higher processors.
19031 @item -mno-strict-align
19032 @itemx -mstrict-align
19033 @opindex mno-strict-align
19034 @opindex mstrict-align
19035 Do not (do) assume that unaligned memory references are handled by
19036 the system.
19038 @item -msep-data
19039 Generate code that allows the data segment to be located in a different
19040 area of memory from the text segment.  This allows for execute-in-place in
19041 an environment without virtual memory management.  This option implies
19042 @option{-fPIC}.
19044 @item -mno-sep-data
19045 Generate code that assumes that the data segment follows the text segment.
19046 This is the default.
19048 @item -mid-shared-library
19049 Generate code that supports shared libraries via the library ID method.
19050 This allows for execute-in-place and shared libraries in an environment
19051 without virtual memory management.  This option implies @option{-fPIC}.
19053 @item -mno-id-shared-library
19054 Generate code that doesn't assume ID-based shared libraries are being used.
19055 This is the default.
19057 @item -mshared-library-id=n
19058 Specifies the identification number of the ID-based shared library being
19059 compiled.  Specifying a value of 0 generates more compact code; specifying
19060 other values forces the allocation of that number to the current
19061 library, but is no more space- or time-efficient than omitting this option.
19063 @item -mxgot
19064 @itemx -mno-xgot
19065 @opindex mxgot
19066 @opindex mno-xgot
19067 When generating position-independent code for ColdFire, generate code
19068 that works if the GOT has more than 8192 entries.  This code is
19069 larger and slower than code generated without this option.  On M680x0
19070 processors, this option is not needed; @option{-fPIC} suffices.
19072 GCC normally uses a single instruction to load values from the GOT@.
19073 While this is relatively efficient, it only works if the GOT
19074 is smaller than about 64k.  Anything larger causes the linker
19075 to report an error such as:
19077 @cindex relocation truncated to fit (ColdFire)
19078 @smallexample
19079 relocation truncated to fit: R_68K_GOT16O foobar
19080 @end smallexample
19082 If this happens, you should recompile your code with @option{-mxgot}.
19083 It should then work with very large GOTs.  However, code generated with
19084 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
19085 the value of a global symbol.
19087 Note that some linkers, including newer versions of the GNU linker,
19088 can create multiple GOTs and sort GOT entries.  If you have such a linker,
19089 you should only need to use @option{-mxgot} when compiling a single
19090 object file that accesses more than 8192 GOT entries.  Very few do.
19092 These options have no effect unless GCC is generating
19093 position-independent code.
19095 @item -mlong-jump-table-offsets
19096 @opindex mlong-jump-table-offsets
19097 Use 32-bit offsets in @code{switch} tables.  The default is to use
19098 16-bit offsets.
19100 @end table
19102 @node MCore Options
19103 @subsection MCore Options
19104 @cindex MCore options
19106 These are the @samp{-m} options defined for the Motorola M*Core
19107 processors.
19109 @table @gcctabopt
19111 @item -mhardlit
19112 @itemx -mno-hardlit
19113 @opindex mhardlit
19114 @opindex mno-hardlit
19115 Inline constants into the code stream if it can be done in two
19116 instructions or less.
19118 @item -mdiv
19119 @itemx -mno-div
19120 @opindex mdiv
19121 @opindex mno-div
19122 Use the divide instruction.  (Enabled by default).
19124 @item -mrelax-immediate
19125 @itemx -mno-relax-immediate
19126 @opindex mrelax-immediate
19127 @opindex mno-relax-immediate
19128 Allow arbitrary-sized immediates in bit operations.
19130 @item -mwide-bitfields
19131 @itemx -mno-wide-bitfields
19132 @opindex mwide-bitfields
19133 @opindex mno-wide-bitfields
19134 Always treat bit-fields as @code{int}-sized.
19136 @item -m4byte-functions
19137 @itemx -mno-4byte-functions
19138 @opindex m4byte-functions
19139 @opindex mno-4byte-functions
19140 Force all functions to be aligned to a 4-byte boundary.
19142 @item -mcallgraph-data
19143 @itemx -mno-callgraph-data
19144 @opindex mcallgraph-data
19145 @opindex mno-callgraph-data
19146 Emit callgraph information.
19148 @item -mslow-bytes
19149 @itemx -mno-slow-bytes
19150 @opindex mslow-bytes
19151 @opindex mno-slow-bytes
19152 Prefer word access when reading byte quantities.
19154 @item -mlittle-endian
19155 @itemx -mbig-endian
19156 @opindex mlittle-endian
19157 @opindex mbig-endian
19158 Generate code for a little-endian target.
19160 @item -m210
19161 @itemx -m340
19162 @opindex m210
19163 @opindex m340
19164 Generate code for the 210 processor.
19166 @item -mno-lsim
19167 @opindex mno-lsim
19168 Assume that runtime support has been provided and so omit the
19169 simulator library (@file{libsim.a)} from the linker command line.
19171 @item -mstack-increment=@var{size}
19172 @opindex mstack-increment
19173 Set the maximum amount for a single stack increment operation.  Large
19174 values can increase the speed of programs that contain functions
19175 that need a large amount of stack space, but they can also trigger a
19176 segmentation fault if the stack is extended too much.  The default
19177 value is 0x1000.
19179 @end table
19181 @node MeP Options
19182 @subsection MeP Options
19183 @cindex MeP options
19185 @table @gcctabopt
19187 @item -mabsdiff
19188 @opindex mabsdiff
19189 Enables the @code{abs} instruction, which is the absolute difference
19190 between two registers.
19192 @item -mall-opts
19193 @opindex mall-opts
19194 Enables all the optional instructions---average, multiply, divide, bit
19195 operations, leading zero, absolute difference, min/max, clip, and
19196 saturation.
19199 @item -maverage
19200 @opindex maverage
19201 Enables the @code{ave} instruction, which computes the average of two
19202 registers.
19204 @item -mbased=@var{n}
19205 @opindex mbased=
19206 Variables of size @var{n} bytes or smaller are placed in the
19207 @code{.based} section by default.  Based variables use the @code{$tp}
19208 register as a base register, and there is a 128-byte limit to the
19209 @code{.based} section.
19211 @item -mbitops
19212 @opindex mbitops
19213 Enables the bit operation instructions---bit test (@code{btstm}), set
19214 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
19215 test-and-set (@code{tas}).
19217 @item -mc=@var{name}
19218 @opindex mc=
19219 Selects which section constant data is placed in.  @var{name} may
19220 be @samp{tiny}, @samp{near}, or @samp{far}.
19222 @item -mclip
19223 @opindex mclip
19224 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
19225 useful unless you also provide @option{-mminmax}.
19227 @item -mconfig=@var{name}
19228 @opindex mconfig=
19229 Selects one of the built-in core configurations.  Each MeP chip has
19230 one or more modules in it; each module has a core CPU and a variety of
19231 coprocessors, optional instructions, and peripherals.  The
19232 @code{MeP-Integrator} tool, not part of GCC, provides these
19233 configurations through this option; using this option is the same as
19234 using all the corresponding command-line options.  The default
19235 configuration is @samp{default}.
19237 @item -mcop
19238 @opindex mcop
19239 Enables the coprocessor instructions.  By default, this is a 32-bit
19240 coprocessor.  Note that the coprocessor is normally enabled via the
19241 @option{-mconfig=} option.
19243 @item -mcop32
19244 @opindex mcop32
19245 Enables the 32-bit coprocessor's instructions.
19247 @item -mcop64
19248 @opindex mcop64
19249 Enables the 64-bit coprocessor's instructions.
19251 @item -mivc2
19252 @opindex mivc2
19253 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
19255 @item -mdc
19256 @opindex mdc
19257 Causes constant variables to be placed in the @code{.near} section.
19259 @item -mdiv
19260 @opindex mdiv
19261 Enables the @code{div} and @code{divu} instructions.
19263 @item -meb
19264 @opindex meb
19265 Generate big-endian code.
19267 @item -mel
19268 @opindex mel
19269 Generate little-endian code.
19271 @item -mio-volatile
19272 @opindex mio-volatile
19273 Tells the compiler that any variable marked with the @code{io}
19274 attribute is to be considered volatile.
19276 @item -ml
19277 @opindex ml
19278 Causes variables to be assigned to the @code{.far} section by default.
19280 @item -mleadz
19281 @opindex mleadz
19282 Enables the @code{leadz} (leading zero) instruction.
19284 @item -mm
19285 @opindex mm
19286 Causes variables to be assigned to the @code{.near} section by default.
19288 @item -mminmax
19289 @opindex mminmax
19290 Enables the @code{min} and @code{max} instructions.
19292 @item -mmult
19293 @opindex mmult
19294 Enables the multiplication and multiply-accumulate instructions.
19296 @item -mno-opts
19297 @opindex mno-opts
19298 Disables all the optional instructions enabled by @option{-mall-opts}.
19300 @item -mrepeat
19301 @opindex mrepeat
19302 Enables the @code{repeat} and @code{erepeat} instructions, used for
19303 low-overhead looping.
19305 @item -ms
19306 @opindex ms
19307 Causes all variables to default to the @code{.tiny} section.  Note
19308 that there is a 65536-byte limit to this section.  Accesses to these
19309 variables use the @code{%gp} base register.
19311 @item -msatur
19312 @opindex msatur
19313 Enables the saturation instructions.  Note that the compiler does not
19314 currently generate these itself, but this option is included for
19315 compatibility with other tools, like @code{as}.
19317 @item -msdram
19318 @opindex msdram
19319 Link the SDRAM-based runtime instead of the default ROM-based runtime.
19321 @item -msim
19322 @opindex msim
19323 Link the simulator run-time libraries.
19325 @item -msimnovec
19326 @opindex msimnovec
19327 Link the simulator runtime libraries, excluding built-in support
19328 for reset and exception vectors and tables.
19330 @item -mtf
19331 @opindex mtf
19332 Causes all functions to default to the @code{.far} section.  Without
19333 this option, functions default to the @code{.near} section.
19335 @item -mtiny=@var{n}
19336 @opindex mtiny=
19337 Variables that are @var{n} bytes or smaller are allocated to the
19338 @code{.tiny} section.  These variables use the @code{$gp} base
19339 register.  The default for this option is 4, but note that there's a
19340 65536-byte limit to the @code{.tiny} section.
19342 @end table
19344 @node MicroBlaze Options
19345 @subsection MicroBlaze Options
19346 @cindex MicroBlaze Options
19348 @table @gcctabopt
19350 @item -msoft-float
19351 @opindex msoft-float
19352 Use software emulation for floating point (default).
19354 @item -mhard-float
19355 @opindex mhard-float
19356 Use hardware floating-point instructions.
19358 @item -mmemcpy
19359 @opindex mmemcpy
19360 Do not optimize block moves, use @code{memcpy}.
19362 @item -mno-clearbss
19363 @opindex mno-clearbss
19364 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
19366 @item -mcpu=@var{cpu-type}
19367 @opindex mcpu=
19368 Use features of, and schedule code for, the given CPU.
19369 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
19370 where @var{X} is a major version, @var{YY} is the minor version, and
19371 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
19372 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
19374 @item -mxl-soft-mul
19375 @opindex mxl-soft-mul
19376 Use software multiply emulation (default).
19378 @item -mxl-soft-div
19379 @opindex mxl-soft-div
19380 Use software emulation for divides (default).
19382 @item -mxl-barrel-shift
19383 @opindex mxl-barrel-shift
19384 Use the hardware barrel shifter.
19386 @item -mxl-pattern-compare
19387 @opindex mxl-pattern-compare
19388 Use pattern compare instructions.
19390 @item -msmall-divides
19391 @opindex msmall-divides
19392 Use table lookup optimization for small signed integer divisions.
19394 @item -mxl-stack-check
19395 @opindex mxl-stack-check
19396 This option is deprecated.  Use @option{-fstack-check} instead.
19398 @item -mxl-gp-opt
19399 @opindex mxl-gp-opt
19400 Use GP-relative @code{.sdata}/@code{.sbss} sections.
19402 @item -mxl-multiply-high
19403 @opindex mxl-multiply-high
19404 Use multiply high instructions for high part of 32x32 multiply.
19406 @item -mxl-float-convert
19407 @opindex mxl-float-convert
19408 Use hardware floating-point conversion instructions.
19410 @item -mxl-float-sqrt
19411 @opindex mxl-float-sqrt
19412 Use hardware floating-point square root instruction.
19414 @item -mbig-endian
19415 @opindex mbig-endian
19416 Generate code for a big-endian target.
19418 @item -mlittle-endian
19419 @opindex mlittle-endian
19420 Generate code for a little-endian target.
19422 @item -mxl-reorder
19423 @opindex mxl-reorder
19424 Use reorder instructions (swap and byte reversed load/store).
19426 @item -mxl-mode-@var{app-model}
19427 Select application model @var{app-model}.  Valid models are
19428 @table @samp
19429 @item executable
19430 normal executable (default), uses startup code @file{crt0.o}.
19432 @item xmdstub
19433 for use with Xilinx Microprocessor Debugger (XMD) based
19434 software intrusive debug agent called xmdstub. This uses startup file
19435 @file{crt1.o} and sets the start address of the program to 0x800.
19437 @item bootstrap
19438 for applications that are loaded using a bootloader.
19439 This model uses startup file @file{crt2.o} which does not contain a processor
19440 reset vector handler. This is suitable for transferring control on a
19441 processor reset to the bootloader rather than the application.
19443 @item novectors
19444 for applications that do not require any of the
19445 MicroBlaze vectors. This option may be useful for applications running
19446 within a monitoring application. This model uses @file{crt3.o} as a startup file.
19447 @end table
19449 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
19450 @option{-mxl-mode-@var{app-model}}.
19452 @end table
19454 @node MIPS Options
19455 @subsection MIPS Options
19456 @cindex MIPS options
19458 @table @gcctabopt
19460 @item -EB
19461 @opindex EB
19462 Generate big-endian code.
19464 @item -EL
19465 @opindex EL
19466 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
19467 configurations.
19469 @item -march=@var{arch}
19470 @opindex march
19471 Generate code that runs on @var{arch}, which can be the name of a
19472 generic MIPS ISA, or the name of a particular processor.
19473 The ISA names are:
19474 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
19475 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
19476 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
19477 @samp{mips64r5} and @samp{mips64r6}.
19478 The processor names are:
19479 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
19480 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
19481 @samp{5kc}, @samp{5kf},
19482 @samp{20kc},
19483 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
19484 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
19485 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
19486 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
19487 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
19488 @samp{i6400},
19489 @samp{interaptiv},
19490 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
19491 @samp{m4k},
19492 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
19493 @samp{m5100}, @samp{m5101},
19494 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
19495 @samp{orion},
19496 @samp{p5600},
19497 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
19498 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
19499 @samp{rm7000}, @samp{rm9000},
19500 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
19501 @samp{sb1},
19502 @samp{sr71000},
19503 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
19504 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
19505 @samp{xlr} and @samp{xlp}.
19506 The special value @samp{from-abi} selects the
19507 most compatible architecture for the selected ABI (that is,
19508 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
19510 The native Linux/GNU toolchain also supports the value @samp{native},
19511 which selects the best architecture option for the host processor.
19512 @option{-march=native} has no effect if GCC does not recognize
19513 the processor.
19515 In processor names, a final @samp{000} can be abbreviated as @samp{k}
19516 (for example, @option{-march=r2k}).  Prefixes are optional, and
19517 @samp{vr} may be written @samp{r}.
19519 Names of the form @samp{@var{n}f2_1} refer to processors with
19520 FPUs clocked at half the rate of the core, names of the form
19521 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
19522 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
19523 processors with FPUs clocked a ratio of 3:2 with respect to the core.
19524 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
19525 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
19526 accepted as synonyms for @samp{@var{n}f1_1}.
19528 GCC defines two macros based on the value of this option.  The first
19529 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
19530 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
19531 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
19532 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
19533 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
19535 Note that the @code{_MIPS_ARCH} macro uses the processor names given
19536 above.  In other words, it has the full prefix and does not
19537 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
19538 the macro names the resolved architecture (either @code{"mips1"} or
19539 @code{"mips3"}).  It names the default architecture when no
19540 @option{-march} option is given.
19542 @item -mtune=@var{arch}
19543 @opindex mtune
19544 Optimize for @var{arch}.  Among other things, this option controls
19545 the way instructions are scheduled, and the perceived cost of arithmetic
19546 operations.  The list of @var{arch} values is the same as for
19547 @option{-march}.
19549 When this option is not used, GCC optimizes for the processor
19550 specified by @option{-march}.  By using @option{-march} and
19551 @option{-mtune} together, it is possible to generate code that
19552 runs on a family of processors, but optimize the code for one
19553 particular member of that family.
19555 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
19556 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
19557 @option{-march} ones described above.
19559 @item -mips1
19560 @opindex mips1
19561 Equivalent to @option{-march=mips1}.
19563 @item -mips2
19564 @opindex mips2
19565 Equivalent to @option{-march=mips2}.
19567 @item -mips3
19568 @opindex mips3
19569 Equivalent to @option{-march=mips3}.
19571 @item -mips4
19572 @opindex mips4
19573 Equivalent to @option{-march=mips4}.
19575 @item -mips32
19576 @opindex mips32
19577 Equivalent to @option{-march=mips32}.
19579 @item -mips32r3
19580 @opindex mips32r3
19581 Equivalent to @option{-march=mips32r3}.
19583 @item -mips32r5
19584 @opindex mips32r5
19585 Equivalent to @option{-march=mips32r5}.
19587 @item -mips32r6
19588 @opindex mips32r6
19589 Equivalent to @option{-march=mips32r6}.
19591 @item -mips64
19592 @opindex mips64
19593 Equivalent to @option{-march=mips64}.
19595 @item -mips64r2
19596 @opindex mips64r2
19597 Equivalent to @option{-march=mips64r2}.
19599 @item -mips64r3
19600 @opindex mips64r3
19601 Equivalent to @option{-march=mips64r3}.
19603 @item -mips64r5
19604 @opindex mips64r5
19605 Equivalent to @option{-march=mips64r5}.
19607 @item -mips64r6
19608 @opindex mips64r6
19609 Equivalent to @option{-march=mips64r6}.
19611 @item -mips16
19612 @itemx -mno-mips16
19613 @opindex mips16
19614 @opindex mno-mips16
19615 Generate (do not generate) MIPS16 code.  If GCC is targeting a
19616 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
19618 MIPS16 code generation can also be controlled on a per-function basis
19619 by means of @code{mips16} and @code{nomips16} attributes.
19620 @xref{Function Attributes}, for more information.
19622 @item -mflip-mips16
19623 @opindex mflip-mips16
19624 Generate MIPS16 code on alternating functions.  This option is provided
19625 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
19626 not intended for ordinary use in compiling user code.
19628 @item -minterlink-compressed
19629 @item -mno-interlink-compressed
19630 @opindex minterlink-compressed
19631 @opindex mno-interlink-compressed
19632 Require (do not require) that code using the standard (uncompressed) MIPS ISA
19633 be link-compatible with MIPS16 and microMIPS code, and vice versa.
19635 For example, code using the standard ISA encoding cannot jump directly
19636 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
19637 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
19638 knows that the target of the jump is not compressed.
19640 @item -minterlink-mips16
19641 @itemx -mno-interlink-mips16
19642 @opindex minterlink-mips16
19643 @opindex mno-interlink-mips16
19644 Aliases of @option{-minterlink-compressed} and
19645 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
19646 and are retained for backwards compatibility.
19648 @item -mabi=32
19649 @itemx -mabi=o64
19650 @itemx -mabi=n32
19651 @itemx -mabi=64
19652 @itemx -mabi=eabi
19653 @opindex mabi=32
19654 @opindex mabi=o64
19655 @opindex mabi=n32
19656 @opindex mabi=64
19657 @opindex mabi=eabi
19658 Generate code for the given ABI@.
19660 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
19661 generates 64-bit code when you select a 64-bit architecture, but you
19662 can use @option{-mgp32} to get 32-bit code instead.
19664 For information about the O64 ABI, see
19665 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
19667 GCC supports a variant of the o32 ABI in which floating-point registers
19668 are 64 rather than 32 bits wide.  You can select this combination with
19669 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
19670 and @code{mfhc1} instructions and is therefore only supported for
19671 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
19673 The register assignments for arguments and return values remain the
19674 same, but each scalar value is passed in a single 64-bit register
19675 rather than a pair of 32-bit registers.  For example, scalar
19676 floating-point values are returned in @samp{$f0} only, not a
19677 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
19678 remains the same in that the even-numbered double-precision registers
19679 are saved.
19681 Two additional variants of the o32 ABI are supported to enable
19682 a transition from 32-bit to 64-bit registers.  These are FPXX
19683 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
19684 The FPXX extension mandates that all code must execute correctly
19685 when run using 32-bit or 64-bit registers.  The code can be interlinked
19686 with either FP32 or FP64, but not both.
19687 The FP64A extension is similar to the FP64 extension but forbids the
19688 use of odd-numbered single-precision registers.  This can be used
19689 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
19690 processors and allows both FP32 and FP64A code to interlink and
19691 run in the same process without changing FPU modes.
19693 @item -mabicalls
19694 @itemx -mno-abicalls
19695 @opindex mabicalls
19696 @opindex mno-abicalls
19697 Generate (do not generate) code that is suitable for SVR4-style
19698 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
19699 systems.
19701 @item -mshared
19702 @itemx -mno-shared
19703 Generate (do not generate) code that is fully position-independent,
19704 and that can therefore be linked into shared libraries.  This option
19705 only affects @option{-mabicalls}.
19707 All @option{-mabicalls} code has traditionally been position-independent,
19708 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
19709 as an extension, the GNU toolchain allows executables to use absolute
19710 accesses for locally-binding symbols.  It can also use shorter GP
19711 initialization sequences and generate direct calls to locally-defined
19712 functions.  This mode is selected by @option{-mno-shared}.
19714 @option{-mno-shared} depends on binutils 2.16 or higher and generates
19715 objects that can only be linked by the GNU linker.  However, the option
19716 does not affect the ABI of the final executable; it only affects the ABI
19717 of relocatable objects.  Using @option{-mno-shared} generally makes
19718 executables both smaller and quicker.
19720 @option{-mshared} is the default.
19722 @item -mplt
19723 @itemx -mno-plt
19724 @opindex mplt
19725 @opindex mno-plt
19726 Assume (do not assume) that the static and dynamic linkers
19727 support PLTs and copy relocations.  This option only affects
19728 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
19729 has no effect without @option{-msym32}.
19731 You can make @option{-mplt} the default by configuring
19732 GCC with @option{--with-mips-plt}.  The default is
19733 @option{-mno-plt} otherwise.
19735 @item -mxgot
19736 @itemx -mno-xgot
19737 @opindex mxgot
19738 @opindex mno-xgot
19739 Lift (do not lift) the usual restrictions on the size of the global
19740 offset table.
19742 GCC normally uses a single instruction to load values from the GOT@.
19743 While this is relatively efficient, it only works if the GOT
19744 is smaller than about 64k.  Anything larger causes the linker
19745 to report an error such as:
19747 @cindex relocation truncated to fit (MIPS)
19748 @smallexample
19749 relocation truncated to fit: R_MIPS_GOT16 foobar
19750 @end smallexample
19752 If this happens, you should recompile your code with @option{-mxgot}.
19753 This works with very large GOTs, although the code is also
19754 less efficient, since it takes three instructions to fetch the
19755 value of a global symbol.
19757 Note that some linkers can create multiple GOTs.  If you have such a
19758 linker, you should only need to use @option{-mxgot} when a single object
19759 file accesses more than 64k's worth of GOT entries.  Very few do.
19761 These options have no effect unless GCC is generating position
19762 independent code.
19764 @item -mgp32
19765 @opindex mgp32
19766 Assume that general-purpose registers are 32 bits wide.
19768 @item -mgp64
19769 @opindex mgp64
19770 Assume that general-purpose registers are 64 bits wide.
19772 @item -mfp32
19773 @opindex mfp32
19774 Assume that floating-point registers are 32 bits wide.
19776 @item -mfp64
19777 @opindex mfp64
19778 Assume that floating-point registers are 64 bits wide.
19780 @item -mfpxx
19781 @opindex mfpxx
19782 Do not assume the width of floating-point registers.
19784 @item -mhard-float
19785 @opindex mhard-float
19786 Use floating-point coprocessor instructions.
19788 @item -msoft-float
19789 @opindex msoft-float
19790 Do not use floating-point coprocessor instructions.  Implement
19791 floating-point calculations using library calls instead.
19793 @item -mno-float
19794 @opindex mno-float
19795 Equivalent to @option{-msoft-float}, but additionally asserts that the
19796 program being compiled does not perform any floating-point operations.
19797 This option is presently supported only by some bare-metal MIPS
19798 configurations, where it may select a special set of libraries
19799 that lack all floating-point support (including, for example, the
19800 floating-point @code{printf} formats).  
19801 If code compiled with @option{-mno-float} accidentally contains
19802 floating-point operations, it is likely to suffer a link-time
19803 or run-time failure.
19805 @item -msingle-float
19806 @opindex msingle-float
19807 Assume that the floating-point coprocessor only supports single-precision
19808 operations.
19810 @item -mdouble-float
19811 @opindex mdouble-float
19812 Assume that the floating-point coprocessor supports double-precision
19813 operations.  This is the default.
19815 @item -modd-spreg
19816 @itemx -mno-odd-spreg
19817 @opindex modd-spreg
19818 @opindex mno-odd-spreg
19819 Enable the use of odd-numbered single-precision floating-point registers
19820 for the o32 ABI.  This is the default for processors that are known to
19821 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
19822 is set by default.
19824 @item -mabs=2008
19825 @itemx -mabs=legacy
19826 @opindex mabs=2008
19827 @opindex mabs=legacy
19828 These options control the treatment of the special not-a-number (NaN)
19829 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
19830 @code{neg.@i{fmt}} machine instructions.
19832 By default or when @option{-mabs=legacy} is used the legacy
19833 treatment is selected.  In this case these instructions are considered
19834 arithmetic and avoided where correct operation is required and the
19835 input operand might be a NaN.  A longer sequence of instructions that
19836 manipulate the sign bit of floating-point datum manually is used
19837 instead unless the @option{-ffinite-math-only} option has also been
19838 specified.
19840 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
19841 this case these instructions are considered non-arithmetic and therefore
19842 operating correctly in all cases, including in particular where the
19843 input operand is a NaN.  These instructions are therefore always used
19844 for the respective operations.
19846 @item -mnan=2008
19847 @itemx -mnan=legacy
19848 @opindex mnan=2008
19849 @opindex mnan=legacy
19850 These options control the encoding of the special not-a-number (NaN)
19851 IEEE 754 floating-point data.
19853 The @option{-mnan=legacy} option selects the legacy encoding.  In this
19854 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
19855 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
19856 by the first bit of their trailing significand field being 1.
19858 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
19859 this case qNaNs are denoted by the first bit of their trailing
19860 significand field being 1, whereas sNaNs are denoted by the first bit of
19861 their trailing significand field being 0.
19863 The default is @option{-mnan=legacy} unless GCC has been configured with
19864 @option{--with-nan=2008}.
19866 @item -mllsc
19867 @itemx -mno-llsc
19868 @opindex mllsc
19869 @opindex mno-llsc
19870 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
19871 implement atomic memory built-in functions.  When neither option is
19872 specified, GCC uses the instructions if the target architecture
19873 supports them.
19875 @option{-mllsc} is useful if the runtime environment can emulate the
19876 instructions and @option{-mno-llsc} can be useful when compiling for
19877 nonstandard ISAs.  You can make either option the default by
19878 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
19879 respectively.  @option{--with-llsc} is the default for some
19880 configurations; see the installation documentation for details.
19882 @item -mdsp
19883 @itemx -mno-dsp
19884 @opindex mdsp
19885 @opindex mno-dsp
19886 Use (do not use) revision 1 of the MIPS DSP ASE@.
19887 @xref{MIPS DSP Built-in Functions}.  This option defines the
19888 preprocessor macro @code{__mips_dsp}.  It also defines
19889 @code{__mips_dsp_rev} to 1.
19891 @item -mdspr2
19892 @itemx -mno-dspr2
19893 @opindex mdspr2
19894 @opindex mno-dspr2
19895 Use (do not use) revision 2 of the MIPS DSP ASE@.
19896 @xref{MIPS DSP Built-in Functions}.  This option defines the
19897 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
19898 It also defines @code{__mips_dsp_rev} to 2.
19900 @item -msmartmips
19901 @itemx -mno-smartmips
19902 @opindex msmartmips
19903 @opindex mno-smartmips
19904 Use (do not use) the MIPS SmartMIPS ASE.
19906 @item -mpaired-single
19907 @itemx -mno-paired-single
19908 @opindex mpaired-single
19909 @opindex mno-paired-single
19910 Use (do not use) paired-single floating-point instructions.
19911 @xref{MIPS Paired-Single Support}.  This option requires
19912 hardware floating-point support to be enabled.
19914 @item -mdmx
19915 @itemx -mno-mdmx
19916 @opindex mdmx
19917 @opindex mno-mdmx
19918 Use (do not use) MIPS Digital Media Extension instructions.
19919 This option can only be used when generating 64-bit code and requires
19920 hardware floating-point support to be enabled.
19922 @item -mips3d
19923 @itemx -mno-mips3d
19924 @opindex mips3d
19925 @opindex mno-mips3d
19926 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
19927 The option @option{-mips3d} implies @option{-mpaired-single}.
19929 @item -mmicromips
19930 @itemx -mno-micromips
19931 @opindex mmicromips
19932 @opindex mno-mmicromips
19933 Generate (do not generate) microMIPS code.
19935 MicroMIPS code generation can also be controlled on a per-function basis
19936 by means of @code{micromips} and @code{nomicromips} attributes.
19937 @xref{Function Attributes}, for more information.
19939 @item -mmt
19940 @itemx -mno-mt
19941 @opindex mmt
19942 @opindex mno-mt
19943 Use (do not use) MT Multithreading instructions.
19945 @item -mmcu
19946 @itemx -mno-mcu
19947 @opindex mmcu
19948 @opindex mno-mcu
19949 Use (do not use) the MIPS MCU ASE instructions.
19951 @item -meva
19952 @itemx -mno-eva
19953 @opindex meva
19954 @opindex mno-eva
19955 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
19957 @item -mvirt
19958 @itemx -mno-virt
19959 @opindex mvirt
19960 @opindex mno-virt
19961 Use (do not use) the MIPS Virtualization (VZ) instructions.
19963 @item -mxpa
19964 @itemx -mno-xpa
19965 @opindex mxpa
19966 @opindex mno-xpa
19967 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
19969 @item -mlong64
19970 @opindex mlong64
19971 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
19972 an explanation of the default and the way that the pointer size is
19973 determined.
19975 @item -mlong32
19976 @opindex mlong32
19977 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
19979 The default size of @code{int}s, @code{long}s and pointers depends on
19980 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
19981 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
19982 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
19983 or the same size as integer registers, whichever is smaller.
19985 @item -msym32
19986 @itemx -mno-sym32
19987 @opindex msym32
19988 @opindex mno-sym32
19989 Assume (do not assume) that all symbols have 32-bit values, regardless
19990 of the selected ABI@.  This option is useful in combination with
19991 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
19992 to generate shorter and faster references to symbolic addresses.
19994 @item -G @var{num}
19995 @opindex G
19996 Put definitions of externally-visible data in a small data section
19997 if that data is no bigger than @var{num} bytes.  GCC can then generate
19998 more efficient accesses to the data; see @option{-mgpopt} for details.
20000 The default @option{-G} option depends on the configuration.
20002 @item -mlocal-sdata
20003 @itemx -mno-local-sdata
20004 @opindex mlocal-sdata
20005 @opindex mno-local-sdata
20006 Extend (do not extend) the @option{-G} behavior to local data too,
20007 such as to static variables in C@.  @option{-mlocal-sdata} is the
20008 default for all configurations.
20010 If the linker complains that an application is using too much small data,
20011 you might want to try rebuilding the less performance-critical parts with
20012 @option{-mno-local-sdata}.  You might also want to build large
20013 libraries with @option{-mno-local-sdata}, so that the libraries leave
20014 more room for the main program.
20016 @item -mextern-sdata
20017 @itemx -mno-extern-sdata
20018 @opindex mextern-sdata
20019 @opindex mno-extern-sdata
20020 Assume (do not assume) that externally-defined data is in
20021 a small data section if the size of that data is within the @option{-G} limit.
20022 @option{-mextern-sdata} is the default for all configurations.
20024 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
20025 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
20026 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
20027 is placed in a small data section.  If @var{Var} is defined by another
20028 module, you must either compile that module with a high-enough
20029 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
20030 definition.  If @var{Var} is common, you must link the application
20031 with a high-enough @option{-G} setting.
20033 The easiest way of satisfying these restrictions is to compile
20034 and link every module with the same @option{-G} option.  However,
20035 you may wish to build a library that supports several different
20036 small data limits.  You can do this by compiling the library with
20037 the highest supported @option{-G} setting and additionally using
20038 @option{-mno-extern-sdata} to stop the library from making assumptions
20039 about externally-defined data.
20041 @item -mgpopt
20042 @itemx -mno-gpopt
20043 @opindex mgpopt
20044 @opindex mno-gpopt
20045 Use (do not use) GP-relative accesses for symbols that are known to be
20046 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
20047 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
20048 configurations.
20050 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
20051 might not hold the value of @code{_gp}.  For example, if the code is
20052 part of a library that might be used in a boot monitor, programs that
20053 call boot monitor routines pass an unknown value in @code{$gp}.
20054 (In such situations, the boot monitor itself is usually compiled
20055 with @option{-G0}.)
20057 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
20058 @option{-mno-extern-sdata}.
20060 @item -membedded-data
20061 @itemx -mno-embedded-data
20062 @opindex membedded-data
20063 @opindex mno-embedded-data
20064 Allocate variables to the read-only data section first if possible, then
20065 next in the small data section if possible, otherwise in data.  This gives
20066 slightly slower code than the default, but reduces the amount of RAM required
20067 when executing, and thus may be preferred for some embedded systems.
20069 @item -muninit-const-in-rodata
20070 @itemx -mno-uninit-const-in-rodata
20071 @opindex muninit-const-in-rodata
20072 @opindex mno-uninit-const-in-rodata
20073 Put uninitialized @code{const} variables in the read-only data section.
20074 This option is only meaningful in conjunction with @option{-membedded-data}.
20076 @item -mcode-readable=@var{setting}
20077 @opindex mcode-readable
20078 Specify whether GCC may generate code that reads from executable sections.
20079 There are three possible settings:
20081 @table @gcctabopt
20082 @item -mcode-readable=yes
20083 Instructions may freely access executable sections.  This is the
20084 default setting.
20086 @item -mcode-readable=pcrel
20087 MIPS16 PC-relative load instructions can access executable sections,
20088 but other instructions must not do so.  This option is useful on 4KSc
20089 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
20090 It is also useful on processors that can be configured to have a dual
20091 instruction/data SRAM interface and that, like the M4K, automatically
20092 redirect PC-relative loads to the instruction RAM.
20094 @item -mcode-readable=no
20095 Instructions must not access executable sections.  This option can be
20096 useful on targets that are configured to have a dual instruction/data
20097 SRAM interface but that (unlike the M4K) do not automatically redirect
20098 PC-relative loads to the instruction RAM.
20099 @end table
20101 @item -msplit-addresses
20102 @itemx -mno-split-addresses
20103 @opindex msplit-addresses
20104 @opindex mno-split-addresses
20105 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
20106 relocation operators.  This option has been superseded by
20107 @option{-mexplicit-relocs} but is retained for backwards compatibility.
20109 @item -mexplicit-relocs
20110 @itemx -mno-explicit-relocs
20111 @opindex mexplicit-relocs
20112 @opindex mno-explicit-relocs
20113 Use (do not use) assembler relocation operators when dealing with symbolic
20114 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
20115 is to use assembler macros instead.
20117 @option{-mexplicit-relocs} is the default if GCC was configured
20118 to use an assembler that supports relocation operators.
20120 @item -mcheck-zero-division
20121 @itemx -mno-check-zero-division
20122 @opindex mcheck-zero-division
20123 @opindex mno-check-zero-division
20124 Trap (do not trap) on integer division by zero.
20126 The default is @option{-mcheck-zero-division}.
20128 @item -mdivide-traps
20129 @itemx -mdivide-breaks
20130 @opindex mdivide-traps
20131 @opindex mdivide-breaks
20132 MIPS systems check for division by zero by generating either a
20133 conditional trap or a break instruction.  Using traps results in
20134 smaller code, but is only supported on MIPS II and later.  Also, some
20135 versions of the Linux kernel have a bug that prevents trap from
20136 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
20137 allow conditional traps on architectures that support them and
20138 @option{-mdivide-breaks} to force the use of breaks.
20140 The default is usually @option{-mdivide-traps}, but this can be
20141 overridden at configure time using @option{--with-divide=breaks}.
20142 Divide-by-zero checks can be completely disabled using
20143 @option{-mno-check-zero-division}.
20145 @item -mload-store-pairs
20146 @itemx -mno-load-store-pairs
20147 @opindex mload-store-pairs
20148 @opindex mno-load-store-pairs
20149 Enable (disable) an optimization that pairs consecutive load or store
20150 instructions to enable load/store bonding.  This option is enabled by
20151 default but only takes effect when the selected architecture is known
20152 to support bonding.
20154 @item -mmemcpy
20155 @itemx -mno-memcpy
20156 @opindex mmemcpy
20157 @opindex mno-memcpy
20158 Force (do not force) the use of @code{memcpy} for non-trivial block
20159 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
20160 most constant-sized copies.
20162 @item -mlong-calls
20163 @itemx -mno-long-calls
20164 @opindex mlong-calls
20165 @opindex mno-long-calls
20166 Disable (do not disable) use of the @code{jal} instruction.  Calling
20167 functions using @code{jal} is more efficient but requires the caller
20168 and callee to be in the same 256 megabyte segment.
20170 This option has no effect on abicalls code.  The default is
20171 @option{-mno-long-calls}.
20173 @item -mmad
20174 @itemx -mno-mad
20175 @opindex mmad
20176 @opindex mno-mad
20177 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
20178 instructions, as provided by the R4650 ISA@.
20180 @item -mimadd
20181 @itemx -mno-imadd
20182 @opindex mimadd
20183 @opindex mno-imadd
20184 Enable (disable) use of the @code{madd} and @code{msub} integer
20185 instructions.  The default is @option{-mimadd} on architectures
20186 that support @code{madd} and @code{msub} except for the 74k 
20187 architecture where it was found to generate slower code.
20189 @item -mfused-madd
20190 @itemx -mno-fused-madd
20191 @opindex mfused-madd
20192 @opindex mno-fused-madd
20193 Enable (disable) use of the floating-point multiply-accumulate
20194 instructions, when they are available.  The default is
20195 @option{-mfused-madd}.
20197 On the R8000 CPU when multiply-accumulate instructions are used,
20198 the intermediate product is calculated to infinite precision
20199 and is not subject to the FCSR Flush to Zero bit.  This may be
20200 undesirable in some circumstances.  On other processors the result
20201 is numerically identical to the equivalent computation using
20202 separate multiply, add, subtract and negate instructions.
20204 @item -nocpp
20205 @opindex nocpp
20206 Tell the MIPS assembler to not run its preprocessor over user
20207 assembler files (with a @samp{.s} suffix) when assembling them.
20209 @item -mfix-24k
20210 @item -mno-fix-24k
20211 @opindex mfix-24k
20212 @opindex mno-fix-24k
20213 Work around the 24K E48 (lost data on stores during refill) errata.
20214 The workarounds are implemented by the assembler rather than by GCC@.
20216 @item -mfix-r4000
20217 @itemx -mno-fix-r4000
20218 @opindex mfix-r4000
20219 @opindex mno-fix-r4000
20220 Work around certain R4000 CPU errata:
20221 @itemize @minus
20222 @item
20223 A double-word or a variable shift may give an incorrect result if executed
20224 immediately after starting an integer division.
20225 @item
20226 A double-word or a variable shift may give an incorrect result if executed
20227 while an integer multiplication is in progress.
20228 @item
20229 An integer division may give an incorrect result if started in a delay slot
20230 of a taken branch or a jump.
20231 @end itemize
20233 @item -mfix-r4400
20234 @itemx -mno-fix-r4400
20235 @opindex mfix-r4400
20236 @opindex mno-fix-r4400
20237 Work around certain R4400 CPU errata:
20238 @itemize @minus
20239 @item
20240 A double-word or a variable shift may give an incorrect result if executed
20241 immediately after starting an integer division.
20242 @end itemize
20244 @item -mfix-r10000
20245 @itemx -mno-fix-r10000
20246 @opindex mfix-r10000
20247 @opindex mno-fix-r10000
20248 Work around certain R10000 errata:
20249 @itemize @minus
20250 @item
20251 @code{ll}/@code{sc} sequences may not behave atomically on revisions
20252 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
20253 @end itemize
20255 This option can only be used if the target architecture supports
20256 branch-likely instructions.  @option{-mfix-r10000} is the default when
20257 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
20258 otherwise.
20260 @item -mfix-rm7000
20261 @itemx -mno-fix-rm7000
20262 @opindex mfix-rm7000
20263 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
20264 workarounds are implemented by the assembler rather than by GCC@.
20266 @item -mfix-vr4120
20267 @itemx -mno-fix-vr4120
20268 @opindex mfix-vr4120
20269 Work around certain VR4120 errata:
20270 @itemize @minus
20271 @item
20272 @code{dmultu} does not always produce the correct result.
20273 @item
20274 @code{div} and @code{ddiv} do not always produce the correct result if one
20275 of the operands is negative.
20276 @end itemize
20277 The workarounds for the division errata rely on special functions in
20278 @file{libgcc.a}.  At present, these functions are only provided by
20279 the @code{mips64vr*-elf} configurations.
20281 Other VR4120 errata require a NOP to be inserted between certain pairs of
20282 instructions.  These errata are handled by the assembler, not by GCC itself.
20284 @item -mfix-vr4130
20285 @opindex mfix-vr4130
20286 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
20287 workarounds are implemented by the assembler rather than by GCC,
20288 although GCC avoids using @code{mflo} and @code{mfhi} if the
20289 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
20290 instructions are available instead.
20292 @item -mfix-sb1
20293 @itemx -mno-fix-sb1
20294 @opindex mfix-sb1
20295 Work around certain SB-1 CPU core errata.
20296 (This flag currently works around the SB-1 revision 2
20297 ``F1'' and ``F2'' floating-point errata.)
20299 @item -mr10k-cache-barrier=@var{setting}
20300 @opindex mr10k-cache-barrier
20301 Specify whether GCC should insert cache barriers to avoid the
20302 side-effects of speculation on R10K processors.
20304 In common with many processors, the R10K tries to predict the outcome
20305 of a conditional branch and speculatively executes instructions from
20306 the ``taken'' branch.  It later aborts these instructions if the
20307 predicted outcome is wrong.  However, on the R10K, even aborted
20308 instructions can have side effects.
20310 This problem only affects kernel stores and, depending on the system,
20311 kernel loads.  As an example, a speculatively-executed store may load
20312 the target memory into cache and mark the cache line as dirty, even if
20313 the store itself is later aborted.  If a DMA operation writes to the
20314 same area of memory before the ``dirty'' line is flushed, the cached
20315 data overwrites the DMA-ed data.  See the R10K processor manual
20316 for a full description, including other potential problems.
20318 One workaround is to insert cache barrier instructions before every memory
20319 access that might be speculatively executed and that might have side
20320 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
20321 controls GCC's implementation of this workaround.  It assumes that
20322 aborted accesses to any byte in the following regions does not have
20323 side effects:
20325 @enumerate
20326 @item
20327 the memory occupied by the current function's stack frame;
20329 @item
20330 the memory occupied by an incoming stack argument;
20332 @item
20333 the memory occupied by an object with a link-time-constant address.
20334 @end enumerate
20336 It is the kernel's responsibility to ensure that speculative
20337 accesses to these regions are indeed safe.
20339 If the input program contains a function declaration such as:
20341 @smallexample
20342 void foo (void);
20343 @end smallexample
20345 then the implementation of @code{foo} must allow @code{j foo} and
20346 @code{jal foo} to be executed speculatively.  GCC honors this
20347 restriction for functions it compiles itself.  It expects non-GCC
20348 functions (such as hand-written assembly code) to do the same.
20350 The option has three forms:
20352 @table @gcctabopt
20353 @item -mr10k-cache-barrier=load-store
20354 Insert a cache barrier before a load or store that might be
20355 speculatively executed and that might have side effects even
20356 if aborted.
20358 @item -mr10k-cache-barrier=store
20359 Insert a cache barrier before a store that might be speculatively
20360 executed and that might have side effects even if aborted.
20362 @item -mr10k-cache-barrier=none
20363 Disable the insertion of cache barriers.  This is the default setting.
20364 @end table
20366 @item -mflush-func=@var{func}
20367 @itemx -mno-flush-func
20368 @opindex mflush-func
20369 Specifies the function to call to flush the I and D caches, or to not
20370 call any such function.  If called, the function must take the same
20371 arguments as the common @code{_flush_func}, that is, the address of the
20372 memory range for which the cache is being flushed, the size of the
20373 memory range, and the number 3 (to flush both caches).  The default
20374 depends on the target GCC was configured for, but commonly is either
20375 @code{_flush_func} or @code{__cpu_flush}.
20377 @item mbranch-cost=@var{num}
20378 @opindex mbranch-cost
20379 Set the cost of branches to roughly @var{num} ``simple'' instructions.
20380 This cost is only a heuristic and is not guaranteed to produce
20381 consistent results across releases.  A zero cost redundantly selects
20382 the default, which is based on the @option{-mtune} setting.
20384 @item -mbranch-likely
20385 @itemx -mno-branch-likely
20386 @opindex mbranch-likely
20387 @opindex mno-branch-likely
20388 Enable or disable use of Branch Likely instructions, regardless of the
20389 default for the selected architecture.  By default, Branch Likely
20390 instructions may be generated if they are supported by the selected
20391 architecture.  An exception is for the MIPS32 and MIPS64 architectures
20392 and processors that implement those architectures; for those, Branch
20393 Likely instructions are not be generated by default because the MIPS32
20394 and MIPS64 architectures specifically deprecate their use.
20396 @item -mcompact-branches=never
20397 @itemx -mcompact-branches=optimal
20398 @itemx -mcompact-branches=always
20399 @opindex mcompact-branches=never
20400 @opindex mcompact-branches=optimal
20401 @opindex mcompact-branches=always
20402 These options control which form of branches will be generated.  The
20403 default is @option{-mcompact-branches=optimal}.
20405 The @option{-mcompact-branches=never} option ensures that compact branch
20406 instructions will never be generated.
20408 The @option{-mcompact-branches=always} option ensures that a compact
20409 branch instruction will be generated if available.  If a compact branch
20410 instruction is not available, a delay slot form of the branch will be
20411 used instead.
20413 This option is supported from MIPS Release 6 onwards.
20415 The @option{-mcompact-branches=optimal} option will cause a delay slot
20416 branch to be used if one is available in the current ISA and the delay
20417 slot is successfully filled.  If the delay slot is not filled, a compact
20418 branch will be chosen if one is available.
20420 @item -mfp-exceptions
20421 @itemx -mno-fp-exceptions
20422 @opindex mfp-exceptions
20423 Specifies whether FP exceptions are enabled.  This affects how
20424 FP instructions are scheduled for some processors.
20425 The default is that FP exceptions are
20426 enabled.
20428 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
20429 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
20430 FP pipe.
20432 @item -mvr4130-align
20433 @itemx -mno-vr4130-align
20434 @opindex mvr4130-align
20435 The VR4130 pipeline is two-way superscalar, but can only issue two
20436 instructions together if the first one is 8-byte aligned.  When this
20437 option is enabled, GCC aligns pairs of instructions that it
20438 thinks should execute in parallel.
20440 This option only has an effect when optimizing for the VR4130.
20441 It normally makes code faster, but at the expense of making it bigger.
20442 It is enabled by default at optimization level @option{-O3}.
20444 @item -msynci
20445 @itemx -mno-synci
20446 @opindex msynci
20447 Enable (disable) generation of @code{synci} instructions on
20448 architectures that support it.  The @code{synci} instructions (if
20449 enabled) are generated when @code{__builtin___clear_cache} is
20450 compiled.
20452 This option defaults to @option{-mno-synci}, but the default can be
20453 overridden by configuring GCC with @option{--with-synci}.
20455 When compiling code for single processor systems, it is generally safe
20456 to use @code{synci}.  However, on many multi-core (SMP) systems, it
20457 does not invalidate the instruction caches on all cores and may lead
20458 to undefined behavior.
20460 @item -mrelax-pic-calls
20461 @itemx -mno-relax-pic-calls
20462 @opindex mrelax-pic-calls
20463 Try to turn PIC calls that are normally dispatched via register
20464 @code{$25} into direct calls.  This is only possible if the linker can
20465 resolve the destination at link time and if the destination is within
20466 range for a direct call.
20468 @option{-mrelax-pic-calls} is the default if GCC was configured to use
20469 an assembler and a linker that support the @code{.reloc} assembly
20470 directive and @option{-mexplicit-relocs} is in effect.  With
20471 @option{-mno-explicit-relocs}, this optimization can be performed by the
20472 assembler and the linker alone without help from the compiler.
20474 @item -mmcount-ra-address
20475 @itemx -mno-mcount-ra-address
20476 @opindex mmcount-ra-address
20477 @opindex mno-mcount-ra-address
20478 Emit (do not emit) code that allows @code{_mcount} to modify the
20479 calling function's return address.  When enabled, this option extends
20480 the usual @code{_mcount} interface with a new @var{ra-address}
20481 parameter, which has type @code{intptr_t *} and is passed in register
20482 @code{$12}.  @code{_mcount} can then modify the return address by
20483 doing both of the following:
20484 @itemize
20485 @item
20486 Returning the new address in register @code{$31}.
20487 @item
20488 Storing the new address in @code{*@var{ra-address}},
20489 if @var{ra-address} is nonnull.
20490 @end itemize
20492 The default is @option{-mno-mcount-ra-address}.
20494 @item -mframe-header-opt
20495 @itemx -mno-frame-header-opt
20496 @opindex mframe-header-opt
20497 Enable (disable) frame header optimization in the o32 ABI.  When using the
20498 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
20499 function to write out register arguments.  When enabled, this optimization
20500 will suppress the allocation of the frame header if it can be determined that
20501 it is unused.
20503 This optimization is off by default at all optimization levels.
20505 @item -mlxc1-sxc1
20506 @itemx -mno-lxc1-sxc1
20507 @opindex mlxc1-sxc1
20508 When applicable, enable (disable) the generation of @code{lwxc1},
20509 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
20511 @item -mmadd4
20512 @itemx -mno-madd4
20513 @opindex mmadd4
20514 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
20515 @code{madd.d} and related instructions.  Enabled by default.
20517 @end table
20519 @node MMIX Options
20520 @subsection MMIX Options
20521 @cindex MMIX Options
20523 These options are defined for the MMIX:
20525 @table @gcctabopt
20526 @item -mlibfuncs
20527 @itemx -mno-libfuncs
20528 @opindex mlibfuncs
20529 @opindex mno-libfuncs
20530 Specify that intrinsic library functions are being compiled, passing all
20531 values in registers, no matter the size.
20533 @item -mepsilon
20534 @itemx -mno-epsilon
20535 @opindex mepsilon
20536 @opindex mno-epsilon
20537 Generate floating-point comparison instructions that compare with respect
20538 to the @code{rE} epsilon register.
20540 @item -mabi=mmixware
20541 @itemx -mabi=gnu
20542 @opindex mabi=mmixware
20543 @opindex mabi=gnu
20544 Generate code that passes function parameters and return values that (in
20545 the called function) are seen as registers @code{$0} and up, as opposed to
20546 the GNU ABI which uses global registers @code{$231} and up.
20548 @item -mzero-extend
20549 @itemx -mno-zero-extend
20550 @opindex mzero-extend
20551 @opindex mno-zero-extend
20552 When reading data from memory in sizes shorter than 64 bits, use (do not
20553 use) zero-extending load instructions by default, rather than
20554 sign-extending ones.
20556 @item -mknuthdiv
20557 @itemx -mno-knuthdiv
20558 @opindex mknuthdiv
20559 @opindex mno-knuthdiv
20560 Make the result of a division yielding a remainder have the same sign as
20561 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
20562 remainder follows the sign of the dividend.  Both methods are
20563 arithmetically valid, the latter being almost exclusively used.
20565 @item -mtoplevel-symbols
20566 @itemx -mno-toplevel-symbols
20567 @opindex mtoplevel-symbols
20568 @opindex mno-toplevel-symbols
20569 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
20570 code can be used with the @code{PREFIX} assembly directive.
20572 @item -melf
20573 @opindex melf
20574 Generate an executable in the ELF format, rather than the default
20575 @samp{mmo} format used by the @command{mmix} simulator.
20577 @item -mbranch-predict
20578 @itemx -mno-branch-predict
20579 @opindex mbranch-predict
20580 @opindex mno-branch-predict
20581 Use (do not use) the probable-branch instructions, when static branch
20582 prediction indicates a probable branch.
20584 @item -mbase-addresses
20585 @itemx -mno-base-addresses
20586 @opindex mbase-addresses
20587 @opindex mno-base-addresses
20588 Generate (do not generate) code that uses @emph{base addresses}.  Using a
20589 base address automatically generates a request (handled by the assembler
20590 and the linker) for a constant to be set up in a global register.  The
20591 register is used for one or more base address requests within the range 0
20592 to 255 from the value held in the register.  The generally leads to short
20593 and fast code, but the number of different data items that can be
20594 addressed is limited.  This means that a program that uses lots of static
20595 data may require @option{-mno-base-addresses}.
20597 @item -msingle-exit
20598 @itemx -mno-single-exit
20599 @opindex msingle-exit
20600 @opindex mno-single-exit
20601 Force (do not force) generated code to have a single exit point in each
20602 function.
20603 @end table
20605 @node MN10300 Options
20606 @subsection MN10300 Options
20607 @cindex MN10300 options
20609 These @option{-m} options are defined for Matsushita MN10300 architectures:
20611 @table @gcctabopt
20612 @item -mmult-bug
20613 @opindex mmult-bug
20614 Generate code to avoid bugs in the multiply instructions for the MN10300
20615 processors.  This is the default.
20617 @item -mno-mult-bug
20618 @opindex mno-mult-bug
20619 Do not generate code to avoid bugs in the multiply instructions for the
20620 MN10300 processors.
20622 @item -mam33
20623 @opindex mam33
20624 Generate code using features specific to the AM33 processor.
20626 @item -mno-am33
20627 @opindex mno-am33
20628 Do not generate code using features specific to the AM33 processor.  This
20629 is the default.
20631 @item -mam33-2
20632 @opindex mam33-2
20633 Generate code using features specific to the AM33/2.0 processor.
20635 @item -mam34
20636 @opindex mam34
20637 Generate code using features specific to the AM34 processor.
20639 @item -mtune=@var{cpu-type}
20640 @opindex mtune
20641 Use the timing characteristics of the indicated CPU type when
20642 scheduling instructions.  This does not change the targeted processor
20643 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
20644 @samp{am33-2} or @samp{am34}.
20646 @item -mreturn-pointer-on-d0
20647 @opindex mreturn-pointer-on-d0
20648 When generating a function that returns a pointer, return the pointer
20649 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
20650 only in @code{a0}, and attempts to call such functions without a prototype
20651 result in errors.  Note that this option is on by default; use
20652 @option{-mno-return-pointer-on-d0} to disable it.
20654 @item -mno-crt0
20655 @opindex mno-crt0
20656 Do not link in the C run-time initialization object file.
20658 @item -mrelax
20659 @opindex mrelax
20660 Indicate to the linker that it should perform a relaxation optimization pass
20661 to shorten branches, calls and absolute memory addresses.  This option only
20662 has an effect when used on the command line for the final link step.
20664 This option makes symbolic debugging impossible.
20666 @item -mliw
20667 @opindex mliw
20668 Allow the compiler to generate @emph{Long Instruction Word}
20669 instructions if the target is the @samp{AM33} or later.  This is the
20670 default.  This option defines the preprocessor macro @code{__LIW__}.
20672 @item -mnoliw
20673 @opindex mnoliw
20674 Do not allow the compiler to generate @emph{Long Instruction Word}
20675 instructions.  This option defines the preprocessor macro
20676 @code{__NO_LIW__}.
20678 @item -msetlb
20679 @opindex msetlb
20680 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
20681 instructions if the target is the @samp{AM33} or later.  This is the
20682 default.  This option defines the preprocessor macro @code{__SETLB__}.
20684 @item -mnosetlb
20685 @opindex mnosetlb
20686 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
20687 instructions.  This option defines the preprocessor macro
20688 @code{__NO_SETLB__}.
20690 @end table
20692 @node Moxie Options
20693 @subsection Moxie Options
20694 @cindex Moxie Options
20696 @table @gcctabopt
20698 @item -meb
20699 @opindex meb
20700 Generate big-endian code.  This is the default for @samp{moxie-*-*}
20701 configurations.
20703 @item -mel
20704 @opindex mel
20705 Generate little-endian code.
20707 @item -mmul.x
20708 @opindex mmul.x
20709 Generate mul.x and umul.x instructions.  This is the default for
20710 @samp{moxiebox-*-*} configurations.
20712 @item -mno-crt0
20713 @opindex mno-crt0
20714 Do not link in the C run-time initialization object file.
20716 @end table
20718 @node MSP430 Options
20719 @subsection MSP430 Options
20720 @cindex MSP430 Options
20722 These options are defined for the MSP430:
20724 @table @gcctabopt
20726 @item -masm-hex
20727 @opindex masm-hex
20728 Force assembly output to always use hex constants.  Normally such
20729 constants are signed decimals, but this option is available for
20730 testsuite and/or aesthetic purposes.
20732 @item -mmcu=
20733 @opindex mmcu=
20734 Select the MCU to target.  This is used to create a C preprocessor
20735 symbol based upon the MCU name, converted to upper case and pre- and
20736 post-fixed with @samp{__}.  This in turn is used by the
20737 @file{msp430.h} header file to select an MCU-specific supplementary
20738 header file.
20740 The option also sets the ISA to use.  If the MCU name is one that is
20741 known to only support the 430 ISA then that is selected, otherwise the
20742 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
20743 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
20744 name selects the 430X ISA.
20746 In addition an MCU-specific linker script is added to the linker
20747 command line.  The script's name is the name of the MCU with
20748 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
20749 command line defines the C preprocessor symbol @code{__XXX__} and
20750 cause the linker to search for a script called @file{xxx.ld}.
20752 This option is also passed on to the assembler.
20754 @item -mwarn-mcu
20755 @itemx -mno-warn-mcu
20756 @opindex mwarn-mcu
20757 @opindex mno-warn-mcu
20758 This option enables or disables warnings about conflicts between the
20759 MCU name specified by the @option{-mmcu} option and the ISA set by the
20760 @option{-mcpu} option and/or the hardware multiply support set by the
20761 @option{-mhwmult} option.  It also toggles warnings about unrecognized
20762 MCU names.  This option is on by default.
20764 @item -mcpu=
20765 @opindex mcpu=
20766 Specifies the ISA to use.  Accepted values are @samp{msp430},
20767 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
20768 @option{-mmcu=} option should be used to select the ISA.
20770 @item -msim
20771 @opindex msim
20772 Link to the simulator runtime libraries and linker script.  Overrides
20773 any scripts that would be selected by the @option{-mmcu=} option.
20775 @item -mlarge
20776 @opindex mlarge
20777 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
20779 @item -msmall
20780 @opindex msmall
20781 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
20783 @item -mrelax
20784 @opindex mrelax
20785 This option is passed to the assembler and linker, and allows the
20786 linker to perform certain optimizations that cannot be done until
20787 the final link.
20789 @item mhwmult=
20790 @opindex mhwmult=
20791 Describes the type of hardware multiply supported by the target.
20792 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
20793 for the original 16-bit-only multiply supported by early MCUs.
20794 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
20795 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
20796 A value of @samp{auto} can also be given.  This tells GCC to deduce
20797 the hardware multiply support based upon the MCU name provided by the
20798 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
20799 the MCU name is not recognized then no hardware multiply support is
20800 assumed.  @code{auto} is the default setting.
20802 Hardware multiplies are normally performed by calling a library
20803 routine.  This saves space in the generated code.  When compiling at
20804 @option{-O3} or higher however the hardware multiplier is invoked
20805 inline.  This makes for bigger, but faster code.
20807 The hardware multiply routines disable interrupts whilst running and
20808 restore the previous interrupt state when they finish.  This makes
20809 them safe to use inside interrupt handlers as well as in normal code.
20811 @item -minrt
20812 @opindex minrt
20813 Enable the use of a minimum runtime environment - no static
20814 initializers or constructors.  This is intended for memory-constrained
20815 devices.  The compiler includes special symbols in some objects
20816 that tell the linker and runtime which code fragments are required.
20818 @item -mcode-region=
20819 @itemx -mdata-region=
20820 @opindex mcode-region
20821 @opindex mdata-region
20822 These options tell the compiler where to place functions and data that
20823 do not have one of the @code{lower}, @code{upper}, @code{either} or
20824 @code{section} attributes.  Possible values are @code{lower},
20825 @code{upper}, @code{either} or @code{any}.  The first three behave
20826 like the corresponding attribute.  The fourth possible value -
20827 @code{any} - is the default.  It leaves placement entirely up to the
20828 linker script and how it assigns the standard sections
20829 (@code{.text}, @code{.data}, etc) to the memory regions.
20831 @item -msilicon-errata=
20832 @opindex msilicon-errata
20833 This option passes on a request to assembler to enable the fixes for
20834 the named silicon errata.
20836 @item -msilicon-errata-warn=
20837 @opindex msilicon-errata-warn
20838 This option passes on a request to the assembler to enable warning
20839 messages when a silicon errata might need to be applied.
20841 @end table
20843 @node NDS32 Options
20844 @subsection NDS32 Options
20845 @cindex NDS32 Options
20847 These options are defined for NDS32 implementations:
20849 @table @gcctabopt
20851 @item -mbig-endian
20852 @opindex mbig-endian
20853 Generate code in big-endian mode.
20855 @item -mlittle-endian
20856 @opindex mlittle-endian
20857 Generate code in little-endian mode.
20859 @item -mreduced-regs
20860 @opindex mreduced-regs
20861 Use reduced-set registers for register allocation.
20863 @item -mfull-regs
20864 @opindex mfull-regs
20865 Use full-set registers for register allocation.
20867 @item -mcmov
20868 @opindex mcmov
20869 Generate conditional move instructions.
20871 @item -mno-cmov
20872 @opindex mno-cmov
20873 Do not generate conditional move instructions.
20875 @item -mperf-ext
20876 @opindex mperf-ext
20877 Generate performance extension instructions.
20879 @item -mno-perf-ext
20880 @opindex mno-perf-ext
20881 Do not generate performance extension instructions.
20883 @item -mv3push
20884 @opindex mv3push
20885 Generate v3 push25/pop25 instructions.
20887 @item -mno-v3push
20888 @opindex mno-v3push
20889 Do not generate v3 push25/pop25 instructions.
20891 @item -m16-bit
20892 @opindex m16-bit
20893 Generate 16-bit instructions.
20895 @item -mno-16-bit
20896 @opindex mno-16-bit
20897 Do not generate 16-bit instructions.
20899 @item -misr-vector-size=@var{num}
20900 @opindex misr-vector-size
20901 Specify the size of each interrupt vector, which must be 4 or 16.
20903 @item -mcache-block-size=@var{num}
20904 @opindex mcache-block-size
20905 Specify the size of each cache block,
20906 which must be a power of 2 between 4 and 512.
20908 @item -march=@var{arch}
20909 @opindex march
20910 Specify the name of the target architecture.
20912 @item -mcmodel=@var{code-model}
20913 @opindex mcmodel
20914 Set the code model to one of
20915 @table @asis
20916 @item @samp{small}
20917 All the data and read-only data segments must be within 512KB addressing space.
20918 The text segment must be within 16MB addressing space.
20919 @item @samp{medium}
20920 The data segment must be within 512KB while the read-only data segment can be
20921 within 4GB addressing space.  The text segment should be still within 16MB
20922 addressing space.
20923 @item @samp{large}
20924 All the text and data segments can be within 4GB addressing space.
20925 @end table
20927 @item -mctor-dtor
20928 @opindex mctor-dtor
20929 Enable constructor/destructor feature.
20931 @item -mrelax
20932 @opindex mrelax
20933 Guide linker to relax instructions.
20935 @end table
20937 @node Nios II Options
20938 @subsection Nios II Options
20939 @cindex Nios II options
20940 @cindex Altera Nios II options
20942 These are the options defined for the Altera Nios II processor.
20944 @table @gcctabopt
20946 @item -G @var{num}
20947 @opindex G
20948 @cindex smaller data references
20949 Put global and static objects less than or equal to @var{num} bytes
20950 into the small data or BSS sections instead of the normal data or BSS
20951 sections.  The default value of @var{num} is 8.
20953 @item -mgpopt=@var{option}
20954 @item -mgpopt
20955 @itemx -mno-gpopt
20956 @opindex mgpopt
20957 @opindex mno-gpopt
20958 Generate (do not generate) GP-relative accesses.  The following 
20959 @var{option} names are recognized:
20961 @table @samp
20963 @item none
20964 Do not generate GP-relative accesses.
20966 @item local
20967 Generate GP-relative accesses for small data objects that are not 
20968 external, weak, or uninitialized common symbols.  
20969 Also use GP-relative addressing for objects that
20970 have been explicitly placed in a small data section via a @code{section}
20971 attribute.
20973 @item global
20974 As for @samp{local}, but also generate GP-relative accesses for
20975 small data objects that are external, weak, or common.  If you use this option,
20976 you must ensure that all parts of your program (including libraries) are
20977 compiled with the same @option{-G} setting.
20979 @item data
20980 Generate GP-relative accesses for all data objects in the program.  If you
20981 use this option, the entire data and BSS segments
20982 of your program must fit in 64K of memory and you must use an appropriate
20983 linker script to allocate them within the addressable range of the
20984 global pointer.
20986 @item all
20987 Generate GP-relative addresses for function pointers as well as data
20988 pointers.  If you use this option, the entire text, data, and BSS segments
20989 of your program must fit in 64K of memory and you must use an appropriate
20990 linker script to allocate them within the addressable range of the
20991 global pointer.
20993 @end table
20995 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
20996 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
20998 The default is @option{-mgpopt} except when @option{-fpic} or
20999 @option{-fPIC} is specified to generate position-independent code.
21000 Note that the Nios II ABI does not permit GP-relative accesses from
21001 shared libraries.
21003 You may need to specify @option{-mno-gpopt} explicitly when building
21004 programs that include large amounts of small data, including large
21005 GOT data sections.  In this case, the 16-bit offset for GP-relative
21006 addressing may not be large enough to allow access to the entire 
21007 small data section.
21009 @item -mel
21010 @itemx -meb
21011 @opindex mel
21012 @opindex meb
21013 Generate little-endian (default) or big-endian (experimental) code,
21014 respectively.
21016 @item -march=@var{arch}
21017 @opindex march
21018 This specifies the name of the target Nios II architecture.  GCC uses this
21019 name to determine what kind of instructions it can emit when generating
21020 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
21022 The preprocessor macro @code{__nios2_arch__} is available to programs,
21023 with value 1 or 2, indicating the targeted ISA level.
21025 @item -mbypass-cache
21026 @itemx -mno-bypass-cache
21027 @opindex mno-bypass-cache
21028 @opindex mbypass-cache
21029 Force all load and store instructions to always bypass cache by 
21030 using I/O variants of the instructions. The default is not to
21031 bypass the cache.
21033 @item -mno-cache-volatile 
21034 @itemx -mcache-volatile       
21035 @opindex mcache-volatile 
21036 @opindex mno-cache-volatile
21037 Volatile memory access bypass the cache using the I/O variants of 
21038 the load and store instructions. The default is not to bypass the cache.
21040 @item -mno-fast-sw-div
21041 @itemx -mfast-sw-div
21042 @opindex mno-fast-sw-div
21043 @opindex mfast-sw-div
21044 Do not use table-based fast divide for small numbers. The default 
21045 is to use the fast divide at @option{-O3} and above.
21047 @item -mno-hw-mul
21048 @itemx -mhw-mul
21049 @itemx -mno-hw-mulx
21050 @itemx -mhw-mulx
21051 @itemx -mno-hw-div
21052 @itemx -mhw-div
21053 @opindex mno-hw-mul
21054 @opindex mhw-mul
21055 @opindex mno-hw-mulx
21056 @opindex mhw-mulx
21057 @opindex mno-hw-div
21058 @opindex mhw-div
21059 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
21060 instructions by the compiler. The default is to emit @code{mul}
21061 and not emit @code{div} and @code{mulx}.
21063 @item -mbmx
21064 @itemx -mno-bmx
21065 @itemx -mcdx
21066 @itemx -mno-cdx
21067 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
21068 CDX (code density) instructions.  Enabling these instructions also
21069 requires @option{-march=r2}.  Since these instructions are optional
21070 extensions to the R2 architecture, the default is not to emit them.
21072 @item -mcustom-@var{insn}=@var{N}
21073 @itemx -mno-custom-@var{insn}
21074 @opindex mcustom-@var{insn}
21075 @opindex mno-custom-@var{insn}
21076 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
21077 custom instruction with encoding @var{N} when generating code that uses 
21078 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
21079 instruction 253 for single-precision floating-point add operations instead
21080 of the default behavior of using a library call.
21082 The following values of @var{insn} are supported.  Except as otherwise
21083 noted, floating-point operations are expected to be implemented with
21084 normal IEEE 754 semantics and correspond directly to the C operators or the
21085 equivalent GCC built-in functions (@pxref{Other Builtins}).
21087 Single-precision floating point:
21088 @table @asis
21090 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
21091 Binary arithmetic operations.
21093 @item @samp{fnegs}
21094 Unary negation.
21096 @item @samp{fabss}
21097 Unary absolute value.
21099 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
21100 Comparison operations.
21102 @item @samp{fmins}, @samp{fmaxs}
21103 Floating-point minimum and maximum.  These instructions are only
21104 generated if @option{-ffinite-math-only} is specified.
21106 @item @samp{fsqrts}
21107 Unary square root operation.
21109 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
21110 Floating-point trigonometric and exponential functions.  These instructions
21111 are only generated if @option{-funsafe-math-optimizations} is also specified.
21113 @end table
21115 Double-precision floating point:
21116 @table @asis
21118 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
21119 Binary arithmetic operations.
21121 @item @samp{fnegd}
21122 Unary negation.
21124 @item @samp{fabsd}
21125 Unary absolute value.
21127 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
21128 Comparison operations.
21130 @item @samp{fmind}, @samp{fmaxd}
21131 Double-precision minimum and maximum.  These instructions are only
21132 generated if @option{-ffinite-math-only} is specified.
21134 @item @samp{fsqrtd}
21135 Unary square root operation.
21137 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
21138 Double-precision trigonometric and exponential functions.  These instructions
21139 are only generated if @option{-funsafe-math-optimizations} is also specified.
21141 @end table
21143 Conversions:
21144 @table @asis
21145 @item @samp{fextsd}
21146 Conversion from single precision to double precision.
21148 @item @samp{ftruncds}
21149 Conversion from double precision to single precision.
21151 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
21152 Conversion from floating point to signed or unsigned integer types, with
21153 truncation towards zero.
21155 @item @samp{round}
21156 Conversion from single-precision floating point to signed integer,
21157 rounding to the nearest integer and ties away from zero.
21158 This corresponds to the @code{__builtin_lroundf} function when
21159 @option{-fno-math-errno} is used.
21161 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
21162 Conversion from signed or unsigned integer types to floating-point types.
21164 @end table
21166 In addition, all of the following transfer instructions for internal
21167 registers X and Y must be provided to use any of the double-precision
21168 floating-point instructions.  Custom instructions taking two
21169 double-precision source operands expect the first operand in the
21170 64-bit register X.  The other operand (or only operand of a unary
21171 operation) is given to the custom arithmetic instruction with the
21172 least significant half in source register @var{src1} and the most
21173 significant half in @var{src2}.  A custom instruction that returns a
21174 double-precision result returns the most significant 32 bits in the
21175 destination register and the other half in 32-bit register Y.  
21176 GCC automatically generates the necessary code sequences to write
21177 register X and/or read register Y when double-precision floating-point
21178 instructions are used.
21180 @table @asis
21182 @item @samp{fwrx}
21183 Write @var{src1} into the least significant half of X and @var{src2} into
21184 the most significant half of X.
21186 @item @samp{fwry}
21187 Write @var{src1} into Y.
21189 @item @samp{frdxhi}, @samp{frdxlo}
21190 Read the most or least (respectively) significant half of X and store it in
21191 @var{dest}.
21193 @item @samp{frdy}
21194 Read the value of Y and store it into @var{dest}.
21195 @end table
21197 Note that you can gain more local control over generation of Nios II custom
21198 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
21199 and @code{target("no-custom-@var{insn}")} function attributes
21200 (@pxref{Function Attributes})
21201 or pragmas (@pxref{Function Specific Option Pragmas}).
21203 @item -mcustom-fpu-cfg=@var{name}
21204 @opindex mcustom-fpu-cfg
21206 This option enables a predefined, named set of custom instruction encodings
21207 (see @option{-mcustom-@var{insn}} above).  
21208 Currently, the following sets are defined:
21210 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
21211 @gccoptlist{-mcustom-fmuls=252 @gol
21212 -mcustom-fadds=253 @gol
21213 -mcustom-fsubs=254 @gol
21214 -fsingle-precision-constant}
21216 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
21217 @gccoptlist{-mcustom-fmuls=252 @gol
21218 -mcustom-fadds=253 @gol
21219 -mcustom-fsubs=254 @gol
21220 -mcustom-fdivs=255 @gol
21221 -fsingle-precision-constant}
21223 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
21224 @gccoptlist{-mcustom-floatus=243 @gol
21225 -mcustom-fixsi=244 @gol
21226 -mcustom-floatis=245 @gol
21227 -mcustom-fcmpgts=246 @gol
21228 -mcustom-fcmples=249 @gol
21229 -mcustom-fcmpeqs=250 @gol
21230 -mcustom-fcmpnes=251 @gol
21231 -mcustom-fmuls=252 @gol
21232 -mcustom-fadds=253 @gol
21233 -mcustom-fsubs=254 @gol
21234 -mcustom-fdivs=255 @gol
21235 -fsingle-precision-constant}
21237 Custom instruction assignments given by individual
21238 @option{-mcustom-@var{insn}=} options override those given by
21239 @option{-mcustom-fpu-cfg=}, regardless of the
21240 order of the options on the command line.
21242 Note that you can gain more local control over selection of a FPU
21243 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
21244 function attribute (@pxref{Function Attributes})
21245 or pragma (@pxref{Function Specific Option Pragmas}).
21247 @end table
21249 These additional @samp{-m} options are available for the Altera Nios II
21250 ELF (bare-metal) target:
21252 @table @gcctabopt
21254 @item -mhal
21255 @opindex mhal
21256 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
21257 startup and termination code, and is typically used in conjunction with
21258 @option{-msys-crt0=} to specify the location of the alternate startup code
21259 provided by the HAL BSP.
21261 @item -msmallc
21262 @opindex msmallc
21263 Link with a limited version of the C library, @option{-lsmallc}, rather than
21264 Newlib.
21266 @item -msys-crt0=@var{startfile}
21267 @opindex msys-crt0
21268 @var{startfile} is the file name of the startfile (crt0) to use 
21269 when linking.  This option is only useful in conjunction with @option{-mhal}.
21271 @item -msys-lib=@var{systemlib}
21272 @opindex msys-lib
21273 @var{systemlib} is the library name of the library that provides
21274 low-level system calls required by the C library,
21275 e.g. @code{read} and @code{write}.
21276 This option is typically used to link with a library provided by a HAL BSP.
21278 @end table
21280 @node Nvidia PTX Options
21281 @subsection Nvidia PTX Options
21282 @cindex Nvidia PTX options
21283 @cindex nvptx options
21285 These options are defined for Nvidia PTX:
21287 @table @gcctabopt
21289 @item -m32
21290 @itemx -m64
21291 @opindex m32
21292 @opindex m64
21293 Generate code for 32-bit or 64-bit ABI.
21295 @item -mmainkernel
21296 @opindex mmainkernel
21297 Link in code for a __main kernel.  This is for stand-alone instead of
21298 offloading execution.
21300 @item -moptimize
21301 @opindex moptimize
21302 Apply partitioned execution optimizations.  This is the default when any
21303 level of optimization is selected.
21305 @item -msoft-stack
21306 @opindex msoft-stack
21307 Generate code that does not use @code{.local} memory
21308 directly for stack storage. Instead, a per-warp stack pointer is
21309 maintained explicitly. This enables variable-length stack allocation (with
21310 variable-length arrays or @code{alloca}), and when global memory is used for
21311 underlying storage, makes it possible to access automatic variables from other
21312 threads, or with atomic instructions. This code generation variant is used
21313 for OpenMP offloading, but the option is exposed on its own for the purpose
21314 of testing the compiler; to generate code suitable for linking into programs
21315 using OpenMP offloading, use option @option{-mgomp}.
21317 @item -muniform-simt
21318 @opindex muniform-simt
21319 Switch to code generation variant that allows to execute all threads in each
21320 warp, while maintaining memory state and side effects as if only one thread
21321 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
21322 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
21323 current lane index equals the master lane index), and the register being
21324 assigned is copied via a shuffle instruction from the master lane.  Outside of
21325 SIMD regions lane 0 is the master; inside, each thread sees itself as the
21326 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
21327 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
21328 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
21329 with current lane index to compute the master lane index.
21331 @item -mgomp
21332 @opindex mgomp
21333 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
21334 @option{-muniform-simt} options, and selects corresponding multilib variant.
21336 @end table
21338 @node PDP-11 Options
21339 @subsection PDP-11 Options
21340 @cindex PDP-11 Options
21342 These options are defined for the PDP-11:
21344 @table @gcctabopt
21345 @item -mfpu
21346 @opindex mfpu
21347 Use hardware FPP floating point.  This is the default.  (FIS floating
21348 point on the PDP-11/40 is not supported.)
21350 @item -msoft-float
21351 @opindex msoft-float
21352 Do not use hardware floating point.
21354 @item -mac0
21355 @opindex mac0
21356 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
21358 @item -mno-ac0
21359 @opindex mno-ac0
21360 Return floating-point results in memory.  This is the default.
21362 @item -m40
21363 @opindex m40
21364 Generate code for a PDP-11/40.
21366 @item -m45
21367 @opindex m45
21368 Generate code for a PDP-11/45.  This is the default.
21370 @item -m10
21371 @opindex m10
21372 Generate code for a PDP-11/10.
21374 @item -mbcopy-builtin
21375 @opindex mbcopy-builtin
21376 Use inline @code{movmemhi} patterns for copying memory.  This is the
21377 default.
21379 @item -mbcopy
21380 @opindex mbcopy
21381 Do not use inline @code{movmemhi} patterns for copying memory.
21383 @item -mint16
21384 @itemx -mno-int32
21385 @opindex mint16
21386 @opindex mno-int32
21387 Use 16-bit @code{int}.  This is the default.
21389 @item -mint32
21390 @itemx -mno-int16
21391 @opindex mint32
21392 @opindex mno-int16
21393 Use 32-bit @code{int}.
21395 @item -mfloat64
21396 @itemx -mno-float32
21397 @opindex mfloat64
21398 @opindex mno-float32
21399 Use 64-bit @code{float}.  This is the default.
21401 @item -mfloat32
21402 @itemx -mno-float64
21403 @opindex mfloat32
21404 @opindex mno-float64
21405 Use 32-bit @code{float}.
21407 @item -mabshi
21408 @opindex mabshi
21409 Use @code{abshi2} pattern.  This is the default.
21411 @item -mno-abshi
21412 @opindex mno-abshi
21413 Do not use @code{abshi2} pattern.
21415 @item -mbranch-expensive
21416 @opindex mbranch-expensive
21417 Pretend that branches are expensive.  This is for experimenting with
21418 code generation only.
21420 @item -mbranch-cheap
21421 @opindex mbranch-cheap
21422 Do not pretend that branches are expensive.  This is the default.
21424 @item -munix-asm
21425 @opindex munix-asm
21426 Use Unix assembler syntax.  This is the default when configured for
21427 @samp{pdp11-*-bsd}.
21429 @item -mdec-asm
21430 @opindex mdec-asm
21431 Use DEC assembler syntax.  This is the default when configured for any
21432 PDP-11 target other than @samp{pdp11-*-bsd}.
21433 @end table
21435 @node picoChip Options
21436 @subsection picoChip Options
21437 @cindex picoChip options
21439 These @samp{-m} options are defined for picoChip implementations:
21441 @table @gcctabopt
21443 @item -mae=@var{ae_type}
21444 @opindex mcpu
21445 Set the instruction set, register set, and instruction scheduling
21446 parameters for array element type @var{ae_type}.  Supported values
21447 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
21449 @option{-mae=ANY} selects a completely generic AE type.  Code
21450 generated with this option runs on any of the other AE types.  The
21451 code is not as efficient as it would be if compiled for a specific
21452 AE type, and some types of operation (e.g., multiplication) do not
21453 work properly on all types of AE.
21455 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
21456 for compiled code, and is the default.
21458 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
21459 option may suffer from poor performance of byte (char) manipulation,
21460 since the DSP AE does not provide hardware support for byte load/stores.
21462 @item -msymbol-as-address
21463 Enable the compiler to directly use a symbol name as an address in a
21464 load/store instruction, without first loading it into a
21465 register.  Typically, the use of this option generates larger
21466 programs, which run faster than when the option isn't used.  However, the
21467 results vary from program to program, so it is left as a user option,
21468 rather than being permanently enabled.
21470 @item -mno-inefficient-warnings
21471 Disables warnings about the generation of inefficient code.  These
21472 warnings can be generated, for example, when compiling code that
21473 performs byte-level memory operations on the MAC AE type.  The MAC AE has
21474 no hardware support for byte-level memory operations, so all byte
21475 load/stores must be synthesized from word load/store operations.  This is
21476 inefficient and a warning is generated to indicate
21477 that you should rewrite the code to avoid byte operations, or to target
21478 an AE type that has the necessary hardware support.  This option disables
21479 these warnings.
21481 @end table
21483 @node PowerPC Options
21484 @subsection PowerPC Options
21485 @cindex PowerPC options
21487 These are listed under @xref{RS/6000 and PowerPC Options}.
21489 @node RISC-V Options
21490 @subsection RISC-V Options
21491 @cindex RISC-V Options
21493 These command-line options are defined for RISC-V targets:
21495 @table @gcctabopt
21496 @item -mbranch-cost=@var{n}
21497 @opindex mbranch-cost
21498 Set the cost of branches to roughly @var{n} instructions.
21500 @item -mmemcpy
21501 @itemx -mno-memcpy
21502 @opindex mmemcpy
21503 Don't optimize block moves.
21505 @item -mplt
21506 @itemx -mno-plt
21507 @opindex plt
21508 When generating PIC code, allow the use of PLTs. Ignored for non-PIC.
21510 @item -mabi=@var{ABI-string}
21511 @opindex mabi
21512 Specify integer and floating-point calling convention.  This defaults to the
21513 natural calling convention: e.g.@ LP64 for RV64I, ILP32 for RV32I, LP64D for
21514 RV64G.
21516 @item -mfdiv
21517 @itemx -mno-fdiv
21518 @opindex mfdiv
21519 Use hardware floating-point divide and square root instructions.  This requires
21520 the F or D extensions for floating-point registers.
21522 @item -mdiv
21523 @itemx -mno-div
21524 @opindex mdiv
21525 Use hardware instructions for integer division.  This requires the M extension.
21527 @item -march=@var{ISA-string}
21528 @opindex march
21529 Generate code for given RISC-V ISA (e.g.@ @samp{rv64im}).  ISA strings must be
21530 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, and @samp{rv32imaf}.
21532 @item -mtune=@var{processor-string}
21533 @opindex mtune
21534 Optimize the output for the given processor, specified by microarchitecture
21535 name.
21537 @item -msmall-data-limit=@var{n}
21538 @opindex msmall-data-limit
21539 Put global and static data smaller than @var{n} bytes into a special section
21540 (on some targets).
21542 @item -msave-restore
21543 @itemx -mno-save-restore
21544 @opindex msave-restore
21545 Use smaller but slower prologue and epilogue code.
21547 @item -mstrict-align
21548 @itemx -mno-strict-align
21549 @opindex mstrict-align
21550 Do not generate unaligned memory accesses.
21552 @item -mcmodel=@var{code-model}
21553 @opindex mcmodel
21554 Specify the code model.
21556 @end table
21558 @node RL78 Options
21559 @subsection RL78 Options
21560 @cindex RL78 Options
21562 @table @gcctabopt
21564 @item -msim
21565 @opindex msim
21566 Links in additional target libraries to support operation within a
21567 simulator.
21569 @item -mmul=none
21570 @itemx -mmul=g10
21571 @itemx -mmul=g13
21572 @itemx -mmul=g14
21573 @itemx -mmul=rl78
21574 @opindex mmul
21575 Specifies the type of hardware multiplication and division support to
21576 be used.  The simplest is @code{none}, which uses software for both
21577 multiplication and division.  This is the default.  The @code{g13}
21578 value is for the hardware multiply/divide peripheral found on the
21579 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
21580 the multiplication and division instructions supported by the RL78/G14
21581 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
21582 the value @code{mg10} is an alias for @code{none}.
21584 In addition a C preprocessor macro is defined, based upon the setting
21585 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
21586 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
21588 @item -mcpu=g10
21589 @itemx -mcpu=g13
21590 @itemx -mcpu=g14
21591 @itemx -mcpu=rl78
21592 @opindex mcpu
21593 Specifies the RL78 core to target.  The default is the G14 core, also
21594 known as an S3 core or just RL78.  The G13 or S2 core does not have
21595 multiply or divide instructions, instead it uses a hardware peripheral
21596 for these operations.  The G10 or S1 core does not have register
21597 banks, so it uses a different calling convention.
21599 If this option is set it also selects the type of hardware multiply
21600 support to use, unless this is overridden by an explicit
21601 @option{-mmul=none} option on the command line.  Thus specifying
21602 @option{-mcpu=g13} enables the use of the G13 hardware multiply
21603 peripheral and specifying @option{-mcpu=g10} disables the use of
21604 hardware multiplications altogether.
21606 Note, although the RL78/G14 core is the default target, specifying
21607 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
21608 change the behavior of the toolchain since it also enables G14
21609 hardware multiply support.  If these options are not specified on the
21610 command line then software multiplication routines will be used even
21611 though the code targets the RL78 core.  This is for backwards
21612 compatibility with older toolchains which did not have hardware
21613 multiply and divide support.
21615 In addition a C preprocessor macro is defined, based upon the setting
21616 of this option.  Possible values are: @code{__RL78_G10__},
21617 @code{__RL78_G13__} or @code{__RL78_G14__}.
21619 @item -mg10
21620 @itemx -mg13
21621 @itemx -mg14
21622 @itemx -mrl78
21623 @opindex mg10
21624 @opindex mg13
21625 @opindex mg14
21626 @opindex mrl78
21627 These are aliases for the corresponding @option{-mcpu=} option.  They
21628 are provided for backwards compatibility.
21630 @item -mallregs
21631 @opindex mallregs
21632 Allow the compiler to use all of the available registers.  By default
21633 registers @code{r24..r31} are reserved for use in interrupt handlers.
21634 With this option enabled these registers can be used in ordinary
21635 functions as well.
21637 @item -m64bit-doubles
21638 @itemx -m32bit-doubles
21639 @opindex m64bit-doubles
21640 @opindex m32bit-doubles
21641 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
21642 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
21643 @option{-m32bit-doubles}.
21645 @item -msave-mduc-in-interrupts
21646 @item -mno-save-mduc-in-interrupts
21647 @opindex msave-mduc-in-interrupts
21648 @opindex mno-save-mduc-in-interrupts
21649 Specifies that interrupt handler functions should preserve the
21650 MDUC registers.  This is only necessary if normal code might use
21651 the MDUC registers, for example because it performs multiplication
21652 and division operations.  The default is to ignore the MDUC registers
21653 as this makes the interrupt handlers faster.  The target option -mg13
21654 needs to be passed for this to work as this feature is only available
21655 on the G13 target (S2 core).  The MDUC registers will only be saved
21656 if the interrupt handler performs a multiplication or division
21657 operation or it calls another function.
21659 @end table
21661 @node RS/6000 and PowerPC Options
21662 @subsection IBM RS/6000 and PowerPC Options
21663 @cindex RS/6000 and PowerPC Options
21664 @cindex IBM RS/6000 and PowerPC Options
21666 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
21667 @table @gcctabopt
21668 @item -mpowerpc-gpopt
21669 @itemx -mno-powerpc-gpopt
21670 @itemx -mpowerpc-gfxopt
21671 @itemx -mno-powerpc-gfxopt
21672 @need 800
21673 @itemx -mpowerpc64
21674 @itemx -mno-powerpc64
21675 @itemx -mmfcrf
21676 @itemx -mno-mfcrf
21677 @itemx -mpopcntb
21678 @itemx -mno-popcntb
21679 @itemx -mpopcntd
21680 @itemx -mno-popcntd
21681 @itemx -mfprnd
21682 @itemx -mno-fprnd
21683 @need 800
21684 @itemx -mcmpb
21685 @itemx -mno-cmpb
21686 @itemx -mmfpgpr
21687 @itemx -mno-mfpgpr
21688 @itemx -mhard-dfp
21689 @itemx -mno-hard-dfp
21690 @opindex mpowerpc-gpopt
21691 @opindex mno-powerpc-gpopt
21692 @opindex mpowerpc-gfxopt
21693 @opindex mno-powerpc-gfxopt
21694 @opindex mpowerpc64
21695 @opindex mno-powerpc64
21696 @opindex mmfcrf
21697 @opindex mno-mfcrf
21698 @opindex mpopcntb
21699 @opindex mno-popcntb
21700 @opindex mpopcntd
21701 @opindex mno-popcntd
21702 @opindex mfprnd
21703 @opindex mno-fprnd
21704 @opindex mcmpb
21705 @opindex mno-cmpb
21706 @opindex mmfpgpr
21707 @opindex mno-mfpgpr
21708 @opindex mhard-dfp
21709 @opindex mno-hard-dfp
21710 You use these options to specify which instructions are available on the
21711 processor you are using.  The default value of these options is
21712 determined when configuring GCC@.  Specifying the
21713 @option{-mcpu=@var{cpu_type}} overrides the specification of these
21714 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
21715 rather than the options listed above.
21717 Specifying @option{-mpowerpc-gpopt} allows
21718 GCC to use the optional PowerPC architecture instructions in the
21719 General Purpose group, including floating-point square root.  Specifying
21720 @option{-mpowerpc-gfxopt} allows GCC to
21721 use the optional PowerPC architecture instructions in the Graphics
21722 group, including floating-point select.
21724 The @option{-mmfcrf} option allows GCC to generate the move from
21725 condition register field instruction implemented on the POWER4
21726 processor and other processors that support the PowerPC V2.01
21727 architecture.
21728 The @option{-mpopcntb} option allows GCC to generate the popcount and
21729 double-precision FP reciprocal estimate instruction implemented on the
21730 POWER5 processor and other processors that support the PowerPC V2.02
21731 architecture.
21732 The @option{-mpopcntd} option allows GCC to generate the popcount
21733 instruction implemented on the POWER7 processor and other processors
21734 that support the PowerPC V2.06 architecture.
21735 The @option{-mfprnd} option allows GCC to generate the FP round to
21736 integer instructions implemented on the POWER5+ processor and other
21737 processors that support the PowerPC V2.03 architecture.
21738 The @option{-mcmpb} option allows GCC to generate the compare bytes
21739 instruction implemented on the POWER6 processor and other processors
21740 that support the PowerPC V2.05 architecture.
21741 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
21742 general-purpose register instructions implemented on the POWER6X
21743 processor and other processors that support the extended PowerPC V2.05
21744 architecture.
21745 The @option{-mhard-dfp} option allows GCC to generate the decimal
21746 floating-point instructions implemented on some POWER processors.
21748 The @option{-mpowerpc64} option allows GCC to generate the additional
21749 64-bit instructions that are found in the full PowerPC64 architecture
21750 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
21751 @option{-mno-powerpc64}.
21753 @item -mcpu=@var{cpu_type}
21754 @opindex mcpu
21755 Set architecture type, register usage, and
21756 instruction scheduling parameters for machine type @var{cpu_type}.
21757 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
21758 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
21759 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
21760 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
21761 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
21762 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
21763 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
21764 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
21765 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
21766 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
21767 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
21768 and @samp{rs64}.
21770 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
21771 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
21772 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
21773 architecture machine types, with an appropriate, generic processor
21774 model assumed for scheduling purposes.
21776 The other options specify a specific processor.  Code generated under
21777 those options runs best on that processor, and may not run at all on
21778 others.
21780 The @option{-mcpu} options automatically enable or disable the
21781 following options:
21783 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
21784 -mpopcntb -mpopcntd  -mpowerpc64 @gol
21785 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
21786 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
21787 -mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
21788 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
21790 The particular options set for any particular CPU varies between
21791 compiler versions, depending on what setting seems to produce optimal
21792 code for that CPU; it doesn't necessarily reflect the actual hardware's
21793 capabilities.  If you wish to set an individual option to a particular
21794 value, you may specify it after the @option{-mcpu} option, like
21795 @option{-mcpu=970 -mno-altivec}.
21797 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
21798 not enabled or disabled by the @option{-mcpu} option at present because
21799 AIX does not have full support for these options.  You may still
21800 enable or disable them individually if you're sure it'll work in your
21801 environment.
21803 @item -mtune=@var{cpu_type}
21804 @opindex mtune
21805 Set the instruction scheduling parameters for machine type
21806 @var{cpu_type}, but do not set the architecture type or register usage,
21807 as @option{-mcpu=@var{cpu_type}} does.  The same
21808 values for @var{cpu_type} are used for @option{-mtune} as for
21809 @option{-mcpu}.  If both are specified, the code generated uses the
21810 architecture and registers set by @option{-mcpu}, but the
21811 scheduling parameters set by @option{-mtune}.
21813 @item -mcmodel=small
21814 @opindex mcmodel=small
21815 Generate PowerPC64 code for the small model: The TOC is limited to
21816 64k.
21818 @item -mcmodel=medium
21819 @opindex mcmodel=medium
21820 Generate PowerPC64 code for the medium model: The TOC and other static
21821 data may be up to a total of 4G in size.  This is the default for 64-bit
21822 Linux.
21824 @item -mcmodel=large
21825 @opindex mcmodel=large
21826 Generate PowerPC64 code for the large model: The TOC may be up to 4G
21827 in size.  Other data and code is only limited by the 64-bit address
21828 space.
21830 @item -maltivec
21831 @itemx -mno-altivec
21832 @opindex maltivec
21833 @opindex mno-altivec
21834 Generate code that uses (does not use) AltiVec instructions, and also
21835 enable the use of built-in functions that allow more direct access to
21836 the AltiVec instruction set.  You may also need to set
21837 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
21838 enhancements.
21840 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
21841 @option{-maltivec=be}, the element order for AltiVec intrinsics such
21842 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
21843 match array element order corresponding to the endianness of the
21844 target.  That is, element zero identifies the leftmost element in a
21845 vector register when targeting a big-endian platform, and identifies
21846 the rightmost element in a vector register when targeting a
21847 little-endian platform.
21849 @item -maltivec=be
21850 @opindex maltivec=be
21851 Generate AltiVec instructions using big-endian element order,
21852 regardless of whether the target is big- or little-endian.  This is
21853 the default when targeting a big-endian platform.
21855 The element order is used to interpret element numbers in AltiVec
21856 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21857 @code{vec_insert}.  By default, these match array element order
21858 corresponding to the endianness for the target.
21860 @item -maltivec=le
21861 @opindex maltivec=le
21862 Generate AltiVec instructions using little-endian element order,
21863 regardless of whether the target is big- or little-endian.  This is
21864 the default when targeting a little-endian platform.  This option is
21865 currently ignored when targeting a big-endian platform.
21867 The element order is used to interpret element numbers in AltiVec
21868 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21869 @code{vec_insert}.  By default, these match array element order
21870 corresponding to the endianness for the target.
21872 @item -mvrsave
21873 @itemx -mno-vrsave
21874 @opindex mvrsave
21875 @opindex mno-vrsave
21876 Generate VRSAVE instructions when generating AltiVec code.
21878 @item -msecure-plt
21879 @opindex msecure-plt
21880 Generate code that allows @command{ld} and @command{ld.so}
21881 to build executables and shared
21882 libraries with non-executable @code{.plt} and @code{.got} sections.
21883 This is a PowerPC
21884 32-bit SYSV ABI option.
21886 @item -mbss-plt
21887 @opindex mbss-plt
21888 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
21889 fills in, and
21890 requires @code{.plt} and @code{.got}
21891 sections that are both writable and executable.
21892 This is a PowerPC 32-bit SYSV ABI option.
21894 @item -misel
21895 @itemx -mno-isel
21896 @opindex misel
21897 @opindex mno-isel
21898 This switch enables or disables the generation of ISEL instructions.
21900 @item -misel=@var{yes/no}
21901 This switch has been deprecated.  Use @option{-misel} and
21902 @option{-mno-isel} instead.
21904 @item -mspe
21905 @itemx -mno-spe
21906 @opindex mspe
21907 @opindex mno-spe
21908 This switch enables or disables the generation of SPE simd
21909 instructions.
21911 @item -mpaired
21912 @itemx -mno-paired
21913 @opindex mpaired
21914 @opindex mno-paired
21915 This switch enables or disables the generation of PAIRED simd
21916 instructions.
21918 @item -mspe=@var{yes/no}
21919 This option has been deprecated.  Use @option{-mspe} and
21920 @option{-mno-spe} instead.
21922 @item -mvsx
21923 @itemx -mno-vsx
21924 @opindex mvsx
21925 @opindex mno-vsx
21926 Generate code that uses (does not use) vector/scalar (VSX)
21927 instructions, and also enable the use of built-in functions that allow
21928 more direct access to the VSX instruction set.
21930 @item -mcrypto
21931 @itemx -mno-crypto
21932 @opindex mcrypto
21933 @opindex mno-crypto
21934 Enable the use (disable) of the built-in functions that allow direct
21935 access to the cryptographic instructions that were added in version
21936 2.07 of the PowerPC ISA.
21938 @item -mdirect-move
21939 @itemx -mno-direct-move
21940 @opindex mdirect-move
21941 @opindex mno-direct-move
21942 Generate code that uses (does not use) the instructions to move data
21943 between the general purpose registers and the vector/scalar (VSX)
21944 registers that were added in version 2.07 of the PowerPC ISA.
21946 @item -mhtm
21947 @itemx -mno-htm
21948 @opindex mhtm
21949 @opindex mno-htm
21950 Enable (disable) the use of the built-in functions that allow direct
21951 access to the Hardware Transactional Memory (HTM) instructions that
21952 were added in version 2.07 of the PowerPC ISA.
21954 @item -mpower8-fusion
21955 @itemx -mno-power8-fusion
21956 @opindex mpower8-fusion
21957 @opindex mno-power8-fusion
21958 Generate code that keeps (does not keeps) some integer operations
21959 adjacent so that the instructions can be fused together on power8 and
21960 later processors.
21962 @item -mpower8-vector
21963 @itemx -mno-power8-vector
21964 @opindex mpower8-vector
21965 @opindex mno-power8-vector
21966 Generate code that uses (does not use) the vector and scalar
21967 instructions that were added in version 2.07 of the PowerPC ISA.  Also
21968 enable the use of built-in functions that allow more direct access to
21969 the vector instructions.
21971 @item -mquad-memory
21972 @itemx -mno-quad-memory
21973 @opindex mquad-memory
21974 @opindex mno-quad-memory
21975 Generate code that uses (does not use) the non-atomic quad word memory
21976 instructions.  The @option{-mquad-memory} option requires use of
21977 64-bit mode.
21979 @item -mquad-memory-atomic
21980 @itemx -mno-quad-memory-atomic
21981 @opindex mquad-memory-atomic
21982 @opindex mno-quad-memory-atomic
21983 Generate code that uses (does not use) the atomic quad word memory
21984 instructions.  The @option{-mquad-memory-atomic} option requires use of
21985 64-bit mode.
21987 @item -mfloat128
21988 @itemx -mno-float128
21989 @opindex mfloat128
21990 @opindex mno-float128
21991 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
21992 and use either software emulation for IEEE 128-bit floating point or
21993 hardware instructions.
21995 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
21996 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
21997 option.  The @option{-mfloat128} option only works on PowerPC 64-bit
21998 Linux systems.
22000 If you use the ISA 3.0 instruction set (@option{-mcpu=power9}), the
22001 @option{-mfloat128} option will also enable the generation of ISA 3.0
22002 IEEE 128-bit floating point instructions.  Otherwise, IEEE 128-bit
22003 floating point will be done with software emulation.
22005 @item -mfloat128-hardware
22006 @itemx -mno-float128-hardware
22007 @opindex mfloat128-hardware
22008 @opindex mno-float128-hardware
22009 Enable/disable using ISA 3.0 hardware instructions to support the
22010 @var{__float128} data type.
22012 If you use @option{-mfloat128-hardware}, it will enable the option
22013 @option{-mfloat128} as well.
22015 If you select ISA 3.0 instructions with @option{-mcpu=power9}, but do
22016 not use either @option{-mfloat128} or @option{-mfloat128-hardware},
22017 the IEEE 128-bit floating point support will not be enabled.
22019 @item -mfloat-gprs=@var{yes/single/double/no}
22020 @itemx -mfloat-gprs
22021 @opindex mfloat-gprs
22022 This switch enables or disables the generation of floating-point
22023 operations on the general-purpose registers for architectures that
22024 support it.
22026 The argument @samp{yes} or @samp{single} enables the use of
22027 single-precision floating-point operations.
22029 The argument @samp{double} enables the use of single and
22030 double-precision floating-point operations.
22032 The argument @samp{no} disables floating-point operations on the
22033 general-purpose registers.
22035 This option is currently only available on the MPC854x.
22037 @item -m32
22038 @itemx -m64
22039 @opindex m32
22040 @opindex m64
22041 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
22042 targets (including GNU/Linux).  The 32-bit environment sets int, long
22043 and pointer to 32 bits and generates code that runs on any PowerPC
22044 variant.  The 64-bit environment sets int to 32 bits and long and
22045 pointer to 64 bits, and generates code for PowerPC64, as for
22046 @option{-mpowerpc64}.
22048 @item -mfull-toc
22049 @itemx -mno-fp-in-toc
22050 @itemx -mno-sum-in-toc
22051 @itemx -mminimal-toc
22052 @opindex mfull-toc
22053 @opindex mno-fp-in-toc
22054 @opindex mno-sum-in-toc
22055 @opindex mminimal-toc
22056 Modify generation of the TOC (Table Of Contents), which is created for
22057 every executable file.  The @option{-mfull-toc} option is selected by
22058 default.  In that case, GCC allocates at least one TOC entry for
22059 each unique non-automatic variable reference in your program.  GCC
22060 also places floating-point constants in the TOC@.  However, only
22061 16,384 entries are available in the TOC@.
22063 If you receive a linker error message that saying you have overflowed
22064 the available TOC space, you can reduce the amount of TOC space used
22065 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
22066 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
22067 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
22068 generate code to calculate the sum of an address and a constant at
22069 run time instead of putting that sum into the TOC@.  You may specify one
22070 or both of these options.  Each causes GCC to produce very slightly
22071 slower and larger code at the expense of conserving TOC space.
22073 If you still run out of space in the TOC even when you specify both of
22074 these options, specify @option{-mminimal-toc} instead.  This option causes
22075 GCC to make only one TOC entry for every file.  When you specify this
22076 option, GCC produces code that is slower and larger but which
22077 uses extremely little TOC space.  You may wish to use this option
22078 only on files that contain less frequently-executed code.
22080 @item -maix64
22081 @itemx -maix32
22082 @opindex maix64
22083 @opindex maix32
22084 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
22085 @code{long} type, and the infrastructure needed to support them.
22086 Specifying @option{-maix64} implies @option{-mpowerpc64},
22087 while @option{-maix32} disables the 64-bit ABI and
22088 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
22090 @item -mxl-compat
22091 @itemx -mno-xl-compat
22092 @opindex mxl-compat
22093 @opindex mno-xl-compat
22094 Produce code that conforms more closely to IBM XL compiler semantics
22095 when using AIX-compatible ABI@.  Pass floating-point arguments to
22096 prototyped functions beyond the register save area (RSA) on the stack
22097 in addition to argument FPRs.  Do not assume that most significant
22098 double in 128-bit long double value is properly rounded when comparing
22099 values and converting to double.  Use XL symbol names for long double
22100 support routines.
22102 The AIX calling convention was extended but not initially documented to
22103 handle an obscure K&R C case of calling a function that takes the
22104 address of its arguments with fewer arguments than declared.  IBM XL
22105 compilers access floating-point arguments that do not fit in the
22106 RSA from the stack when a subroutine is compiled without
22107 optimization.  Because always storing floating-point arguments on the
22108 stack is inefficient and rarely needed, this option is not enabled by
22109 default and only is necessary when calling subroutines compiled by IBM
22110 XL compilers without optimization.
22112 @item -mpe
22113 @opindex mpe
22114 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
22115 application written to use message passing with special startup code to
22116 enable the application to run.  The system must have PE installed in the
22117 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
22118 must be overridden with the @option{-specs=} option to specify the
22119 appropriate directory location.  The Parallel Environment does not
22120 support threads, so the @option{-mpe} option and the @option{-pthread}
22121 option are incompatible.
22123 @item -malign-natural
22124 @itemx -malign-power
22125 @opindex malign-natural
22126 @opindex malign-power
22127 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
22128 @option{-malign-natural} overrides the ABI-defined alignment of larger
22129 types, such as floating-point doubles, on their natural size-based boundary.
22130 The option @option{-malign-power} instructs GCC to follow the ABI-specified
22131 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
22133 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
22134 is not supported.
22136 @item -msoft-float
22137 @itemx -mhard-float
22138 @opindex msoft-float
22139 @opindex mhard-float
22140 Generate code that does not use (uses) the floating-point register set.
22141 Software floating-point emulation is provided if you use the
22142 @option{-msoft-float} option, and pass the option to GCC when linking.
22144 @item -msingle-float
22145 @itemx -mdouble-float
22146 @opindex msingle-float
22147 @opindex mdouble-float
22148 Generate code for single- or double-precision floating-point operations.
22149 @option{-mdouble-float} implies @option{-msingle-float}.
22151 @item -msimple-fpu
22152 @opindex msimple-fpu
22153 Do not generate @code{sqrt} and @code{div} instructions for hardware
22154 floating-point unit.
22156 @item -mfpu=@var{name}
22157 @opindex mfpu
22158 Specify type of floating-point unit.  Valid values for @var{name} are
22159 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
22160 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
22161 @samp{sp_full} (equivalent to @option{-msingle-float}),
22162 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
22164 @item -mxilinx-fpu
22165 @opindex mxilinx-fpu
22166 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
22168 @item -mmultiple
22169 @itemx -mno-multiple
22170 @opindex mmultiple
22171 @opindex mno-multiple
22172 Generate code that uses (does not use) the load multiple word
22173 instructions and the store multiple word instructions.  These
22174 instructions are generated by default on POWER systems, and not
22175 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
22176 PowerPC systems, since those instructions do not work when the
22177 processor is in little-endian mode.  The exceptions are PPC740 and
22178 PPC750 which permit these instructions in little-endian mode.
22180 @item -mstring
22181 @itemx -mno-string
22182 @opindex mstring
22183 @opindex mno-string
22184 Generate code that uses (does not use) the load string instructions
22185 and the store string word instructions to save multiple registers and
22186 do small block moves.  These instructions are generated by default on
22187 POWER systems, and not generated on PowerPC systems.  Do not use
22188 @option{-mstring} on little-endian PowerPC systems, since those
22189 instructions do not work when the processor is in little-endian mode.
22190 The exceptions are PPC740 and PPC750 which permit these instructions
22191 in little-endian mode.
22193 @item -mupdate
22194 @itemx -mno-update
22195 @opindex mupdate
22196 @opindex mno-update
22197 Generate code that uses (does not use) the load or store instructions
22198 that update the base register to the address of the calculated memory
22199 location.  These instructions are generated by default.  If you use
22200 @option{-mno-update}, there is a small window between the time that the
22201 stack pointer is updated and the address of the previous frame is
22202 stored, which means code that walks the stack frame across interrupts or
22203 signals may get corrupted data.
22205 @item -mavoid-indexed-addresses
22206 @itemx -mno-avoid-indexed-addresses
22207 @opindex mavoid-indexed-addresses
22208 @opindex mno-avoid-indexed-addresses
22209 Generate code that tries to avoid (not avoid) the use of indexed load
22210 or store instructions. These instructions can incur a performance
22211 penalty on Power6 processors in certain situations, such as when
22212 stepping through large arrays that cross a 16M boundary.  This option
22213 is enabled by default when targeting Power6 and disabled otherwise.
22215 @item -mfused-madd
22216 @itemx -mno-fused-madd
22217 @opindex mfused-madd
22218 @opindex mno-fused-madd
22219 Generate code that uses (does not use) the floating-point multiply and
22220 accumulate instructions.  These instructions are generated by default
22221 if hardware floating point is used.  The machine-dependent
22222 @option{-mfused-madd} option is now mapped to the machine-independent
22223 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
22224 mapped to @option{-ffp-contract=off}.
22226 @item -mmulhw
22227 @itemx -mno-mulhw
22228 @opindex mmulhw
22229 @opindex mno-mulhw
22230 Generate code that uses (does not use) the half-word multiply and
22231 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
22232 These instructions are generated by default when targeting those
22233 processors.
22235 @item -mdlmzb
22236 @itemx -mno-dlmzb
22237 @opindex mdlmzb
22238 @opindex mno-dlmzb
22239 Generate code that uses (does not use) the string-search @samp{dlmzb}
22240 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
22241 generated by default when targeting those processors.
22243 @item -mno-bit-align
22244 @itemx -mbit-align
22245 @opindex mno-bit-align
22246 @opindex mbit-align
22247 On System V.4 and embedded PowerPC systems do not (do) force structures
22248 and unions that contain bit-fields to be aligned to the base type of the
22249 bit-field.
22251 For example, by default a structure containing nothing but 8
22252 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
22253 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
22254 the structure is aligned to a 1-byte boundary and is 1 byte in
22255 size.
22257 @item -mno-strict-align
22258 @itemx -mstrict-align
22259 @opindex mno-strict-align
22260 @opindex mstrict-align
22261 On System V.4 and embedded PowerPC systems do not (do) assume that
22262 unaligned memory references are handled by the system.
22264 @item -mrelocatable
22265 @itemx -mno-relocatable
22266 @opindex mrelocatable
22267 @opindex mno-relocatable
22268 Generate code that allows (does not allow) a static executable to be
22269 relocated to a different address at run time.  A simple embedded
22270 PowerPC system loader should relocate the entire contents of
22271 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
22272 a table of 32-bit addresses generated by this option.  For this to
22273 work, all objects linked together must be compiled with
22274 @option{-mrelocatable} or @option{-mrelocatable-lib}.
22275 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
22277 @item -mrelocatable-lib
22278 @itemx -mno-relocatable-lib
22279 @opindex mrelocatable-lib
22280 @opindex mno-relocatable-lib
22281 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
22282 @code{.fixup} section to allow static executables to be relocated at
22283 run time, but @option{-mrelocatable-lib} does not use the smaller stack
22284 alignment of @option{-mrelocatable}.  Objects compiled with
22285 @option{-mrelocatable-lib} may be linked with objects compiled with
22286 any combination of the @option{-mrelocatable} options.
22288 @item -mno-toc
22289 @itemx -mtoc
22290 @opindex mno-toc
22291 @opindex mtoc
22292 On System V.4 and embedded PowerPC systems do not (do) assume that
22293 register 2 contains a pointer to a global area pointing to the addresses
22294 used in the program.
22296 @item -mlittle
22297 @itemx -mlittle-endian
22298 @opindex mlittle
22299 @opindex mlittle-endian
22300 On System V.4 and embedded PowerPC systems compile code for the
22301 processor in little-endian mode.  The @option{-mlittle-endian} option is
22302 the same as @option{-mlittle}.
22304 @item -mbig
22305 @itemx -mbig-endian
22306 @opindex mbig
22307 @opindex mbig-endian
22308 On System V.4 and embedded PowerPC systems compile code for the
22309 processor in big-endian mode.  The @option{-mbig-endian} option is
22310 the same as @option{-mbig}.
22312 @item -mdynamic-no-pic
22313 @opindex mdynamic-no-pic
22314 On Darwin and Mac OS X systems, compile code so that it is not
22315 relocatable, but that its external references are relocatable.  The
22316 resulting code is suitable for applications, but not shared
22317 libraries.
22319 @item -msingle-pic-base
22320 @opindex msingle-pic-base
22321 Treat the register used for PIC addressing as read-only, rather than
22322 loading it in the prologue for each function.  The runtime system is
22323 responsible for initializing this register with an appropriate value
22324 before execution begins.
22326 @item -mprioritize-restricted-insns=@var{priority}
22327 @opindex mprioritize-restricted-insns
22328 This option controls the priority that is assigned to
22329 dispatch-slot restricted instructions during the second scheduling
22330 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
22331 or @samp{2} to assign no, highest, or second-highest (respectively) 
22332 priority to dispatch-slot restricted
22333 instructions.
22335 @item -msched-costly-dep=@var{dependence_type}
22336 @opindex msched-costly-dep
22337 This option controls which dependences are considered costly
22338 by the target during instruction scheduling.  The argument
22339 @var{dependence_type} takes one of the following values:
22341 @table @asis
22342 @item @samp{no}
22343 No dependence is costly.
22345 @item @samp{all}
22346 All dependences are costly.
22348 @item @samp{true_store_to_load}
22349 A true dependence from store to load is costly.
22351 @item @samp{store_to_load}
22352 Any dependence from store to load is costly.
22354 @item @var{number}
22355 Any dependence for which the latency is greater than or equal to 
22356 @var{number} is costly.
22357 @end table
22359 @item -minsert-sched-nops=@var{scheme}
22360 @opindex minsert-sched-nops
22361 This option controls which NOP insertion scheme is used during
22362 the second scheduling pass.  The argument @var{scheme} takes one of the
22363 following values:
22365 @table @asis
22366 @item @samp{no}
22367 Don't insert NOPs.
22369 @item @samp{pad}
22370 Pad with NOPs any dispatch group that has vacant issue slots,
22371 according to the scheduler's grouping.
22373 @item @samp{regroup_exact}
22374 Insert NOPs to force costly dependent insns into
22375 separate groups.  Insert exactly as many NOPs as needed to force an insn
22376 to a new group, according to the estimated processor grouping.
22378 @item @var{number}
22379 Insert NOPs to force costly dependent insns into
22380 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
22381 @end table
22383 @item -mcall-sysv
22384 @opindex mcall-sysv
22385 On System V.4 and embedded PowerPC systems compile code using calling
22386 conventions that adhere to the March 1995 draft of the System V
22387 Application Binary Interface, PowerPC processor supplement.  This is the
22388 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
22390 @item -mcall-sysv-eabi
22391 @itemx -mcall-eabi
22392 @opindex mcall-sysv-eabi
22393 @opindex mcall-eabi
22394 Specify both @option{-mcall-sysv} and @option{-meabi} options.
22396 @item -mcall-sysv-noeabi
22397 @opindex mcall-sysv-noeabi
22398 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
22400 @item -mcall-aixdesc
22401 @opindex m
22402 On System V.4 and embedded PowerPC systems compile code for the AIX
22403 operating system.
22405 @item -mcall-linux
22406 @opindex mcall-linux
22407 On System V.4 and embedded PowerPC systems compile code for the
22408 Linux-based GNU system.
22410 @item -mcall-freebsd
22411 @opindex mcall-freebsd
22412 On System V.4 and embedded PowerPC systems compile code for the
22413 FreeBSD operating system.
22415 @item -mcall-netbsd
22416 @opindex mcall-netbsd
22417 On System V.4 and embedded PowerPC systems compile code for the
22418 NetBSD operating system.
22420 @item -mcall-openbsd
22421 @opindex mcall-netbsd
22422 On System V.4 and embedded PowerPC systems compile code for the
22423 OpenBSD operating system.
22425 @item -maix-struct-return
22426 @opindex maix-struct-return
22427 Return all structures in memory (as specified by the AIX ABI)@.
22429 @item -msvr4-struct-return
22430 @opindex msvr4-struct-return
22431 Return structures smaller than 8 bytes in registers (as specified by the
22432 SVR4 ABI)@.
22434 @item -mabi=@var{abi-type}
22435 @opindex mabi
22436 Extend the current ABI with a particular extension, or remove such extension.
22437 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
22438 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
22439 @samp{elfv1}, @samp{elfv2}@.
22441 @item -mabi=spe
22442 @opindex mabi=spe
22443 Extend the current ABI with SPE ABI extensions.  This does not change
22444 the default ABI, instead it adds the SPE ABI extensions to the current
22445 ABI@.
22447 @item -mabi=no-spe
22448 @opindex mabi=no-spe
22449 Disable Book-E SPE ABI extensions for the current ABI@.
22451 @item -mabi=ibmlongdouble
22452 @opindex mabi=ibmlongdouble
22453 Change the current ABI to use IBM extended-precision long double.
22454 This is a PowerPC 32-bit SYSV ABI option.
22456 @item -mabi=ieeelongdouble
22457 @opindex mabi=ieeelongdouble
22458 Change the current ABI to use IEEE extended-precision long double.
22459 This is a PowerPC 32-bit Linux ABI option.
22461 @item -mabi=elfv1
22462 @opindex mabi=elfv1
22463 Change the current ABI to use the ELFv1 ABI.
22464 This is the default ABI for big-endian PowerPC 64-bit Linux.
22465 Overriding the default ABI requires special system support and is
22466 likely to fail in spectacular ways.
22468 @item -mabi=elfv2
22469 @opindex mabi=elfv2
22470 Change the current ABI to use the ELFv2 ABI.
22471 This is the default ABI for little-endian PowerPC 64-bit Linux.
22472 Overriding the default ABI requires special system support and is
22473 likely to fail in spectacular ways.
22475 @item -mgnu-attribute
22476 @itemx -mno-gnu-attribute
22477 @opindex mgnu-attribute
22478 @opindex mno-gnu-attribute
22479 Emit .gnu_attribute assembly directives to set tag/value pairs in a
22480 .gnu.attributes section that specify ABI variations in function
22481 parameters or return values.
22483 @item -mprototype
22484 @itemx -mno-prototype
22485 @opindex mprototype
22486 @opindex mno-prototype
22487 On System V.4 and embedded PowerPC systems assume that all calls to
22488 variable argument functions are properly prototyped.  Otherwise, the
22489 compiler must insert an instruction before every non-prototyped call to
22490 set or clear bit 6 of the condition code register (@code{CR}) to
22491 indicate whether floating-point values are passed in the floating-point
22492 registers in case the function takes variable arguments.  With
22493 @option{-mprototype}, only calls to prototyped variable argument functions
22494 set or clear the bit.
22496 @item -msim
22497 @opindex msim
22498 On embedded PowerPC systems, assume that the startup module is called
22499 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
22500 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
22501 configurations.
22503 @item -mmvme
22504 @opindex mmvme
22505 On embedded PowerPC systems, assume that the startup module is called
22506 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
22507 @file{libc.a}.
22509 @item -mads
22510 @opindex mads
22511 On embedded PowerPC systems, assume that the startup module is called
22512 @file{crt0.o} and the standard C libraries are @file{libads.a} and
22513 @file{libc.a}.
22515 @item -myellowknife
22516 @opindex myellowknife
22517 On embedded PowerPC systems, assume that the startup module is called
22518 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
22519 @file{libc.a}.
22521 @item -mvxworks
22522 @opindex mvxworks
22523 On System V.4 and embedded PowerPC systems, specify that you are
22524 compiling for a VxWorks system.
22526 @item -memb
22527 @opindex memb
22528 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
22529 header to indicate that @samp{eabi} extended relocations are used.
22531 @item -meabi
22532 @itemx -mno-eabi
22533 @opindex meabi
22534 @opindex mno-eabi
22535 On System V.4 and embedded PowerPC systems do (do not) adhere to the
22536 Embedded Applications Binary Interface (EABI), which is a set of
22537 modifications to the System V.4 specifications.  Selecting @option{-meabi}
22538 means that the stack is aligned to an 8-byte boundary, a function
22539 @code{__eabi} is called from @code{main} to set up the EABI
22540 environment, and the @option{-msdata} option can use both @code{r2} and
22541 @code{r13} to point to two separate small data areas.  Selecting
22542 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
22543 no EABI initialization function is called from @code{main}, and the
22544 @option{-msdata} option only uses @code{r13} to point to a single
22545 small data area.  The @option{-meabi} option is on by default if you
22546 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
22548 @item -msdata=eabi
22549 @opindex msdata=eabi
22550 On System V.4 and embedded PowerPC systems, put small initialized
22551 @code{const} global and static data in the @code{.sdata2} section, which
22552 is pointed to by register @code{r2}.  Put small initialized
22553 non-@code{const} global and static data in the @code{.sdata} section,
22554 which is pointed to by register @code{r13}.  Put small uninitialized
22555 global and static data in the @code{.sbss} section, which is adjacent to
22556 the @code{.sdata} section.  The @option{-msdata=eabi} option is
22557 incompatible with the @option{-mrelocatable} option.  The
22558 @option{-msdata=eabi} option also sets the @option{-memb} option.
22560 @item -msdata=sysv
22561 @opindex msdata=sysv
22562 On System V.4 and embedded PowerPC systems, put small global and static
22563 data in the @code{.sdata} section, which is pointed to by register
22564 @code{r13}.  Put small uninitialized global and static data in the
22565 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
22566 The @option{-msdata=sysv} option is incompatible with the
22567 @option{-mrelocatable} option.
22569 @item -msdata=default
22570 @itemx -msdata
22571 @opindex msdata=default
22572 @opindex msdata
22573 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
22574 compile code the same as @option{-msdata=eabi}, otherwise compile code the
22575 same as @option{-msdata=sysv}.
22577 @item -msdata=data
22578 @opindex msdata=data
22579 On System V.4 and embedded PowerPC systems, put small global
22580 data in the @code{.sdata} section.  Put small uninitialized global
22581 data in the @code{.sbss} section.  Do not use register @code{r13}
22582 to address small data however.  This is the default behavior unless
22583 other @option{-msdata} options are used.
22585 @item -msdata=none
22586 @itemx -mno-sdata
22587 @opindex msdata=none
22588 @opindex mno-sdata
22589 On embedded PowerPC systems, put all initialized global and static data
22590 in the @code{.data} section, and all uninitialized data in the
22591 @code{.bss} section.
22593 @item -mblock-move-inline-limit=@var{num}
22594 @opindex mblock-move-inline-limit
22595 Inline all block moves (such as calls to @code{memcpy} or structure
22596 copies) less than or equal to @var{num} bytes.  The minimum value for
22597 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
22598 targets.  The default value is target-specific.
22600 @item -G @var{num}
22601 @opindex G
22602 @cindex smaller data references (PowerPC)
22603 @cindex .sdata/.sdata2 references (PowerPC)
22604 On embedded PowerPC systems, put global and static items less than or
22605 equal to @var{num} bytes into the small data or BSS sections instead of
22606 the normal data or BSS section.  By default, @var{num} is 8.  The
22607 @option{-G @var{num}} switch is also passed to the linker.
22608 All modules should be compiled with the same @option{-G @var{num}} value.
22610 @item -mregnames
22611 @itemx -mno-regnames
22612 @opindex mregnames
22613 @opindex mno-regnames
22614 On System V.4 and embedded PowerPC systems do (do not) emit register
22615 names in the assembly language output using symbolic forms.
22617 @item -mlongcall
22618 @itemx -mno-longcall
22619 @opindex mlongcall
22620 @opindex mno-longcall
22621 By default assume that all calls are far away so that a longer and more
22622 expensive calling sequence is required.  This is required for calls
22623 farther than 32 megabytes (33,554,432 bytes) from the current location.
22624 A short call is generated if the compiler knows
22625 the call cannot be that far away.  This setting can be overridden by
22626 the @code{shortcall} function attribute, or by @code{#pragma
22627 longcall(0)}.
22629 Some linkers are capable of detecting out-of-range calls and generating
22630 glue code on the fly.  On these systems, long calls are unnecessary and
22631 generate slower code.  As of this writing, the AIX linker can do this,
22632 as can the GNU linker for PowerPC/64.  It is planned to add this feature
22633 to the GNU linker for 32-bit PowerPC systems as well.
22635 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
22636 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
22637 addresses represent the callee and the branch island.  The
22638 Darwin/PPC linker prefers the first address and generates a @code{bl
22639 callee} if the PPC @code{bl} instruction reaches the callee directly;
22640 otherwise, the linker generates @code{bl L42} to call the branch
22641 island.  The branch island is appended to the body of the
22642 calling function; it computes the full 32-bit address of the callee
22643 and jumps to it.
22645 On Mach-O (Darwin) systems, this option directs the compiler emit to
22646 the glue for every direct call, and the Darwin linker decides whether
22647 to use or discard it.
22649 In the future, GCC may ignore all longcall specifications
22650 when the linker is known to generate glue.
22652 @item -mtls-markers
22653 @itemx -mno-tls-markers
22654 @opindex mtls-markers
22655 @opindex mno-tls-markers
22656 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
22657 specifying the function argument.  The relocation allows the linker to
22658 reliably associate function call with argument setup instructions for
22659 TLS optimization, which in turn allows GCC to better schedule the
22660 sequence.
22662 @item -mrecip
22663 @itemx -mno-recip
22664 @opindex mrecip
22665 This option enables use of the reciprocal estimate and
22666 reciprocal square root estimate instructions with additional
22667 Newton-Raphson steps to increase precision instead of doing a divide or
22668 square root and divide for floating-point arguments.  You should use
22669 the @option{-ffast-math} option when using @option{-mrecip} (or at
22670 least @option{-funsafe-math-optimizations},
22671 @option{-ffinite-math-only}, @option{-freciprocal-math} and
22672 @option{-fno-trapping-math}).  Note that while the throughput of the
22673 sequence is generally higher than the throughput of the non-reciprocal
22674 instruction, the precision of the sequence can be decreased by up to 2
22675 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
22676 roots.
22678 @item -mrecip=@var{opt}
22679 @opindex mrecip=opt
22680 This option controls which reciprocal estimate instructions
22681 may be used.  @var{opt} is a comma-separated list of options, which may
22682 be preceded by a @code{!} to invert the option:
22684 @table @samp
22686 @item all
22687 Enable all estimate instructions.
22689 @item default 
22690 Enable the default instructions, equivalent to @option{-mrecip}.
22692 @item none 
22693 Disable all estimate instructions, equivalent to @option{-mno-recip}.
22695 @item div 
22696 Enable the reciprocal approximation instructions for both 
22697 single and double precision.
22699 @item divf 
22700 Enable the single-precision reciprocal approximation instructions.
22702 @item divd 
22703 Enable the double-precision reciprocal approximation instructions.
22705 @item rsqrt 
22706 Enable the reciprocal square root approximation instructions for both
22707 single and double precision.
22709 @item rsqrtf 
22710 Enable the single-precision reciprocal square root approximation instructions.
22712 @item rsqrtd 
22713 Enable the double-precision reciprocal square root approximation instructions.
22715 @end table
22717 So, for example, @option{-mrecip=all,!rsqrtd} enables
22718 all of the reciprocal estimate instructions, except for the
22719 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
22720 which handle the double-precision reciprocal square root calculations.
22722 @item -mrecip-precision
22723 @itemx -mno-recip-precision
22724 @opindex mrecip-precision
22725 Assume (do not assume) that the reciprocal estimate instructions
22726 provide higher-precision estimates than is mandated by the PowerPC
22727 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
22728 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
22729 The double-precision square root estimate instructions are not generated by
22730 default on low-precision machines, since they do not provide an
22731 estimate that converges after three steps.
22733 @item -mveclibabi=@var{type}
22734 @opindex mveclibabi
22735 Specifies the ABI type to use for vectorizing intrinsics using an
22736 external library.  The only type supported at present is @samp{mass},
22737 which specifies to use IBM's Mathematical Acceleration Subsystem
22738 (MASS) libraries for vectorizing intrinsics using external libraries.
22739 GCC currently emits calls to @code{acosd2}, @code{acosf4},
22740 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
22741 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
22742 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
22743 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
22744 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
22745 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
22746 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
22747 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
22748 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
22749 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
22750 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
22751 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
22752 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
22753 for power7.  Both @option{-ftree-vectorize} and
22754 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
22755 libraries must be specified at link time.
22757 @item -mfriz
22758 @itemx -mno-friz
22759 @opindex mfriz
22760 Generate (do not generate) the @code{friz} instruction when the
22761 @option{-funsafe-math-optimizations} option is used to optimize
22762 rounding of floating-point values to 64-bit integer and back to floating
22763 point.  The @code{friz} instruction does not return the same value if
22764 the floating-point number is too large to fit in an integer.
22766 @item -mpointers-to-nested-functions
22767 @itemx -mno-pointers-to-nested-functions
22768 @opindex mpointers-to-nested-functions
22769 Generate (do not generate) code to load up the static chain register
22770 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
22771 systems where a function pointer points to a 3-word descriptor giving
22772 the function address, TOC value to be loaded in register @code{r2}, and
22773 static chain value to be loaded in register @code{r11}.  The
22774 @option{-mpointers-to-nested-functions} is on by default.  You cannot
22775 call through pointers to nested functions or pointers
22776 to functions compiled in other languages that use the static chain if
22777 you use @option{-mno-pointers-to-nested-functions}.
22779 @item -msave-toc-indirect
22780 @itemx -mno-save-toc-indirect
22781 @opindex msave-toc-indirect
22782 Generate (do not generate) code to save the TOC value in the reserved
22783 stack location in the function prologue if the function calls through
22784 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
22785 saved in the prologue, it is saved just before the call through the
22786 pointer.  The @option{-mno-save-toc-indirect} option is the default.
22788 @item -mcompat-align-parm
22789 @itemx -mno-compat-align-parm
22790 @opindex mcompat-align-parm
22791 Generate (do not generate) code to pass structure parameters with a
22792 maximum alignment of 64 bits, for compatibility with older versions
22793 of GCC.
22795 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
22796 structure parameter on a 128-bit boundary when that structure contained
22797 a member requiring 128-bit alignment.  This is corrected in more
22798 recent versions of GCC.  This option may be used to generate code
22799 that is compatible with functions compiled with older versions of
22800 GCC.
22802 The @option{-mno-compat-align-parm} option is the default.
22804 @item -mstack-protector-guard=@var{guard}
22805 @itemx -mstack-protector-guard-reg=@var{reg}
22806 @itemx -mstack-protector-guard-offset=@var{offset}
22807 @itemx -mstack-protector-guard-symbol=@var{symbol}
22808 @opindex mstack-protector-guard
22809 @opindex mstack-protector-guard-reg
22810 @opindex mstack-protector-guard-offset
22811 @opindex mstack-protector-guard-symbol
22812 Generate stack protection code using canary at @var{guard}.  Supported
22813 locations are @samp{global} for global canary or @samp{tls} for per-thread
22814 canary in the TLS block (the default with GNU libc version 2.4 or later).
22816 With the latter choice the options
22817 @option{-mstack-protector-guard-reg=@var{reg}} and
22818 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
22819 which register to use as base register for reading the canary, and from what
22820 offset from that base register. The default for those is as specified in the
22821 relevant ABI.  @option{-mstack-protector-guard-symbol=@var{symbol}} overrides
22822 the offset with a symbol reference to a canary in the TLS block.
22823 @end table
22825 @node RX Options
22826 @subsection RX Options
22827 @cindex RX Options
22829 These command-line options are defined for RX targets:
22831 @table @gcctabopt
22832 @item -m64bit-doubles
22833 @itemx -m32bit-doubles
22834 @opindex m64bit-doubles
22835 @opindex m32bit-doubles
22836 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
22837 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
22838 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
22839 works on 32-bit values, which is why the default is
22840 @option{-m32bit-doubles}.
22842 @item -fpu
22843 @itemx -nofpu
22844 @opindex fpu
22845 @opindex nofpu
22846 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
22847 floating-point hardware.  The default is enabled for the RX600
22848 series and disabled for the RX200 series.
22850 Floating-point instructions are only generated for 32-bit floating-point 
22851 values, however, so the FPU hardware is not used for doubles if the
22852 @option{-m64bit-doubles} option is used.
22854 @emph{Note} If the @option{-fpu} option is enabled then
22855 @option{-funsafe-math-optimizations} is also enabled automatically.
22856 This is because the RX FPU instructions are themselves unsafe.
22858 @item -mcpu=@var{name}
22859 @opindex mcpu
22860 Selects the type of RX CPU to be targeted.  Currently three types are
22861 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
22862 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
22864 The only difference between @samp{RX600} and @samp{RX610} is that the
22865 @samp{RX610} does not support the @code{MVTIPL} instruction.
22867 The @samp{RX200} series does not have a hardware floating-point unit
22868 and so @option{-nofpu} is enabled by default when this type is
22869 selected.
22871 @item -mbig-endian-data
22872 @itemx -mlittle-endian-data
22873 @opindex mbig-endian-data
22874 @opindex mlittle-endian-data
22875 Store data (but not code) in the big-endian format.  The default is
22876 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
22877 format.
22879 @item -msmall-data-limit=@var{N}
22880 @opindex msmall-data-limit
22881 Specifies the maximum size in bytes of global and static variables
22882 which can be placed into the small data area.  Using the small data
22883 area can lead to smaller and faster code, but the size of area is
22884 limited and it is up to the programmer to ensure that the area does
22885 not overflow.  Also when the small data area is used one of the RX's
22886 registers (usually @code{r13}) is reserved for use pointing to this
22887 area, so it is no longer available for use by the compiler.  This
22888 could result in slower and/or larger code if variables are pushed onto
22889 the stack instead of being held in this register.
22891 Note, common variables (variables that have not been initialized) and
22892 constants are not placed into the small data area as they are assigned
22893 to other sections in the output executable.
22895 The default value is zero, which disables this feature.  Note, this
22896 feature is not enabled by default with higher optimization levels
22897 (@option{-O2} etc) because of the potentially detrimental effects of
22898 reserving a register.  It is up to the programmer to experiment and
22899 discover whether this feature is of benefit to their program.  See the
22900 description of the @option{-mpid} option for a description of how the
22901 actual register to hold the small data area pointer is chosen.
22903 @item -msim
22904 @itemx -mno-sim
22905 @opindex msim
22906 @opindex mno-sim
22907 Use the simulator runtime.  The default is to use the libgloss
22908 board-specific runtime.
22910 @item -mas100-syntax
22911 @itemx -mno-as100-syntax
22912 @opindex mas100-syntax
22913 @opindex mno-as100-syntax
22914 When generating assembler output use a syntax that is compatible with
22915 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
22916 assembler, but it has some restrictions so it is not generated by default.
22918 @item -mmax-constant-size=@var{N}
22919 @opindex mmax-constant-size
22920 Specifies the maximum size, in bytes, of a constant that can be used as
22921 an operand in a RX instruction.  Although the RX instruction set does
22922 allow constants of up to 4 bytes in length to be used in instructions,
22923 a longer value equates to a longer instruction.  Thus in some
22924 circumstances it can be beneficial to restrict the size of constants
22925 that are used in instructions.  Constants that are too big are instead
22926 placed into a constant pool and referenced via register indirection.
22928 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
22929 or 4 means that constants of any size are allowed.
22931 @item -mrelax
22932 @opindex mrelax
22933 Enable linker relaxation.  Linker relaxation is a process whereby the
22934 linker attempts to reduce the size of a program by finding shorter
22935 versions of various instructions.  Disabled by default.
22937 @item -mint-register=@var{N}
22938 @opindex mint-register
22939 Specify the number of registers to reserve for fast interrupt handler
22940 functions.  The value @var{N} can be between 0 and 4.  A value of 1
22941 means that register @code{r13} is reserved for the exclusive use
22942 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
22943 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
22944 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
22945 A value of 0, the default, does not reserve any registers.
22947 @item -msave-acc-in-interrupts
22948 @opindex msave-acc-in-interrupts
22949 Specifies that interrupt handler functions should preserve the
22950 accumulator register.  This is only necessary if normal code might use
22951 the accumulator register, for example because it performs 64-bit
22952 multiplications.  The default is to ignore the accumulator as this
22953 makes the interrupt handlers faster.
22955 @item -mpid
22956 @itemx -mno-pid
22957 @opindex mpid
22958 @opindex mno-pid
22959 Enables the generation of position independent data.  When enabled any
22960 access to constant data is done via an offset from a base address
22961 held in a register.  This allows the location of constant data to be
22962 determined at run time without requiring the executable to be
22963 relocated, which is a benefit to embedded applications with tight
22964 memory constraints.  Data that can be modified is not affected by this
22965 option.
22967 Note, using this feature reserves a register, usually @code{r13}, for
22968 the constant data base address.  This can result in slower and/or
22969 larger code, especially in complicated functions.
22971 The actual register chosen to hold the constant data base address
22972 depends upon whether the @option{-msmall-data-limit} and/or the
22973 @option{-mint-register} command-line options are enabled.  Starting
22974 with register @code{r13} and proceeding downwards, registers are
22975 allocated first to satisfy the requirements of @option{-mint-register},
22976 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
22977 is possible for the small data area register to be @code{r8} if both
22978 @option{-mint-register=4} and @option{-mpid} are specified on the
22979 command line.
22981 By default this feature is not enabled.  The default can be restored
22982 via the @option{-mno-pid} command-line option.
22984 @item -mno-warn-multiple-fast-interrupts
22985 @itemx -mwarn-multiple-fast-interrupts
22986 @opindex mno-warn-multiple-fast-interrupts
22987 @opindex mwarn-multiple-fast-interrupts
22988 Prevents GCC from issuing a warning message if it finds more than one
22989 fast interrupt handler when it is compiling a file.  The default is to
22990 issue a warning for each extra fast interrupt handler found, as the RX
22991 only supports one such interrupt.
22993 @item -mallow-string-insns
22994 @itemx -mno-allow-string-insns
22995 @opindex mallow-string-insns
22996 @opindex mno-allow-string-insns
22997 Enables or disables the use of the string manipulation instructions
22998 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
22999 @code{SWHILE} and also the @code{RMPA} instruction.  These
23000 instructions may prefetch data, which is not safe to do if accessing
23001 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
23002 for more information).
23004 The default is to allow these instructions, but it is not possible for
23005 GCC to reliably detect all circumstances where a string instruction
23006 might be used to access an I/O register, so their use cannot be
23007 disabled automatically.  Instead it is reliant upon the programmer to
23008 use the @option{-mno-allow-string-insns} option if their program
23009 accesses I/O space.
23011 When the instructions are enabled GCC defines the C preprocessor
23012 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
23013 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
23015 @item -mjsr
23016 @itemx -mno-jsr
23017 @opindex mjsr
23018 @opindex mno-jsr
23019 Use only (or not only) @code{JSR} instructions to access functions.
23020 This option can be used when code size exceeds the range of @code{BSR}
23021 instructions.  Note that @option{-mno-jsr} does not mean to not use
23022 @code{JSR} but instead means that any type of branch may be used.
23023 @end table
23025 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
23026 has special significance to the RX port when used with the
23027 @code{interrupt} function attribute.  This attribute indicates a
23028 function intended to process fast interrupts.  GCC ensures
23029 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
23030 and/or @code{r13} and only provided that the normal use of the
23031 corresponding registers have been restricted via the
23032 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
23033 options.
23035 @node S/390 and zSeries Options
23036 @subsection S/390 and zSeries Options
23037 @cindex S/390 and zSeries Options
23039 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
23041 @table @gcctabopt
23042 @item -mhard-float
23043 @itemx -msoft-float
23044 @opindex mhard-float
23045 @opindex msoft-float
23046 Use (do not use) the hardware floating-point instructions and registers
23047 for floating-point operations.  When @option{-msoft-float} is specified,
23048 functions in @file{libgcc.a} are used to perform floating-point
23049 operations.  When @option{-mhard-float} is specified, the compiler
23050 generates IEEE floating-point instructions.  This is the default.
23052 @item -mhard-dfp
23053 @itemx -mno-hard-dfp
23054 @opindex mhard-dfp
23055 @opindex mno-hard-dfp
23056 Use (do not use) the hardware decimal-floating-point instructions for
23057 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
23058 specified, functions in @file{libgcc.a} are used to perform
23059 decimal-floating-point operations.  When @option{-mhard-dfp} is
23060 specified, the compiler generates decimal-floating-point hardware
23061 instructions.  This is the default for @option{-march=z9-ec} or higher.
23063 @item -mlong-double-64
23064 @itemx -mlong-double-128
23065 @opindex mlong-double-64
23066 @opindex mlong-double-128
23067 These switches control the size of @code{long double} type. A size
23068 of 64 bits makes the @code{long double} type equivalent to the @code{double}
23069 type. This is the default.
23071 @item -mbackchain
23072 @itemx -mno-backchain
23073 @opindex mbackchain
23074 @opindex mno-backchain
23075 Store (do not store) the address of the caller's frame as backchain pointer
23076 into the callee's stack frame.
23077 A backchain may be needed to allow debugging using tools that do not understand
23078 DWARF call frame information.
23079 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
23080 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
23081 the backchain is placed into the topmost word of the 96/160 byte register
23082 save area.
23084 In general, code compiled with @option{-mbackchain} is call-compatible with
23085 code compiled with @option{-mmo-backchain}; however, use of the backchain
23086 for debugging purposes usually requires that the whole binary is built with
23087 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
23088 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
23089 to build a linux kernel use @option{-msoft-float}.
23091 The default is to not maintain the backchain.
23093 @item -mpacked-stack
23094 @itemx -mno-packed-stack
23095 @opindex mpacked-stack
23096 @opindex mno-packed-stack
23097 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
23098 specified, the compiler uses the all fields of the 96/160 byte register save
23099 area only for their default purpose; unused fields still take up stack space.
23100 When @option{-mpacked-stack} is specified, register save slots are densely
23101 packed at the top of the register save area; unused space is reused for other
23102 purposes, allowing for more efficient use of the available stack space.
23103 However, when @option{-mbackchain} is also in effect, the topmost word of
23104 the save area is always used to store the backchain, and the return address
23105 register is always saved two words below the backchain.
23107 As long as the stack frame backchain is not used, code generated with
23108 @option{-mpacked-stack} is call-compatible with code generated with
23109 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
23110 S/390 or zSeries generated code that uses the stack frame backchain at run
23111 time, not just for debugging purposes.  Such code is not call-compatible
23112 with code compiled with @option{-mpacked-stack}.  Also, note that the
23113 combination of @option{-mbackchain},
23114 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
23115 to build a linux kernel use @option{-msoft-float}.
23117 The default is to not use the packed stack layout.
23119 @item -msmall-exec
23120 @itemx -mno-small-exec
23121 @opindex msmall-exec
23122 @opindex mno-small-exec
23123 Generate (or do not generate) code using the @code{bras} instruction
23124 to do subroutine calls.
23125 This only works reliably if the total executable size does not
23126 exceed 64k.  The default is to use the @code{basr} instruction instead,
23127 which does not have this limitation.
23129 @item -m64
23130 @itemx -m31
23131 @opindex m64
23132 @opindex m31
23133 When @option{-m31} is specified, generate code compliant to the
23134 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
23135 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
23136 particular to generate 64-bit instructions.  For the @samp{s390}
23137 targets, the default is @option{-m31}, while the @samp{s390x}
23138 targets default to @option{-m64}.
23140 @item -mzarch
23141 @itemx -mesa
23142 @opindex mzarch
23143 @opindex mesa
23144 When @option{-mzarch} is specified, generate code using the
23145 instructions available on z/Architecture.
23146 When @option{-mesa} is specified, generate code using the
23147 instructions available on ESA/390.  Note that @option{-mesa} is
23148 not possible with @option{-m64}.
23149 When generating code compliant to the GNU/Linux for S/390 ABI,
23150 the default is @option{-mesa}.  When generating code compliant
23151 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
23153 @item -mhtm
23154 @itemx -mno-htm
23155 @opindex mhtm
23156 @opindex mno-htm
23157 The @option{-mhtm} option enables a set of builtins making use of
23158 instructions available with the transactional execution facility
23159 introduced with the IBM zEnterprise EC12 machine generation
23160 @ref{S/390 System z Built-in Functions}.
23161 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
23163 @item -mvx
23164 @itemx -mno-vx
23165 @opindex mvx
23166 @opindex mno-vx
23167 When @option{-mvx} is specified, generate code using the instructions
23168 available with the vector extension facility introduced with the IBM
23169 z13 machine generation.
23170 This option changes the ABI for some vector type values with regard to
23171 alignment and calling conventions.  In case vector type values are
23172 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
23173 command will be added to mark the resulting binary with the ABI used.
23174 @option{-mvx} is enabled by default when using @option{-march=z13}.
23176 @item -mzvector
23177 @itemx -mno-zvector
23178 @opindex mzvector
23179 @opindex mno-zvector
23180 The @option{-mzvector} option enables vector language extensions and
23181 builtins using instructions available with the vector extension
23182 facility introduced with the IBM z13 machine generation.
23183 This option adds support for @samp{vector} to be used as a keyword to
23184 define vector type variables and arguments.  @samp{vector} is only
23185 available when GNU extensions are enabled.  It will not be expanded
23186 when requesting strict standard compliance e.g. with @option{-std=c99}.
23187 In addition to the GCC low-level builtins @option{-mzvector} enables
23188 a set of builtins added for compatibility with AltiVec-style
23189 implementations like Power and Cell.  In order to make use of these
23190 builtins the header file @file{vecintrin.h} needs to be included.
23191 @option{-mzvector} is disabled by default.
23193 @item -mmvcle
23194 @itemx -mno-mvcle
23195 @opindex mmvcle
23196 @opindex mno-mvcle
23197 Generate (or do not generate) code using the @code{mvcle} instruction
23198 to perform block moves.  When @option{-mno-mvcle} is specified,
23199 use a @code{mvc} loop instead.  This is the default unless optimizing for
23200 size.
23202 @item -mdebug
23203 @itemx -mno-debug
23204 @opindex mdebug
23205 @opindex mno-debug
23206 Print (or do not print) additional debug information when compiling.
23207 The default is to not print debug information.
23209 @item -march=@var{cpu-type}
23210 @opindex march
23211 Generate code that runs on @var{cpu-type}, which is the name of a
23212 system representing a certain processor type.  Possible values for
23213 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
23214 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
23215 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11}, and
23216 @samp{native}.
23218 The default is @option{-march=z900}.  @samp{g5}/@samp{arch3} and
23219 @samp{g6} are deprecated and will be removed with future releases.
23221 Specifying @samp{native} as cpu type can be used to select the best
23222 architecture option for the host processor.
23223 @option{-march=native} has no effect if GCC does not recognize the
23224 processor.
23226 @item -mtune=@var{cpu-type}
23227 @opindex mtune
23228 Tune to @var{cpu-type} everything applicable about the generated code,
23229 except for the ABI and the set of available instructions.
23230 The list of @var{cpu-type} values is the same as for @option{-march}.
23231 The default is the value used for @option{-march}.
23233 @item -mtpf-trace
23234 @itemx -mno-tpf-trace
23235 @opindex mtpf-trace
23236 @opindex mno-tpf-trace
23237 Generate code that adds (does not add) in TPF OS specific branches to trace
23238 routines in the operating system.  This option is off by default, even
23239 when compiling for the TPF OS@.
23241 @item -mfused-madd
23242 @itemx -mno-fused-madd
23243 @opindex mfused-madd
23244 @opindex mno-fused-madd
23245 Generate code that uses (does not use) the floating-point multiply and
23246 accumulate instructions.  These instructions are generated by default if
23247 hardware floating point is used.
23249 @item -mwarn-framesize=@var{framesize}
23250 @opindex mwarn-framesize
23251 Emit a warning if the current function exceeds the given frame size.  Because
23252 this is a compile-time check it doesn't need to be a real problem when the program
23253 runs.  It is intended to identify functions that most probably cause
23254 a stack overflow.  It is useful to be used in an environment with limited stack
23255 size e.g.@: the linux kernel.
23257 @item -mwarn-dynamicstack
23258 @opindex mwarn-dynamicstack
23259 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
23260 arrays.  This is generally a bad idea with a limited stack size.
23262 @item -mstack-guard=@var{stack-guard}
23263 @itemx -mstack-size=@var{stack-size}
23264 @opindex mstack-guard
23265 @opindex mstack-size
23266 If these options are provided the S/390 back end emits additional instructions in
23267 the function prologue that trigger a trap if the stack size is @var{stack-guard}
23268 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
23269 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
23270 the frame size of the compiled function is chosen.
23271 These options are intended to be used to help debugging stack overflow problems.
23272 The additionally emitted code causes only little overhead and hence can also be
23273 used in production-like systems without greater performance degradation.  The given
23274 values have to be exact powers of 2 and @var{stack-size} has to be greater than
23275 @var{stack-guard} without exceeding 64k.
23276 In order to be efficient the extra code makes the assumption that the stack starts
23277 at an address aligned to the value given by @var{stack-size}.
23278 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
23280 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
23281 @opindex mhotpatch
23282 If the hotpatch option is enabled, a ``hot-patching'' function
23283 prologue is generated for all functions in the compilation unit.
23284 The funtion label is prepended with the given number of two-byte
23285 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
23286 the label, 2 * @var{post-halfwords} bytes are appended, using the
23287 largest NOP like instructions the architecture allows (maximum
23288 1000000).
23290 If both arguments are zero, hotpatching is disabled.
23292 This option can be overridden for individual functions with the
23293 @code{hotpatch} attribute.
23294 @end table
23296 @node Score Options
23297 @subsection Score Options
23298 @cindex Score Options
23300 These options are defined for Score implementations:
23302 @table @gcctabopt
23303 @item -meb
23304 @opindex meb
23305 Compile code for big-endian mode.  This is the default.
23307 @item -mel
23308 @opindex mel
23309 Compile code for little-endian mode.
23311 @item -mnhwloop
23312 @opindex mnhwloop
23313 Disable generation of @code{bcnz} instructions.
23315 @item -muls
23316 @opindex muls
23317 Enable generation of unaligned load and store instructions.
23319 @item -mmac
23320 @opindex mmac
23321 Enable the use of multiply-accumulate instructions. Disabled by default.
23323 @item -mscore5
23324 @opindex mscore5
23325 Specify the SCORE5 as the target architecture.
23327 @item -mscore5u
23328 @opindex mscore5u
23329 Specify the SCORE5U of the target architecture.
23331 @item -mscore7
23332 @opindex mscore7
23333 Specify the SCORE7 as the target architecture. This is the default.
23335 @item -mscore7d
23336 @opindex mscore7d
23337 Specify the SCORE7D as the target architecture.
23338 @end table
23340 @node SH Options
23341 @subsection SH Options
23343 These @samp{-m} options are defined for the SH implementations:
23345 @table @gcctabopt
23346 @item -m1
23347 @opindex m1
23348 Generate code for the SH1.
23350 @item -m2
23351 @opindex m2
23352 Generate code for the SH2.
23354 @item -m2e
23355 Generate code for the SH2e.
23357 @item -m2a-nofpu
23358 @opindex m2a-nofpu
23359 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
23360 that the floating-point unit is not used.
23362 @item -m2a-single-only
23363 @opindex m2a-single-only
23364 Generate code for the SH2a-FPU, in such a way that no double-precision
23365 floating-point operations are used.
23367 @item -m2a-single
23368 @opindex m2a-single
23369 Generate code for the SH2a-FPU assuming the floating-point unit is in
23370 single-precision mode by default.
23372 @item -m2a
23373 @opindex m2a
23374 Generate code for the SH2a-FPU assuming the floating-point unit is in
23375 double-precision mode by default.
23377 @item -m3
23378 @opindex m3
23379 Generate code for the SH3.
23381 @item -m3e
23382 @opindex m3e
23383 Generate code for the SH3e.
23385 @item -m4-nofpu
23386 @opindex m4-nofpu
23387 Generate code for the SH4 without a floating-point unit.
23389 @item -m4-single-only
23390 @opindex m4-single-only
23391 Generate code for the SH4 with a floating-point unit that only
23392 supports single-precision arithmetic.
23394 @item -m4-single
23395 @opindex m4-single
23396 Generate code for the SH4 assuming the floating-point unit is in
23397 single-precision mode by default.
23399 @item -m4
23400 @opindex m4
23401 Generate code for the SH4.
23403 @item -m4-100
23404 @opindex m4-100
23405 Generate code for SH4-100.
23407 @item -m4-100-nofpu
23408 @opindex m4-100-nofpu
23409 Generate code for SH4-100 in such a way that the
23410 floating-point unit is not used.
23412 @item -m4-100-single
23413 @opindex m4-100-single
23414 Generate code for SH4-100 assuming the floating-point unit is in
23415 single-precision mode by default.
23417 @item -m4-100-single-only
23418 @opindex m4-100-single-only
23419 Generate code for SH4-100 in such a way that no double-precision
23420 floating-point operations are used.
23422 @item -m4-200
23423 @opindex m4-200
23424 Generate code for SH4-200.
23426 @item -m4-200-nofpu
23427 @opindex m4-200-nofpu
23428 Generate code for SH4-200 without in such a way that the
23429 floating-point unit is not used.
23431 @item -m4-200-single
23432 @opindex m4-200-single
23433 Generate code for SH4-200 assuming the floating-point unit is in
23434 single-precision mode by default.
23436 @item -m4-200-single-only
23437 @opindex m4-200-single-only
23438 Generate code for SH4-200 in such a way that no double-precision
23439 floating-point operations are used.
23441 @item -m4-300
23442 @opindex m4-300
23443 Generate code for SH4-300.
23445 @item -m4-300-nofpu
23446 @opindex m4-300-nofpu
23447 Generate code for SH4-300 without in such a way that the
23448 floating-point unit is not used.
23450 @item -m4-300-single
23451 @opindex m4-300-single
23452 Generate code for SH4-300 in such a way that no double-precision
23453 floating-point operations are used.
23455 @item -m4-300-single-only
23456 @opindex m4-300-single-only
23457 Generate code for SH4-300 in such a way that no double-precision
23458 floating-point operations are used.
23460 @item -m4-340
23461 @opindex m4-340
23462 Generate code for SH4-340 (no MMU, no FPU).
23464 @item -m4-500
23465 @opindex m4-500
23466 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
23467 assembler.
23469 @item -m4a-nofpu
23470 @opindex m4a-nofpu
23471 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
23472 floating-point unit is not used.
23474 @item -m4a-single-only
23475 @opindex m4a-single-only
23476 Generate code for the SH4a, in such a way that no double-precision
23477 floating-point operations are used.
23479 @item -m4a-single
23480 @opindex m4a-single
23481 Generate code for the SH4a assuming the floating-point unit is in
23482 single-precision mode by default.
23484 @item -m4a
23485 @opindex m4a
23486 Generate code for the SH4a.
23488 @item -m4al
23489 @opindex m4al
23490 Same as @option{-m4a-nofpu}, except that it implicitly passes
23491 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
23492 instructions at the moment.
23494 @item -mb
23495 @opindex mb
23496 Compile code for the processor in big-endian mode.
23498 @item -ml
23499 @opindex ml
23500 Compile code for the processor in little-endian mode.
23502 @item -mdalign
23503 @opindex mdalign
23504 Align doubles at 64-bit boundaries.  Note that this changes the calling
23505 conventions, and thus some functions from the standard C library do
23506 not work unless you recompile it first with @option{-mdalign}.
23508 @item -mrelax
23509 @opindex mrelax
23510 Shorten some address references at link time, when possible; uses the
23511 linker option @option{-relax}.
23513 @item -mbigtable
23514 @opindex mbigtable
23515 Use 32-bit offsets in @code{switch} tables.  The default is to use
23516 16-bit offsets.
23518 @item -mbitops
23519 @opindex mbitops
23520 Enable the use of bit manipulation instructions on SH2A.
23522 @item -mfmovd
23523 @opindex mfmovd
23524 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
23525 alignment constraints.
23527 @item -mrenesas
23528 @opindex mrenesas
23529 Comply with the calling conventions defined by Renesas.
23531 @item -mno-renesas
23532 @opindex mno-renesas
23533 Comply with the calling conventions defined for GCC before the Renesas
23534 conventions were available.  This option is the default for all
23535 targets of the SH toolchain.
23537 @item -mnomacsave
23538 @opindex mnomacsave
23539 Mark the @code{MAC} register as call-clobbered, even if
23540 @option{-mrenesas} is given.
23542 @item -mieee
23543 @itemx -mno-ieee
23544 @opindex mieee
23545 @opindex mno-ieee
23546 Control the IEEE compliance of floating-point comparisons, which affects the
23547 handling of cases where the result of a comparison is unordered.  By default
23548 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
23549 enabled @option{-mno-ieee} is implicitly set, which results in faster
23550 floating-point greater-equal and less-equal comparisons.  The implicit settings
23551 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
23553 @item -minline-ic_invalidate
23554 @opindex minline-ic_invalidate
23555 Inline code to invalidate instruction cache entries after setting up
23556 nested function trampolines.
23557 This option has no effect if @option{-musermode} is in effect and the selected
23558 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
23559 instruction.
23560 If the selected code generation option does not allow the use of the @code{icbi}
23561 instruction, and @option{-musermode} is not in effect, the inlined code
23562 manipulates the instruction cache address array directly with an associative
23563 write.  This not only requires privileged mode at run time, but it also
23564 fails if the cache line had been mapped via the TLB and has become unmapped.
23566 @item -misize
23567 @opindex misize
23568 Dump instruction size and location in the assembly code.
23570 @item -mpadstruct
23571 @opindex mpadstruct
23572 This option is deprecated.  It pads structures to multiple of 4 bytes,
23573 which is incompatible with the SH ABI@.
23575 @item -matomic-model=@var{model}
23576 @opindex matomic-model=@var{model}
23577 Sets the model of atomic operations and additional parameters as a comma
23578 separated list.  For details on the atomic built-in functions see
23579 @ref{__atomic Builtins}.  The following models and parameters are supported:
23581 @table @samp
23583 @item none
23584 Disable compiler generated atomic sequences and emit library calls for atomic
23585 operations.  This is the default if the target is not @code{sh*-*-linux*}.
23587 @item soft-gusa
23588 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
23589 built-in functions.  The generated atomic sequences require additional support
23590 from the interrupt/exception handling code of the system and are only suitable
23591 for SH3* and SH4* single-core systems.  This option is enabled by default when
23592 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
23593 this option also partially utilizes the hardware atomic instructions
23594 @code{movli.l} and @code{movco.l} to create more efficient code, unless
23595 @samp{strict} is specified.  
23597 @item soft-tcb
23598 Generate software atomic sequences that use a variable in the thread control
23599 block.  This is a variation of the gUSA sequences which can also be used on
23600 SH1* and SH2* targets.  The generated atomic sequences require additional
23601 support from the interrupt/exception handling code of the system and are only
23602 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
23603 parameter has to be specified as well.
23605 @item soft-imask
23606 Generate software atomic sequences that temporarily disable interrupts by
23607 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
23608 in privileged mode and is only suitable for single-core systems.  Additional
23609 support from the interrupt/exception handling code of the system is not
23610 required.  This model is enabled by default when the target is
23611 @code{sh*-*-linux*} and SH1* or SH2*.
23613 @item hard-llcs
23614 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
23615 instructions only.  This is only available on SH4A and is suitable for
23616 multi-core systems.  Since the hardware instructions support only 32 bit atomic
23617 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
23618 Code compiled with this option is also compatible with other software
23619 atomic model interrupt/exception handling systems if executed on an SH4A
23620 system.  Additional support from the interrupt/exception handling code of the
23621 system is not required for this model.
23623 @item gbr-offset=
23624 This parameter specifies the offset in bytes of the variable in the thread
23625 control block structure that should be used by the generated atomic sequences
23626 when the @samp{soft-tcb} model has been selected.  For other models this
23627 parameter is ignored.  The specified value must be an integer multiple of four
23628 and in the range 0-1020.
23630 @item strict
23631 This parameter prevents mixed usage of multiple atomic models, even if they
23632 are compatible, and makes the compiler generate atomic sequences of the
23633 specified model only.
23635 @end table
23637 @item -mtas
23638 @opindex mtas
23639 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
23640 Notice that depending on the particular hardware and software configuration
23641 this can degrade overall performance due to the operand cache line flushes
23642 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
23643 processors the @code{tas.b} instruction must be used with caution since it
23644 can result in data corruption for certain cache configurations.
23646 @item -mprefergot
23647 @opindex mprefergot
23648 When generating position-independent code, emit function calls using
23649 the Global Offset Table instead of the Procedure Linkage Table.
23651 @item -musermode
23652 @itemx -mno-usermode
23653 @opindex musermode
23654 @opindex mno-usermode
23655 Don't allow (allow) the compiler generating privileged mode code.  Specifying
23656 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
23657 inlined code would not work in user mode.  @option{-musermode} is the default
23658 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
23659 @option{-musermode} has no effect, since there is no user mode.
23661 @item -multcost=@var{number}
23662 @opindex multcost=@var{number}
23663 Set the cost to assume for a multiply insn.
23665 @item -mdiv=@var{strategy}
23666 @opindex mdiv=@var{strategy}
23667 Set the division strategy to be used for integer division operations.
23668 @var{strategy} can be one of: 
23670 @table @samp
23672 @item call-div1
23673 Calls a library function that uses the single-step division instruction
23674 @code{div1} to perform the operation.  Division by zero calculates an
23675 unspecified result and does not trap.  This is the default except for SH4,
23676 SH2A and SHcompact.
23678 @item call-fp
23679 Calls a library function that performs the operation in double precision
23680 floating point.  Division by zero causes a floating-point exception.  This is
23681 the default for SHcompact with FPU.  Specifying this for targets that do not
23682 have a double precision FPU defaults to @code{call-div1}.
23684 @item call-table
23685 Calls a library function that uses a lookup table for small divisors and
23686 the @code{div1} instruction with case distinction for larger divisors.  Division
23687 by zero calculates an unspecified result and does not trap.  This is the default
23688 for SH4.  Specifying this for targets that do not have dynamic shift
23689 instructions defaults to @code{call-div1}.
23691 @end table
23693 When a division strategy has not been specified the default strategy is
23694 selected based on the current target.  For SH2A the default strategy is to
23695 use the @code{divs} and @code{divu} instructions instead of library function
23696 calls.
23698 @item -maccumulate-outgoing-args
23699 @opindex maccumulate-outgoing-args
23700 Reserve space once for outgoing arguments in the function prologue rather
23701 than around each call.  Generally beneficial for performance and size.  Also
23702 needed for unwinding to avoid changing the stack frame around conditional code.
23704 @item -mdivsi3_libfunc=@var{name}
23705 @opindex mdivsi3_libfunc=@var{name}
23706 Set the name of the library function used for 32-bit signed division to
23707 @var{name}.
23708 This only affects the name used in the @samp{call} division strategies, and
23709 the compiler still expects the same sets of input/output/clobbered registers as
23710 if this option were not present.
23712 @item -mfixed-range=@var{register-range}
23713 @opindex mfixed-range
23714 Generate code treating the given register range as fixed registers.
23715 A fixed register is one that the register allocator can not use.  This is
23716 useful when compiling kernel code.  A register range is specified as
23717 two registers separated by a dash.  Multiple register ranges can be
23718 specified separated by a comma.
23720 @item -mbranch-cost=@var{num}
23721 @opindex mbranch-cost=@var{num}
23722 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
23723 make the compiler try to generate more branch-free code if possible.  
23724 If not specified the value is selected depending on the processor type that
23725 is being compiled for.
23727 @item -mzdcbranch
23728 @itemx -mno-zdcbranch
23729 @opindex mzdcbranch
23730 @opindex mno-zdcbranch
23731 Assume (do not assume) that zero displacement conditional branch instructions
23732 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
23733 compiler prefers zero displacement branch code sequences.  This is
23734 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
23735 disabled by specifying @option{-mno-zdcbranch}.
23737 @item -mcbranch-force-delay-slot
23738 @opindex mcbranch-force-delay-slot
23739 Force the usage of delay slots for conditional branches, which stuffs the delay
23740 slot with a @code{nop} if a suitable instruction cannot be found.  By default
23741 this option is disabled.  It can be enabled to work around hardware bugs as
23742 found in the original SH7055.
23744 @item -mfused-madd
23745 @itemx -mno-fused-madd
23746 @opindex mfused-madd
23747 @opindex mno-fused-madd
23748 Generate code that uses (does not use) the floating-point multiply and
23749 accumulate instructions.  These instructions are generated by default
23750 if hardware floating point is used.  The machine-dependent
23751 @option{-mfused-madd} option is now mapped to the machine-independent
23752 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
23753 mapped to @option{-ffp-contract=off}.
23755 @item -mfsca
23756 @itemx -mno-fsca
23757 @opindex mfsca
23758 @opindex mno-fsca
23759 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
23760 and cosine approximations.  The option @option{-mfsca} must be used in
23761 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
23762 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
23763 approximations even if @option{-funsafe-math-optimizations} is in effect.
23765 @item -mfsrra
23766 @itemx -mno-fsrra
23767 @opindex mfsrra
23768 @opindex mno-fsrra
23769 Allow or disallow the compiler to emit the @code{fsrra} instruction for
23770 reciprocal square root approximations.  The option @option{-mfsrra} must be used
23771 in combination with @option{-funsafe-math-optimizations} and
23772 @option{-ffinite-math-only}.  It is enabled by default when generating code for
23773 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
23774 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
23775 in effect.
23777 @item -mpretend-cmove
23778 @opindex mpretend-cmove
23779 Prefer zero-displacement conditional branches for conditional move instruction
23780 patterns.  This can result in faster code on the SH4 processor.
23782 @item -mfdpic
23783 @opindex fdpic
23784 Generate code using the FDPIC ABI.
23786 @end table
23788 @node Solaris 2 Options
23789 @subsection Solaris 2 Options
23790 @cindex Solaris 2 options
23792 These @samp{-m} options are supported on Solaris 2:
23794 @table @gcctabopt
23795 @item -mclear-hwcap
23796 @opindex mclear-hwcap
23797 @option{-mclear-hwcap} tells the compiler to remove the hardware
23798 capabilities generated by the Solaris assembler.  This is only necessary
23799 when object files use ISA extensions not supported by the current
23800 machine, but check at runtime whether or not to use them.
23802 @item -mimpure-text
23803 @opindex mimpure-text
23804 @option{-mimpure-text}, used in addition to @option{-shared}, tells
23805 the compiler to not pass @option{-z text} to the linker when linking a
23806 shared object.  Using this option, you can link position-dependent
23807 code into a shared object.
23809 @option{-mimpure-text} suppresses the ``relocations remain against
23810 allocatable but non-writable sections'' linker error message.
23811 However, the necessary relocations trigger copy-on-write, and the
23812 shared object is not actually shared across processes.  Instead of
23813 using @option{-mimpure-text}, you should compile all source code with
23814 @option{-fpic} or @option{-fPIC}.
23816 @end table
23818 These switches are supported in addition to the above on Solaris 2:
23820 @table @gcctabopt
23821 @item -pthreads
23822 @opindex pthreads
23823 This is a synonym for @option{-pthread}.
23824 @end table
23826 @node SPARC Options
23827 @subsection SPARC Options
23828 @cindex SPARC options
23830 These @samp{-m} options are supported on the SPARC:
23832 @table @gcctabopt
23833 @item -mno-app-regs
23834 @itemx -mapp-regs
23835 @opindex mno-app-regs
23836 @opindex mapp-regs
23837 Specify @option{-mapp-regs} to generate output using the global registers
23838 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
23839 global register 1, each global register 2 through 4 is then treated as an
23840 allocable register that is clobbered by function calls.  This is the default.
23842 To be fully SVR4 ABI-compliant at the cost of some performance loss,
23843 specify @option{-mno-app-regs}.  You should compile libraries and system
23844 software with this option.
23846 @item -mflat
23847 @itemx -mno-flat
23848 @opindex mflat
23849 @opindex mno-flat
23850 With @option{-mflat}, the compiler does not generate save/restore instructions
23851 and uses a ``flat'' or single register window model.  This model is compatible
23852 with the regular register window model.  The local registers and the input
23853 registers (0--5) are still treated as ``call-saved'' registers and are
23854 saved on the stack as needed.
23856 With @option{-mno-flat} (the default), the compiler generates save/restore
23857 instructions (except for leaf functions).  This is the normal operating mode.
23859 @item -mfpu
23860 @itemx -mhard-float
23861 @opindex mfpu
23862 @opindex mhard-float
23863 Generate output containing floating-point instructions.  This is the
23864 default.
23866 @item -mno-fpu
23867 @itemx -msoft-float
23868 @opindex mno-fpu
23869 @opindex msoft-float
23870 Generate output containing library calls for floating point.
23871 @strong{Warning:} the requisite libraries are not available for all SPARC
23872 targets.  Normally the facilities of the machine's usual C compiler are
23873 used, but this cannot be done directly in cross-compilation.  You must make
23874 your own arrangements to provide suitable library functions for
23875 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
23876 @samp{sparclite-*-*} do provide software floating-point support.
23878 @option{-msoft-float} changes the calling convention in the output file;
23879 therefore, it is only useful if you compile @emph{all} of a program with
23880 this option.  In particular, you need to compile @file{libgcc.a}, the
23881 library that comes with GCC, with @option{-msoft-float} in order for
23882 this to work.
23884 @item -mhard-quad-float
23885 @opindex mhard-quad-float
23886 Generate output containing quad-word (long double) floating-point
23887 instructions.
23889 @item -msoft-quad-float
23890 @opindex msoft-quad-float
23891 Generate output containing library calls for quad-word (long double)
23892 floating-point instructions.  The functions called are those specified
23893 in the SPARC ABI@.  This is the default.
23895 As of this writing, there are no SPARC implementations that have hardware
23896 support for the quad-word floating-point instructions.  They all invoke
23897 a trap handler for one of these instructions, and then the trap handler
23898 emulates the effect of the instruction.  Because of the trap handler overhead,
23899 this is much slower than calling the ABI library routines.  Thus the
23900 @option{-msoft-quad-float} option is the default.
23902 @item -mno-unaligned-doubles
23903 @itemx -munaligned-doubles
23904 @opindex mno-unaligned-doubles
23905 @opindex munaligned-doubles
23906 Assume that doubles have 8-byte alignment.  This is the default.
23908 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
23909 alignment only if they are contained in another type, or if they have an
23910 absolute address.  Otherwise, it assumes they have 4-byte alignment.
23911 Specifying this option avoids some rare compatibility problems with code
23912 generated by other compilers.  It is not the default because it results
23913 in a performance loss, especially for floating-point code.
23915 @item -muser-mode
23916 @itemx -mno-user-mode
23917 @opindex muser-mode
23918 @opindex mno-user-mode
23919 Do not generate code that can only run in supervisor mode.  This is relevant
23920 only for the @code{casa} instruction emitted for the LEON3 processor.  This
23921 is the default.
23923 @item -mfaster-structs
23924 @itemx -mno-faster-structs
23925 @opindex mfaster-structs
23926 @opindex mno-faster-structs
23927 With @option{-mfaster-structs}, the compiler assumes that structures
23928 should have 8-byte alignment.  This enables the use of pairs of
23929 @code{ldd} and @code{std} instructions for copies in structure
23930 assignment, in place of twice as many @code{ld} and @code{st} pairs.
23931 However, the use of this changed alignment directly violates the SPARC
23932 ABI@.  Thus, it's intended only for use on targets where the developer
23933 acknowledges that their resulting code is not directly in line with
23934 the rules of the ABI@.
23936 @item -mstd-struct-return
23937 @itemx -mno-std-struct-return
23938 @opindex mstd-struct-return
23939 @opindex mno-std-struct-return
23940 With @option{-mstd-struct-return}, the compiler generates checking code
23941 in functions returning structures or unions to detect size mismatches
23942 between the two sides of function calls, as per the 32-bit ABI@.
23944 The default is @option{-mno-std-struct-return}.  This option has no effect
23945 in 64-bit mode.
23947 @item -mlra
23948 @itemx -mno-lra
23949 @opindex mlra
23950 @opindex mno-lra
23951 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
23952 so @option{-mno-lra} needs to be passed to get old Reload.
23954 @item -mcpu=@var{cpu_type}
23955 @opindex mcpu
23956 Set the instruction set, register set, and instruction scheduling parameters
23957 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
23958 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
23959 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
23960 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
23961 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
23962 @samp{niagara3}, @samp{niagara4}, @samp{niagara7} and @samp{m8}.
23964 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
23965 which selects the best architecture option for the host processor.
23966 @option{-mcpu=native} has no effect if GCC does not recognize
23967 the processor.
23969 Default instruction scheduling parameters are used for values that select
23970 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
23971 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
23973 Here is a list of each supported architecture and their supported
23974 implementations.
23976 @table @asis
23977 @item v7
23978 cypress, leon3v7
23980 @item v8
23981 supersparc, hypersparc, leon, leon3
23983 @item sparclite
23984 f930, f934, sparclite86x
23986 @item sparclet
23987 tsc701
23989 @item v9
23990 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4,
23991 niagara7, m8
23992 @end table
23994 By default (unless configured otherwise), GCC generates code for the V7
23995 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
23996 additionally optimizes it for the Cypress CY7C602 chip, as used in the
23997 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
23998 SPARCStation 1, 2, IPX etc.
24000 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
24001 architecture.  The only difference from V7 code is that the compiler emits
24002 the integer multiply and integer divide instructions which exist in SPARC-V8
24003 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
24004 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
24005 2000 series.
24007 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
24008 the SPARC architecture.  This adds the integer multiply, integer divide step
24009 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
24010 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
24011 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
24012 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
24013 MB86934 chip, which is the more recent SPARClite with FPU@.
24015 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
24016 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
24017 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
24018 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
24019 optimizes it for the TEMIC SPARClet chip.
24021 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
24022 architecture.  This adds 64-bit integer and floating-point move instructions,
24023 3 additional floating-point condition code registers and conditional move
24024 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
24025 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
24026 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
24027 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
24028 @option{-mcpu=niagara}, the compiler additionally optimizes it for
24029 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
24030 additionally optimizes it for Sun UltraSPARC T2 chips. With
24031 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
24032 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
24033 additionally optimizes it for Sun UltraSPARC T4 chips.  With
24034 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
24035 Oracle SPARC M7 chips.  With @option{-mcpu=m8}, the compiler
24036 additionally optimizes it for Oracle M8 chips.
24038 @item -mtune=@var{cpu_type}
24039 @opindex mtune
24040 Set the instruction scheduling parameters for machine type
24041 @var{cpu_type}, but do not set the instruction set or register set that the
24042 option @option{-mcpu=@var{cpu_type}} does.
24044 The same values for @option{-mcpu=@var{cpu_type}} can be used for
24045 @option{-mtune=@var{cpu_type}}, but the only useful values are those
24046 that select a particular CPU implementation.  Those are
24047 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
24048 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
24049 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
24050 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
24051 @samp{niagara4}, @samp{niagara7} and @samp{m8}.  With native Solaris
24052 and GNU/Linux toolchains, @samp{native} can also be used.
24054 @item -mv8plus
24055 @itemx -mno-v8plus
24056 @opindex mv8plus
24057 @opindex mno-v8plus
24058 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
24059 difference from the V8 ABI is that the global and out registers are
24060 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
24061 mode for all SPARC-V9 processors.
24063 @item -mvis
24064 @itemx -mno-vis
24065 @opindex mvis
24066 @opindex mno-vis
24067 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
24068 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
24070 @item -mvis2
24071 @itemx -mno-vis2
24072 @opindex mvis2
24073 @opindex mno-vis2
24074 With @option{-mvis2}, GCC generates code that takes advantage of
24075 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
24076 default is @option{-mvis2} when targeting a cpu that supports such
24077 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
24078 also sets @option{-mvis}.
24080 @item -mvis3
24081 @itemx -mno-vis3
24082 @opindex mvis3
24083 @opindex mno-vis3
24084 With @option{-mvis3}, GCC generates code that takes advantage of
24085 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
24086 default is @option{-mvis3} when targeting a cpu that supports such
24087 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
24088 also sets @option{-mvis2} and @option{-mvis}.
24090 @item -mvis4
24091 @itemx -mno-vis4
24092 @opindex mvis4
24093 @opindex mno-vis4
24094 With @option{-mvis4}, GCC generates code that takes advantage of
24095 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
24096 default is @option{-mvis4} when targeting a cpu that supports such
24097 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
24098 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
24100 @item -mvis4b
24101 @itemx -mno-vis4b
24102 @opindex mvis4b
24103 @opindex mno-vis4b
24104 With @option{-mvis4b}, GCC generates code that takes advantage of
24105 version 4.0 of the UltraSPARC Visual Instruction Set extensions, plus
24106 the additional VIS instructions introduced in the Oracle SPARC
24107 Architecture 2017.  The default is @option{-mvis4b} when targeting a
24108 cpu that supports such instructions, such as m8 and later.  Setting
24109 @option{-mvis4b} also sets @option{-mvis4}, @option{-mvis3},
24110 @option{-mvis2} and @option{-mvis}.
24112 @item -mcbcond
24113 @itemx -mno-cbcond
24114 @opindex mcbcond
24115 @opindex mno-cbcond
24116 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
24117 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
24118 when targeting a CPU that supports such instructions, such as Niagara-4 and
24119 later.
24121 @item -mfmaf
24122 @itemx -mno-fmaf
24123 @opindex mfmaf
24124 @opindex mno-fmaf
24125 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
24126 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
24127 when targeting a CPU that supports such instructions, such as Niagara-3 and
24128 later.
24130 @item -mfsmuld
24131 @itemx -mno-fsmuld
24132 @opindex mfsmuld
24133 @opindex mno-fsmuld
24134 With @option{-mfsmuld}, GCC generates code that takes advantage of the
24135 Floating-point Multiply Single to Double (FsMULd) instruction.  The default is
24136 @option{-mfsmuld} when targeting a CPU supporting the architecture versions V8
24137 or V9 with FPU except @option{-mcpu=leon}.
24139 @item -mpopc
24140 @itemx -mno-popc
24141 @opindex mpopc
24142 @opindex mno-popc
24143 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
24144 Population Count instruction.  The default is @option{-mpopc}
24145 when targeting a CPU that supports such an instruction, such as Niagara-2 and
24146 later.
24148 @item -msubxc
24149 @itemx -mno-subxc
24150 @opindex msubxc
24151 @opindex mno-subxc
24152 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
24153 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
24154 when targeting a CPU that supports such an instruction, such as Niagara-7 and
24155 later.
24157 @item -mfix-at697f
24158 @opindex mfix-at697f
24159 Enable the documented workaround for the single erratum of the Atmel AT697F
24160 processor (which corresponds to erratum #13 of the AT697E processor).
24162 @item -mfix-ut699
24163 @opindex mfix-ut699
24164 Enable the documented workarounds for the floating-point errata and the data
24165 cache nullify errata of the UT699 processor.
24167 @item -mfix-ut700
24168 @opindex mfix-ut700
24169 Enable the documented workaround for the back-to-back store errata of
24170 the UT699E/UT700 processor.
24172 @item -mfix-gr712rc
24173 @opindex mfix-gr712rc
24174 Enable the documented workaround for the back-to-back store errata of
24175 the GR712RC processor.
24176 @end table
24178 These @samp{-m} options are supported in addition to the above
24179 on SPARC-V9 processors in 64-bit environments:
24181 @table @gcctabopt
24182 @item -m32
24183 @itemx -m64
24184 @opindex m32
24185 @opindex m64
24186 Generate code for a 32-bit or 64-bit environment.
24187 The 32-bit environment sets int, long and pointer to 32 bits.
24188 The 64-bit environment sets int to 32 bits and long and pointer
24189 to 64 bits.
24191 @item -mcmodel=@var{which}
24192 @opindex mcmodel
24193 Set the code model to one of
24195 @table @samp
24196 @item medlow
24197 The Medium/Low code model: 64-bit addresses, programs
24198 must be linked in the low 32 bits of memory.  Programs can be statically
24199 or dynamically linked.
24201 @item medmid
24202 The Medium/Middle code model: 64-bit addresses, programs
24203 must be linked in the low 44 bits of memory, the text and data segments must
24204 be less than 2GB in size and the data segment must be located within 2GB of
24205 the text segment.
24207 @item medany
24208 The Medium/Anywhere code model: 64-bit addresses, programs
24209 may be linked anywhere in memory, the text and data segments must be less
24210 than 2GB in size and the data segment must be located within 2GB of the
24211 text segment.
24213 @item embmedany
24214 The Medium/Anywhere code model for embedded systems:
24215 64-bit addresses, the text and data segments must be less than 2GB in
24216 size, both starting anywhere in memory (determined at link time).  The
24217 global register %g4 points to the base of the data segment.  Programs
24218 are statically linked and PIC is not supported.
24219 @end table
24221 @item -mmemory-model=@var{mem-model}
24222 @opindex mmemory-model
24223 Set the memory model in force on the processor to one of
24225 @table @samp
24226 @item default
24227 The default memory model for the processor and operating system.
24229 @item rmo
24230 Relaxed Memory Order
24232 @item pso
24233 Partial Store Order
24235 @item tso
24236 Total Store Order
24238 @item sc
24239 Sequential Consistency
24240 @end table
24242 These memory models are formally defined in Appendix D of the SPARC-V9
24243 architecture manual, as set in the processor's @code{PSTATE.MM} field.
24245 @item -mstack-bias
24246 @itemx -mno-stack-bias
24247 @opindex mstack-bias
24248 @opindex mno-stack-bias
24249 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
24250 frame pointer if present, are offset by @minus{}2047 which must be added back
24251 when making stack frame references.  This is the default in 64-bit mode.
24252 Otherwise, assume no such offset is present.
24253 @end table
24255 @node SPU Options
24256 @subsection SPU Options
24257 @cindex SPU options
24259 These @samp{-m} options are supported on the SPU:
24261 @table @gcctabopt
24262 @item -mwarn-reloc
24263 @itemx -merror-reloc
24264 @opindex mwarn-reloc
24265 @opindex merror-reloc
24267 The loader for SPU does not handle dynamic relocations.  By default, GCC
24268 gives an error when it generates code that requires a dynamic
24269 relocation.  @option{-mno-error-reloc} disables the error,
24270 @option{-mwarn-reloc} generates a warning instead.
24272 @item -msafe-dma
24273 @itemx -munsafe-dma
24274 @opindex msafe-dma
24275 @opindex munsafe-dma
24277 Instructions that initiate or test completion of DMA must not be
24278 reordered with respect to loads and stores of the memory that is being
24279 accessed.
24280 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
24281 memory accesses, but that can lead to inefficient code in places where the
24282 memory is known to not change.  Rather than mark the memory as volatile,
24283 you can use @option{-msafe-dma} to tell the compiler to treat
24284 the DMA instructions as potentially affecting all memory.  
24286 @item -mbranch-hints
24287 @opindex mbranch-hints
24289 By default, GCC generates a branch hint instruction to avoid
24290 pipeline stalls for always-taken or probably-taken branches.  A hint
24291 is not generated closer than 8 instructions away from its branch.
24292 There is little reason to disable them, except for debugging purposes,
24293 or to make an object a little bit smaller.
24295 @item -msmall-mem
24296 @itemx -mlarge-mem
24297 @opindex msmall-mem
24298 @opindex mlarge-mem
24300 By default, GCC generates code assuming that addresses are never larger
24301 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
24302 a full 32-bit address.
24304 @item -mstdmain
24305 @opindex mstdmain
24307 By default, GCC links against startup code that assumes the SPU-style
24308 main function interface (which has an unconventional parameter list).
24309 With @option{-mstdmain}, GCC links your program against startup
24310 code that assumes a C99-style interface to @code{main}, including a
24311 local copy of @code{argv} strings.
24313 @item -mfixed-range=@var{register-range}
24314 @opindex mfixed-range
24315 Generate code treating the given register range as fixed registers.
24316 A fixed register is one that the register allocator cannot use.  This is
24317 useful when compiling kernel code.  A register range is specified as
24318 two registers separated by a dash.  Multiple register ranges can be
24319 specified separated by a comma.
24321 @item -mea32
24322 @itemx -mea64
24323 @opindex mea32
24324 @opindex mea64
24325 Compile code assuming that pointers to the PPU address space accessed
24326 via the @code{__ea} named address space qualifier are either 32 or 64
24327 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
24328 all object code in an executable must be compiled with the same setting.
24330 @item -maddress-space-conversion
24331 @itemx -mno-address-space-conversion
24332 @opindex maddress-space-conversion
24333 @opindex mno-address-space-conversion
24334 Allow/disallow treating the @code{__ea} address space as superset
24335 of the generic address space.  This enables explicit type casts
24336 between @code{__ea} and generic pointer as well as implicit
24337 conversions of generic pointers to @code{__ea} pointers.  The
24338 default is to allow address space pointer conversions.
24340 @item -mcache-size=@var{cache-size}
24341 @opindex mcache-size
24342 This option controls the version of libgcc that the compiler links to an
24343 executable and selects a software-managed cache for accessing variables
24344 in the @code{__ea} address space with a particular cache size.  Possible
24345 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
24346 and @samp{128}.  The default cache size is 64KB.
24348 @item -matomic-updates
24349 @itemx -mno-atomic-updates
24350 @opindex matomic-updates
24351 @opindex mno-atomic-updates
24352 This option controls the version of libgcc that the compiler links to an
24353 executable and selects whether atomic updates to the software-managed
24354 cache of PPU-side variables are used.  If you use atomic updates, changes
24355 to a PPU variable from SPU code using the @code{__ea} named address space
24356 qualifier do not interfere with changes to other PPU variables residing
24357 in the same cache line from PPU code.  If you do not use atomic updates,
24358 such interference may occur; however, writing back cache lines is
24359 more efficient.  The default behavior is to use atomic updates.
24361 @item -mdual-nops
24362 @itemx -mdual-nops=@var{n}
24363 @opindex mdual-nops
24364 By default, GCC inserts NOPs to increase dual issue when it expects
24365 it to increase performance.  @var{n} can be a value from 0 to 10.  A
24366 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
24367 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
24369 @item -mhint-max-nops=@var{n}
24370 @opindex mhint-max-nops
24371 Maximum number of NOPs to insert for a branch hint.  A branch hint must
24372 be at least 8 instructions away from the branch it is affecting.  GCC
24373 inserts up to @var{n} NOPs to enforce this, otherwise it does not
24374 generate the branch hint.
24376 @item -mhint-max-distance=@var{n}
24377 @opindex mhint-max-distance
24378 The encoding of the branch hint instruction limits the hint to be within
24379 256 instructions of the branch it is affecting.  By default, GCC makes
24380 sure it is within 125.
24382 @item -msafe-hints
24383 @opindex msafe-hints
24384 Work around a hardware bug that causes the SPU to stall indefinitely.
24385 By default, GCC inserts the @code{hbrp} instruction to make sure
24386 this stall won't happen.
24388 @end table
24390 @node System V Options
24391 @subsection Options for System V
24393 These additional options are available on System V Release 4 for
24394 compatibility with other compilers on those systems:
24396 @table @gcctabopt
24397 @item -G
24398 @opindex G
24399 Create a shared object.
24400 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
24402 @item -Qy
24403 @opindex Qy
24404 Identify the versions of each tool used by the compiler, in a
24405 @code{.ident} assembler directive in the output.
24407 @item -Qn
24408 @opindex Qn
24409 Refrain from adding @code{.ident} directives to the output file (this is
24410 the default).
24412 @item -YP,@var{dirs}
24413 @opindex YP
24414 Search the directories @var{dirs}, and no others, for libraries
24415 specified with @option{-l}.
24417 @item -Ym,@var{dir}
24418 @opindex Ym
24419 Look in the directory @var{dir} to find the M4 preprocessor.
24420 The assembler uses this option.
24421 @c This is supposed to go with a -Yd for predefined M4 macro files, but
24422 @c the generic assembler that comes with Solaris takes just -Ym.
24423 @end table
24425 @node TILE-Gx Options
24426 @subsection TILE-Gx Options
24427 @cindex TILE-Gx options
24429 These @samp{-m} options are supported on the TILE-Gx:
24431 @table @gcctabopt
24432 @item -mcmodel=small
24433 @opindex mcmodel=small
24434 Generate code for the small model.  The distance for direct calls is
24435 limited to 500M in either direction.  PC-relative addresses are 32
24436 bits.  Absolute addresses support the full address range.
24438 @item -mcmodel=large
24439 @opindex mcmodel=large
24440 Generate code for the large model.  There is no limitation on call
24441 distance, pc-relative addresses, or absolute addresses.
24443 @item -mcpu=@var{name}
24444 @opindex mcpu
24445 Selects the type of CPU to be targeted.  Currently the only supported
24446 type is @samp{tilegx}.
24448 @item -m32
24449 @itemx -m64
24450 @opindex m32
24451 @opindex m64
24452 Generate code for a 32-bit or 64-bit environment.  The 32-bit
24453 environment sets int, long, and pointer to 32 bits.  The 64-bit
24454 environment sets int to 32 bits and long and pointer to 64 bits.
24456 @item -mbig-endian
24457 @itemx -mlittle-endian
24458 @opindex mbig-endian
24459 @opindex mlittle-endian
24460 Generate code in big/little endian mode, respectively.
24461 @end table
24463 @node TILEPro Options
24464 @subsection TILEPro Options
24465 @cindex TILEPro options
24467 These @samp{-m} options are supported on the TILEPro:
24469 @table @gcctabopt
24470 @item -mcpu=@var{name}
24471 @opindex mcpu
24472 Selects the type of CPU to be targeted.  Currently the only supported
24473 type is @samp{tilepro}.
24475 @item -m32
24476 @opindex m32
24477 Generate code for a 32-bit environment, which sets int, long, and
24478 pointer to 32 bits.  This is the only supported behavior so the flag
24479 is essentially ignored.
24480 @end table
24482 @node V850 Options
24483 @subsection V850 Options
24484 @cindex V850 Options
24486 These @samp{-m} options are defined for V850 implementations:
24488 @table @gcctabopt
24489 @item -mlong-calls
24490 @itemx -mno-long-calls
24491 @opindex mlong-calls
24492 @opindex mno-long-calls
24493 Treat all calls as being far away (near).  If calls are assumed to be
24494 far away, the compiler always loads the function's address into a
24495 register, and calls indirect through the pointer.
24497 @item -mno-ep
24498 @itemx -mep
24499 @opindex mno-ep
24500 @opindex mep
24501 Do not optimize (do optimize) basic blocks that use the same index
24502 pointer 4 or more times to copy pointer into the @code{ep} register, and
24503 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
24504 option is on by default if you optimize.
24506 @item -mno-prolog-function
24507 @itemx -mprolog-function
24508 @opindex mno-prolog-function
24509 @opindex mprolog-function
24510 Do not use (do use) external functions to save and restore registers
24511 at the prologue and epilogue of a function.  The external functions
24512 are slower, but use less code space if more than one function saves
24513 the same number of registers.  The @option{-mprolog-function} option
24514 is on by default if you optimize.
24516 @item -mspace
24517 @opindex mspace
24518 Try to make the code as small as possible.  At present, this just turns
24519 on the @option{-mep} and @option{-mprolog-function} options.
24521 @item -mtda=@var{n}
24522 @opindex mtda
24523 Put static or global variables whose size is @var{n} bytes or less into
24524 the tiny data area that register @code{ep} points to.  The tiny data
24525 area can hold up to 256 bytes in total (128 bytes for byte references).
24527 @item -msda=@var{n}
24528 @opindex msda
24529 Put static or global variables whose size is @var{n} bytes or less into
24530 the small data area that register @code{gp} points to.  The small data
24531 area can hold up to 64 kilobytes.
24533 @item -mzda=@var{n}
24534 @opindex mzda
24535 Put static or global variables whose size is @var{n} bytes or less into
24536 the first 32 kilobytes of memory.
24538 @item -mv850
24539 @opindex mv850
24540 Specify that the target processor is the V850.
24542 @item -mv850e3v5
24543 @opindex mv850e3v5
24544 Specify that the target processor is the V850E3V5.  The preprocessor
24545 constant @code{__v850e3v5__} is defined if this option is used.
24547 @item -mv850e2v4
24548 @opindex mv850e2v4
24549 Specify that the target processor is the V850E3V5.  This is an alias for
24550 the @option{-mv850e3v5} option.
24552 @item -mv850e2v3
24553 @opindex mv850e2v3
24554 Specify that the target processor is the V850E2V3.  The preprocessor
24555 constant @code{__v850e2v3__} is defined if this option is used.
24557 @item -mv850e2
24558 @opindex mv850e2
24559 Specify that the target processor is the V850E2.  The preprocessor
24560 constant @code{__v850e2__} is defined if this option is used.
24562 @item -mv850e1
24563 @opindex mv850e1
24564 Specify that the target processor is the V850E1.  The preprocessor
24565 constants @code{__v850e1__} and @code{__v850e__} are defined if
24566 this option is used.
24568 @item -mv850es
24569 @opindex mv850es
24570 Specify that the target processor is the V850ES.  This is an alias for
24571 the @option{-mv850e1} option.
24573 @item -mv850e
24574 @opindex mv850e
24575 Specify that the target processor is the V850E@.  The preprocessor
24576 constant @code{__v850e__} is defined if this option is used.
24578 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
24579 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
24580 are defined then a default target processor is chosen and the
24581 relevant @samp{__v850*__} preprocessor constant is defined.
24583 The preprocessor constants @code{__v850} and @code{__v851__} are always
24584 defined, regardless of which processor variant is the target.
24586 @item -mdisable-callt
24587 @itemx -mno-disable-callt
24588 @opindex mdisable-callt
24589 @opindex mno-disable-callt
24590 This option suppresses generation of the @code{CALLT} instruction for the
24591 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
24592 architecture.
24594 This option is enabled by default when the RH850 ABI is
24595 in use (see @option{-mrh850-abi}), and disabled by default when the
24596 GCC ABI is in use.  If @code{CALLT} instructions are being generated
24597 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
24599 @item -mrelax
24600 @itemx -mno-relax
24601 @opindex mrelax
24602 @opindex mno-relax
24603 Pass on (or do not pass on) the @option{-mrelax} command-line option
24604 to the assembler.
24606 @item -mlong-jumps
24607 @itemx -mno-long-jumps
24608 @opindex mlong-jumps
24609 @opindex mno-long-jumps
24610 Disable (or re-enable) the generation of PC-relative jump instructions.
24612 @item -msoft-float
24613 @itemx -mhard-float
24614 @opindex msoft-float
24615 @opindex mhard-float
24616 Disable (or re-enable) the generation of hardware floating point
24617 instructions.  This option is only significant when the target
24618 architecture is @samp{V850E2V3} or higher.  If hardware floating point
24619 instructions are being generated then the C preprocessor symbol
24620 @code{__FPU_OK__} is defined, otherwise the symbol
24621 @code{__NO_FPU__} is defined.
24623 @item -mloop
24624 @opindex mloop
24625 Enables the use of the e3v5 LOOP instruction.  The use of this
24626 instruction is not enabled by default when the e3v5 architecture is
24627 selected because its use is still experimental.
24629 @item -mrh850-abi
24630 @itemx -mghs
24631 @opindex mrh850-abi
24632 @opindex mghs
24633 Enables support for the RH850 version of the V850 ABI.  This is the
24634 default.  With this version of the ABI the following rules apply:
24636 @itemize
24637 @item
24638 Integer sized structures and unions are returned via a memory pointer
24639 rather than a register.
24641 @item
24642 Large structures and unions (more than 8 bytes in size) are passed by
24643 value.
24645 @item
24646 Functions are aligned to 16-bit boundaries.
24648 @item
24649 The @option{-m8byte-align} command-line option is supported.
24651 @item
24652 The @option{-mdisable-callt} command-line option is enabled by
24653 default.  The @option{-mno-disable-callt} command-line option is not
24654 supported.
24655 @end itemize
24657 When this version of the ABI is enabled the C preprocessor symbol
24658 @code{__V850_RH850_ABI__} is defined.
24660 @item -mgcc-abi
24661 @opindex mgcc-abi
24662 Enables support for the old GCC version of the V850 ABI.  With this
24663 version of the ABI the following rules apply:
24665 @itemize
24666 @item
24667 Integer sized structures and unions are returned in register @code{r10}.
24669 @item
24670 Large structures and unions (more than 8 bytes in size) are passed by
24671 reference.
24673 @item
24674 Functions are aligned to 32-bit boundaries, unless optimizing for
24675 size.
24677 @item
24678 The @option{-m8byte-align} command-line option is not supported.
24680 @item
24681 The @option{-mdisable-callt} command-line option is supported but not
24682 enabled by default.
24683 @end itemize
24685 When this version of the ABI is enabled the C preprocessor symbol
24686 @code{__V850_GCC_ABI__} is defined.
24688 @item -m8byte-align
24689 @itemx -mno-8byte-align
24690 @opindex m8byte-align
24691 @opindex mno-8byte-align
24692 Enables support for @code{double} and @code{long long} types to be
24693 aligned on 8-byte boundaries.  The default is to restrict the
24694 alignment of all objects to at most 4-bytes.  When
24695 @option{-m8byte-align} is in effect the C preprocessor symbol
24696 @code{__V850_8BYTE_ALIGN__} is defined.
24698 @item -mbig-switch
24699 @opindex mbig-switch
24700 Generate code suitable for big switch tables.  Use this option only if
24701 the assembler/linker complain about out of range branches within a switch
24702 table.
24704 @item -mapp-regs
24705 @opindex mapp-regs
24706 This option causes r2 and r5 to be used in the code generated by
24707 the compiler.  This setting is the default.
24709 @item -mno-app-regs
24710 @opindex mno-app-regs
24711 This option causes r2 and r5 to be treated as fixed registers.
24713 @end table
24715 @node VAX Options
24716 @subsection VAX Options
24717 @cindex VAX options
24719 These @samp{-m} options are defined for the VAX:
24721 @table @gcctabopt
24722 @item -munix
24723 @opindex munix
24724 Do not output certain jump instructions (@code{aobleq} and so on)
24725 that the Unix assembler for the VAX cannot handle across long
24726 ranges.
24728 @item -mgnu
24729 @opindex mgnu
24730 Do output those jump instructions, on the assumption that the
24731 GNU assembler is being used.
24733 @item -mg
24734 @opindex mg
24735 Output code for G-format floating-point numbers instead of D-format.
24736 @end table
24738 @node Visium Options
24739 @subsection Visium Options
24740 @cindex Visium options
24742 @table @gcctabopt
24744 @item -mdebug
24745 @opindex mdebug
24746 A program which performs file I/O and is destined to run on an MCM target
24747 should be linked with this option.  It causes the libraries libc.a and
24748 libdebug.a to be linked.  The program should be run on the target under
24749 the control of the GDB remote debugging stub.
24751 @item -msim
24752 @opindex msim
24753 A program which performs file I/O and is destined to run on the simulator
24754 should be linked with option.  This causes libraries libc.a and libsim.a to
24755 be linked.
24757 @item -mfpu
24758 @itemx -mhard-float
24759 @opindex mfpu
24760 @opindex mhard-float
24761 Generate code containing floating-point instructions.  This is the
24762 default.
24764 @item -mno-fpu
24765 @itemx -msoft-float
24766 @opindex mno-fpu
24767 @opindex msoft-float
24768 Generate code containing library calls for floating-point.
24770 @option{-msoft-float} changes the calling convention in the output file;
24771 therefore, it is only useful if you compile @emph{all} of a program with
24772 this option.  In particular, you need to compile @file{libgcc.a}, the
24773 library that comes with GCC, with @option{-msoft-float} in order for
24774 this to work.
24776 @item -mcpu=@var{cpu_type}
24777 @opindex mcpu
24778 Set the instruction set, register set, and instruction scheduling parameters
24779 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
24780 @samp{mcm}, @samp{gr5} and @samp{gr6}.
24782 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
24784 By default (unless configured otherwise), GCC generates code for the GR5
24785 variant of the Visium architecture.  
24787 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
24788 architecture.  The only difference from GR5 code is that the compiler will
24789 generate block move instructions.
24791 @item -mtune=@var{cpu_type}
24792 @opindex mtune
24793 Set the instruction scheduling parameters for machine type @var{cpu_type},
24794 but do not set the instruction set or register set that the option
24795 @option{-mcpu=@var{cpu_type}} would.
24797 @item -msv-mode
24798 @opindex msv-mode
24799 Generate code for the supervisor mode, where there are no restrictions on
24800 the access to general registers.  This is the default.
24802 @item -muser-mode
24803 @opindex muser-mode
24804 Generate code for the user mode, where the access to some general registers
24805 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
24806 mode; on the GR6, only registers r29 to r31 are affected.
24807 @end table
24809 @node VMS Options
24810 @subsection VMS Options
24812 These @samp{-m} options are defined for the VMS implementations:
24814 @table @gcctabopt
24815 @item -mvms-return-codes
24816 @opindex mvms-return-codes
24817 Return VMS condition codes from @code{main}. The default is to return POSIX-style
24818 condition (e.g.@ error) codes.
24820 @item -mdebug-main=@var{prefix}
24821 @opindex mdebug-main=@var{prefix}
24822 Flag the first routine whose name starts with @var{prefix} as the main
24823 routine for the debugger.
24825 @item -mmalloc64
24826 @opindex mmalloc64
24827 Default to 64-bit memory allocation routines.
24829 @item -mpointer-size=@var{size}
24830 @opindex mpointer-size=@var{size}
24831 Set the default size of pointers. Possible options for @var{size} are
24832 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
24833 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
24834 The later option disables @code{pragma pointer_size}.
24835 @end table
24837 @node VxWorks Options
24838 @subsection VxWorks Options
24839 @cindex VxWorks Options
24841 The options in this section are defined for all VxWorks targets.
24842 Options specific to the target hardware are listed with the other
24843 options for that target.
24845 @table @gcctabopt
24846 @item -mrtp
24847 @opindex mrtp
24848 GCC can generate code for both VxWorks kernels and real time processes
24849 (RTPs).  This option switches from the former to the latter.  It also
24850 defines the preprocessor macro @code{__RTP__}.
24852 @item -non-static
24853 @opindex non-static
24854 Link an RTP executable against shared libraries rather than static
24855 libraries.  The options @option{-static} and @option{-shared} can
24856 also be used for RTPs (@pxref{Link Options}); @option{-static}
24857 is the default.
24859 @item -Bstatic
24860 @itemx -Bdynamic
24861 @opindex Bstatic
24862 @opindex Bdynamic
24863 These options are passed down to the linker.  They are defined for
24864 compatibility with Diab.
24866 @item -Xbind-lazy
24867 @opindex Xbind-lazy
24868 Enable lazy binding of function calls.  This option is equivalent to
24869 @option{-Wl,-z,now} and is defined for compatibility with Diab.
24871 @item -Xbind-now
24872 @opindex Xbind-now
24873 Disable lazy binding of function calls.  This option is the default and
24874 is defined for compatibility with Diab.
24875 @end table
24877 @node x86 Options
24878 @subsection x86 Options
24879 @cindex x86 Options
24881 These @samp{-m} options are defined for the x86 family of computers.
24883 @table @gcctabopt
24885 @item -march=@var{cpu-type}
24886 @opindex march
24887 Generate instructions for the machine type @var{cpu-type}.  In contrast to
24888 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
24889 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
24890 to generate code that may not run at all on processors other than the one
24891 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
24892 @option{-mtune=@var{cpu-type}}.
24894 The choices for @var{cpu-type} are:
24896 @table @samp
24897 @item native
24898 This selects the CPU to generate code for at compilation time by determining
24899 the processor type of the compiling machine.  Using @option{-march=native}
24900 enables all instruction subsets supported by the local machine (hence
24901 the result might not run on different machines).  Using @option{-mtune=native}
24902 produces code optimized for the local machine under the constraints
24903 of the selected instruction set.  
24905 @item i386
24906 Original Intel i386 CPU@.
24908 @item i486
24909 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
24911 @item i586
24912 @itemx pentium
24913 Intel Pentium CPU with no MMX support.
24915 @item lakemont
24916 Intel Lakemont MCU, based on Intel Pentium CPU.
24918 @item pentium-mmx
24919 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
24921 @item pentiumpro
24922 Intel Pentium Pro CPU@.
24924 @item i686
24925 When used with @option{-march}, the Pentium Pro
24926 instruction set is used, so the code runs on all i686 family chips.
24927 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
24929 @item pentium2
24930 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
24931 support.
24933 @item pentium3
24934 @itemx pentium3m
24935 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
24936 set support.
24938 @item pentium-m
24939 Intel Pentium M; low-power version of Intel Pentium III CPU
24940 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
24942 @item pentium4
24943 @itemx pentium4m
24944 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
24946 @item prescott
24947 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
24948 set support.
24950 @item nocona
24951 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
24952 SSE2 and SSE3 instruction set support.
24954 @item core2
24955 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
24956 instruction set support.
24958 @item nehalem
24959 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24960 SSE4.1, SSE4.2 and POPCNT instruction set support.
24962 @item westmere
24963 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24964 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
24966 @item sandybridge
24967 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24968 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
24970 @item ivybridge
24971 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24972 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
24973 instruction set support.
24975 @item haswell
24976 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24977 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24978 BMI, BMI2 and F16C instruction set support.
24980 @item broadwell
24981 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24982 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24983 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
24985 @item skylake
24986 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24987 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24988 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
24989 XSAVES instruction set support.
24991 @item bonnell
24992 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
24993 instruction set support.
24995 @item silvermont
24996 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24997 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
24999 @item knl
25000 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
25001 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
25002 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
25003 AVX512CD instruction set support.
25005 @item skylake-avx512
25006 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
25007 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
25008 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
25009 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
25011 @item k6
25012 AMD K6 CPU with MMX instruction set support.
25014 @item k6-2
25015 @itemx k6-3
25016 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
25018 @item athlon
25019 @itemx athlon-tbird
25020 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
25021 support.
25023 @item athlon-4
25024 @itemx athlon-xp
25025 @itemx athlon-mp
25026 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
25027 instruction set support.
25029 @item k8
25030 @itemx opteron
25031 @itemx athlon64
25032 @itemx athlon-fx
25033 Processors based on the AMD K8 core with x86-64 instruction set support,
25034 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
25035 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
25036 instruction set extensions.)
25038 @item k8-sse3
25039 @itemx opteron-sse3
25040 @itemx athlon64-sse3
25041 Improved versions of AMD K8 cores with SSE3 instruction set support.
25043 @item amdfam10
25044 @itemx barcelona
25045 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
25046 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
25047 instruction set extensions.)
25049 @item bdver1
25050 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
25051 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
25052 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
25053 @item bdver2
25054 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
25055 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
25056 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
25057 extensions.)
25058 @item bdver3
25059 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
25060 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
25061 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
25062 64-bit instruction set extensions.
25063 @item bdver4
25064 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
25065 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
25066 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
25067 SSE4.2, ABM and 64-bit instruction set extensions.
25069 @item znver1
25070 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
25071 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
25072 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
25073 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
25074 instruction set extensions.
25076 @item btver1
25077 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
25078 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
25079 instruction set extensions.)
25081 @item btver2
25082 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
25083 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
25084 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
25086 @item winchip-c6
25087 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
25088 set support.
25090 @item winchip2
25091 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
25092 instruction set support.
25094 @item c3
25095 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
25096 (No scheduling is implemented for this chip.)
25098 @item c3-2
25099 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
25100 (No scheduling is implemented for this chip.)
25102 @item c7
25103 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
25104 (No scheduling is implemented for this chip.)
25106 @item samuel-2
25107 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
25108 (No scheduling is implemented for this chip.)
25110 @item nehemiah
25111 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
25112 (No scheduling is implemented for this chip.)
25114 @item esther
25115 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
25116 (No scheduling is implemented for this chip.)
25118 @item eden-x2
25119 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
25120 (No scheduling is implemented for this chip.)
25122 @item eden-x4
25123 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
25124 AVX and AVX2 instruction set support.
25125 (No scheduling is implemented for this chip.)
25127 @item nano
25128 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
25129 instruction set support.
25130 (No scheduling is implemented for this chip.)
25132 @item nano-1000
25133 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
25134 instruction set support.
25135 (No scheduling is implemented for this chip.)
25137 @item nano-2000
25138 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
25139 instruction set support.
25140 (No scheduling is implemented for this chip.)
25142 @item nano-3000
25143 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
25144 instruction set support.
25145 (No scheduling is implemented for this chip.)
25147 @item nano-x2
25148 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
25149 instruction set support.
25150 (No scheduling is implemented for this chip.)
25152 @item nano-x4
25153 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
25154 instruction set support.
25155 (No scheduling is implemented for this chip.)
25157 @item geode
25158 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
25159 @end table
25161 @item -mtune=@var{cpu-type}
25162 @opindex mtune
25163 Tune to @var{cpu-type} everything applicable about the generated code, except
25164 for the ABI and the set of available instructions.  
25165 While picking a specific @var{cpu-type} schedules things appropriately
25166 for that particular chip, the compiler does not generate any code that
25167 cannot run on the default machine type unless you use a
25168 @option{-march=@var{cpu-type}} option.
25169 For example, if GCC is configured for i686-pc-linux-gnu
25170 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
25171 but still runs on i686 machines.
25173 The choices for @var{cpu-type} are the same as for @option{-march}.
25174 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
25176 @table @samp
25177 @item generic
25178 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
25179 If you know the CPU on which your code will run, then you should use
25180 the corresponding @option{-mtune} or @option{-march} option instead of
25181 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
25182 of your application will have, then you should use this option.
25184 As new processors are deployed in the marketplace, the behavior of this
25185 option will change.  Therefore, if you upgrade to a newer version of
25186 GCC, code generation controlled by this option will change to reflect
25187 the processors
25188 that are most common at the time that version of GCC is released.
25190 There is no @option{-march=generic} option because @option{-march}
25191 indicates the instruction set the compiler can use, and there is no
25192 generic instruction set applicable to all processors.  In contrast,
25193 @option{-mtune} indicates the processor (or, in this case, collection of
25194 processors) for which the code is optimized.
25196 @item intel
25197 Produce code optimized for the most current Intel processors, which are
25198 Haswell and Silvermont for this version of GCC.  If you know the CPU
25199 on which your code will run, then you should use the corresponding
25200 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
25201 But, if you want your application performs better on both Haswell and
25202 Silvermont, then you should use this option.
25204 As new Intel processors are deployed in the marketplace, the behavior of
25205 this option will change.  Therefore, if you upgrade to a newer version of
25206 GCC, code generation controlled by this option will change to reflect
25207 the most current Intel processors at the time that version of GCC is
25208 released.
25210 There is no @option{-march=intel} option because @option{-march} indicates
25211 the instruction set the compiler can use, and there is no common
25212 instruction set applicable to all processors.  In contrast,
25213 @option{-mtune} indicates the processor (or, in this case, collection of
25214 processors) for which the code is optimized.
25215 @end table
25217 @item -mcpu=@var{cpu-type}
25218 @opindex mcpu
25219 A deprecated synonym for @option{-mtune}.
25221 @item -mfpmath=@var{unit}
25222 @opindex mfpmath
25223 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
25224 for @var{unit} are:
25226 @table @samp
25227 @item 387
25228 Use the standard 387 floating-point coprocessor present on the majority of chips and
25229 emulated otherwise.  Code compiled with this option runs almost everywhere.
25230 The temporary results are computed in 80-bit precision instead of the precision
25231 specified by the type, resulting in slightly different results compared to most
25232 of other chips.  See @option{-ffloat-store} for more detailed description.
25234 This is the default choice for non-Darwin x86-32 targets.
25236 @item sse
25237 Use scalar floating-point instructions present in the SSE instruction set.
25238 This instruction set is supported by Pentium III and newer chips,
25239 and in the AMD line
25240 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
25241 instruction set supports only single-precision arithmetic, thus the double and
25242 extended-precision arithmetic are still done using 387.  A later version, present
25243 only in Pentium 4 and AMD x86-64 chips, supports double-precision
25244 arithmetic too.
25246 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
25247 or @option{-msse2} switches to enable SSE extensions and make this option
25248 effective.  For the x86-64 compiler, these extensions are enabled by default.
25250 The resulting code should be considerably faster in the majority of cases and avoid
25251 the numerical instability problems of 387 code, but may break some existing
25252 code that expects temporaries to be 80 bits.
25254 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
25255 and the default choice for x86-32 targets with the SSE2 instruction set
25256 when @option{-ffast-math} is enabled.
25258 @item sse,387
25259 @itemx sse+387
25260 @itemx both
25261 Attempt to utilize both instruction sets at once.  This effectively doubles the
25262 amount of available registers, and on chips with separate execution units for
25263 387 and SSE the execution resources too.  Use this option with care, as it is
25264 still experimental, because the GCC register allocator does not model separate
25265 functional units well, resulting in unstable performance.
25266 @end table
25268 @item -masm=@var{dialect}
25269 @opindex masm=@var{dialect}
25270 Output assembly instructions using selected @var{dialect}.  Also affects
25271 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
25272 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
25273 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
25274 not support @samp{intel}.
25276 @item -mieee-fp
25277 @itemx -mno-ieee-fp
25278 @opindex mieee-fp
25279 @opindex mno-ieee-fp
25280 Control whether or not the compiler uses IEEE floating-point
25281 comparisons.  These correctly handle the case where the result of a
25282 comparison is unordered.
25284 @item -m80387
25285 @item -mhard-float
25286 @opindex 80387
25287 @opindex mhard-float
25288 Generate output containing 80387 instructions for floating point.
25290 @item -mno-80387
25291 @item -msoft-float
25292 @opindex no-80387
25293 @opindex msoft-float
25294 Generate output containing library calls for floating point.
25296 @strong{Warning:} the requisite libraries are not part of GCC@.
25297 Normally the facilities of the machine's usual C compiler are used, but
25298 this cannot be done directly in cross-compilation.  You must make your
25299 own arrangements to provide suitable library functions for
25300 cross-compilation.
25302 On machines where a function returns floating-point results in the 80387
25303 register stack, some floating-point opcodes may be emitted even if
25304 @option{-msoft-float} is used.
25306 @item -mno-fp-ret-in-387
25307 @opindex mno-fp-ret-in-387
25308 Do not use the FPU registers for return values of functions.
25310 The usual calling convention has functions return values of types
25311 @code{float} and @code{double} in an FPU register, even if there
25312 is no FPU@.  The idea is that the operating system should emulate
25313 an FPU@.
25315 The option @option{-mno-fp-ret-in-387} causes such values to be returned
25316 in ordinary CPU registers instead.
25318 @item -mno-fancy-math-387
25319 @opindex mno-fancy-math-387
25320 Some 387 emulators do not support the @code{sin}, @code{cos} and
25321 @code{sqrt} instructions for the 387.  Specify this option to avoid
25322 generating those instructions.  This option is the default on
25323 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
25324 indicates that the target CPU always has an FPU and so the
25325 instruction does not need emulation.  These
25326 instructions are not generated unless you also use the
25327 @option{-funsafe-math-optimizations} switch.
25329 @item -malign-double
25330 @itemx -mno-align-double
25331 @opindex malign-double
25332 @opindex mno-align-double
25333 Control whether GCC aligns @code{double}, @code{long double}, and
25334 @code{long long} variables on a two-word boundary or a one-word
25335 boundary.  Aligning @code{double} variables on a two-word boundary
25336 produces code that runs somewhat faster on a Pentium at the
25337 expense of more memory.
25339 On x86-64, @option{-malign-double} is enabled by default.
25341 @strong{Warning:} if you use the @option{-malign-double} switch,
25342 structures containing the above types are aligned differently than
25343 the published application binary interface specifications for the x86-32
25344 and are not binary compatible with structures in code compiled
25345 without that switch.
25347 @item -m96bit-long-double
25348 @itemx -m128bit-long-double
25349 @opindex m96bit-long-double
25350 @opindex m128bit-long-double
25351 These switches control the size of @code{long double} type.  The x86-32
25352 application binary interface specifies the size to be 96 bits,
25353 so @option{-m96bit-long-double} is the default in 32-bit mode.
25355 Modern architectures (Pentium and newer) prefer @code{long double}
25356 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
25357 conforming to the ABI, this is not possible.  So specifying
25358 @option{-m128bit-long-double} aligns @code{long double}
25359 to a 16-byte boundary by padding the @code{long double} with an additional
25360 32-bit zero.
25362 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
25363 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
25365 Notice that neither of these options enable any extra precision over the x87
25366 standard of 80 bits for a @code{long double}.
25368 @strong{Warning:} if you override the default value for your target ABI, this
25369 changes the size of 
25370 structures and arrays containing @code{long double} variables,
25371 as well as modifying the function calling convention for functions taking
25372 @code{long double}.  Hence they are not binary-compatible
25373 with code compiled without that switch.
25375 @item -mlong-double-64
25376 @itemx -mlong-double-80
25377 @itemx -mlong-double-128
25378 @opindex mlong-double-64
25379 @opindex mlong-double-80
25380 @opindex mlong-double-128
25381 These switches control the size of @code{long double} type. A size
25382 of 64 bits makes the @code{long double} type equivalent to the @code{double}
25383 type. This is the default for 32-bit Bionic C library.  A size
25384 of 128 bits makes the @code{long double} type equivalent to the
25385 @code{__float128} type. This is the default for 64-bit Bionic C library.
25387 @strong{Warning:} if you override the default value for your target ABI, this
25388 changes the size of
25389 structures and arrays containing @code{long double} variables,
25390 as well as modifying the function calling convention for functions taking
25391 @code{long double}.  Hence they are not binary-compatible
25392 with code compiled without that switch.
25394 @item -malign-data=@var{type}
25395 @opindex malign-data
25396 Control how GCC aligns variables.  Supported values for @var{type} are
25397 @samp{compat} uses increased alignment value compatible uses GCC 4.8
25398 and earlier, @samp{abi} uses alignment value as specified by the
25399 psABI, and @samp{cacheline} uses increased alignment value to match
25400 the cache line size.  @samp{compat} is the default.
25402 @item -mlarge-data-threshold=@var{threshold}
25403 @opindex mlarge-data-threshold
25404 When @option{-mcmodel=medium} is specified, data objects larger than
25405 @var{threshold} are placed in the large data section.  This value must be the
25406 same across all objects linked into the binary, and defaults to 65535.
25408 @item -mrtd
25409 @opindex mrtd
25410 Use a different function-calling convention, in which functions that
25411 take a fixed number of arguments return with the @code{ret @var{num}}
25412 instruction, which pops their arguments while returning.  This saves one
25413 instruction in the caller since there is no need to pop the arguments
25414 there.
25416 You can specify that an individual function is called with this calling
25417 sequence with the function attribute @code{stdcall}.  You can also
25418 override the @option{-mrtd} option by using the function attribute
25419 @code{cdecl}.  @xref{Function Attributes}.
25421 @strong{Warning:} this calling convention is incompatible with the one
25422 normally used on Unix, so you cannot use it if you need to call
25423 libraries compiled with the Unix compiler.
25425 Also, you must provide function prototypes for all functions that
25426 take variable numbers of arguments (including @code{printf});
25427 otherwise incorrect code is generated for calls to those
25428 functions.
25430 In addition, seriously incorrect code results if you call a
25431 function with too many arguments.  (Normally, extra arguments are
25432 harmlessly ignored.)
25434 @item -mregparm=@var{num}
25435 @opindex mregparm
25436 Control how many registers are used to pass integer arguments.  By
25437 default, no registers are used to pass arguments, and at most 3
25438 registers can be used.  You can control this behavior for a specific
25439 function by using the function attribute @code{regparm}.
25440 @xref{Function Attributes}.
25442 @strong{Warning:} if you use this switch, and
25443 @var{num} is nonzero, then you must build all modules with the same
25444 value, including any libraries.  This includes the system libraries and
25445 startup modules.
25447 @item -msseregparm
25448 @opindex msseregparm
25449 Use SSE register passing conventions for float and double arguments
25450 and return values.  You can control this behavior for a specific
25451 function by using the function attribute @code{sseregparm}.
25452 @xref{Function Attributes}.
25454 @strong{Warning:} if you use this switch then you must build all
25455 modules with the same value, including any libraries.  This includes
25456 the system libraries and startup modules.
25458 @item -mvect8-ret-in-mem
25459 @opindex mvect8-ret-in-mem
25460 Return 8-byte vectors in memory instead of MMX registers.  This is the
25461 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
25462 Studio compilers until version 12.  Later compiler versions (starting
25463 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
25464 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
25465 you need to remain compatible with existing code produced by those
25466 previous compiler versions or older versions of GCC@.
25468 @item -mpc32
25469 @itemx -mpc64
25470 @itemx -mpc80
25471 @opindex mpc32
25472 @opindex mpc64
25473 @opindex mpc80
25475 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
25476 is specified, the significands of results of floating-point operations are
25477 rounded to 24 bits (single precision); @option{-mpc64} rounds the
25478 significands of results of floating-point operations to 53 bits (double
25479 precision) and @option{-mpc80} rounds the significands of results of
25480 floating-point operations to 64 bits (extended double precision), which is
25481 the default.  When this option is used, floating-point operations in higher
25482 precisions are not available to the programmer without setting the FPU
25483 control word explicitly.
25485 Setting the rounding of floating-point operations to less than the default
25486 80 bits can speed some programs by 2% or more.  Note that some mathematical
25487 libraries assume that extended-precision (80-bit) floating-point operations
25488 are enabled by default; routines in such libraries could suffer significant
25489 loss of accuracy, typically through so-called ``catastrophic cancellation'',
25490 when this option is used to set the precision to less than extended precision.
25492 @item -mstackrealign
25493 @opindex mstackrealign
25494 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
25495 option generates an alternate prologue and epilogue that realigns the
25496 run-time stack if necessary.  This supports mixing legacy codes that keep
25497 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
25498 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
25499 applicable to individual functions.
25501 @item -mpreferred-stack-boundary=@var{num}
25502 @opindex mpreferred-stack-boundary
25503 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
25504 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
25505 the default is 4 (16 bytes or 128 bits).
25507 @strong{Warning:} When generating code for the x86-64 architecture with
25508 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
25509 used to keep the stack boundary aligned to 8 byte boundary.  Since
25510 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
25511 intended to be used in controlled environment where stack space is
25512 important limitation.  This option leads to wrong code when functions
25513 compiled with 16 byte stack alignment (such as functions from a standard
25514 library) are called with misaligned stack.  In this case, SSE
25515 instructions may lead to misaligned memory access traps.  In addition,
25516 variable arguments are handled incorrectly for 16 byte aligned
25517 objects (including x87 long double and __int128), leading to wrong
25518 results.  You must build all modules with
25519 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
25520 includes the system libraries and startup modules.
25522 @item -mincoming-stack-boundary=@var{num}
25523 @opindex mincoming-stack-boundary
25524 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
25525 boundary.  If @option{-mincoming-stack-boundary} is not specified,
25526 the one specified by @option{-mpreferred-stack-boundary} is used.
25528 On Pentium and Pentium Pro, @code{double} and @code{long double} values
25529 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
25530 suffer significant run time performance penalties.  On Pentium III, the
25531 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
25532 properly if it is not 16-byte aligned.
25534 To ensure proper alignment of this values on the stack, the stack boundary
25535 must be as aligned as that required by any value stored on the stack.
25536 Further, every function must be generated such that it keeps the stack
25537 aligned.  Thus calling a function compiled with a higher preferred
25538 stack boundary from a function compiled with a lower preferred stack
25539 boundary most likely misaligns the stack.  It is recommended that
25540 libraries that use callbacks always use the default setting.
25542 This extra alignment does consume extra stack space, and generally
25543 increases code size.  Code that is sensitive to stack space usage, such
25544 as embedded systems and operating system kernels, may want to reduce the
25545 preferred alignment to @option{-mpreferred-stack-boundary=2}.
25547 @need 200
25548 @item -mmmx
25549 @opindex mmmx
25550 @need 200
25551 @itemx -msse
25552 @opindex msse
25553 @need 200
25554 @itemx -msse2
25555 @opindex msse2
25556 @need 200
25557 @itemx -msse3
25558 @opindex msse3
25559 @need 200
25560 @itemx -mssse3
25561 @opindex mssse3
25562 @need 200
25563 @itemx -msse4
25564 @opindex msse4
25565 @need 200
25566 @itemx -msse4a
25567 @opindex msse4a
25568 @need 200
25569 @itemx -msse4.1
25570 @opindex msse4.1
25571 @need 200
25572 @itemx -msse4.2
25573 @opindex msse4.2
25574 @need 200
25575 @itemx -mavx
25576 @opindex mavx
25577 @need 200
25578 @itemx -mavx2
25579 @opindex mavx2
25580 @need 200
25581 @itemx -mavx512f
25582 @opindex mavx512f
25583 @need 200
25584 @itemx -mavx512pf
25585 @opindex mavx512pf
25586 @need 200
25587 @itemx -mavx512er
25588 @opindex mavx512er
25589 @need 200
25590 @itemx -mavx512cd
25591 @opindex mavx512cd
25592 @need 200
25593 @itemx -mavx512vl
25594 @opindex mavx512vl
25595 @need 200
25596 @itemx -mavx512bw
25597 @opindex mavx512bw
25598 @need 200
25599 @itemx -mavx512dq
25600 @opindex mavx512dq
25601 @need 200
25602 @itemx -mavx512ifma
25603 @opindex mavx512ifma
25604 @need 200
25605 @itemx -mavx512vbmi
25606 @opindex mavx512vbmi
25607 @need 200
25608 @itemx -msha
25609 @opindex msha
25610 @need 200
25611 @itemx -maes
25612 @opindex maes
25613 @need 200
25614 @itemx -mpclmul
25615 @opindex mpclmul
25616 @need 200
25617 @itemx -mclfushopt
25618 @opindex mclfushopt
25619 @need 200
25620 @itemx -mfsgsbase
25621 @opindex mfsgsbase
25622 @need 200
25623 @itemx -mrdrnd
25624 @opindex mrdrnd
25625 @need 200
25626 @itemx -mf16c
25627 @opindex mf16c
25628 @need 200
25629 @itemx -mfma
25630 @opindex mfma
25631 @need 200
25632 @itemx -mfma4
25633 @opindex mfma4
25634 @need 200
25635 @itemx -mprefetchwt1
25636 @opindex mprefetchwt1
25637 @need 200
25638 @itemx -mxop
25639 @opindex mxop
25640 @need 200
25641 @itemx -mlwp
25642 @opindex mlwp
25643 @need 200
25644 @itemx -m3dnow
25645 @opindex m3dnow
25646 @need 200
25647 @itemx -m3dnowa
25648 @opindex m3dnowa
25649 @need 200
25650 @itemx -mpopcnt
25651 @opindex mpopcnt
25652 @need 200
25653 @itemx -mabm
25654 @opindex mabm
25655 @need 200
25656 @itemx -mbmi
25657 @opindex mbmi
25658 @need 200
25659 @itemx -mbmi2
25660 @need 200
25661 @itemx -mlzcnt
25662 @opindex mlzcnt
25663 @need 200
25664 @itemx -mfxsr
25665 @opindex mfxsr
25666 @need 200
25667 @itemx -mxsave
25668 @opindex mxsave
25669 @need 200
25670 @itemx -mxsaveopt
25671 @opindex mxsaveopt
25672 @need 200
25673 @itemx -mxsavec
25674 @opindex mxsavec
25675 @need 200
25676 @itemx -mxsaves
25677 @opindex mxsaves
25678 @need 200
25679 @itemx -mrtm
25680 @opindex mrtm
25681 @need 200
25682 @itemx -mtbm
25683 @opindex mtbm
25684 @need 200
25685 @itemx -mmpx
25686 @opindex mmpx
25687 @need 200
25688 @itemx -mmwaitx
25689 @opindex mmwaitx
25690 @need 200
25691 @itemx -mclzero
25692 @opindex mclzero
25693 @itemx -mpku
25694 @opindex mpku
25695 These switches enable the use of instructions in the MMX, SSE,
25696 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
25697 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
25698 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
25699 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU, 3DNow!@: or enhanced 3DNow!@:
25700 extended instruction sets.  Each has a corresponding @option{-mno-} option
25701 to disable use of these instructions.
25703 These extensions are also available as built-in functions: see
25704 @ref{x86 Built-in Functions}, for details of the functions enabled and
25705 disabled by these switches.
25707 To generate SSE/SSE2 instructions automatically from floating-point
25708 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
25710 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
25711 generates new AVX instructions or AVX equivalence for all SSEx instructions
25712 when needed.
25714 These options enable GCC to use these extended instructions in
25715 generated code, even without @option{-mfpmath=sse}.  Applications that
25716 perform run-time CPU detection must compile separate files for each
25717 supported architecture, using the appropriate flags.  In particular,
25718 the file containing the CPU detection code should be compiled without
25719 these options.
25721 @item -mdump-tune-features
25722 @opindex mdump-tune-features
25723 This option instructs GCC to dump the names of the x86 performance 
25724 tuning features and default settings. The names can be used in 
25725 @option{-mtune-ctrl=@var{feature-list}}.
25727 @item -mtune-ctrl=@var{feature-list}
25728 @opindex mtune-ctrl=@var{feature-list}
25729 This option is used to do fine grain control of x86 code generation features.
25730 @var{feature-list} is a comma separated list of @var{feature} names. See also
25731 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
25732 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
25733 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
25734 developers. Using it may lead to code paths not covered by testing and can
25735 potentially result in compiler ICEs or runtime errors.
25737 @item -mno-default
25738 @opindex mno-default
25739 This option instructs GCC to turn off all tunable features. See also 
25740 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
25742 @item -mcld
25743 @opindex mcld
25744 This option instructs GCC to emit a @code{cld} instruction in the prologue
25745 of functions that use string instructions.  String instructions depend on
25746 the DF flag to select between autoincrement or autodecrement mode.  While the
25747 ABI specifies the DF flag to be cleared on function entry, some operating
25748 systems violate this specification by not clearing the DF flag in their
25749 exception dispatchers.  The exception handler can be invoked with the DF flag
25750 set, which leads to wrong direction mode when string instructions are used.
25751 This option can be enabled by default on 32-bit x86 targets by configuring
25752 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
25753 instructions can be suppressed with the @option{-mno-cld} compiler option
25754 in this case.
25756 @item -mvzeroupper
25757 @opindex mvzeroupper
25758 This option instructs GCC to emit a @code{vzeroupper} instruction
25759 before a transfer of control flow out of the function to minimize
25760 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
25761 intrinsics.
25763 @item -mprefer-avx128
25764 @opindex mprefer-avx128
25765 This option instructs GCC to use 128-bit AVX instructions instead of
25766 256-bit AVX instructions in the auto-vectorizer.
25768 @item -mcx16
25769 @opindex mcx16
25770 This option enables GCC to generate @code{CMPXCHG16B} instructions in 64-bit
25771 code to implement compare-and-exchange operations on 16-byte aligned 128-bit
25772 objects.  This is useful for atomic updates of data structures exceeding one
25773 machine word in size.  The compiler uses this instruction to implement
25774 @ref{__sync Builtins}.  However, for @ref{__atomic Builtins} operating on
25775 128-bit integers, a library call is always used.
25777 @item -msahf
25778 @opindex msahf
25779 This option enables generation of @code{SAHF} instructions in 64-bit code.
25780 Early Intel Pentium 4 CPUs with Intel 64 support,
25781 prior to the introduction of Pentium 4 G1 step in December 2005,
25782 lacked the @code{LAHF} and @code{SAHF} instructions
25783 which are supported by AMD64.
25784 These are load and store instructions, respectively, for certain status flags.
25785 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
25786 @code{drem}, and @code{remainder} built-in functions;
25787 see @ref{Other Builtins} for details.
25789 @item -mmovbe
25790 @opindex mmovbe
25791 This option enables use of the @code{movbe} instruction to implement
25792 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
25794 @item -mcrc32
25795 @opindex mcrc32
25796 This option enables built-in functions @code{__builtin_ia32_crc32qi},
25797 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
25798 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
25800 @item -mrecip
25801 @opindex mrecip
25802 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
25803 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
25804 with an additional Newton-Raphson step
25805 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
25806 (and their vectorized
25807 variants) for single-precision floating-point arguments.  These instructions
25808 are generated only when @option{-funsafe-math-optimizations} is enabled
25809 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
25810 Note that while the throughput of the sequence is higher than the throughput
25811 of the non-reciprocal instruction, the precision of the sequence can be
25812 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
25814 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
25815 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
25816 combination), and doesn't need @option{-mrecip}.
25818 Also note that GCC emits the above sequence with additional Newton-Raphson step
25819 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
25820 already with @option{-ffast-math} (or the above option combination), and
25821 doesn't need @option{-mrecip}.
25823 @item -mrecip=@var{opt}
25824 @opindex mrecip=opt
25825 This option controls which reciprocal estimate instructions
25826 may be used.  @var{opt} is a comma-separated list of options, which may
25827 be preceded by a @samp{!} to invert the option:
25829 @table @samp
25830 @item all
25831 Enable all estimate instructions.
25833 @item default
25834 Enable the default instructions, equivalent to @option{-mrecip}.
25836 @item none
25837 Disable all estimate instructions, equivalent to @option{-mno-recip}.
25839 @item div
25840 Enable the approximation for scalar division.
25842 @item vec-div
25843 Enable the approximation for vectorized division.
25845 @item sqrt
25846 Enable the approximation for scalar square root.
25848 @item vec-sqrt
25849 Enable the approximation for vectorized square root.
25850 @end table
25852 So, for example, @option{-mrecip=all,!sqrt} enables
25853 all of the reciprocal approximations, except for square root.
25855 @item -mveclibabi=@var{type}
25856 @opindex mveclibabi
25857 Specifies the ABI type to use for vectorizing intrinsics using an
25858 external library.  Supported values for @var{type} are @samp{svml} 
25859 for the Intel short
25860 vector math library and @samp{acml} for the AMD math core library.
25861 To use this option, both @option{-ftree-vectorize} and
25862 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
25863 ABI-compatible library must be specified at link time.
25865 GCC currently emits calls to @code{vmldExp2},
25866 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
25867 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
25868 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
25869 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
25870 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
25871 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
25872 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
25873 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
25874 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
25875 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
25876 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
25877 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
25878 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
25879 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
25880 when @option{-mveclibabi=acml} is used.  
25882 @item -mabi=@var{name}
25883 @opindex mabi
25884 Generate code for the specified calling convention.  Permissible values
25885 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
25886 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
25887 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
25888 You can control this behavior for specific functions by
25889 using the function attributes @code{ms_abi} and @code{sysv_abi}.
25890 @xref{Function Attributes}.
25892 @item -mcall-ms2sysv-xlogues
25893 @opindex mcall-ms2sysv-xlogues
25894 @opindex mno-call-ms2sysv-xlogues
25895 Due to differences in 64-bit ABIs, any Microsoft ABI function that calls a
25896 System V ABI function must consider RSI, RDI and XMM6-15 as clobbered.  By
25897 default, the code for saving and restoring these registers is emitted inline,
25898 resulting in fairly lengthy prologues and epilogues.  Using
25899 @option{-mcall-ms2sysv-xlogues} emits prologues and epilogues that
25900 use stubs in the static portion of libgcc to perform these saves and restores,
25901 thus reducing function size at the cost of a few extra instructions.
25903 @item -mtls-dialect=@var{type}
25904 @opindex mtls-dialect
25905 Generate code to access thread-local storage using the @samp{gnu} or
25906 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
25907 @samp{gnu2} is more efficient, but it may add compile- and run-time
25908 requirements that cannot be satisfied on all systems.
25910 @item -mpush-args
25911 @itemx -mno-push-args
25912 @opindex mpush-args
25913 @opindex mno-push-args
25914 Use PUSH operations to store outgoing parameters.  This method is shorter
25915 and usually equally fast as method using SUB/MOV operations and is enabled
25916 by default.  In some cases disabling it may improve performance because of
25917 improved scheduling and reduced dependencies.
25919 @item -maccumulate-outgoing-args
25920 @opindex maccumulate-outgoing-args
25921 If enabled, the maximum amount of space required for outgoing arguments is
25922 computed in the function prologue.  This is faster on most modern CPUs
25923 because of reduced dependencies, improved scheduling and reduced stack usage
25924 when the preferred stack boundary is not equal to 2.  The drawback is a notable
25925 increase in code size.  This switch implies @option{-mno-push-args}.
25927 @item -mthreads
25928 @opindex mthreads
25929 Support thread-safe exception handling on MinGW.  Programs that rely
25930 on thread-safe exception handling must compile and link all code with the
25931 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
25932 @option{-D_MT}; when linking, it links in a special thread helper library
25933 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
25935 @item -mms-bitfields
25936 @itemx -mno-ms-bitfields
25937 @opindex mms-bitfields
25938 @opindex mno-ms-bitfields
25940 Enable/disable bit-field layout compatible with the native Microsoft
25941 Windows compiler.  
25943 If @code{packed} is used on a structure, or if bit-fields are used,
25944 it may be that the Microsoft ABI lays out the structure differently
25945 than the way GCC normally does.  Particularly when moving packed
25946 data between functions compiled with GCC and the native Microsoft compiler
25947 (either via function call or as data in a file), it may be necessary to access
25948 either format.
25950 This option is enabled by default for Microsoft Windows
25951 targets.  This behavior can also be controlled locally by use of variable
25952 or type attributes.  For more information, see @ref{x86 Variable Attributes}
25953 and @ref{x86 Type Attributes}.
25955 The Microsoft structure layout algorithm is fairly simple with the exception
25956 of the bit-field packing.  
25957 The padding and alignment of members of structures and whether a bit-field 
25958 can straddle a storage-unit boundary are determine by these rules:
25960 @enumerate
25961 @item Structure members are stored sequentially in the order in which they are
25962 declared: the first member has the lowest memory address and the last member
25963 the highest.
25965 @item Every data object has an alignment requirement.  The alignment requirement
25966 for all data except structures, unions, and arrays is either the size of the
25967 object or the current packing size (specified with either the
25968 @code{aligned} attribute or the @code{pack} pragma),
25969 whichever is less.  For structures, unions, and arrays,
25970 the alignment requirement is the largest alignment requirement of its members.
25971 Every object is allocated an offset so that:
25973 @smallexample
25974 offset % alignment_requirement == 0
25975 @end smallexample
25977 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
25978 unit if the integral types are the same size and if the next bit-field fits
25979 into the current allocation unit without crossing the boundary imposed by the
25980 common alignment requirements of the bit-fields.
25981 @end enumerate
25983 MSVC interprets zero-length bit-fields in the following ways:
25985 @enumerate
25986 @item If a zero-length bit-field is inserted between two bit-fields that
25987 are normally coalesced, the bit-fields are not coalesced.
25989 For example:
25991 @smallexample
25992 struct
25993  @{
25994    unsigned long bf_1 : 12;
25995    unsigned long : 0;
25996    unsigned long bf_2 : 12;
25997  @} t1;
25998 @end smallexample
26000 @noindent
26001 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
26002 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
26004 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
26005 alignment of the zero-length bit-field is greater than the member that follows it,
26006 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
26008 For example:
26010 @smallexample
26011 struct
26012  @{
26013    char foo : 4;
26014    short : 0;
26015    char bar;
26016  @} t2;
26018 struct
26019  @{
26020    char foo : 4;
26021    short : 0;
26022    double bar;
26023  @} t3;
26024 @end smallexample
26026 @noindent
26027 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
26028 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
26029 bit-field does not affect the alignment of @code{bar} or, as a result, the size
26030 of the structure.
26032 Taking this into account, it is important to note the following:
26034 @enumerate
26035 @item If a zero-length bit-field follows a normal bit-field, the type of the
26036 zero-length bit-field may affect the alignment of the structure as whole. For
26037 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
26038 normal bit-field, and is of type short.
26040 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
26041 still affect the alignment of the structure:
26043 @smallexample
26044 struct
26045  @{
26046    char foo : 6;
26047    long : 0;
26048  @} t4;
26049 @end smallexample
26051 @noindent
26052 Here, @code{t4} takes up 4 bytes.
26053 @end enumerate
26055 @item Zero-length bit-fields following non-bit-field members are ignored:
26057 @smallexample
26058 struct
26059  @{
26060    char foo;
26061    long : 0;
26062    char bar;
26063  @} t5;
26064 @end smallexample
26066 @noindent
26067 Here, @code{t5} takes up 2 bytes.
26068 @end enumerate
26071 @item -mno-align-stringops
26072 @opindex mno-align-stringops
26073 Do not align the destination of inlined string operations.  This switch reduces
26074 code size and improves performance in case the destination is already aligned,
26075 but GCC doesn't know about it.
26077 @item -minline-all-stringops
26078 @opindex minline-all-stringops
26079 By default GCC inlines string operations only when the destination is 
26080 known to be aligned to least a 4-byte boundary.  
26081 This enables more inlining and increases code
26082 size, but may improve performance of code that depends on fast
26083 @code{memcpy}, @code{strlen},
26084 and @code{memset} for short lengths.
26086 @item -minline-stringops-dynamically
26087 @opindex minline-stringops-dynamically
26088 For string operations of unknown size, use run-time checks with
26089 inline code for small blocks and a library call for large blocks.
26091 @item -mstringop-strategy=@var{alg}
26092 @opindex mstringop-strategy=@var{alg}
26093 Override the internal decision heuristic for the particular algorithm to use
26094 for inlining string operations.  The allowed values for @var{alg} are:
26096 @table @samp
26097 @item rep_byte
26098 @itemx rep_4byte
26099 @itemx rep_8byte
26100 Expand using i386 @code{rep} prefix of the specified size.
26102 @item byte_loop
26103 @itemx loop
26104 @itemx unrolled_loop
26105 Expand into an inline loop.
26107 @item libcall
26108 Always use a library call.
26109 @end table
26111 @item -mmemcpy-strategy=@var{strategy}
26112 @opindex mmemcpy-strategy=@var{strategy}
26113 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
26114 should be inlined and what inline algorithm to use when the expected size
26115 of the copy operation is known. @var{strategy} 
26116 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
26117 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
26118 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
26119 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
26120 in the list must be specified in increasing order.  The minimal byte size for 
26121 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
26122 preceding range.
26124 @item -mmemset-strategy=@var{strategy}
26125 @opindex mmemset-strategy=@var{strategy}
26126 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
26127 @code{__builtin_memset} expansion.
26129 @item -momit-leaf-frame-pointer
26130 @opindex momit-leaf-frame-pointer
26131 Don't keep the frame pointer in a register for leaf functions.  This
26132 avoids the instructions to save, set up, and restore frame pointers and
26133 makes an extra register available in leaf functions.  The option
26134 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
26135 which might make debugging harder.
26137 @item -mtls-direct-seg-refs
26138 @itemx -mno-tls-direct-seg-refs
26139 @opindex mtls-direct-seg-refs
26140 Controls whether TLS variables may be accessed with offsets from the
26141 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
26142 or whether the thread base pointer must be added.  Whether or not this
26143 is valid depends on the operating system, and whether it maps the
26144 segment to cover the entire TLS area.
26146 For systems that use the GNU C Library, the default is on.
26148 @item -msse2avx
26149 @itemx -mno-sse2avx
26150 @opindex msse2avx
26151 Specify that the assembler should encode SSE instructions with VEX
26152 prefix.  The option @option{-mavx} turns this on by default.
26154 @item -mfentry
26155 @itemx -mno-fentry
26156 @opindex mfentry
26157 If profiling is active (@option{-pg}), put the profiling
26158 counter call before the prologue.
26159 Note: On x86 architectures the attribute @code{ms_hook_prologue}
26160 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
26162 @item -mrecord-mcount
26163 @itemx -mno-record-mcount
26164 @opindex mrecord-mcount
26165 If profiling is active (@option{-pg}), generate a __mcount_loc section
26166 that contains pointers to each profiling call. This is useful for
26167 automatically patching and out calls.
26169 @item -mnop-mcount
26170 @itemx -mno-nop-mcount
26171 @opindex mnop-mcount
26172 If profiling is active (@option{-pg}), generate the calls to
26173 the profiling functions as NOPs. This is useful when they
26174 should be patched in later dynamically. This is likely only
26175 useful together with @option{-mrecord-mcount}.
26177 @item -mskip-rax-setup
26178 @itemx -mno-skip-rax-setup
26179 @opindex mskip-rax-setup
26180 When generating code for the x86-64 architecture with SSE extensions
26181 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
26182 register when there are no variable arguments passed in vector registers.
26184 @strong{Warning:} Since RAX register is used to avoid unnecessarily
26185 saving vector registers on stack when passing variable arguments, the
26186 impacts of this option are callees may waste some stack space,
26187 misbehave or jump to a random location.  GCC 4.4 or newer don't have
26188 those issues, regardless the RAX register value.
26190 @item -m8bit-idiv
26191 @itemx -mno-8bit-idiv
26192 @opindex m8bit-idiv
26193 On some processors, like Intel Atom, 8-bit unsigned integer divide is
26194 much faster than 32-bit/64-bit integer divide.  This option generates a
26195 run-time check.  If both dividend and divisor are within range of 0
26196 to 255, 8-bit unsigned integer divide is used instead of
26197 32-bit/64-bit integer divide.
26199 @item -mavx256-split-unaligned-load
26200 @itemx -mavx256-split-unaligned-store
26201 @opindex mavx256-split-unaligned-load
26202 @opindex mavx256-split-unaligned-store
26203 Split 32-byte AVX unaligned load and store.
26205 @item -mstack-protector-guard=@var{guard}
26206 @itemx -mstack-protector-guard-reg=@var{reg}
26207 @itemx -mstack-protector-guard-offset=@var{offset}
26208 @opindex mstack-protector-guard
26209 @opindex mstack-protector-guard-reg
26210 @opindex mstack-protector-guard-offset
26211 Generate stack protection code using canary at @var{guard}.  Supported
26212 locations are @samp{global} for global canary or @samp{tls} for per-thread
26213 canary in the TLS block (the default).  This option has effect only when
26214 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
26216 With the latter choice the options
26217 @option{-mstack-protector-guard-reg=@var{reg}} and
26218 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
26219 which segment register (@code{%fs} or @code{%gs}) to use as base register
26220 for reading the canary, and from what offset from that base register.
26221 The default for those is as specified in the relevant ABI.
26223 @item -mmitigate-rop
26224 @opindex mmitigate-rop
26225 Try to avoid generating code sequences that contain unintended return
26226 opcodes, to mitigate against certain forms of attack. At the moment,
26227 this option is limited in what it can do and should not be relied
26228 on to provide serious protection.
26230 @item -mgeneral-regs-only
26231 @opindex mgeneral-regs-only
26232 Generate code that uses only the general-purpose registers.  This
26233 prevents the compiler from using floating-point, vector, mask and bound
26234 registers.
26236 @end table
26238 These @samp{-m} switches are supported in addition to the above
26239 on x86-64 processors in 64-bit environments.
26241 @table @gcctabopt
26242 @item -m32
26243 @itemx -m64
26244 @itemx -mx32
26245 @itemx -m16
26246 @itemx -miamcu
26247 @opindex m32
26248 @opindex m64
26249 @opindex mx32
26250 @opindex m16
26251 @opindex miamcu
26252 Generate code for a 16-bit, 32-bit or 64-bit environment.
26253 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
26254 to 32 bits, and
26255 generates code that runs on any i386 system.
26257 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
26258 types to 64 bits, and generates code for the x86-64 architecture.
26259 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
26260 and @option{-mdynamic-no-pic} options.
26262 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
26263 to 32 bits, and
26264 generates code for the x86-64 architecture.
26266 The @option{-m16} option is the same as @option{-m32}, except for that
26267 it outputs the @code{.code16gcc} assembly directive at the beginning of
26268 the assembly output so that the binary can run in 16-bit mode.
26270 The @option{-miamcu} option generates code which conforms to Intel MCU
26271 psABI.  It requires the @option{-m32} option to be turned on.
26273 @item -mno-red-zone
26274 @opindex mno-red-zone
26275 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
26276 by the x86-64 ABI; it is a 128-byte area beyond the location of the
26277 stack pointer that is not modified by signal or interrupt handlers
26278 and therefore can be used for temporary data without adjusting the stack
26279 pointer.  The flag @option{-mno-red-zone} disables this red zone.
26281 @item -mcmodel=small
26282 @opindex mcmodel=small
26283 Generate code for the small code model: the program and its symbols must
26284 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
26285 Programs can be statically or dynamically linked.  This is the default
26286 code model.
26288 @item -mcmodel=kernel
26289 @opindex mcmodel=kernel
26290 Generate code for the kernel code model.  The kernel runs in the
26291 negative 2 GB of the address space.
26292 This model has to be used for Linux kernel code.
26294 @item -mcmodel=medium
26295 @opindex mcmodel=medium
26296 Generate code for the medium model: the program is linked in the lower 2
26297 GB of the address space.  Small symbols are also placed there.  Symbols
26298 with sizes larger than @option{-mlarge-data-threshold} are put into
26299 large data or BSS sections and can be located above 2GB.  Programs can
26300 be statically or dynamically linked.
26302 @item -mcmodel=large
26303 @opindex mcmodel=large
26304 Generate code for the large model.  This model makes no assumptions
26305 about addresses and sizes of sections.
26307 @item -maddress-mode=long
26308 @opindex maddress-mode=long
26309 Generate code for long address mode.  This is only supported for 64-bit
26310 and x32 environments.  It is the default address mode for 64-bit
26311 environments.
26313 @item -maddress-mode=short
26314 @opindex maddress-mode=short
26315 Generate code for short address mode.  This is only supported for 32-bit
26316 and x32 environments.  It is the default address mode for 32-bit and
26317 x32 environments.
26318 @end table
26320 @node x86 Windows Options
26321 @subsection x86 Windows Options
26322 @cindex x86 Windows Options
26323 @cindex Windows Options for x86
26325 These additional options are available for Microsoft Windows targets:
26327 @table @gcctabopt
26328 @item -mconsole
26329 @opindex mconsole
26330 This option
26331 specifies that a console application is to be generated, by
26332 instructing the linker to set the PE header subsystem type
26333 required for console applications.
26334 This option is available for Cygwin and MinGW targets and is
26335 enabled by default on those targets.
26337 @item -mdll
26338 @opindex mdll
26339 This option is available for Cygwin and MinGW targets.  It
26340 specifies that a DLL---a dynamic link library---is to be
26341 generated, enabling the selection of the required runtime
26342 startup object and entry point.
26344 @item -mnop-fun-dllimport
26345 @opindex mnop-fun-dllimport
26346 This option is available for Cygwin and MinGW targets.  It
26347 specifies that the @code{dllimport} attribute should be ignored.
26349 @item -mthread
26350 @opindex mthread
26351 This option is available for MinGW targets. It specifies
26352 that MinGW-specific thread support is to be used.
26354 @item -municode
26355 @opindex municode
26356 This option is available for MinGW-w64 targets.  It causes
26357 the @code{UNICODE} preprocessor macro to be predefined, and
26358 chooses Unicode-capable runtime startup code.
26360 @item -mwin32
26361 @opindex mwin32
26362 This option is available for Cygwin and MinGW targets.  It
26363 specifies that the typical Microsoft Windows predefined macros are to
26364 be set in the pre-processor, but does not influence the choice
26365 of runtime library/startup code.
26367 @item -mwindows
26368 @opindex mwindows
26369 This option is available for Cygwin and MinGW targets.  It
26370 specifies that a GUI application is to be generated by
26371 instructing the linker to set the PE header subsystem type
26372 appropriately.
26374 @item -fno-set-stack-executable
26375 @opindex fno-set-stack-executable
26376 This option is available for MinGW targets. It specifies that
26377 the executable flag for the stack used by nested functions isn't
26378 set. This is necessary for binaries running in kernel mode of
26379 Microsoft Windows, as there the User32 API, which is used to set executable
26380 privileges, isn't available.
26382 @item -fwritable-relocated-rdata
26383 @opindex fno-writable-relocated-rdata
26384 This option is available for MinGW and Cygwin targets.  It specifies
26385 that relocated-data in read-only section is put into the @code{.data}
26386 section.  This is a necessary for older runtimes not supporting
26387 modification of @code{.rdata} sections for pseudo-relocation.
26389 @item -mpe-aligned-commons
26390 @opindex mpe-aligned-commons
26391 This option is available for Cygwin and MinGW targets.  It
26392 specifies that the GNU extension to the PE file format that
26393 permits the correct alignment of COMMON variables should be
26394 used when generating code.  It is enabled by default if
26395 GCC detects that the target assembler found during configuration
26396 supports the feature.
26397 @end table
26399 See also under @ref{x86 Options} for standard options.
26401 @node Xstormy16 Options
26402 @subsection Xstormy16 Options
26403 @cindex Xstormy16 Options
26405 These options are defined for Xstormy16:
26407 @table @gcctabopt
26408 @item -msim
26409 @opindex msim
26410 Choose startup files and linker script suitable for the simulator.
26411 @end table
26413 @node Xtensa Options
26414 @subsection Xtensa Options
26415 @cindex Xtensa Options
26417 These options are supported for Xtensa targets:
26419 @table @gcctabopt
26420 @item -mconst16
26421 @itemx -mno-const16
26422 @opindex mconst16
26423 @opindex mno-const16
26424 Enable or disable use of @code{CONST16} instructions for loading
26425 constant values.  The @code{CONST16} instruction is currently not a
26426 standard option from Tensilica.  When enabled, @code{CONST16}
26427 instructions are always used in place of the standard @code{L32R}
26428 instructions.  The use of @code{CONST16} is enabled by default only if
26429 the @code{L32R} instruction is not available.
26431 @item -mfused-madd
26432 @itemx -mno-fused-madd
26433 @opindex mfused-madd
26434 @opindex mno-fused-madd
26435 Enable or disable use of fused multiply/add and multiply/subtract
26436 instructions in the floating-point option.  This has no effect if the
26437 floating-point option is not also enabled.  Disabling fused multiply/add
26438 and multiply/subtract instructions forces the compiler to use separate
26439 instructions for the multiply and add/subtract operations.  This may be
26440 desirable in some cases where strict IEEE 754-compliant results are
26441 required: the fused multiply add/subtract instructions do not round the
26442 intermediate result, thereby producing results with @emph{more} bits of
26443 precision than specified by the IEEE standard.  Disabling fused multiply
26444 add/subtract instructions also ensures that the program output is not
26445 sensitive to the compiler's ability to combine multiply and add/subtract
26446 operations.
26448 @item -mserialize-volatile
26449 @itemx -mno-serialize-volatile
26450 @opindex mserialize-volatile
26451 @opindex mno-serialize-volatile
26452 When this option is enabled, GCC inserts @code{MEMW} instructions before
26453 @code{volatile} memory references to guarantee sequential consistency.
26454 The default is @option{-mserialize-volatile}.  Use
26455 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
26457 @item -mforce-no-pic
26458 @opindex mforce-no-pic
26459 For targets, like GNU/Linux, where all user-mode Xtensa code must be
26460 position-independent code (PIC), this option disables PIC for compiling
26461 kernel code.
26463 @item -mtext-section-literals
26464 @itemx -mno-text-section-literals
26465 @opindex mtext-section-literals
26466 @opindex mno-text-section-literals
26467 These options control the treatment of literal pools.  The default is
26468 @option{-mno-text-section-literals}, which places literals in a separate
26469 section in the output file.  This allows the literal pool to be placed
26470 in a data RAM/ROM, and it also allows the linker to combine literal
26471 pools from separate object files to remove redundant literals and
26472 improve code size.  With @option{-mtext-section-literals}, the literals
26473 are interspersed in the text section in order to keep them as close as
26474 possible to their references.  This may be necessary for large assembly
26475 files.  Literals for each function are placed right before that function.
26477 @item -mauto-litpools
26478 @itemx -mno-auto-litpools
26479 @opindex mauto-litpools
26480 @opindex mno-auto-litpools
26481 These options control the treatment of literal pools.  The default is
26482 @option{-mno-auto-litpools}, which places literals in a separate
26483 section in the output file unless @option{-mtext-section-literals} is
26484 used.  With @option{-mauto-litpools} the literals are interspersed in
26485 the text section by the assembler.  Compiler does not produce explicit
26486 @code{.literal} directives and loads literals into registers with
26487 @code{MOVI} instructions instead of @code{L32R} to let the assembler
26488 do relaxation and place literals as necessary.  This option allows
26489 assembler to create several literal pools per function and assemble
26490 very big functions, which may not be possible with
26491 @option{-mtext-section-literals}.
26493 @item -mtarget-align
26494 @itemx -mno-target-align
26495 @opindex mtarget-align
26496 @opindex mno-target-align
26497 When this option is enabled, GCC instructs the assembler to
26498 automatically align instructions to reduce branch penalties at the
26499 expense of some code density.  The assembler attempts to widen density
26500 instructions to align branch targets and the instructions following call
26501 instructions.  If there are not enough preceding safe density
26502 instructions to align a target, no widening is performed.  The
26503 default is @option{-mtarget-align}.  These options do not affect the
26504 treatment of auto-aligned instructions like @code{LOOP}, which the
26505 assembler always aligns, either by widening density instructions or
26506 by inserting NOP instructions.
26508 @item -mlongcalls
26509 @itemx -mno-longcalls
26510 @opindex mlongcalls
26511 @opindex mno-longcalls
26512 When this option is enabled, GCC instructs the assembler to translate
26513 direct calls to indirect calls unless it can determine that the target
26514 of a direct call is in the range allowed by the call instruction.  This
26515 translation typically occurs for calls to functions in other source
26516 files.  Specifically, the assembler translates a direct @code{CALL}
26517 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
26518 The default is @option{-mno-longcalls}.  This option should be used in
26519 programs where the call target can potentially be out of range.  This
26520 option is implemented in the assembler, not the compiler, so the
26521 assembly code generated by GCC still shows direct call
26522 instructions---look at the disassembled object code to see the actual
26523 instructions.  Note that the assembler uses an indirect call for
26524 every cross-file call, not just those that really are out of range.
26525 @end table
26527 @node zSeries Options
26528 @subsection zSeries Options
26529 @cindex zSeries options
26531 These are listed under @xref{S/390 and zSeries Options}.
26534 @c man end
26536 @node Spec Files
26537 @section Specifying Subprocesses and the Switches to Pass to Them
26538 @cindex Spec Files
26540 @command{gcc} is a driver program.  It performs its job by invoking a
26541 sequence of other programs to do the work of compiling, assembling and
26542 linking.  GCC interprets its command-line parameters and uses these to
26543 deduce which programs it should invoke, and which command-line options
26544 it ought to place on their command lines.  This behavior is controlled
26545 by @dfn{spec strings}.  In most cases there is one spec string for each
26546 program that GCC can invoke, but a few programs have multiple spec
26547 strings to control their behavior.  The spec strings built into GCC can
26548 be overridden by using the @option{-specs=} command-line switch to specify
26549 a spec file.
26551 @dfn{Spec files} are plain-text files that are used to construct spec
26552 strings.  They consist of a sequence of directives separated by blank
26553 lines.  The type of directive is determined by the first non-whitespace
26554 character on the line, which can be one of the following:
26556 @table @code
26557 @item %@var{command}
26558 Issues a @var{command} to the spec file processor.  The commands that can
26559 appear here are:
26561 @table @code
26562 @item %include <@var{file}>
26563 @cindex @code{%include}
26564 Search for @var{file} and insert its text at the current point in the
26565 specs file.
26567 @item %include_noerr <@var{file}>
26568 @cindex @code{%include_noerr}
26569 Just like @samp{%include}, but do not generate an error message if the include
26570 file cannot be found.
26572 @item %rename @var{old_name} @var{new_name}
26573 @cindex @code{%rename}
26574 Rename the spec string @var{old_name} to @var{new_name}.
26576 @end table
26578 @item *[@var{spec_name}]:
26579 This tells the compiler to create, override or delete the named spec
26580 string.  All lines after this directive up to the next directive or
26581 blank line are considered to be the text for the spec string.  If this
26582 results in an empty string then the spec is deleted.  (Or, if the
26583 spec did not exist, then nothing happens.)  Otherwise, if the spec
26584 does not currently exist a new spec is created.  If the spec does
26585 exist then its contents are overridden by the text of this
26586 directive, unless the first character of that text is the @samp{+}
26587 character, in which case the text is appended to the spec.
26589 @item [@var{suffix}]:
26590 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
26591 and up to the next directive or blank line are considered to make up the
26592 spec string for the indicated suffix.  When the compiler encounters an
26593 input file with the named suffix, it processes the spec string in
26594 order to work out how to compile that file.  For example:
26596 @smallexample
26597 .ZZ:
26598 z-compile -input %i
26599 @end smallexample
26601 This says that any input file whose name ends in @samp{.ZZ} should be
26602 passed to the program @samp{z-compile}, which should be invoked with the
26603 command-line switch @option{-input} and with the result of performing the
26604 @samp{%i} substitution.  (See below.)
26606 As an alternative to providing a spec string, the text following a
26607 suffix directive can be one of the following:
26609 @table @code
26610 @item @@@var{language}
26611 This says that the suffix is an alias for a known @var{language}.  This is
26612 similar to using the @option{-x} command-line switch to GCC to specify a
26613 language explicitly.  For example:
26615 @smallexample
26616 .ZZ:
26617 @@c++
26618 @end smallexample
26620 Says that .ZZ files are, in fact, C++ source files.
26622 @item #@var{name}
26623 This causes an error messages saying:
26625 @smallexample
26626 @var{name} compiler not installed on this system.
26627 @end smallexample
26628 @end table
26630 GCC already has an extensive list of suffixes built into it.
26631 This directive adds an entry to the end of the list of suffixes, but
26632 since the list is searched from the end backwards, it is effectively
26633 possible to override earlier entries using this technique.
26635 @end table
26637 GCC has the following spec strings built into it.  Spec files can
26638 override these strings or create their own.  Note that individual
26639 targets can also add their own spec strings to this list.
26641 @smallexample
26642 asm          Options to pass to the assembler
26643 asm_final    Options to pass to the assembler post-processor
26644 cpp          Options to pass to the C preprocessor
26645 cc1          Options to pass to the C compiler
26646 cc1plus      Options to pass to the C++ compiler
26647 endfile      Object files to include at the end of the link
26648 link         Options to pass to the linker
26649 lib          Libraries to include on the command line to the linker
26650 libgcc       Decides which GCC support library to pass to the linker
26651 linker       Sets the name of the linker
26652 predefines   Defines to be passed to the C preprocessor
26653 signed_char  Defines to pass to CPP to say whether @code{char} is signed
26654              by default
26655 startfile    Object files to include at the start of the link
26656 @end smallexample
26658 Here is a small example of a spec file:
26660 @smallexample
26661 %rename lib                 old_lib
26663 *lib:
26664 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
26665 @end smallexample
26667 This example renames the spec called @samp{lib} to @samp{old_lib} and
26668 then overrides the previous definition of @samp{lib} with a new one.
26669 The new definition adds in some extra command-line options before
26670 including the text of the old definition.
26672 @dfn{Spec strings} are a list of command-line options to be passed to their
26673 corresponding program.  In addition, the spec strings can contain
26674 @samp{%}-prefixed sequences to substitute variable text or to
26675 conditionally insert text into the command line.  Using these constructs
26676 it is possible to generate quite complex command lines.
26678 Here is a table of all defined @samp{%}-sequences for spec
26679 strings.  Note that spaces are not generated automatically around the
26680 results of expanding these sequences.  Therefore you can concatenate them
26681 together or combine them with constant text in a single argument.
26683 @table @code
26684 @item %%
26685 Substitute one @samp{%} into the program name or argument.
26687 @item %i
26688 Substitute the name of the input file being processed.
26690 @item %b
26691 Substitute the basename of the input file being processed.
26692 This is the substring up to (and not including) the last period
26693 and not including the directory.
26695 @item %B
26696 This is the same as @samp{%b}, but include the file suffix (text after
26697 the last period).
26699 @item %d
26700 Marks the argument containing or following the @samp{%d} as a
26701 temporary file name, so that that file is deleted if GCC exits
26702 successfully.  Unlike @samp{%g}, this contributes no text to the
26703 argument.
26705 @item %g@var{suffix}
26706 Substitute a file name that has suffix @var{suffix} and is chosen
26707 once per compilation, and mark the argument in the same way as
26708 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
26709 name is now chosen in a way that is hard to predict even when previously
26710 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
26711 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
26712 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
26713 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
26714 was simply substituted with a file name chosen once per compilation,
26715 without regard to any appended suffix (which was therefore treated
26716 just like ordinary text), making such attacks more likely to succeed.
26718 @item %u@var{suffix}
26719 Like @samp{%g}, but generates a new temporary file name
26720 each time it appears instead of once per compilation.
26722 @item %U@var{suffix}
26723 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
26724 new one if there is no such last file name.  In the absence of any
26725 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
26726 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
26727 involves the generation of two distinct file names, one
26728 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
26729 simply substituted with a file name chosen for the previous @samp{%u},
26730 without regard to any appended suffix.
26732 @item %j@var{suffix}
26733 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
26734 writable, and if @option{-save-temps} is not used; 
26735 otherwise, substitute the name
26736 of a temporary file, just like @samp{%u}.  This temporary file is not
26737 meant for communication between processes, but rather as a junk
26738 disposal mechanism.
26740 @item %|@var{suffix}
26741 @itemx %m@var{suffix}
26742 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
26743 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
26744 all.  These are the two most common ways to instruct a program that it
26745 should read from standard input or write to standard output.  If you
26746 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
26747 construct: see for example @file{f/lang-specs.h}.
26749 @item %.@var{SUFFIX}
26750 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
26751 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
26752 terminated by the next space or %.
26754 @item %w
26755 Marks the argument containing or following the @samp{%w} as the
26756 designated output file of this compilation.  This puts the argument
26757 into the sequence of arguments that @samp{%o} substitutes.
26759 @item %o
26760 Substitutes the names of all the output files, with spaces
26761 automatically placed around them.  You should write spaces
26762 around the @samp{%o} as well or the results are undefined.
26763 @samp{%o} is for use in the specs for running the linker.
26764 Input files whose names have no recognized suffix are not compiled
26765 at all, but they are included among the output files, so they are
26766 linked.
26768 @item %O
26769 Substitutes the suffix for object files.  Note that this is
26770 handled specially when it immediately follows @samp{%g, %u, or %U},
26771 because of the need for those to form complete file names.  The
26772 handling is such that @samp{%O} is treated exactly as if it had already
26773 been substituted, except that @samp{%g, %u, and %U} do not currently
26774 support additional @var{suffix} characters following @samp{%O} as they do
26775 following, for example, @samp{.o}.
26777 @item %p
26778 Substitutes the standard macro predefinitions for the
26779 current target machine.  Use this when running @command{cpp}.
26781 @item %P
26782 Like @samp{%p}, but puts @samp{__} before and after the name of each
26783 predefined macro, except for macros that start with @samp{__} or with
26784 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
26787 @item %I
26788 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
26789 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
26790 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
26791 and @option{-imultilib} as necessary.
26793 @item %s
26794 Current argument is the name of a library or startup file of some sort.
26795 Search for that file in a standard list of directories and substitute
26796 the full name found.  The current working directory is included in the
26797 list of directories scanned.
26799 @item %T
26800 Current argument is the name of a linker script.  Search for that file
26801 in the current list of directories to scan for libraries. If the file
26802 is located insert a @option{--script} option into the command line
26803 followed by the full path name found.  If the file is not found then
26804 generate an error message.  Note: the current working directory is not
26805 searched.
26807 @item %e@var{str}
26808 Print @var{str} as an error message.  @var{str} is terminated by a newline.
26809 Use this when inconsistent options are detected.
26811 @item %(@var{name})
26812 Substitute the contents of spec string @var{name} at this point.
26814 @item %x@{@var{option}@}
26815 Accumulate an option for @samp{%X}.
26817 @item %X
26818 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
26819 spec string.
26821 @item %Y
26822 Output the accumulated assembler options specified by @option{-Wa}.
26824 @item %Z
26825 Output the accumulated preprocessor options specified by @option{-Wp}.
26827 @item %a
26828 Process the @code{asm} spec.  This is used to compute the
26829 switches to be passed to the assembler.
26831 @item %A
26832 Process the @code{asm_final} spec.  This is a spec string for
26833 passing switches to an assembler post-processor, if such a program is
26834 needed.
26836 @item %l
26837 Process the @code{link} spec.  This is the spec for computing the
26838 command line passed to the linker.  Typically it makes use of the
26839 @samp{%L %G %S %D and %E} sequences.
26841 @item %D
26842 Dump out a @option{-L} option for each directory that GCC believes might
26843 contain startup files.  If the target supports multilibs then the
26844 current multilib directory is prepended to each of these paths.
26846 @item %L
26847 Process the @code{lib} spec.  This is a spec string for deciding which
26848 libraries are included on the command line to the linker.
26850 @item %G
26851 Process the @code{libgcc} spec.  This is a spec string for deciding
26852 which GCC support library is included on the command line to the linker.
26854 @item %S
26855 Process the @code{startfile} spec.  This is a spec for deciding which
26856 object files are the first ones passed to the linker.  Typically
26857 this might be a file named @file{crt0.o}.
26859 @item %E
26860 Process the @code{endfile} spec.  This is a spec string that specifies
26861 the last object files that are passed to the linker.
26863 @item %C
26864 Process the @code{cpp} spec.  This is used to construct the arguments
26865 to be passed to the C preprocessor.
26867 @item %1
26868 Process the @code{cc1} spec.  This is used to construct the options to be
26869 passed to the actual C compiler (@command{cc1}).
26871 @item %2
26872 Process the @code{cc1plus} spec.  This is used to construct the options to be
26873 passed to the actual C++ compiler (@command{cc1plus}).
26875 @item %*
26876 Substitute the variable part of a matched option.  See below.
26877 Note that each comma in the substituted string is replaced by
26878 a single space.
26880 @item %<S
26881 Remove all occurrences of @code{-S} from the command line.  Note---this
26882 command is position dependent.  @samp{%} commands in the spec string
26883 before this one see @code{-S}, @samp{%} commands in the spec string
26884 after this one do not.
26886 @item %:@var{function}(@var{args})
26887 Call the named function @var{function}, passing it @var{args}.
26888 @var{args} is first processed as a nested spec string, then split
26889 into an argument vector in the usual fashion.  The function returns
26890 a string which is processed as if it had appeared literally as part
26891 of the current spec.
26893 The following built-in spec functions are provided:
26895 @table @code
26896 @item @code{getenv}
26897 The @code{getenv} spec function takes two arguments: an environment
26898 variable name and a string.  If the environment variable is not
26899 defined, a fatal error is issued.  Otherwise, the return value is the
26900 value of the environment variable concatenated with the string.  For
26901 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
26903 @smallexample
26904 %:getenv(TOPDIR /include)
26905 @end smallexample
26907 expands to @file{/path/to/top/include}.
26909 @item @code{if-exists}
26910 The @code{if-exists} spec function takes one argument, an absolute
26911 pathname to a file.  If the file exists, @code{if-exists} returns the
26912 pathname.  Here is a small example of its usage:
26914 @smallexample
26915 *startfile:
26916 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
26917 @end smallexample
26919 @item @code{if-exists-else}
26920 The @code{if-exists-else} spec function is similar to the @code{if-exists}
26921 spec function, except that it takes two arguments.  The first argument is
26922 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
26923 returns the pathname.  If it does not exist, it returns the second argument.
26924 This way, @code{if-exists-else} can be used to select one file or another,
26925 based on the existence of the first.  Here is a small example of its usage:
26927 @smallexample
26928 *startfile:
26929 crt0%O%s %:if-exists(crti%O%s) \
26930 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
26931 @end smallexample
26933 @item @code{replace-outfile}
26934 The @code{replace-outfile} spec function takes two arguments.  It looks for the
26935 first argument in the outfiles array and replaces it with the second argument.  Here
26936 is a small example of its usage:
26938 @smallexample
26939 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
26940 @end smallexample
26942 @item @code{remove-outfile}
26943 The @code{remove-outfile} spec function takes one argument.  It looks for the
26944 first argument in the outfiles array and removes it.  Here is a small example
26945 its usage:
26947 @smallexample
26948 %:remove-outfile(-lm)
26949 @end smallexample
26951 @item @code{pass-through-libs}
26952 The @code{pass-through-libs} spec function takes any number of arguments.  It
26953 finds any @option{-l} options and any non-options ending in @file{.a} (which it
26954 assumes are the names of linker input library archive files) and returns a
26955 result containing all the found arguments each prepended by
26956 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
26957 intended to be passed to the LTO linker plugin.
26959 @smallexample
26960 %:pass-through-libs(%G %L %G)
26961 @end smallexample
26963 @item @code{print-asm-header}
26964 The @code{print-asm-header} function takes no arguments and simply
26965 prints a banner like:
26967 @smallexample
26968 Assembler options
26969 =================
26971 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
26972 @end smallexample
26974 It is used to separate compiler options from assembler options
26975 in the @option{--target-help} output.
26976 @end table
26978 @item %@{S@}
26979 Substitutes the @code{-S} switch, if that switch is given to GCC@.
26980 If that switch is not specified, this substitutes nothing.  Note that
26981 the leading dash is omitted when specifying this option, and it is
26982 automatically inserted if the substitution is performed.  Thus the spec
26983 string @samp{%@{foo@}} matches the command-line option @option{-foo}
26984 and outputs the command-line option @option{-foo}.
26986 @item %W@{S@}
26987 Like %@{@code{S}@} but mark last argument supplied within as a file to be
26988 deleted on failure.
26990 @item %@{S*@}
26991 Substitutes all the switches specified to GCC whose names start
26992 with @code{-S}, but which also take an argument.  This is used for
26993 switches like @option{-o}, @option{-D}, @option{-I}, etc.
26994 GCC considers @option{-o foo} as being
26995 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
26996 text, including the space.  Thus two arguments are generated.
26998 @item %@{S*&T*@}
26999 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
27000 (the order of @code{S} and @code{T} in the spec is not significant).
27001 There can be any number of ampersand-separated variables; for each the
27002 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
27004 @item %@{S:X@}
27005 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
27007 @item %@{!S:X@}
27008 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
27010 @item %@{S*:X@}
27011 Substitutes @code{X} if one or more switches whose names start with
27012 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
27013 once, no matter how many such switches appeared.  However, if @code{%*}
27014 appears somewhere in @code{X}, then @code{X} is substituted once
27015 for each matching switch, with the @code{%*} replaced by the part of
27016 that switch matching the @code{*}.
27018 If @code{%*} appears as the last part of a spec sequence then a space
27019 is added after the end of the last substitution.  If there is more
27020 text in the sequence, however, then a space is not generated.  This
27021 allows the @code{%*} substitution to be used as part of a larger
27022 string.  For example, a spec string like this:
27024 @smallexample
27025 %@{mcu=*:--script=%*/memory.ld@}
27026 @end smallexample
27028 @noindent
27029 when matching an option like @option{-mcu=newchip} produces:
27031 @smallexample
27032 --script=newchip/memory.ld
27033 @end smallexample
27035 @item %@{.S:X@}
27036 Substitutes @code{X}, if processing a file with suffix @code{S}.
27038 @item %@{!.S:X@}
27039 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
27041 @item %@{,S:X@}
27042 Substitutes @code{X}, if processing a file for language @code{S}.
27044 @item %@{!,S:X@}
27045 Substitutes @code{X}, if not processing a file for language @code{S}.
27047 @item %@{S|P:X@}
27048 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
27049 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
27050 @code{*} sequences as well, although they have a stronger binding than
27051 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
27052 alternatives must be starred, and only the first matching alternative
27053 is substituted.
27055 For example, a spec string like this:
27057 @smallexample
27058 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
27059 @end smallexample
27061 @noindent
27062 outputs the following command-line options from the following input
27063 command-line options:
27065 @smallexample
27066 fred.c        -foo -baz
27067 jim.d         -bar -boggle
27068 -d fred.c     -foo -baz -boggle
27069 -d jim.d      -bar -baz -boggle
27070 @end smallexample
27072 @item %@{S:X; T:Y; :D@}
27074 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
27075 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
27076 be as many clauses as you need.  This may be combined with @code{.},
27077 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
27080 @end table
27082 The switch matching text @code{S} in a @samp{%@{S@}}, @samp{%@{S:X@}}
27083 or similar construct can use a backslash to ignore the special meaning
27084 of the character following it, thus allowing literal matching of a
27085 character that is otherwise specially treated.  For example,
27086 @samp{%@{std=iso9899\:1999:X@}} substitutes @code{X} if the
27087 @option{-std=iso9899:1999} option is given.
27089 The conditional text @code{X} in a @samp{%@{S:X@}} or similar
27090 construct may contain other nested @samp{%} constructs or spaces, or
27091 even newlines.  They are processed as usual, as described above.
27092 Trailing white space in @code{X} is ignored.  White space may also
27093 appear anywhere on the left side of the colon in these constructs,
27094 except between @code{.} or @code{*} and the corresponding word.
27096 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
27097 handled specifically in these constructs.  If another value of
27098 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
27099 @option{-W} switch is found later in the command line, the earlier
27100 switch value is ignored, except with @{@code{S}*@} where @code{S} is
27101 just one letter, which passes all matching options.
27103 The character @samp{|} at the beginning of the predicate text is used to
27104 indicate that a command should be piped to the following command, but
27105 only if @option{-pipe} is specified.
27107 It is built into GCC which switches take arguments and which do not.
27108 (You might think it would be useful to generalize this to allow each
27109 compiler's spec to say which switches take arguments.  But this cannot
27110 be done in a consistent fashion.  GCC cannot even decide which input
27111 files have been specified without knowing which switches take arguments,
27112 and it must know which input files to compile in order to tell which
27113 compilers to run).
27115 GCC also knows implicitly that arguments starting in @option{-l} are to be
27116 treated as compiler output files, and passed to the linker in their
27117 proper position among the other output files.
27119 @node Environment Variables
27120 @section Environment Variables Affecting GCC
27121 @cindex environment variables
27123 @c man begin ENVIRONMENT
27124 This section describes several environment variables that affect how GCC
27125 operates.  Some of them work by specifying directories or prefixes to use
27126 when searching for various kinds of files.  Some are used to specify other
27127 aspects of the compilation environment.
27129 Note that you can also specify places to search using options such as
27130 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
27131 take precedence over places specified using environment variables, which
27132 in turn take precedence over those specified by the configuration of GCC@.
27133 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
27134 GNU Compiler Collection (GCC) Internals}.
27136 @table @env
27137 @item LANG
27138 @itemx LC_CTYPE
27139 @c @itemx LC_COLLATE
27140 @itemx LC_MESSAGES
27141 @c @itemx LC_MONETARY
27142 @c @itemx LC_NUMERIC
27143 @c @itemx LC_TIME
27144 @itemx LC_ALL
27145 @findex LANG
27146 @findex LC_CTYPE
27147 @c @findex LC_COLLATE
27148 @findex LC_MESSAGES
27149 @c @findex LC_MONETARY
27150 @c @findex LC_NUMERIC
27151 @c @findex LC_TIME
27152 @findex LC_ALL
27153 @cindex locale
27154 These environment variables control the way that GCC uses
27155 localization information which allows GCC to work with different
27156 national conventions.  GCC inspects the locale categories
27157 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
27158 so.  These locale categories can be set to any value supported by your
27159 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
27160 Kingdom encoded in UTF-8.
27162 The @env{LC_CTYPE} environment variable specifies character
27163 classification.  GCC uses it to determine the character boundaries in
27164 a string; this is needed for some multibyte encodings that contain quote
27165 and escape characters that are otherwise interpreted as a string
27166 end or escape.
27168 The @env{LC_MESSAGES} environment variable specifies the language to
27169 use in diagnostic messages.
27171 If the @env{LC_ALL} environment variable is set, it overrides the value
27172 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
27173 and @env{LC_MESSAGES} default to the value of the @env{LANG}
27174 environment variable.  If none of these variables are set, GCC
27175 defaults to traditional C English behavior.
27177 @item TMPDIR
27178 @findex TMPDIR
27179 If @env{TMPDIR} is set, it specifies the directory to use for temporary
27180 files.  GCC uses temporary files to hold the output of one stage of
27181 compilation which is to be used as input to the next stage: for example,
27182 the output of the preprocessor, which is the input to the compiler
27183 proper.
27185 @item GCC_COMPARE_DEBUG
27186 @findex GCC_COMPARE_DEBUG
27187 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
27188 @option{-fcompare-debug} to the compiler driver.  See the documentation
27189 of this option for more details.
27191 @item GCC_EXEC_PREFIX
27192 @findex GCC_EXEC_PREFIX
27193 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
27194 names of the subprograms executed by the compiler.  No slash is added
27195 when this prefix is combined with the name of a subprogram, but you can
27196 specify a prefix that ends with a slash if you wish.
27198 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
27199 an appropriate prefix to use based on the pathname it is invoked with.
27201 If GCC cannot find the subprogram using the specified prefix, it
27202 tries looking in the usual places for the subprogram.
27204 The default value of @env{GCC_EXEC_PREFIX} is
27205 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
27206 the installed compiler. In many cases @var{prefix} is the value
27207 of @code{prefix} when you ran the @file{configure} script.
27209 Other prefixes specified with @option{-B} take precedence over this prefix.
27211 This prefix is also used for finding files such as @file{crt0.o} that are
27212 used for linking.
27214 In addition, the prefix is used in an unusual way in finding the
27215 directories to search for header files.  For each of the standard
27216 directories whose name normally begins with @samp{/usr/local/lib/gcc}
27217 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
27218 replacing that beginning with the specified prefix to produce an
27219 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
27220 @file{foo/bar} just before it searches the standard directory 
27221 @file{/usr/local/lib/bar}.
27222 If a standard directory begins with the configured
27223 @var{prefix} then the value of @var{prefix} is replaced by
27224 @env{GCC_EXEC_PREFIX} when looking for header files.
27226 @item COMPILER_PATH
27227 @findex COMPILER_PATH
27228 The value of @env{COMPILER_PATH} is a colon-separated list of
27229 directories, much like @env{PATH}.  GCC tries the directories thus
27230 specified when searching for subprograms, if it cannot find the
27231 subprograms using @env{GCC_EXEC_PREFIX}.
27233 @item LIBRARY_PATH
27234 @findex LIBRARY_PATH
27235 The value of @env{LIBRARY_PATH} is a colon-separated list of
27236 directories, much like @env{PATH}.  When configured as a native compiler,
27237 GCC tries the directories thus specified when searching for special
27238 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
27239 using GCC also uses these directories when searching for ordinary
27240 libraries for the @option{-l} option (but directories specified with
27241 @option{-L} come first).
27243 @item LANG
27244 @findex LANG
27245 @cindex locale definition
27246 This variable is used to pass locale information to the compiler.  One way in
27247 which this information is used is to determine the character set to be used
27248 when character literals, string literals and comments are parsed in C and C++.
27249 When the compiler is configured to allow multibyte characters,
27250 the following values for @env{LANG} are recognized:
27252 @table @samp
27253 @item C-JIS
27254 Recognize JIS characters.
27255 @item C-SJIS
27256 Recognize SJIS characters.
27257 @item C-EUCJP
27258 Recognize EUCJP characters.
27259 @end table
27261 If @env{LANG} is not defined, or if it has some other value, then the
27262 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
27263 recognize and translate multibyte characters.
27264 @end table
27266 @noindent
27267 Some additional environment variables affect the behavior of the
27268 preprocessor.
27270 @include cppenv.texi
27272 @c man end
27274 @node Precompiled Headers
27275 @section Using Precompiled Headers
27276 @cindex precompiled headers
27277 @cindex speed of compilation
27279 Often large projects have many header files that are included in every
27280 source file.  The time the compiler takes to process these header files
27281 over and over again can account for nearly all of the time required to
27282 build the project.  To make builds faster, GCC allows you to
27283 @dfn{precompile} a header file.
27285 To create a precompiled header file, simply compile it as you would any
27286 other file, if necessary using the @option{-x} option to make the driver
27287 treat it as a C or C++ header file.  You may want to use a
27288 tool like @command{make} to keep the precompiled header up-to-date when
27289 the headers it contains change.
27291 A precompiled header file is searched for when @code{#include} is
27292 seen in the compilation.  As it searches for the included file
27293 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
27294 compiler looks for a precompiled header in each directory just before it
27295 looks for the include file in that directory.  The name searched for is
27296 the name specified in the @code{#include} with @samp{.gch} appended.  If
27297 the precompiled header file cannot be used, it is ignored.
27299 For instance, if you have @code{#include "all.h"}, and you have
27300 @file{all.h.gch} in the same directory as @file{all.h}, then the
27301 precompiled header file is used if possible, and the original
27302 header is used otherwise.
27304 Alternatively, you might decide to put the precompiled header file in a
27305 directory and use @option{-I} to ensure that directory is searched
27306 before (or instead of) the directory containing the original header.
27307 Then, if you want to check that the precompiled header file is always
27308 used, you can put a file of the same name as the original header in this
27309 directory containing an @code{#error} command.
27311 This also works with @option{-include}.  So yet another way to use
27312 precompiled headers, good for projects not designed with precompiled
27313 header files in mind, is to simply take most of the header files used by
27314 a project, include them from another header file, precompile that header
27315 file, and @option{-include} the precompiled header.  If the header files
27316 have guards against multiple inclusion, they are skipped because
27317 they've already been included (in the precompiled header).
27319 If you need to precompile the same header file for different
27320 languages, targets, or compiler options, you can instead make a
27321 @emph{directory} named like @file{all.h.gch}, and put each precompiled
27322 header in the directory, perhaps using @option{-o}.  It doesn't matter
27323 what you call the files in the directory; every precompiled header in
27324 the directory is considered.  The first precompiled header
27325 encountered in the directory that is valid for this compilation is
27326 used; they're searched in no particular order.
27328 There are many other possibilities, limited only by your imagination,
27329 good sense, and the constraints of your build system.
27331 A precompiled header file can be used only when these conditions apply:
27333 @itemize
27334 @item
27335 Only one precompiled header can be used in a particular compilation.
27337 @item
27338 A precompiled header cannot be used once the first C token is seen.  You
27339 can have preprocessor directives before a precompiled header; you cannot
27340 include a precompiled header from inside another header.
27342 @item
27343 The precompiled header file must be produced for the same language as
27344 the current compilation.  You cannot use a C precompiled header for a C++
27345 compilation.
27347 @item
27348 The precompiled header file must have been produced by the same compiler
27349 binary as the current compilation is using.
27351 @item
27352 Any macros defined before the precompiled header is included must
27353 either be defined in the same way as when the precompiled header was
27354 generated, or must not affect the precompiled header, which usually
27355 means that they don't appear in the precompiled header at all.
27357 The @option{-D} option is one way to define a macro before a
27358 precompiled header is included; using a @code{#define} can also do it.
27359 There are also some options that define macros implicitly, like
27360 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
27361 defined this way.
27363 @item If debugging information is output when using the precompiled
27364 header, using @option{-g} or similar, the same kind of debugging information
27365 must have been output when building the precompiled header.  However,
27366 a precompiled header built using @option{-g} can be used in a compilation
27367 when no debugging information is being output.
27369 @item The same @option{-m} options must generally be used when building
27370 and using the precompiled header.  @xref{Submodel Options},
27371 for any cases where this rule is relaxed.
27373 @item Each of the following options must be the same when building and using
27374 the precompiled header:
27376 @gccoptlist{-fexceptions}
27378 @item
27379 Some other command-line options starting with @option{-f},
27380 @option{-p}, or @option{-O} must be defined in the same way as when
27381 the precompiled header was generated.  At present, it's not clear
27382 which options are safe to change and which are not; the safest choice
27383 is to use exactly the same options when generating and using the
27384 precompiled header.  The following are known to be safe:
27386 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
27387 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
27388 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
27389 -pedantic-errors}
27391 @end itemize
27393 For all of these except the last, the compiler automatically
27394 ignores the precompiled header if the conditions aren't met.  If you
27395 find an option combination that doesn't work and doesn't cause the
27396 precompiled header to be ignored, please consider filing a bug report,
27397 see @ref{Bugs}.
27399 If you do use differing options when generating and using the
27400 precompiled header, the actual behavior is a mixture of the
27401 behavior for the options.  For instance, if you use @option{-g} to
27402 generate the precompiled header but not when using it, you may or may
27403 not get debugging information for routines in the precompiled header.