Update ChangeLog and version files for release
[official-gcc.git] / gcc / doc / invoke.texi
blob19a85b6cd9a37d9696d151fd48379c7afc02a662
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  -Wnon-virtual-dtor  -Wreorder  -Wregister @gol
219 -Weffc++  -Wstrict-null-sentinel  -Wtemplates @gol
220 -Wno-non-template-friend  -Wold-style-cast @gol
221 -Woverloaded-virtual  -Wno-pmf-conversions @gol
222 -Wsign-promo  -Wvirtual-inheritance}
224 @item Objective-C and Objective-C++ Language Options
225 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
226 Objective-C and Objective-C++ Dialects}.
227 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
228 -fgnu-runtime  -fnext-runtime @gol
229 -fno-nil-receivers @gol
230 -fobjc-abi-version=@var{n} @gol
231 -fobjc-call-cxx-cdtors @gol
232 -fobjc-direct-dispatch @gol
233 -fobjc-exceptions @gol
234 -fobjc-gc @gol
235 -fobjc-nilcheck @gol
236 -fobjc-std=objc1 @gol
237 -fno-local-ivars @gol
238 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
239 -freplace-objc-classes @gol
240 -fzero-link @gol
241 -gen-decls @gol
242 -Wassign-intercept @gol
243 -Wno-protocol  -Wselector @gol
244 -Wstrict-selector-match @gol
245 -Wundeclared-selector}
247 @item Diagnostic Message Formatting Options
248 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
249 @gccoptlist{-fmessage-length=@var{n}  @gol
250 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
251 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
252 -fno-diagnostics-show-option  -fno-diagnostics-show-caret @gol
253 -fdiagnostics-parseable-fixits  -fdiagnostics-generate-patch @gol
254 -fno-show-column}
256 @item Warning Options
257 @xref{Warning Options,,Options to Request or Suppress Warnings}.
258 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
259 -pedantic-errors @gol
260 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
261 -Walloc-zero  -Walloc-size-larger-than=@var{n}
262 -Walloca  -Walloca-larger-than=@var{n} @gol
263 -Wno-aggressive-loop-optimizations  -Warray-bounds  -Warray-bounds=@var{n} @gol
264 -Wno-attributes  -Wbool-compare  -Wbool-operation @gol
265 -Wno-builtin-declaration-mismatch @gol
266 -Wno-builtin-macro-redefined  -Wc90-c99-compat  -Wc99-c11-compat @gol
267 -Wc++-compat  -Wc++11-compat  -Wc++14-compat  -Wcast-align  -Wcast-qual  @gol
268 -Wchar-subscripts -Wchkp  -Wclobbered  -Wcomment  @gol
269 -Wconditionally-supported  @gol
270 -Wconversion  -Wcoverage-mismatch  -Wno-cpp  -Wdangling-else  -Wdate-time @gol
271 -Wdelete-incomplete @gol
272 -Wno-deprecated  -Wno-deprecated-declarations  -Wno-designated-init @gol
273 -Wdisabled-optimization @gol
274 -Wno-discarded-qualifiers  -Wno-discarded-array-qualifiers @gol
275 -Wno-div-by-zero  -Wdouble-promotion  -Wduplicated-cond @gol
276 -Wempty-body  -Wenum-compare  -Wno-endif-labels  -Wexpansion-to-defined @gol
277 -Werror  -Werror=*  -Wfatal-errors  -Wfloat-equal  -Wformat  -Wformat=2 @gol
278 -Wno-format-contains-nul  -Wno-format-extra-args  @gol
279 -Wformat-nonliteral -Wformat-overflow=@var{n} @gol
280 -Wformat-security  -Wformat-signedness  -Wformat-truncation=@var{n} @gol
281 -Wformat-y2k  -Wframe-address @gol
282 -Wframe-larger-than=@var{len}  -Wno-free-nonheap-object  -Wjump-misses-init @gol
283 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
284 -Wimplicit  -Wimplicit-fallthrough  -Wimplicit-fallthrough=@var{n} @gol
285 -Wimplicit-function-declaration  -Wimplicit-int @gol
286 -Winit-self  -Winline  -Wno-int-conversion  -Wint-in-bool-context @gol
287 -Wno-int-to-pointer-cast  -Winvalid-memory-model  -Wno-invalid-offsetof @gol
288 -Winvalid-pch  -Wlarger-than=@var{len} @gol
289 -Wlogical-op  -Wlogical-not-parentheses  -Wlong-long @gol
290 -Wmain  -Wmaybe-uninitialized  -Wmemset-elt-size  -Wmemset-transposed-args @gol
291 -Wmisleading-indentation  -Wmissing-braces @gol
292 -Wmissing-field-initializers  -Wmissing-include-dirs @gol
293 -Wno-multichar  -Wnonnull  -Wnonnull-compare @gol
294 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
295 -Wnull-dereference  -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
296 -Woverride-init-side-effects  -Woverlength-strings @gol
297 -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
298 -Wparentheses  -Wno-pedantic-ms-format @gol
299 -Wplacement-new  -Wplacement-new=@var{n} @gol
300 -Wpointer-arith  -Wpointer-compare  -Wno-pointer-to-int-cast @gol
301 -Wno-pragmas  -Wredundant-decls  -Wrestrict  -Wno-return-local-addr @gol
302 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
303 -Wshadow=global,  -Wshadow=local,  -Wshadow=compatible-local @gol
304 -Wshift-overflow  -Wshift-overflow=@var{n} @gol
305 -Wshift-count-negative  -Wshift-count-overflow  -Wshift-negative-value @gol
306 -Wsign-compare  -Wsign-conversion  -Wfloat-conversion @gol
307 -Wno-scalar-storage-order @gol
308 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
309 -Wstack-protector  -Wstack-usage=@var{len}  -Wstrict-aliasing @gol
310 -Wstrict-aliasing=n  -Wstrict-overflow  -Wstrict-overflow=@var{n} @gol
311 -Wstringop-overflow=@var{n} @gol
312 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
313 -Wsuggest-final-types @gol  -Wsuggest-final-methods  -Wsuggest-override @gol
314 -Wmissing-format-attribute  -Wsubobject-linkage @gol
315 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
316 -Wswitch-unreachable  -Wsync-nand @gol
317 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
318 -Wtype-limits  -Wundef @gol
319 -Wuninitialized  -Wunknown-pragmas  -Wunsafe-loop-optimizations @gol
320 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
321 -Wunused-label  -Wunused-local-typedefs  -Wunused-macros @gol
322 -Wunused-parameter  -Wno-unused-result @gol
323 -Wunused-value  -Wunused-variable @gol
324 -Wunused-const-variable  -Wunused-const-variable=@var{n} @gol
325 -Wunused-but-set-parameter  -Wunused-but-set-variable @gol
326 -Wuseless-cast  -Wvariadic-macros  -Wvector-operation-performance @gol
327 -Wvla  -Wvla-larger-than=@var{n}  -Wvolatile-register-var  -Wwrite-strings @gol
328 -Wzero-as-null-pointer-constant  -Whsa}
330 @item C and Objective-C-only Warning Options
331 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
332 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
333 -Wold-style-declaration  -Wold-style-definition @gol
334 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
335 -Wdeclaration-after-statement  -Wpointer-sign}
337 @item Debugging Options
338 @xref{Debugging Options,,Options for Debugging Your Program}.
339 @gccoptlist{-g  -g@var{level}  -gcoff  -gdwarf  -gdwarf-@var{version} @gol
340 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
341 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
342 -gcolumn-info  -gno-column-info @gol
343 -gvms  -gxcoff  -gxcoff+  -gz@r{[}=@var{type}@r{]} @gol
344 -fdebug-prefix-map=@var{old}=@var{new}  -fdebug-types-section @gol
345 -feliminate-dwarf2-dups  -fno-eliminate-unused-debug-types @gol
346 -femit-struct-debug-baseonly  -femit-struct-debug-reduced @gol
347 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
348 -feliminate-unused-debug-symbols  -femit-class-debug-always @gol
349 -fno-merge-debug-strings  -fno-dwarf2-cfi-asm @gol
350 -fvar-tracking  -fvar-tracking-assignments}
352 @item Optimization Options
353 @xref{Optimize Options,,Options that Control Optimization}.
354 @gccoptlist{-faggressive-loop-optimizations  -falign-functions[=@var{n}] @gol
355 -falign-jumps[=@var{n}] @gol
356 -falign-labels[=@var{n}]  -falign-loops[=@var{n}] @gol
357 -fassociative-math  -fauto-profile  -fauto-profile[=@var{path}] @gol
358 -fauto-inc-dec  -fbranch-probabilities @gol
359 -fbranch-target-load-optimize  -fbranch-target-load-optimize2 @gol
360 -fbtr-bb-exclusive  -fcaller-saves @gol
361 -fcombine-stack-adjustments  -fconserve-stack @gol
362 -fcompare-elim  -fcprop-registers  -fcrossjumping @gol
363 -fcse-follow-jumps  -fcse-skip-blocks  -fcx-fortran-rules @gol
364 -fcx-limited-range @gol
365 -fdata-sections  -fdce  -fdelayed-branch @gol
366 -fdelete-null-pointer-checks  -fdevirtualize  -fdevirtualize-speculatively @gol
367 -fdevirtualize-at-ltrans  -fdse @gol
368 -fearly-inlining  -fipa-sra  -fexpensive-optimizations  -ffat-lto-objects @gol
369 -ffast-math  -ffinite-math-only  -ffloat-store  -fexcess-precision=@var{style} @gol
370 -fforward-propagate  -ffp-contract=@var{style}  -ffunction-sections @gol
371 -fgcse  -fgcse-after-reload  -fgcse-las  -fgcse-lm  -fgraphite-identity @gol
372 -fgcse-sm  -fhoist-adjacent-loads  -fif-conversion @gol
373 -fif-conversion2  -findirect-inlining @gol
374 -finline-functions  -finline-functions-called-once  -finline-limit=@var{n} @gol
375 -finline-small-functions  -fipa-cp  -fipa-cp-clone @gol
376 -fipa-bit-cp -fipa-vrp @gol
377 -fipa-pta  -fipa-profile  -fipa-pure-const  -fipa-reference  -fipa-icf @gol
378 -fira-algorithm=@var{algorithm} @gol
379 -fira-region=@var{region}  -fira-hoist-pressure @gol
380 -fira-loop-pressure  -fno-ira-share-save-slots @gol
381 -fno-ira-share-spill-slots @gol
382 -fisolate-erroneous-paths-dereference  -fisolate-erroneous-paths-attribute @gol
383 -fivopts  -fkeep-inline-functions  -fkeep-static-functions @gol
384 -fkeep-static-consts  -flimit-function-alignment  -flive-range-shrinkage @gol
385 -floop-block  -floop-interchange  -floop-strip-mine @gol
386 -floop-unroll-and-jam  -floop-nest-optimize @gol
387 -floop-parallelize-all  -flra-remat  -flto  -flto-compression-level @gol
388 -flto-partition=@var{alg}  -fmerge-all-constants @gol
389 -fmerge-constants  -fmodulo-sched  -fmodulo-sched-allow-regmoves @gol
390 -fmove-loop-invariants  -fno-branch-count-reg @gol
391 -fno-defer-pop  -fno-fp-int-builtin-inexact  -fno-function-cse @gol
392 -fno-guess-branch-probability  -fno-inline  -fno-math-errno  -fno-peephole @gol
393 -fno-peephole2  -fno-printf-return-value  -fno-sched-interblock @gol
394 -fno-sched-spec  -fno-signed-zeros @gol
395 -fno-toplevel-reorder  -fno-trapping-math  -fno-zero-initialized-in-bss @gol
396 -fomit-frame-pointer  -foptimize-sibling-calls @gol
397 -fpartial-inlining  -fpeel-loops  -fpredictive-commoning @gol
398 -fprefetch-loop-arrays @gol
399 -fprofile-correction @gol
400 -fprofile-use  -fprofile-use=@var{path}  -fprofile-values @gol
401 -fprofile-reorder-functions @gol
402 -freciprocal-math  -free  -frename-registers  -freorder-blocks @gol
403 -freorder-blocks-algorithm=@var{algorithm} @gol
404 -freorder-blocks-and-partition  -freorder-functions @gol
405 -frerun-cse-after-loop  -freschedule-modulo-scheduled-loops @gol
406 -frounding-math  -fsched2-use-superblocks  -fsched-pressure @gol
407 -fsched-spec-load  -fsched-spec-load-dangerous @gol
408 -fsched-stalled-insns-dep[=@var{n}]  -fsched-stalled-insns[=@var{n}] @gol
409 -fsched-group-heuristic  -fsched-critical-path-heuristic @gol
410 -fsched-spec-insn-heuristic  -fsched-rank-heuristic @gol
411 -fsched-last-insn-heuristic  -fsched-dep-count-heuristic @gol
412 -fschedule-fusion @gol
413 -fschedule-insns  -fschedule-insns2  -fsection-anchors @gol
414 -fselective-scheduling  -fselective-scheduling2 @gol
415 -fsel-sched-pipelining  -fsel-sched-pipelining-outer-loops @gol
416 -fsemantic-interposition  -fshrink-wrap  -fshrink-wrap-separate @gol
417 -fsignaling-nans @gol
418 -fsingle-precision-constant  -fsplit-ivs-in-unroller  -fsplit-loops@gol
419 -fsplit-paths @gol
420 -fsplit-wide-types  -fssa-backprop  -fssa-phiopt @gol
421 -fstdarg-opt  -fstore-merging  -fstrict-aliasing @gol
422 -fstrict-overflow  -fthread-jumps  -ftracer  -ftree-bit-ccp @gol
423 -ftree-builtin-call-dce  -ftree-ccp  -ftree-ch @gol
424 -ftree-coalesce-vars  -ftree-copy-prop  -ftree-dce  -ftree-dominator-opts @gol
425 -ftree-dse  -ftree-forwprop  -ftree-fre  -fcode-hoisting @gol
426 -ftree-loop-if-convert  -ftree-loop-im @gol
427 -ftree-phiprop  -ftree-loop-distribution  -ftree-loop-distribute-patterns @gol
428 -ftree-loop-ivcanon  -ftree-loop-linear  -ftree-loop-optimize @gol
429 -ftree-loop-vectorize @gol
430 -ftree-parallelize-loops=@var{n}  -ftree-pre  -ftree-partial-pre  -ftree-pta @gol
431 -ftree-reassoc  -ftree-sink  -ftree-slsr  -ftree-sra @gol
432 -ftree-switch-conversion  -ftree-tail-merge @gol
433 -ftree-ter  -ftree-vectorize  -ftree-vrp  -funconstrained-commons @gol
434 -funit-at-a-time  -funroll-all-loops  -funroll-loops @gol
435 -funsafe-math-optimizations  -funswitch-loops @gol
436 -fipa-ra  -fvariable-expansion-in-unroller  -fvect-cost-model  -fvpt @gol
437 -fweb  -fwhole-program  -fwpa  -fuse-linker-plugin @gol
438 --param @var{name}=@var{value}
439 -O  -O0  -O1  -O2  -O3  -Os  -Ofast  -Og}
441 @item Program Instrumentation Options
442 @xref{Instrumentation Options,,Program Instrumentation Options}.
443 @gccoptlist{-p  -pg  -fprofile-arcs  --coverage  -ftest-coverage @gol
444 -fprofile-dir=@var{path}  -fprofile-generate  -fprofile-generate=@var{path} @gol
445 -fsanitize=@var{style}  -fsanitize-recover  -fsanitize-recover=@var{style} @gol
446 -fasan-shadow-offset=@var{number}  -fsanitize-sections=@var{s1},@var{s2},... @gol
447 -fsanitize-undefined-trap-on-error  -fbounds-check @gol
448 -fcheck-pointer-bounds  -fchkp-check-incomplete-type @gol
449 -fchkp-first-field-has-own-bounds  -fchkp-narrow-bounds @gol
450 -fchkp-narrow-to-innermost-array  -fchkp-optimize @gol
451 -fchkp-use-fast-string-functions  -fchkp-use-nochk-string-functions @gol
452 -fchkp-use-static-bounds  -fchkp-use-static-const-bounds @gol
453 -fchkp-treat-zero-dynamic-size-as-infinite  -fchkp-check-read @gol
454 -fchkp-check-read  -fchkp-check-write  -fchkp-store-bounds @gol
455 -fchkp-instrument-calls  -fchkp-instrument-marked-only @gol
456 -fchkp-use-wrappers  -fchkp-flexible-struct-trailing-arrays@gol
457 -fstack-protector  -fstack-protector-all  -fstack-protector-strong @gol
458 -fstack-protector-explicit  -fstack-check @gol
459 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
460 -fno-stack-limit  -fsplit-stack @gol
461 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
462 -fvtv-counts  -fvtv-debug @gol
463 -finstrument-functions @gol
464 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
465 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
467 @item Preprocessor Options
468 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
469 @gccoptlist{-A@var{question}=@var{answer} @gol
470 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
471 -C  -CC  -D@var{macro}@r{[}=@var{defn}@r{]} @gol
472 -dD  -dI  -dM  -dN  -dU @gol
473 -fdebug-cpp  -fdirectives-only  -fdollars-in-identifiers  @gol
474 -fexec-charset=@var{charset}  -fextended-identifiers  @gol
475 -finput-charset=@var{charset}  -fno-canonical-system-headers @gol
476 -fpch-deps  -fpch-preprocess  -fpreprocessed @gol
477 -ftabstop=@var{width}  -ftrack-macro-expansion  @gol
478 -fwide-exec-charset=@var{charset}  -fworking-directory @gol
479 -H  -imacros @var{file}  -include @var{file} @gol
480 -M  -MD  -MF  -MG  -MM  -MMD  -MP  -MQ  -MT @gol
481 -no-integrated-cpp  -P  -pthread  -remap @gol
482 -traditional  -traditional-cpp  -trigraphs @gol
483 -U@var{macro}  -undef  @gol
484 -Wp,@var{option}  -Xpreprocessor @var{option}}
486 @item Assembler Options
487 @xref{Assembler Options,,Passing Options to the Assembler}.
488 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
490 @item Linker Options
491 @xref{Link Options,,Options for Linking}.
492 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker}  -l@var{library} @gol
493 -nostartfiles  -nodefaultlibs  -nostdlib  -pie  -pthread  -rdynamic @gol
494 -s  -static  -static-libgcc  -static-libstdc++ @gol
495 -static-libasan  -static-libtsan  -static-liblsan  -static-libubsan @gol
496 -static-libmpx  -static-libmpxwrappers @gol
497 -shared  -shared-libgcc  -symbolic @gol
498 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
499 -u @var{symbol}  -z @var{keyword}}
501 @item Directory Options
502 @xref{Directory Options,,Options for Directory Search}.
503 @gccoptlist{-B@var{prefix}  -I@var{dir}  -I- @gol
504 -idirafter @var{dir} @gol
505 -imacros @var{file}  -imultilib @var{dir} @gol
506 -iplugindir=@var{dir}  -iprefix @var{file} @gol
507 -iquote @var{dir}  -isysroot @var{dir}  -isystem @var{dir} @gol
508 -iwithprefix @var{dir}  -iwithprefixbefore @var{dir}  @gol
509 -L@var{dir}  -no-canonical-prefixes  --no-sysroot-suffix @gol
510 -nostdinc  -nostdinc++  --sysroot=@var{dir}}
512 @item Code Generation Options
513 @xref{Code Gen Options,,Options for Code Generation Conventions}.
514 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
515 -ffixed-@var{reg}  -fexceptions @gol
516 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
517 -fasynchronous-unwind-tables @gol
518 -fno-gnu-unique @gol
519 -finhibit-size-directive  -fno-common  -fno-ident @gol
520 -fpcc-struct-return  -fpic  -fPIC  -fpie  -fPIE  -fno-plt @gol
521 -fno-jump-tables @gol
522 -frecord-gcc-switches @gol
523 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
524 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
525 -fleading-underscore  -ftls-model=@var{model} @gol
526 -fstack-reuse=@var{reuse_level} @gol
527 -ftrampolines  -ftrapv  -fwrapv @gol
528 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
529 -fstrict-volatile-bitfields  -fsync-libcalls}
531 @item Developer Options
532 @xref{Developer Options,,GCC Developer Options}.
533 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
534 -dumpfullversion  -fchecking  -fchecking=@var{n}  -fdbg-cnt-list @gol
535 -fdbg-cnt=@var{counter-value-list} @gol
536 -fdisable-ipa-@var{pass_name} @gol
537 -fdisable-rtl-@var{pass_name} @gol
538 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
539 -fdisable-tree-@var{pass_name} @gol
540 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
541 -fdump-noaddr  -fdump-unnumbered  -fdump-unnumbered-links @gol
542 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
543 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
544 -fdump-ipa-all  -fdump-ipa-cgraph  -fdump-ipa-inline @gol
545 -fdump-passes @gol
546 -fdump-rtl-@var{pass}  -fdump-rtl-@var{pass}=@var{filename} @gol
547 -fdump-statistics @gol
548 -fdump-final-insns@r{[}=@var{file}@r{]}
549 -fdump-tree-all @gol
550 -fdump-tree-@var{switch} @gol
551 -fdump-tree-@var{switch}-@var{options} @gol
552 -fdump-tree-@var{switch}-@var{options}=@var{filename} @gol
553 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
554 -fenable-@var{kind}-@var{pass} @gol
555 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
556 -fira-verbose=@var{n} @gol
557 -flto-report  -flto-report-wpa  -fmem-report-wpa @gol
558 -fmem-report  -fpre-ipa-mem-report  -fpost-ipa-mem-report @gol
559 -fopt-info  -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
560 -fprofile-report @gol
561 -frandom-seed=@var{string}  -fsched-verbose=@var{n} @gol
562 -fsel-sched-verbose  -fsel-sched-dump-cfg  -fsel-sched-pipelining-verbose @gol
563 -fstats  -fstack-usage  -ftime-report  -ftime-report-details @gol
564 -fvar-tracking-assignments-toggle  -gtoggle @gol
565 -print-file-name=@var{library}  -print-libgcc-file-name @gol
566 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
567 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
568 -print-sysroot  -print-sysroot-headers-suffix @gol
569 -save-temps  -save-temps=cwd  -save-temps=obj  -time@r{[}=@var{file}@r{]}}
571 @item Machine-Dependent Options
572 @xref{Submodel Options,,Machine-Dependent Options}.
573 @c This list is ordered alphanumerically by subsection name.
574 @c Try and put the significant identifier (CPU or system) first,
575 @c so users have a clue at guessing where the ones they want will be.
577 @emph{AArch64 Options}
578 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
579 -mgeneral-regs-only @gol
580 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
581 -mstrict-align @gol
582 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
583 -mtls-dialect=desc  -mtls-dialect=traditional @gol
584 -mtls-size=@var{size} @gol
585 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
586 -mfix-cortex-a53-843419  -mno-fix-cortex-a53-843419 @gol
587 -mlow-precision-recip-sqrt  -mno-low-precision-recip-sqrt@gol
588 -mlow-precision-sqrt  -mno-low-precision-sqrt@gol
589 -mlow-precision-div  -mno-low-precision-div @gol
590 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
592 @emph{Adapteva Epiphany Options}
593 @gccoptlist{-mhalf-reg-file  -mprefer-short-insn-regs @gol
594 -mbranch-cost=@var{num}  -mcmove  -mnops=@var{num}  -msoft-cmpsf @gol
595 -msplit-lohi  -mpost-inc  -mpost-modify  -mstack-offset=@var{num} @gol
596 -mround-nearest  -mlong-calls  -mshort-calls  -msmall16 @gol
597 -mfp-mode=@var{mode}  -mvect-double  -max-vect-align=@var{num} @gol
598 -msplit-vecmove-early  -m1reg-@var{reg}}
600 @emph{ARC Options}
601 @gccoptlist{-mbarrel-shifter @gol
602 -mcpu=@var{cpu}  -mA6  -mARC600  -mA7  -mARC700 @gol
603 -mdpfp  -mdpfp-compact  -mdpfp-fast  -mno-dpfp-lrsr @gol
604 -mea  -mno-mpy  -mmul32x16  -mmul64  -matomic @gol
605 -mnorm  -mspfp  -mspfp-compact  -mspfp-fast  -msimd  -msoft-float  -mswap @gol
606 -mcrc  -mdsp-packa  -mdvbf  -mlock  -mmac-d16  -mmac-24  -mrtsc  -mswape @gol
607 -mtelephony  -mxy  -misize  -mannotate-align  -marclinux  -marclinux_prof @gol
608 -mlong-calls  -mmedium-calls  -msdata @gol
609 -mvolatile-cache  -mtp-regno=@var{regno} @gol
610 -malign-call  -mauto-modify-reg  -mbbit-peephole  -mno-brcc @gol
611 -mcase-vector-pcrel  -mcompact-casesi  -mno-cond-exec  -mearly-cbranchsi @gol
612 -mexpand-adddi  -mindexed-loads  -mlra  -mlra-priority-none @gol
613 -mlra-priority-compact mlra-priority-noncompact  -mno-millicode @gol
614 -mmixed-code  -mq-class  -mRcq  -mRcw  -msize-level=@var{level} @gol
615 -mtune=@var{cpu}  -mmultcost=@var{num} @gol
616 -munalign-prob-threshold=@var{probability}  -mmpy-option=@var{multo} @gol
617 -mdiv-rem  -mcode-density  -mll64  -mfpu=@var{fpu}}
619 @emph{ARM Options}
620 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
621 -mabi=@var{name} @gol
622 -mapcs-stack-check  -mno-apcs-stack-check @gol
623 -mapcs-reentrant  -mno-apcs-reentrant @gol
624 -msched-prolog  -mno-sched-prolog @gol
625 -mlittle-endian  -mbig-endian @gol
626 -mfloat-abi=@var{name} @gol
627 -mfp16-format=@var{name}
628 -mthumb-interwork  -mno-thumb-interwork @gol
629 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
630 -mtune=@var{name}  -mprint-tune-info @gol
631 -mstructure-size-boundary=@var{n} @gol
632 -mabort-on-noreturn @gol
633 -mlong-calls  -mno-long-calls @gol
634 -msingle-pic-base  -mno-single-pic-base @gol
635 -mpic-register=@var{reg} @gol
636 -mnop-fun-dllimport @gol
637 -mpoke-function-name @gol
638 -mthumb  -marm @gol
639 -mtpcs-frame  -mtpcs-leaf-frame @gol
640 -mcaller-super-interworking  -mcallee-super-interworking @gol
641 -mtp=@var{name}  -mtls-dialect=@var{dialect} @gol
642 -mword-relocations @gol
643 -mfix-cortex-m3-ldrd @gol
644 -munaligned-access @gol
645 -mneon-for-64bits @gol
646 -mslow-flash-data @gol
647 -masm-syntax-unified @gol
648 -mrestrict-it @gol
649 -mpure-code @gol
650 -mcmse}
652 @emph{AVR Options}
653 @gccoptlist{-mmcu=@var{mcu}  -mabsdata  -maccumulate-args @gol
654 -mbranch-cost=@var{cost} @gol
655 -mcall-prologues  -mint8  -mn_flash=@var{size}  -mno-interrupts @gol
656 -mrelax  -mrmw  -mstrict-X  -mtiny-stack  -mfract-convert-truncate @gol
657 -nodevicelib @gol
658 -Waddr-space-convert  -Wmisspelled-isr}
660 @emph{Blackfin Options}
661 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
662 -msim  -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
663 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
664 -mlow-64k  -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
665 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
666 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
667 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
668 -mfast-fp  -minline-plt  -mmulticore  -mcorea  -mcoreb  -msdram @gol
669 -micplb}
671 @emph{C6X Options}
672 @gccoptlist{-mbig-endian  -mlittle-endian  -march=@var{cpu} @gol
673 -msim  -msdata=@var{sdata-type}}
675 @emph{CRIS Options}
676 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
677 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
678 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
679 -mstack-align  -mdata-align  -mconst-align @gol
680 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
681 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
682 -mmul-bug-workaround  -mno-mul-bug-workaround}
684 @emph{CR16 Options}
685 @gccoptlist{-mmac @gol
686 -mcr16cplus  -mcr16c @gol
687 -msim  -mint32  -mbit-ops
688 -mdata-model=@var{model}}
690 @emph{Darwin Options}
691 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
692 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
693 -client_name  -compatibility_version  -current_version @gol
694 -dead_strip @gol
695 -dependency-file  -dylib_file  -dylinker_install_name @gol
696 -dynamic  -dynamiclib  -exported_symbols_list @gol
697 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
698 -force_flat_namespace  -headerpad_max_install_names @gol
699 -iframework @gol
700 -image_base  -init  -install_name  -keep_private_externs @gol
701 -multi_module  -multiply_defined  -multiply_defined_unused @gol
702 -noall_load   -no_dead_strip_inits_and_terms @gol
703 -nofixprebinding  -nomultidefs  -noprebind  -noseglinkedit @gol
704 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
705 -private_bundle  -read_only_relocs  -sectalign @gol
706 -sectobjectsymbols  -whyload  -seg1addr @gol
707 -sectcreate  -sectobjectsymbols  -sectorder @gol
708 -segaddr  -segs_read_only_addr  -segs_read_write_addr @gol
709 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
710 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
711 -single_module  -static  -sub_library  -sub_umbrella @gol
712 -twolevel_namespace  -umbrella  -undefined @gol
713 -unexported_symbols_list  -weak_reference_mismatches @gol
714 -whatsloaded  -F  -gused  -gfull  -mmacosx-version-min=@var{version} @gol
715 -mkernel  -mone-byte-bool}
717 @emph{DEC Alpha Options}
718 @gccoptlist{-mno-fp-regs  -msoft-float @gol
719 -mieee  -mieee-with-inexact  -mieee-conformant @gol
720 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
721 -mtrap-precision=@var{mode}  -mbuild-constants @gol
722 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
723 -mbwx  -mmax  -mfix  -mcix @gol
724 -mfloat-vax  -mfloat-ieee @gol
725 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
726 -msmall-text  -mlarge-text @gol
727 -mmemory-latency=@var{time}}
729 @emph{FR30 Options}
730 @gccoptlist{-msmall-model  -mno-lsim}
732 @emph{FT32 Options}
733 @gccoptlist{-msim  -mlra  -mnodiv}
735 @emph{FRV Options}
736 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
737 -mhard-float  -msoft-float @gol
738 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
739 -mdouble  -mno-double @gol
740 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
741 -mfdpic  -minline-plt  -mgprel-ro  -multilib-library-pic @gol
742 -mlinked-fp  -mlong-calls  -malign-labels @gol
743 -mlibrary-pic  -macc-4  -macc-8 @gol
744 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
745 -moptimize-membar  -mno-optimize-membar @gol
746 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
747 -mvliw-branch  -mno-vliw-branch @gol
748 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
749 -mno-nested-cond-exec  -mtomcat-stats @gol
750 -mTLS  -mtls @gol
751 -mcpu=@var{cpu}}
753 @emph{GNU/Linux Options}
754 @gccoptlist{-mglibc  -muclibc  -mmusl  -mbionic  -mandroid @gol
755 -tno-android-cc  -tno-android-ld}
757 @emph{H8/300 Options}
758 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr  -mno-exr  -mint32  -malign-300}
760 @emph{HPPA Options}
761 @gccoptlist{-march=@var{architecture-type} @gol
762 -mcaller-copies  -mdisable-fpregs  -mdisable-indexing @gol
763 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
764 -mfixed-range=@var{register-range} @gol
765 -mjump-in-delay  -mlinker-opt  -mlong-calls @gol
766 -mlong-load-store  -mno-disable-fpregs @gol
767 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
768 -mno-jump-in-delay  -mno-long-load-store @gol
769 -mno-portable-runtime  -mno-soft-float @gol
770 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
771 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
772 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
773 -munix=@var{unix-std}  -nolibdld  -static  -threads}
775 @emph{IA-64 Options}
776 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
777 -mvolatile-asm-stop  -mregister-names  -msdata  -mno-sdata @gol
778 -mconstant-gp  -mauto-pic  -mfused-madd @gol
779 -minline-float-divide-min-latency @gol
780 -minline-float-divide-max-throughput @gol
781 -mno-inline-float-divide @gol
782 -minline-int-divide-min-latency @gol
783 -minline-int-divide-max-throughput  @gol
784 -mno-inline-int-divide @gol
785 -minline-sqrt-min-latency  -minline-sqrt-max-throughput @gol
786 -mno-inline-sqrt @gol
787 -mdwarf2-asm  -mearly-stop-bits @gol
788 -mfixed-range=@var{register-range}  -mtls-size=@var{tls-size} @gol
789 -mtune=@var{cpu-type}  -milp32  -mlp64 @gol
790 -msched-br-data-spec  -msched-ar-data-spec  -msched-control-spec @gol
791 -msched-br-in-data-spec  -msched-ar-in-data-spec  -msched-in-control-spec @gol
792 -msched-spec-ldc  -msched-spec-control-ldc @gol
793 -msched-prefer-non-data-spec-insns  -msched-prefer-non-control-spec-insns @gol
794 -msched-stop-bits-after-every-cycle  -msched-count-spec-in-critical-path @gol
795 -msel-sched-dont-check-control-spec  -msched-fp-mem-deps-zero-cost @gol
796 -msched-max-memory-insns-hard-limit  -msched-max-memory-insns=@var{max-insns}}
798 @emph{LM32 Options}
799 @gccoptlist{-mbarrel-shift-enabled  -mdivide-enabled  -mmultiply-enabled @gol
800 -msign-extend-enabled  -muser-enabled}
802 @emph{M32R/D Options}
803 @gccoptlist{-m32r2  -m32rx  -m32r @gol
804 -mdebug @gol
805 -malign-loops  -mno-align-loops @gol
806 -missue-rate=@var{number} @gol
807 -mbranch-cost=@var{number} @gol
808 -mmodel=@var{code-size-model-type} @gol
809 -msdata=@var{sdata-type} @gol
810 -mno-flush-func  -mflush-func=@var{name} @gol
811 -mno-flush-trap  -mflush-trap=@var{number} @gol
812 -G @var{num}}
814 @emph{M32C Options}
815 @gccoptlist{-mcpu=@var{cpu}  -msim  -memregs=@var{number}}
817 @emph{M680x0 Options}
818 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
819 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
820 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
821 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
822 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
823 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
824 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
825 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
826 -mxgot  -mno-xgot  -mlong-jump-table-offsets}
828 @emph{MCore Options}
829 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
830 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
831 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
832 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
833 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
835 @emph{MeP Options}
836 @gccoptlist{-mabsdiff  -mall-opts  -maverage  -mbased=@var{n}  -mbitops @gol
837 -mc=@var{n}  -mclip  -mconfig=@var{name}  -mcop  -mcop32  -mcop64  -mivc2 @gol
838 -mdc  -mdiv  -meb  -mel  -mio-volatile  -ml  -mleadz  -mm  -mminmax @gol
839 -mmult  -mno-opts  -mrepeat  -ms  -msatur  -msdram  -msim  -msimnovec  -mtf @gol
840 -mtiny=@var{n}}
842 @emph{MicroBlaze Options}
843 @gccoptlist{-msoft-float  -mhard-float  -msmall-divides  -mcpu=@var{cpu} @gol
844 -mmemcpy  -mxl-soft-mul  -mxl-soft-div  -mxl-barrel-shift @gol
845 -mxl-pattern-compare  -mxl-stack-check  -mxl-gp-opt  -mno-clearbss @gol
846 -mxl-multiply-high  -mxl-float-convert  -mxl-float-sqrt @gol
847 -mbig-endian  -mlittle-endian  -mxl-reorder  -mxl-mode-@var{app-model}}
849 @emph{MIPS Options}
850 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
851 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
852 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
853 -mips16  -mno-mips16  -mflip-mips16 @gol
854 -minterlink-compressed  -mno-interlink-compressed @gol
855 -minterlink-mips16  -mno-interlink-mips16 @gol
856 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
857 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
858 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
859 -mno-float  -msingle-float  -mdouble-float @gol
860 -modd-spreg  -mno-odd-spreg @gol
861 -mabs=@var{mode}  -mnan=@var{encoding} @gol
862 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
863 -mmcu  -mmno-mcu @gol
864 -meva  -mno-eva @gol
865 -mvirt  -mno-virt @gol
866 -mxpa  -mno-xpa @gol
867 -mmicromips  -mno-micromips @gol
868 -mmsa  -mno-msa @gol
869 -mfpu=@var{fpu-type} @gol
870 -msmartmips  -mno-smartmips @gol
871 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
872 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
873 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
874 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
875 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
876 -membedded-data  -mno-embedded-data @gol
877 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
878 -mcode-readable=@var{setting} @gol
879 -msplit-addresses  -mno-split-addresses @gol
880 -mexplicit-relocs  -mno-explicit-relocs @gol
881 -mcheck-zero-division  -mno-check-zero-division @gol
882 -mdivide-traps  -mdivide-breaks @gol
883 -mload-store-pairs  -mno-load-store-pairs @gol
884 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
885 -mmad  -mno-mad  -mimadd  -mno-imadd  -mfused-madd  -mno-fused-madd  -nocpp @gol
886 -mfix-24k  -mno-fix-24k @gol
887 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
888 -mfix-r10000  -mno-fix-r10000  -mfix-rm7000  -mno-fix-rm7000 @gol
889 -mfix-vr4120  -mno-fix-vr4120 @gol
890 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
891 -mflush-func=@var{func}  -mno-flush-func @gol
892 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
893 -mcompact-branches=@var{policy} @gol
894 -mfp-exceptions  -mno-fp-exceptions @gol
895 -mvr4130-align  -mno-vr4130-align  -msynci  -mno-synci @gol
896 -mlxc1-sxc1 -mno-lxc1-sxc1 -mmadd4 -mno-madd4 @gol
897 -mrelax-pic-calls  -mno-relax-pic-calls  -mmcount-ra-address @gol
898 -mframe-header-opt  -mno-frame-header-opt}
900 @emph{MMIX Options}
901 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
902 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
903 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
904 -mno-base-addresses  -msingle-exit  -mno-single-exit}
906 @emph{MN10300 Options}
907 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
908 -mno-am33  -mam33  -mam33-2  -mam34 @gol
909 -mtune=@var{cpu-type} @gol
910 -mreturn-pointer-on-d0 @gol
911 -mno-crt0  -mrelax  -mliw  -msetlb}
913 @emph{Moxie Options}
914 @gccoptlist{-meb  -mel  -mmul.x  -mno-crt0}
916 @emph{MSP430 Options}
917 @gccoptlist{-msim  -masm-hex  -mmcu=  -mcpu=  -mlarge  -msmall  -mrelax @gol
918 -mwarn-mcu @gol
919 -mcode-region=  -mdata-region= @gol
920 -msilicon-errata=  -msilicon-errata-warn= @gol
921 -mhwmult=  -minrt}
923 @emph{NDS32 Options}
924 @gccoptlist{-mbig-endian  -mlittle-endian @gol
925 -mreduced-regs  -mfull-regs @gol
926 -mcmov  -mno-cmov @gol
927 -mperf-ext  -mno-perf-ext @gol
928 -mv3push  -mno-v3push @gol
929 -m16bit  -mno-16bit @gol
930 -misr-vector-size=@var{num} @gol
931 -mcache-block-size=@var{num} @gol
932 -march=@var{arch} @gol
933 -mcmodel=@var{code-model} @gol
934 -mctor-dtor  -mrelax}
936 @emph{Nios II Options}
937 @gccoptlist{-G @var{num}  -mgpopt=@var{option}  -mgpopt  -mno-gpopt @gol
938 -mel  -meb @gol
939 -mno-bypass-cache  -mbypass-cache @gol
940 -mno-cache-volatile  -mcache-volatile @gol
941 -mno-fast-sw-div  -mfast-sw-div @gol
942 -mhw-mul  -mno-hw-mul  -mhw-mulx  -mno-hw-mulx  -mno-hw-div  -mhw-div @gol
943 -mcustom-@var{insn}=@var{N}  -mno-custom-@var{insn} @gol
944 -mcustom-fpu-cfg=@var{name} @gol
945 -mhal  -msmallc  -msys-crt0=@var{name}  -msys-lib=@var{name} @gol
946 -march=@var{arch}  -mbmx  -mno-bmx  -mcdx  -mno-cdx}
948 @emph{Nvidia PTX Options}
949 @gccoptlist{-m32  -m64  -mmainkernel  -moptimize}
951 @emph{PDP-11 Options}
952 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
953 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
954 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
955 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
956 -mbranch-expensive  -mbranch-cheap @gol
957 -munix-asm  -mdec-asm}
959 @emph{picoChip Options}
960 @gccoptlist{-mae=@var{ae_type}  -mvliw-lookahead=@var{N} @gol
961 -msymbol-as-address  -mno-inefficient-warnings}
963 @emph{PowerPC Options}
964 See RS/6000 and PowerPC Options.
966 @emph{RISC-V Options}
967 @gccoptlist{-mbranch-cost=@var{N-instruction} @gol
968 -mmemcpy  -mno-memcpy @gol
969 -mplt  -mno-plt @gol
970 -mabi=@var{ABI-string} @gol
971 -mfdiv  -mno-fdiv @gol
972 -mdiv  -mno-div @gol
973 -march=@var{ISA-string} @gol
974 -mtune=@var{processor-string} @gol
975 -msmall-data-limit=@var{N-bytes} @gol
976 -msave-restore  -mno-save-restore @gol
977 -mcmodel=@var{code-model} @gol
978 -mexplicit-relocs  -mno-explicit-relocs @gol}
980 @emph{RL78 Options}
981 @gccoptlist{-msim  -mmul=none  -mmul=g13  -mmul=g14  -mallregs @gol
982 -mcpu=g10  -mcpu=g13  -mcpu=g14  -mg10  -mg13  -mg14 @gol
983 -m64bit-doubles  -m32bit-doubles  -msave-mduc-in-interrupts}
985 @emph{RS/6000 and PowerPC Options}
986 @gccoptlist{-mcpu=@var{cpu-type} @gol
987 -mtune=@var{cpu-type} @gol
988 -mcmodel=@var{code-model} @gol
989 -mpowerpc64 @gol
990 -maltivec  -mno-altivec @gol
991 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
992 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
993 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb  -mpopcntd  -mno-popcntd @gol
994 -mfprnd  -mno-fprnd @gol
995 -mcmpb  -mno-cmpb  -mmfpgpr  -mno-mfpgpr  -mhard-dfp  -mno-hard-dfp @gol
996 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
997 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
998 -malign-power  -malign-natural @gol
999 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
1000 -msingle-float  -mdouble-float  -msimple-fpu @gol
1001 -mstring  -mno-string  -mupdate  -mno-update @gol
1002 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
1003 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
1004 -mstrict-align  -mno-strict-align  -mrelocatable @gol
1005 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
1006 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
1007 -mdynamic-no-pic  -maltivec  -mswdiv  -msingle-pic-base @gol
1008 -mprioritize-restricted-insns=@var{priority} @gol
1009 -msched-costly-dep=@var{dependence_type} @gol
1010 -minsert-sched-nops=@var{scheme} @gol
1011 -mcall-sysv  -mcall-netbsd @gol
1012 -maix-struct-return  -msvr4-struct-return @gol
1013 -mabi=@var{abi-type}  -msecure-plt  -mbss-plt @gol
1014 -mblock-move-inline-limit=@var{num} @gol
1015 -misel  -mno-isel @gol
1016 -misel=yes  -misel=no @gol
1017 -mspe  -mno-spe @gol
1018 -mspe=yes  -mspe=no @gol
1019 -mpaired @gol
1020 -mgen-cell-microcode  -mwarn-cell-microcode @gol
1021 -mvrsave  -mno-vrsave @gol
1022 -mmulhw  -mno-mulhw @gol
1023 -mdlmzb  -mno-dlmzb @gol
1024 -mfloat-gprs=yes  -mfloat-gprs=no  -mfloat-gprs=single  -mfloat-gprs=double @gol
1025 -mprototype  -mno-prototype @gol
1026 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1027 -msdata=@var{opt}  -mvxworks  -G @var{num} @gol
1028 -mrecip  -mrecip=@var{opt}  -mno-recip  -mrecip-precision @gol
1029 -mno-recip-precision @gol
1030 -mveclibabi=@var{type}  -mfriz  -mno-friz @gol
1031 -mpointers-to-nested-functions  -mno-pointers-to-nested-functions @gol
1032 -msave-toc-indirect  -mno-save-toc-indirect @gol
1033 -mpower8-fusion  -mno-mpower8-fusion  -mpower8-vector  -mno-power8-vector @gol
1034 -mcrypto  -mno-crypto  -mhtm  -mno-htm  -mdirect-move  -mno-direct-move @gol
1035 -mquad-memory  -mno-quad-memory @gol
1036 -mquad-memory-atomic  -mno-quad-memory-atomic @gol
1037 -mcompat-align-parm  -mno-compat-align-parm @gol
1038 -mupper-regs-df  -mno-upper-regs-df  -mupper-regs-sf  -mno-upper-regs-sf @gol
1039 -mupper-regs-di  -mno-upper-regs-di @gol
1040 -mupper-regs  -mno-upper-regs @gol
1041 -mfloat128  -mno-float128  -mfloat128-hardware  -mno-float128-hardware @gol
1042 -mgnu-attribute  -mno-gnu-attribute @gol
1043 -mstack-protector-guard=@var{guard} -mstack-protector-guard-reg=@var{reg} @gol
1044 -mstack-protector-guard-offset=@var{offset} @gol
1045 -mlra  -mno-lra}
1047 @emph{RX Options}
1048 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1049 -mcpu=@gol
1050 -mbig-endian-data  -mlittle-endian-data @gol
1051 -msmall-data @gol
1052 -msim  -mno-sim@gol
1053 -mas100-syntax  -mno-as100-syntax@gol
1054 -mrelax@gol
1055 -mmax-constant-size=@gol
1056 -mint-register=@gol
1057 -mpid@gol
1058 -mallow-string-insns  -mno-allow-string-insns@gol
1059 -mjsr@gol
1060 -mno-warn-multiple-fast-interrupts@gol
1061 -msave-acc-in-interrupts}
1063 @emph{S/390 and zSeries Options}
1064 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1065 -mhard-float  -msoft-float  -mhard-dfp  -mno-hard-dfp @gol
1066 -mlong-double-64  -mlong-double-128 @gol
1067 -mbackchain  -mno-backchain  -mpacked-stack  -mno-packed-stack @gol
1068 -msmall-exec  -mno-small-exec  -mmvcle  -mno-mvcle @gol
1069 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1070 -mhtm  -mvx  -mzvector @gol
1071 -mtpf-trace  -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1072 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size  -mstack-guard @gol
1073 -mhotpatch=@var{halfwords},@var{halfwords}}
1075 @emph{Score Options}
1076 @gccoptlist{-meb  -mel @gol
1077 -mnhwloop @gol
1078 -muls @gol
1079 -mmac @gol
1080 -mscore5  -mscore5u  -mscore7  -mscore7d}
1082 @emph{SH Options}
1083 @gccoptlist{-m1  -m2  -m2e @gol
1084 -m2a-nofpu  -m2a-single-only  -m2a-single  -m2a @gol
1085 -m3  -m3e @gol
1086 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1087 -m4a-nofpu  -m4a-single-only  -m4a-single  -m4a  -m4al @gol
1088 -mb  -ml  -mdalign  -mrelax @gol
1089 -mbigtable  -mfmovd  -mrenesas  -mno-renesas  -mnomacsave @gol
1090 -mieee  -mno-ieee  -mbitops  -misize  -minline-ic_invalidate  -mpadstruct @gol
1091 -mprefergot  -musermode  -multcost=@var{number}  -mdiv=@var{strategy} @gol
1092 -mdivsi3_libfunc=@var{name}  -mfixed-range=@var{register-range} @gol
1093 -maccumulate-outgoing-args @gol
1094 -matomic-model=@var{atomic-model} @gol
1095 -mbranch-cost=@var{num}  -mzdcbranch  -mno-zdcbranch @gol
1096 -mcbranch-force-delay-slot @gol
1097 -mfused-madd  -mno-fused-madd  -mfsca  -mno-fsca  -mfsrra  -mno-fsrra @gol
1098 -mpretend-cmove  -mtas}
1100 @emph{Solaris 2 Options}
1101 @gccoptlist{-mclear-hwcap  -mno-clear-hwcap  -mimpure-text  -mno-impure-text @gol
1102 -pthreads}
1104 @emph{SPARC Options}
1105 @gccoptlist{-mcpu=@var{cpu-type} @gol
1106 -mtune=@var{cpu-type} @gol
1107 -mcmodel=@var{code-model} @gol
1108 -mmemory-model=@var{mem-model} @gol
1109 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1110 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1111 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1112 -mhard-quad-float  -msoft-quad-float @gol
1113 -mstack-bias  -mno-stack-bias @gol
1114 -mstd-struct-return  -mno-std-struct-return @gol
1115 -munaligned-doubles  -mno-unaligned-doubles @gol
1116 -muser-mode  -mno-user-mode @gol
1117 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1118 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1119 -mcbcond  -mno-cbcond  -mfmaf  -mno-fmaf  @gol
1120 -mpopc  -mno-popc  -msubxc  -mno-subxc@gol
1121 -mfix-at697f  -mfix-ut699 @gol
1122 -mlra  -mno-lra}
1124 @emph{SPU Options}
1125 @gccoptlist{-mwarn-reloc  -merror-reloc @gol
1126 -msafe-dma  -munsafe-dma @gol
1127 -mbranch-hints @gol
1128 -msmall-mem  -mlarge-mem  -mstdmain @gol
1129 -mfixed-range=@var{register-range} @gol
1130 -mea32  -mea64 @gol
1131 -maddress-space-conversion  -mno-address-space-conversion @gol
1132 -mcache-size=@var{cache-size} @gol
1133 -matomic-updates  -mno-atomic-updates}
1135 @emph{System V Options}
1136 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1138 @emph{TILE-Gx Options}
1139 @gccoptlist{-mcpu=CPU  -m32  -m64  -mbig-endian  -mlittle-endian @gol
1140 -mcmodel=@var{code-model}}
1142 @emph{TILEPro Options}
1143 @gccoptlist{-mcpu=@var{cpu}  -m32}
1145 @emph{V850 Options}
1146 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1147 -mprolog-function  -mno-prolog-function  -mspace @gol
1148 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1149 -mapp-regs  -mno-app-regs @gol
1150 -mdisable-callt  -mno-disable-callt @gol
1151 -mv850e2v3  -mv850e2  -mv850e1  -mv850es @gol
1152 -mv850e  -mv850  -mv850e3v5 @gol
1153 -mloop @gol
1154 -mrelax @gol
1155 -mlong-jumps @gol
1156 -msoft-float @gol
1157 -mhard-float @gol
1158 -mgcc-abi @gol
1159 -mrh850-abi @gol
1160 -mbig-switch}
1162 @emph{VAX Options}
1163 @gccoptlist{-mg  -mgnu  -munix}
1165 @emph{Visium Options}
1166 @gccoptlist{-mdebug  -msim  -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1167 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type}  -msv-mode  -muser-mode}
1169 @emph{VMS Options}
1170 @gccoptlist{-mvms-return-codes  -mdebug-main=@var{prefix}  -mmalloc64 @gol
1171 -mpointer-size=@var{size}}
1173 @emph{VxWorks Options}
1174 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1175 -Xbind-lazy  -Xbind-now}
1177 @emph{x86 Options}
1178 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1179 -mtune-ctrl=@var{feature-list}  -mdump-tune-features  -mno-default @gol
1180 -mfpmath=@var{unit} @gol
1181 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1182 -mno-fp-ret-in-387  -m80387  -mhard-float  -msoft-float @gol
1183 -mno-wide-multiply  -mrtd  -malign-double @gol
1184 -mpreferred-stack-boundary=@var{num} @gol
1185 -mincoming-stack-boundary=@var{num} @gol
1186 -mcld  -mcx16  -msahf  -mmovbe  -mcrc32 @gol
1187 -mrecip  -mrecip=@var{opt} @gol
1188 -mvzeroupper  -mprefer-avx128 @gol
1189 -mmmx  -msse  -msse2  -msse3  -mssse3  -msse4.1  -msse4.2  -msse4  -mavx @gol
1190 -mavx2  -mavx512f  -mavx512pf  -mavx512er  -mavx512cd  -mavx512vl @gol
1191 -mavx512bw  -mavx512dq  -mavx512ifma  -mavx512vbmi  -msha  -maes @gol
1192 -mpclmul  -mfsgsbase  -mrdrnd  -mf16c  -mfma @gol
1193 -mprefetchwt1  -mclflushopt  -mxsavec  -mxsaves @gol
1194 -msse4a  -m3dnow  -m3dnowa  -mpopcnt  -mabm  -mbmi  -mtbm  -mfma4  -mxop @gol
1195 -mlzcnt  -mbmi2  -mfxsr  -mxsave  -mxsaveopt  -mrtm  -mlwp  -mmpx  @gol
1196 -mmwaitx  -mclzero  -mpku  -mthreads @gol
1197 -mms-bitfields  -mno-align-stringops  -minline-all-stringops @gol
1198 -minline-stringops-dynamically  -mstringop-strategy=@var{alg} @gol
1199 -mmemcpy-strategy=@var{strategy}  -mmemset-strategy=@var{strategy} @gol
1200 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1201 -m96bit-long-double  -mlong-double-64  -mlong-double-80  -mlong-double-128 @gol
1202 -mregparm=@var{num}  -msseregparm @gol
1203 -mveclibabi=@var{type}  -mvect8-ret-in-mem @gol
1204 -mpc32  -mpc64  -mpc80  -mstackrealign @gol
1205 -momit-leaf-frame-pointer  -mno-red-zone  -mno-tls-direct-seg-refs @gol
1206 -mcmodel=@var{code-model}  -mabi=@var{name}  -maddress-mode=@var{mode} @gol
1207 -m32  -m64  -mx32  -m16  -miamcu  -mlarge-data-threshold=@var{num} @gol
1208 -msse2avx  -mfentry  -mrecord-mcount  -mnop-mcount  -m8bit-idiv @gol
1209 -mavx256-split-unaligned-load  -mavx256-split-unaligned-store @gol
1210 -malign-data=@var{type}  -mstack-protector-guard=@var{guard} @gol
1211 -mmitigate-rop  -mgeneral-regs-only}
1213 @emph{x86 Windows Options}
1214 @gccoptlist{-mconsole  -mcygwin  -mno-cygwin  -mdll @gol
1215 -mnop-fun-dllimport  -mthread @gol
1216 -municode  -mwin32  -mwindows  -fno-set-stack-executable}
1218 @emph{Xstormy16 Options}
1219 @gccoptlist{-msim}
1221 @emph{Xtensa Options}
1222 @gccoptlist{-mconst16  -mno-const16 @gol
1223 -mfused-madd  -mno-fused-madd @gol
1224 -mforce-no-pic @gol
1225 -mserialize-volatile  -mno-serialize-volatile @gol
1226 -mtext-section-literals  -mno-text-section-literals @gol
1227 -mauto-litpools  -mno-auto-litpools @gol
1228 -mtarget-align  -mno-target-align @gol
1229 -mlongcalls  -mno-longcalls}
1231 @emph{zSeries Options}
1232 See S/390 and zSeries Options.
1233 @end table
1236 @node Overall Options
1237 @section Options Controlling the Kind of Output
1239 Compilation can involve up to four stages: preprocessing, compilation
1240 proper, assembly and linking, always in that order.  GCC is capable of
1241 preprocessing and compiling several files either into several
1242 assembler input files, or into one assembler input file; then each
1243 assembler input file produces an object file, and linking combines all
1244 the object files (those newly compiled, and those specified as input)
1245 into an executable file.
1247 @cindex file name suffix
1248 For any given input file, the file name suffix determines what kind of
1249 compilation is done:
1251 @table @gcctabopt
1252 @item @var{file}.c
1253 C source code that must be preprocessed.
1255 @item @var{file}.i
1256 C source code that should not be preprocessed.
1258 @item @var{file}.ii
1259 C++ source code that should not be preprocessed.
1261 @item @var{file}.m
1262 Objective-C source code.  Note that you must link with the @file{libobjc}
1263 library to make an Objective-C program work.
1265 @item @var{file}.mi
1266 Objective-C source code that should not be preprocessed.
1268 @item @var{file}.mm
1269 @itemx @var{file}.M
1270 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1271 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1272 to a literal capital M@.
1274 @item @var{file}.mii
1275 Objective-C++ source code that should not be preprocessed.
1277 @item @var{file}.h
1278 C, C++, Objective-C or Objective-C++ header file to be turned into a
1279 precompiled header (default), or C, C++ header file to be turned into an
1280 Ada spec (via the @option{-fdump-ada-spec} switch).
1282 @item @var{file}.cc
1283 @itemx @var{file}.cp
1284 @itemx @var{file}.cxx
1285 @itemx @var{file}.cpp
1286 @itemx @var{file}.CPP
1287 @itemx @var{file}.c++
1288 @itemx @var{file}.C
1289 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1290 the last two letters must both be literally @samp{x}.  Likewise,
1291 @samp{.C} refers to a literal capital C@.
1293 @item @var{file}.mm
1294 @itemx @var{file}.M
1295 Objective-C++ source code that must be preprocessed.
1297 @item @var{file}.mii
1298 Objective-C++ source code that should not be preprocessed.
1300 @item @var{file}.hh
1301 @itemx @var{file}.H
1302 @itemx @var{file}.hp
1303 @itemx @var{file}.hxx
1304 @itemx @var{file}.hpp
1305 @itemx @var{file}.HPP
1306 @itemx @var{file}.h++
1307 @itemx @var{file}.tcc
1308 C++ header file to be turned into a precompiled header or Ada spec.
1310 @item @var{file}.f
1311 @itemx @var{file}.for
1312 @itemx @var{file}.ftn
1313 Fixed form Fortran source code that should not be preprocessed.
1315 @item @var{file}.F
1316 @itemx @var{file}.FOR
1317 @itemx @var{file}.fpp
1318 @itemx @var{file}.FPP
1319 @itemx @var{file}.FTN
1320 Fixed form Fortran source code that must be preprocessed (with the traditional
1321 preprocessor).
1323 @item @var{file}.f90
1324 @itemx @var{file}.f95
1325 @itemx @var{file}.f03
1326 @itemx @var{file}.f08
1327 Free form Fortran source code that should not be preprocessed.
1329 @item @var{file}.F90
1330 @itemx @var{file}.F95
1331 @itemx @var{file}.F03
1332 @itemx @var{file}.F08
1333 Free form Fortran source code that must be preprocessed (with the
1334 traditional preprocessor).
1336 @item @var{file}.go
1337 Go source code.
1339 @item @var{file}.brig
1340 BRIG files (binary representation of HSAIL).
1342 @item @var{file}.ads
1343 Ada source code file that contains a library unit declaration (a
1344 declaration of a package, subprogram, or generic, or a generic
1345 instantiation), or a library unit renaming declaration (a package,
1346 generic, or subprogram renaming declaration).  Such files are also
1347 called @dfn{specs}.
1349 @item @var{file}.adb
1350 Ada source code file containing a library unit body (a subprogram or
1351 package body).  Such files are also called @dfn{bodies}.
1353 @c GCC also knows about some suffixes for languages not yet included:
1354 @c Pascal:
1355 @c @var{file}.p
1356 @c @var{file}.pas
1357 @c Ratfor:
1358 @c @var{file}.r
1360 @item @var{file}.s
1361 Assembler code.
1363 @item @var{file}.S
1364 @itemx @var{file}.sx
1365 Assembler code that must be preprocessed.
1367 @item @var{other}
1368 An object file to be fed straight into linking.
1369 Any file name with no recognized suffix is treated this way.
1370 @end table
1372 @opindex x
1373 You can specify the input language explicitly with the @option{-x} option:
1375 @table @gcctabopt
1376 @item -x @var{language}
1377 Specify explicitly the @var{language} for the following input files
1378 (rather than letting the compiler choose a default based on the file
1379 name suffix).  This option applies to all following input files until
1380 the next @option{-x} option.  Possible values for @var{language} are:
1381 @smallexample
1382 c  c-header  cpp-output
1383 c++  c++-header  c++-cpp-output
1384 objective-c  objective-c-header  objective-c-cpp-output
1385 objective-c++ objective-c++-header objective-c++-cpp-output
1386 assembler  assembler-with-cpp
1388 f77  f77-cpp-input f95  f95-cpp-input
1390 brig
1391 @end smallexample
1393 @item -x none
1394 Turn off any specification of a language, so that subsequent files are
1395 handled according to their file name suffixes (as they are if @option{-x}
1396 has not been used at all).
1397 @end table
1399 If you only want some of the stages of compilation, you can use
1400 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1401 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1402 @command{gcc} is to stop.  Note that some combinations (for example,
1403 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1405 @table @gcctabopt
1406 @item -c
1407 @opindex c
1408 Compile or assemble the source files, but do not link.  The linking
1409 stage simply is not done.  The ultimate output is in the form of an
1410 object file for each source file.
1412 By default, the object file name for a source file is made by replacing
1413 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1415 Unrecognized input files, not requiring compilation or assembly, are
1416 ignored.
1418 @item -S
1419 @opindex S
1420 Stop after the stage of compilation proper; do not assemble.  The output
1421 is in the form of an assembler code file for each non-assembler input
1422 file specified.
1424 By default, the assembler file name for a source file is made by
1425 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1427 Input files that don't require compilation are ignored.
1429 @item -E
1430 @opindex E
1431 Stop after the preprocessing stage; do not run the compiler proper.  The
1432 output is in the form of preprocessed source code, which is sent to the
1433 standard output.
1435 Input files that don't require preprocessing are ignored.
1437 @cindex output file option
1438 @item -o @var{file}
1439 @opindex o
1440 Place output in file @var{file}.  This applies to whatever
1441 sort of output is being produced, whether it be an executable file,
1442 an object file, an assembler file or preprocessed C code.
1444 If @option{-o} is not specified, the default is to put an executable
1445 file in @file{a.out}, the object file for
1446 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1447 assembler file in @file{@var{source}.s}, a precompiled header file in
1448 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1449 standard output.
1451 @item -v
1452 @opindex v
1453 Print (on standard error output) the commands executed to run the stages
1454 of compilation.  Also print the version number of the compiler driver
1455 program and of the preprocessor and the compiler proper.
1457 @item -###
1458 @opindex ###
1459 Like @option{-v} except the commands are not executed and arguments
1460 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1461 This is useful for shell scripts to capture the driver-generated command lines.
1463 @item --help
1464 @opindex help
1465 Print (on the standard output) a description of the command-line options
1466 understood by @command{gcc}.  If the @option{-v} option is also specified
1467 then @option{--help} is also passed on to the various processes
1468 invoked by @command{gcc}, so that they can display the command-line options
1469 they accept.  If the @option{-Wextra} option has also been specified
1470 (prior to the @option{--help} option), then command-line options that
1471 have no documentation associated with them are also displayed.
1473 @item --target-help
1474 @opindex target-help
1475 Print (on the standard output) a description of target-specific command-line
1476 options for each tool.  For some targets extra target-specific
1477 information may also be printed.
1479 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1480 Print (on the standard output) a description of the command-line
1481 options understood by the compiler that fit into all specified classes
1482 and qualifiers.  These are the supported classes:
1484 @table @asis
1485 @item @samp{optimizers}
1486 Display all of the optimization options supported by the
1487 compiler.
1489 @item @samp{warnings}
1490 Display all of the options controlling warning messages
1491 produced by the compiler.
1493 @item @samp{target}
1494 Display target-specific options.  Unlike the
1495 @option{--target-help} option however, target-specific options of the
1496 linker and assembler are not displayed.  This is because those
1497 tools do not currently support the extended @option{--help=} syntax.
1499 @item @samp{params}
1500 Display the values recognized by the @option{--param}
1501 option.
1503 @item @var{language}
1504 Display the options supported for @var{language}, where
1505 @var{language} is the name of one of the languages supported in this
1506 version of GCC@.
1508 @item @samp{common}
1509 Display the options that are common to all languages.
1510 @end table
1512 These are the supported qualifiers:
1514 @table @asis
1515 @item @samp{undocumented}
1516 Display only those options that are undocumented.
1518 @item @samp{joined}
1519 Display options taking an argument that appears after an equal
1520 sign in the same continuous piece of text, such as:
1521 @samp{--help=target}.
1523 @item @samp{separate}
1524 Display options taking an argument that appears as a separate word
1525 following the original option, such as: @samp{-o output-file}.
1526 @end table
1528 Thus for example to display all the undocumented target-specific
1529 switches supported by the compiler, use:
1531 @smallexample
1532 --help=target,undocumented
1533 @end smallexample
1535 The sense of a qualifier can be inverted by prefixing it with the
1536 @samp{^} character, so for example to display all binary warning
1537 options (i.e., ones that are either on or off and that do not take an
1538 argument) that have a description, use:
1540 @smallexample
1541 --help=warnings,^joined,^undocumented
1542 @end smallexample
1544 The argument to @option{--help=} should not consist solely of inverted
1545 qualifiers.
1547 Combining several classes is possible, although this usually
1548 restricts the output so much that there is nothing to display.  One
1549 case where it does work, however, is when one of the classes is
1550 @var{target}.  For example, to display all the target-specific
1551 optimization options, use:
1553 @smallexample
1554 --help=target,optimizers
1555 @end smallexample
1557 The @option{--help=} option can be repeated on the command line.  Each
1558 successive use displays its requested class of options, skipping
1559 those that have already been displayed.
1561 If the @option{-Q} option appears on the command line before the
1562 @option{--help=} option, then the descriptive text displayed by
1563 @option{--help=} is changed.  Instead of describing the displayed
1564 options, an indication is given as to whether the option is enabled,
1565 disabled or set to a specific value (assuming that the compiler
1566 knows this at the point where the @option{--help=} option is used).
1568 Here is a truncated example from the ARM port of @command{gcc}:
1570 @smallexample
1571   % gcc -Q -mabi=2 --help=target -c
1572   The following options are target specific:
1573   -mabi=                                2
1574   -mabort-on-noreturn                   [disabled]
1575   -mapcs                                [disabled]
1576 @end smallexample
1578 The output is sensitive to the effects of previous command-line
1579 options, so for example it is possible to find out which optimizations
1580 are enabled at @option{-O2} by using:
1582 @smallexample
1583 -Q -O2 --help=optimizers
1584 @end smallexample
1586 Alternatively you can discover which binary optimizations are enabled
1587 by @option{-O3} by using:
1589 @smallexample
1590 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1591 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1592 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1593 @end smallexample
1595 @item --version
1596 @opindex version
1597 Display the version number and copyrights of the invoked GCC@.
1599 @item -pass-exit-codes
1600 @opindex pass-exit-codes
1601 Normally the @command{gcc} program exits with the code of 1 if any
1602 phase of the compiler returns a non-success return code.  If you specify
1603 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1604 the numerically highest error produced by any phase returning an error
1605 indication.  The C, C++, and Fortran front ends return 4 if an internal
1606 compiler error is encountered.
1608 @item -pipe
1609 @opindex pipe
1610 Use pipes rather than temporary files for communication between the
1611 various stages of compilation.  This fails to work on some systems where
1612 the assembler is unable to read from a pipe; but the GNU assembler has
1613 no trouble.
1615 @item -specs=@var{file}
1616 @opindex specs
1617 Process @var{file} after the compiler reads in the standard @file{specs}
1618 file, in order to override the defaults which the @command{gcc} driver
1619 program uses when determining what switches to pass to @command{cc1},
1620 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1621 @option{-specs=@var{file}} can be specified on the command line, and they
1622 are processed in order, from left to right.  @xref{Spec Files}, for
1623 information about the format of the @var{file}.
1625 @item -wrapper
1626 @opindex wrapper
1627 Invoke all subcommands under a wrapper program.  The name of the
1628 wrapper program and its parameters are passed as a comma separated
1629 list.
1631 @smallexample
1632 gcc -c t.c -wrapper gdb,--args
1633 @end smallexample
1635 @noindent
1636 This invokes all subprograms of @command{gcc} under
1637 @samp{gdb --args}, thus the invocation of @command{cc1} is
1638 @samp{gdb --args cc1 @dots{}}.
1640 @item -fplugin=@var{name}.so
1641 @opindex fplugin
1642 Load the plugin code in file @var{name}.so, assumed to be a
1643 shared object to be dlopen'd by the compiler.  The base name of
1644 the shared object file is used to identify the plugin for the
1645 purposes of argument parsing (See
1646 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1647 Each plugin should define the callback functions specified in the
1648 Plugins API.
1650 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1651 @opindex fplugin-arg
1652 Define an argument called @var{key} with a value of @var{value}
1653 for the plugin called @var{name}.
1655 @item -fdump-ada-spec@r{[}-slim@r{]}
1656 @opindex fdump-ada-spec
1657 For C and C++ source and include files, generate corresponding Ada specs.
1658 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1659 GNAT User's Guide}, which provides detailed documentation on this feature.
1661 @item -fada-spec-parent=@var{unit}
1662 @opindex fada-spec-parent
1663 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1664 Ada specs as child units of parent @var{unit}.
1666 @item -fdump-go-spec=@var{file}
1667 @opindex fdump-go-spec
1668 For input files in any language, generate corresponding Go
1669 declarations in @var{file}.  This generates Go @code{const},
1670 @code{type}, @code{var}, and @code{func} declarations which may be a
1671 useful way to start writing a Go interface to code written in some
1672 other language.
1674 @include @value{srcdir}/../libiberty/at-file.texi
1675 @end table
1677 @node Invoking G++
1678 @section Compiling C++ Programs
1680 @cindex suffixes for C++ source
1681 @cindex C++ source file suffixes
1682 C++ source files conventionally use one of the suffixes @samp{.C},
1683 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1684 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1685 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1686 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1687 files with these names and compiles them as C++ programs even if you
1688 call the compiler the same way as for compiling C programs (usually
1689 with the name @command{gcc}).
1691 @findex g++
1692 @findex c++
1693 However, the use of @command{gcc} does not add the C++ library.
1694 @command{g++} is a program that calls GCC and automatically specifies linking
1695 against the C++ library.  It treats @samp{.c},
1696 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1697 files unless @option{-x} is used.  This program is also useful when
1698 precompiling a C header file with a @samp{.h} extension for use in C++
1699 compilations.  On many systems, @command{g++} is also installed with
1700 the name @command{c++}.
1702 @cindex invoking @command{g++}
1703 When you compile C++ programs, you may specify many of the same
1704 command-line options that you use for compiling programs in any
1705 language; or command-line options meaningful for C and related
1706 languages; or options that are meaningful only for C++ programs.
1707 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1708 explanations of options for languages related to C@.
1709 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1710 explanations of options that are meaningful only for C++ programs.
1712 @node C Dialect Options
1713 @section Options Controlling C Dialect
1714 @cindex dialect options
1715 @cindex language dialect options
1716 @cindex options, dialect
1718 The following options control the dialect of C (or languages derived
1719 from C, such as C++, Objective-C and Objective-C++) that the compiler
1720 accepts:
1722 @table @gcctabopt
1723 @cindex ANSI support
1724 @cindex ISO support
1725 @item -ansi
1726 @opindex ansi
1727 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1728 equivalent to @option{-std=c++98}.
1730 This turns off certain features of GCC that are incompatible with ISO
1731 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1732 such as the @code{asm} and @code{typeof} keywords, and
1733 predefined macros such as @code{unix} and @code{vax} that identify the
1734 type of system you are using.  It also enables the undesirable and
1735 rarely used ISO trigraph feature.  For the C compiler,
1736 it disables recognition of C++ style @samp{//} comments as well as
1737 the @code{inline} keyword.
1739 The alternate keywords @code{__asm__}, @code{__extension__},
1740 @code{__inline__} and @code{__typeof__} continue to work despite
1741 @option{-ansi}.  You would not want to use them in an ISO C program, of
1742 course, but it is useful to put them in header files that might be included
1743 in compilations done with @option{-ansi}.  Alternate predefined macros
1744 such as @code{__unix__} and @code{__vax__} are also available, with or
1745 without @option{-ansi}.
1747 The @option{-ansi} option does not cause non-ISO programs to be
1748 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1749 addition to @option{-ansi}.  @xref{Warning Options}.
1751 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1752 option is used.  Some header files may notice this macro and refrain
1753 from declaring certain functions or defining certain macros that the
1754 ISO standard doesn't call for; this is to avoid interfering with any
1755 programs that might use these names for other things.
1757 Functions that are normally built in but do not have semantics
1758 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1759 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1760 built-in functions provided by GCC}, for details of the functions
1761 affected.
1763 @item -std=
1764 @opindex std
1765 Determine the language standard. @xref{Standards,,Language Standards
1766 Supported by GCC}, for details of these standard versions.  This option
1767 is currently only supported when compiling C or C++.
1769 The compiler can accept several base standards, such as @samp{c90} or
1770 @samp{c++98}, and GNU dialects of those standards, such as
1771 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1772 compiler accepts all programs following that standard plus those
1773 using GNU extensions that do not contradict it.  For example,
1774 @option{-std=c90} turns off certain features of GCC that are
1775 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1776 keywords, but not other GNU extensions that do not have a meaning in
1777 ISO C90, such as omitting the middle term of a @code{?:}
1778 expression. On the other hand, when a GNU dialect of a standard is
1779 specified, all features supported by the compiler are enabled, even when
1780 those features change the meaning of the base standard.  As a result, some
1781 strict-conforming programs may be rejected.  The particular standard
1782 is used by @option{-Wpedantic} to identify which features are GNU
1783 extensions given that version of the standard. For example
1784 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1785 comments, while @option{-std=gnu99 -Wpedantic} does not.
1787 A value for this option must be provided; possible values are
1789 @table @samp
1790 @item c90
1791 @itemx c89
1792 @itemx iso9899:1990
1793 Support all ISO C90 programs (certain GNU extensions that conflict
1794 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1796 @item iso9899:199409
1797 ISO C90 as modified in amendment 1.
1799 @item c99
1800 @itemx c9x
1801 @itemx iso9899:1999
1802 @itemx iso9899:199x
1803 ISO C99.  This standard is substantially completely supported, modulo
1804 bugs and floating-point issues
1805 (mainly but not entirely relating to optional C99 features from
1806 Annexes F and G).  See
1807 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1808 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1810 @item c11
1811 @itemx c1x
1812 @itemx iso9899:2011
1813 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1814 substantially completely supported, modulo bugs, floating-point issues
1815 (mainly but not entirely relating to optional C11 features from
1816 Annexes F and G) and the optional Annexes K (Bounds-checking
1817 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1819 @item gnu90
1820 @itemx gnu89
1821 GNU dialect of ISO C90 (including some C99 features).
1823 @item gnu99
1824 @itemx gnu9x
1825 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1827 @item gnu11
1828 @itemx gnu1x
1829 GNU dialect of ISO C11.  This is the default for C code.
1830 The name @samp{gnu1x} is deprecated.
1832 @item c++98
1833 @itemx c++03
1834 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1835 additional defect reports. Same as @option{-ansi} for C++ code.
1837 @item gnu++98
1838 @itemx gnu++03
1839 GNU dialect of @option{-std=c++98}.
1841 @item c++11
1842 @itemx c++0x
1843 The 2011 ISO C++ standard plus amendments.
1844 The name @samp{c++0x} is deprecated.
1846 @item gnu++11
1847 @itemx gnu++0x
1848 GNU dialect of @option{-std=c++11}.
1849 The name @samp{gnu++0x} is deprecated.
1851 @item c++14
1852 @itemx c++1y
1853 The 2014 ISO C++ standard plus amendments.
1854 The name @samp{c++1y} is deprecated.
1856 @item gnu++14
1857 @itemx gnu++1y
1858 GNU dialect of @option{-std=c++14}.
1859 This is the default for C++ code.
1860 The name @samp{gnu++1y} is deprecated.
1862 @item c++1z
1863 The next revision of the ISO C++ standard, tentatively planned for
1864 2017.  Support is highly experimental, and will almost certainly
1865 change in incompatible ways in future releases.
1867 @item gnu++1z
1868 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1869 and will almost certainly change in incompatible ways in future
1870 releases.
1871 @end table
1873 @item -fgnu89-inline
1874 @opindex fgnu89-inline
1875 The option @option{-fgnu89-inline} tells GCC to use the traditional
1876 GNU semantics for @code{inline} functions when in C99 mode.
1877 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1878 Using this option is roughly equivalent to adding the
1879 @code{gnu_inline} function attribute to all inline functions
1880 (@pxref{Function Attributes}).
1882 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1883 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1884 specifies the default behavior).
1885 This option is not supported in @option{-std=c90} or
1886 @option{-std=gnu90} mode.
1888 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1889 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1890 in effect for @code{inline} functions.  @xref{Common Predefined
1891 Macros,,,cpp,The C Preprocessor}.
1893 @item -fpermitted-flt-eval-methods=@var{style}
1894 @opindex fpermitted-flt-eval-methods
1895 @opindex fpermitted-flt-eval-methods=c11
1896 @opindex fpermitted-flt-eval-methods=ts-18661-3
1897 ISO/IEC TS 18661-3 defines new permissible values for
1898 @code{FLT_EVAL_METHOD} that indicate that operations and constants with
1899 a semantic type that is an interchange or extended format should be
1900 evaluated to the precision and range of that type.  These new values are
1901 a superset of those permitted under C99/C11, which does not specify the
1902 meaning of other positive values of @code{FLT_EVAL_METHOD}.  As such, code
1903 conforming to C11 may not have been written expecting the possibility of
1904 the new values.
1906 @option{-fpermitted-flt-eval-methods} specifies whether the compiler
1907 should allow only the values of @code{FLT_EVAL_METHOD} specified in C99/C11,
1908 or the extended set of values specified in ISO/IEC TS 18661-3.
1910 @var{style} is either @code{c11} or @code{ts-18661-3} as appropriate.
1912 The default when in a standards compliant mode (@option{-std=c11} or similar)
1913 is @option{-fpermitted-flt-eval-methods=c11}.  The default when in a GNU
1914 dialect (@option{-std=gnu11} or similar) is
1915 @option{-fpermitted-flt-eval-methods=ts-18661-3}.
1917 @item -aux-info @var{filename}
1918 @opindex aux-info
1919 Output to the given filename prototyped declarations for all functions
1920 declared and/or defined in a translation unit, including those in header
1921 files.  This option is silently ignored in any language other than C@.
1923 Besides declarations, the file indicates, in comments, the origin of
1924 each declaration (source file and line), whether the declaration was
1925 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1926 @samp{O} for old, respectively, in the first character after the line
1927 number and the colon), and whether it came from a declaration or a
1928 definition (@samp{C} or @samp{F}, respectively, in the following
1929 character).  In the case of function definitions, a K&R-style list of
1930 arguments followed by their declarations is also provided, inside
1931 comments, after the declaration.
1933 @item -fallow-parameterless-variadic-functions
1934 @opindex fallow-parameterless-variadic-functions
1935 Accept variadic functions without named parameters.
1937 Although it is possible to define such a function, this is not very
1938 useful as it is not possible to read the arguments.  This is only
1939 supported for C as this construct is allowed by C++.
1941 @item -fno-asm
1942 @opindex fno-asm
1943 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1944 keyword, so that code can use these words as identifiers.  You can use
1945 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1946 instead.  @option{-ansi} implies @option{-fno-asm}.
1948 In C++, this switch only affects the @code{typeof} keyword, since
1949 @code{asm} and @code{inline} are standard keywords.  You may want to
1950 use the @option{-fno-gnu-keywords} flag instead, which has the same
1951 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1952 switch only affects the @code{asm} and @code{typeof} keywords, since
1953 @code{inline} is a standard keyword in ISO C99.
1955 @item -fno-builtin
1956 @itemx -fno-builtin-@var{function}
1957 @opindex fno-builtin
1958 @cindex built-in functions
1959 Don't recognize built-in functions that do not begin with
1960 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1961 functions provided by GCC}, for details of the functions affected,
1962 including those which are not built-in functions when @option{-ansi} or
1963 @option{-std} options for strict ISO C conformance are used because they
1964 do not have an ISO standard meaning.
1966 GCC normally generates special code to handle certain built-in functions
1967 more efficiently; for instance, calls to @code{alloca} may become single
1968 instructions which adjust the stack directly, and calls to @code{memcpy}
1969 may become inline copy loops.  The resulting code is often both smaller
1970 and faster, but since the function calls no longer appear as such, you
1971 cannot set a breakpoint on those calls, nor can you change the behavior
1972 of the functions by linking with a different library.  In addition,
1973 when a function is recognized as a built-in function, GCC may use
1974 information about that function to warn about problems with calls to
1975 that function, or to generate more efficient code, even if the
1976 resulting code still contains calls to that function.  For example,
1977 warnings are given with @option{-Wformat} for bad calls to
1978 @code{printf} when @code{printf} is built in and @code{strlen} is
1979 known not to modify global memory.
1981 With the @option{-fno-builtin-@var{function}} option
1982 only the built-in function @var{function} is
1983 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1984 function is named that is not built-in in this version of GCC, this
1985 option is ignored.  There is no corresponding
1986 @option{-fbuiltin-@var{function}} option; if you wish to enable
1987 built-in functions selectively when using @option{-fno-builtin} or
1988 @option{-ffreestanding}, you may define macros such as:
1990 @smallexample
1991 #define abs(n)          __builtin_abs ((n))
1992 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1993 @end smallexample
1995 @item -fgimple
1996 @opindex fgimple
1998 Enable parsing of function definitions marked with @code{__GIMPLE}.
1999 This is an experimental feature that allows unit testing of GIMPLE
2000 passes.
2002 @item -fhosted
2003 @opindex fhosted
2004 @cindex hosted environment
2006 Assert that compilation targets a hosted environment.  This implies
2007 @option{-fbuiltin}.  A hosted environment is one in which the
2008 entire standard library is available, and in which @code{main} has a return
2009 type of @code{int}.  Examples are nearly everything except a kernel.
2010 This is equivalent to @option{-fno-freestanding}.
2012 @item -ffreestanding
2013 @opindex ffreestanding
2014 @cindex hosted environment
2016 Assert that compilation targets a freestanding environment.  This
2017 implies @option{-fno-builtin}.  A freestanding environment
2018 is one in which the standard library may not exist, and program startup may
2019 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
2020 This is equivalent to @option{-fno-hosted}.
2022 @xref{Standards,,Language Standards Supported by GCC}, for details of
2023 freestanding and hosted environments.
2025 @item -fopenacc
2026 @opindex fopenacc
2027 @cindex OpenACC accelerator programming
2028 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
2029 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
2030 compiler generates accelerated code according to the OpenACC Application
2031 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
2032 implies @option{-pthread}, and thus is only supported on targets that
2033 have support for @option{-pthread}.
2035 @item -fopenacc-dim=@var{geom}
2036 @opindex fopenacc-dim
2037 @cindex OpenACC accelerator programming
2038 Specify default compute dimensions for parallel offload regions that do
2039 not explicitly specify.  The @var{geom} value is a triple of
2040 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
2041 can be omitted, to use a target-specific default value.
2043 @item -fopenmp
2044 @opindex fopenmp
2045 @cindex OpenMP parallel
2046 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
2047 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
2048 compiler generates parallel code according to the OpenMP Application
2049 Program Interface v4.5 @w{@uref{http://www.openmp.org/}}.  This option
2050 implies @option{-pthread}, and thus is only supported on targets that
2051 have support for @option{-pthread}. @option{-fopenmp} implies
2052 @option{-fopenmp-simd}.
2054 @item -fopenmp-simd
2055 @opindex fopenmp-simd
2056 @cindex OpenMP SIMD
2057 @cindex SIMD
2058 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2059 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2060 are ignored.
2062 @item -fcilkplus
2063 @opindex fcilkplus
2064 @cindex Enable Cilk Plus
2065 Enable the usage of Cilk Plus language extension features for C/C++.
2066 When the option @option{-fcilkplus} is specified, enable the usage of
2067 the Cilk Plus Language extension features for C/C++.  The present
2068 implementation follows ABI version 1.2.  This is an experimental
2069 feature that is only partially complete, and whose interface may
2070 change in future versions of GCC as the official specification
2071 changes.  Currently, all features but @code{_Cilk_for} have been
2072 implemented.
2074 @item -fgnu-tm
2075 @opindex fgnu-tm
2076 When the option @option{-fgnu-tm} is specified, the compiler
2077 generates code for the Linux variant of Intel's current Transactional
2078 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2079 an experimental feature whose interface may change in future versions
2080 of GCC, as the official specification changes.  Please note that not
2081 all architectures are supported for this feature.
2083 For more information on GCC's support for transactional memory,
2084 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2085 Transactional Memory Library}.
2087 Note that the transactional memory feature is not supported with
2088 non-call exceptions (@option{-fnon-call-exceptions}).
2090 @item -fms-extensions
2091 @opindex fms-extensions
2092 Accept some non-standard constructs used in Microsoft header files.
2094 In C++ code, this allows member names in structures to be similar
2095 to previous types declarations.
2097 @smallexample
2098 typedef int UOW;
2099 struct ABC @{
2100   UOW UOW;
2102 @end smallexample
2104 Some cases of unnamed fields in structures and unions are only
2105 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2106 fields within structs/unions}, for details.
2108 Note that this option is off for all targets but x86 
2109 targets using ms-abi.
2111 @item -fplan9-extensions
2112 @opindex fplan9-extensions
2113 Accept some non-standard constructs used in Plan 9 code.
2115 This enables @option{-fms-extensions}, permits passing pointers to
2116 structures with anonymous fields to functions that expect pointers to
2117 elements of the type of the field, and permits referring to anonymous
2118 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2119 struct/union fields within structs/unions}, for details.  This is only
2120 supported for C, not C++.
2122 @item -fcond-mismatch
2123 @opindex fcond-mismatch
2124 Allow conditional expressions with mismatched types in the second and
2125 third arguments.  The value of such an expression is void.  This option
2126 is not supported for C++.
2128 @item -flax-vector-conversions
2129 @opindex flax-vector-conversions
2130 Allow implicit conversions between vectors with differing numbers of
2131 elements and/or incompatible element types.  This option should not be
2132 used for new code.
2134 @item -funsigned-char
2135 @opindex funsigned-char
2136 Let the type @code{char} be unsigned, like @code{unsigned char}.
2138 Each kind of machine has a default for what @code{char} should
2139 be.  It is either like @code{unsigned char} by default or like
2140 @code{signed char} by default.
2142 Ideally, a portable program should always use @code{signed char} or
2143 @code{unsigned char} when it depends on the signedness of an object.
2144 But many programs have been written to use plain @code{char} and
2145 expect it to be signed, or expect it to be unsigned, depending on the
2146 machines they were written for.  This option, and its inverse, let you
2147 make such a program work with the opposite default.
2149 The type @code{char} is always a distinct type from each of
2150 @code{signed char} or @code{unsigned char}, even though its behavior
2151 is always just like one of those two.
2153 @item -fsigned-char
2154 @opindex fsigned-char
2155 Let the type @code{char} be signed, like @code{signed char}.
2157 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2158 the negative form of @option{-funsigned-char}.  Likewise, the option
2159 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2161 @item -fsigned-bitfields
2162 @itemx -funsigned-bitfields
2163 @itemx -fno-signed-bitfields
2164 @itemx -fno-unsigned-bitfields
2165 @opindex fsigned-bitfields
2166 @opindex funsigned-bitfields
2167 @opindex fno-signed-bitfields
2168 @opindex fno-unsigned-bitfields
2169 These options control whether a bit-field is signed or unsigned, when the
2170 declaration does not use either @code{signed} or @code{unsigned}.  By
2171 default, such a bit-field is signed, because this is consistent: the
2172 basic integer types such as @code{int} are signed types.
2174 @item -fsso-struct=@var{endianness}
2175 @opindex fsso-struct
2176 Set the default scalar storage order of structures and unions to the
2177 specified endianness.  The accepted values are @samp{big-endian},
2178 @samp{little-endian} and @samp{native} for the native endianness of
2179 the target (the default).  This option is not supported for C++.
2181 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2182 code that is not binary compatible with code generated without it if the
2183 specified endianness is not the native endianness of the target.
2184 @end table
2186 @node C++ Dialect Options
2187 @section Options Controlling C++ Dialect
2189 @cindex compiler options, C++
2190 @cindex C++ options, command-line
2191 @cindex options, C++
2192 This section describes the command-line options that are only meaningful
2193 for C++ programs.  You can also use most of the GNU compiler options
2194 regardless of what language your program is in.  For example, you
2195 might compile a file @file{firstClass.C} like this:
2197 @smallexample
2198 g++ -g -fstrict-enums -O -c firstClass.C
2199 @end smallexample
2201 @noindent
2202 In this example, only @option{-fstrict-enums} is an option meant
2203 only for C++ programs; you can use the other options with any
2204 language supported by GCC@.
2206 Some options for compiling C programs, such as @option{-std}, are also
2207 relevant for C++ programs.
2208 @xref{C Dialect Options,,Options Controlling C Dialect}.
2210 Here is a list of options that are @emph{only} for compiling C++ programs:
2212 @table @gcctabopt
2214 @item -fabi-version=@var{n}
2215 @opindex fabi-version
2216 Use version @var{n} of the C++ ABI@.  The default is version 0.
2218 Version 0 refers to the version conforming most closely to
2219 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2220 will change in different versions of G++ as ABI bugs are fixed.
2222 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2224 Version 2 is the version of the C++ ABI that first appeared in G++
2225 3.4, and was the default through G++ 4.9.
2227 Version 3 corrects an error in mangling a constant address as a
2228 template argument.
2230 Version 4, which first appeared in G++ 4.5, implements a standard
2231 mangling for vector types.
2233 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2234 attribute const/volatile on function pointer types, decltype of a
2235 plain decl, and use of a function parameter in the declaration of
2236 another parameter.
2238 Version 6, which first appeared in G++ 4.7, corrects the promotion
2239 behavior of C++11 scoped enums and the mangling of template argument
2240 packs, const/static_cast, prefix ++ and --, and a class scope function
2241 used as a template argument.
2243 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2244 builtin type and corrects the mangling of lambdas in default argument
2245 scope.
2247 Version 8, which first appeared in G++ 4.9, corrects the substitution
2248 behavior of function types with function-cv-qualifiers.
2250 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2251 @code{nullptr_t}.
2253 Version 10, which first appeared in G++ 6.1, adds mangling of
2254 attributes that affect type identity, such as ia32 calling convention
2255 attributes (e.g. @samp{stdcall}).
2257 Version 11, which first appeared in G++ 7, corrects the mangling of
2258 sizeof... expressions and operator names.  For multiple entities with
2259 the same name within a function, that are declared in different scopes,
2260 the mangling now changes starting with the twelfth occurrence.  It also
2261 implies @option{-fnew-inheriting-ctors}.
2263 See also @option{-Wabi}.
2265 @item -fabi-compat-version=@var{n}
2266 @opindex fabi-compat-version
2267 On targets that support strong aliases, G++
2268 works around mangling changes by creating an alias with the correct
2269 mangled name when defining a symbol with an incorrect mangled name.
2270 This switch specifies which ABI version to use for the alias.
2272 With @option{-fabi-version=0} (the default), this defaults to 8 (GCC 5
2273 compatibility).  If another ABI version is explicitly selected, this
2274 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2275 use @option{-fabi-compat-version=2}.
2277 If this option is not provided but @option{-Wabi=@var{n}} is, that
2278 version is used for compatibility aliases.  If this option is provided
2279 along with @option{-Wabi} (without the version), the version from this
2280 option is used for the warning.
2282 @item -fno-access-control
2283 @opindex fno-access-control
2284 Turn off all access checking.  This switch is mainly useful for working
2285 around bugs in the access control code.
2287 @item -faligned-new
2288 @opindex faligned-new
2289 Enable support for C++17 @code{new} of types that require more
2290 alignment than @code{void* ::operator new(std::size_t)} provides.  A
2291 numeric argument such as @code{-faligned-new=32} can be used to
2292 specify how much alignment (in bytes) is provided by that function,
2293 but few users will need to override the default of
2294 @code{alignof(std::max_align_t)}.
2296 @item -fcheck-new
2297 @opindex fcheck-new
2298 Check that the pointer returned by @code{operator new} is non-null
2299 before attempting to modify the storage allocated.  This check is
2300 normally unnecessary because the C++ standard specifies that
2301 @code{operator new} only returns @code{0} if it is declared
2302 @code{throw()}, in which case the compiler always checks the
2303 return value even without this option.  In all other cases, when
2304 @code{operator new} has a non-empty exception specification, memory
2305 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2306 @samp{new (nothrow)}.
2308 @item -fconcepts
2309 @opindex fconcepts
2310 Enable support for the C++ Extensions for Concepts Technical
2311 Specification, ISO 19217 (2015), which allows code like
2313 @smallexample
2314 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2315 template <Addable T> T add (T a, T b) @{ return a + b; @}
2316 @end smallexample
2318 @item -fconstexpr-depth=@var{n}
2319 @opindex fconstexpr-depth
2320 Set the maximum nested evaluation depth for C++11 constexpr functions
2321 to @var{n}.  A limit is needed to detect endless recursion during
2322 constant expression evaluation.  The minimum specified by the standard
2323 is 512.
2325 @item -fconstexpr-loop-limit=@var{n}
2326 @opindex fconstexpr-loop-limit
2327 Set the maximum number of iterations for a loop in C++14 constexpr functions
2328 to @var{n}.  A limit is needed to detect infinite loops during
2329 constant expression evaluation.  The default is 262144 (1<<18).
2331 @item -fdeduce-init-list
2332 @opindex fdeduce-init-list
2333 Enable deduction of a template type parameter as
2334 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2336 @smallexample
2337 template <class T> auto forward(T t) -> decltype (realfn (t))
2339   return realfn (t);
2342 void f()
2344   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2346 @end smallexample
2348 This deduction was implemented as a possible extension to the
2349 originally proposed semantics for the C++11 standard, but was not part
2350 of the final standard, so it is disabled by default.  This option is
2351 deprecated, and may be removed in a future version of G++.
2353 @item -ffriend-injection
2354 @opindex ffriend-injection
2355 Inject friend functions into the enclosing namespace, so that they are
2356 visible outside the scope of the class in which they are declared.
2357 Friend functions were documented to work this way in the old Annotated
2358 C++ Reference Manual.  
2359 However, in ISO C++ a friend function that is not declared
2360 in an enclosing scope can only be found using argument dependent
2361 lookup.  GCC defaults to the standard behavior.
2363 This option is for compatibility, and may be removed in a future
2364 release of G++.
2366 @item -fno-elide-constructors
2367 @opindex fno-elide-constructors
2368 The C++ standard allows an implementation to omit creating a temporary
2369 that is only used to initialize another object of the same type.
2370 Specifying this option disables that optimization, and forces G++ to
2371 call the copy constructor in all cases.  This option also causes G++
2372 to call trivial member functions which otherwise would be expanded inline.
2374 In C++17, the compiler is required to omit these temporaries, but this
2375 option still affects trivial member functions.
2377 @item -fno-enforce-eh-specs
2378 @opindex fno-enforce-eh-specs
2379 Don't generate code to check for violation of exception specifications
2380 at run time.  This option violates the C++ standard, but may be useful
2381 for reducing code size in production builds, much like defining
2382 @code{NDEBUG}.  This does not give user code permission to throw
2383 exceptions in violation of the exception specifications; the compiler
2384 still optimizes based on the specifications, so throwing an
2385 unexpected exception results in undefined behavior at run time.
2387 @item -fextern-tls-init
2388 @itemx -fno-extern-tls-init
2389 @opindex fextern-tls-init
2390 @opindex fno-extern-tls-init
2391 The C++11 and OpenMP standards allow @code{thread_local} and
2392 @code{threadprivate} variables to have dynamic (runtime)
2393 initialization.  To support this, any use of such a variable goes
2394 through a wrapper function that performs any necessary initialization.
2395 When the use and definition of the variable are in the same
2396 translation unit, this overhead can be optimized away, but when the
2397 use is in a different translation unit there is significant overhead
2398 even if the variable doesn't actually need dynamic initialization.  If
2399 the programmer can be sure that no use of the variable in a
2400 non-defining TU needs to trigger dynamic initialization (either
2401 because the variable is statically initialized, or a use of the
2402 variable in the defining TU will be executed before any uses in
2403 another TU), they can avoid this overhead with the
2404 @option{-fno-extern-tls-init} option.
2406 On targets that support symbol aliases, the default is
2407 @option{-fextern-tls-init}.  On targets that do not support symbol
2408 aliases, the default is @option{-fno-extern-tls-init}.
2410 @item -ffor-scope
2411 @itemx -fno-for-scope
2412 @opindex ffor-scope
2413 @opindex fno-for-scope
2414 If @option{-ffor-scope} is specified, the scope of variables declared in
2415 a @i{for-init-statement} is limited to the @code{for} loop itself,
2416 as specified by the C++ standard.
2417 If @option{-fno-for-scope} is specified, the scope of variables declared in
2418 a @i{for-init-statement} extends to the end of the enclosing scope,
2419 as was the case in old versions of G++, and other (traditional)
2420 implementations of C++.
2422 If neither flag is given, the default is to follow the standard,
2423 but to allow and give a warning for old-style code that would
2424 otherwise be invalid, or have different behavior.
2426 @item -fno-gnu-keywords
2427 @opindex fno-gnu-keywords
2428 Do not recognize @code{typeof} as a keyword, so that code can use this
2429 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2430 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2431 @option{-std=c++98}, @option{-std=c++11}, etc.
2433 @item -fno-implicit-templates
2434 @opindex fno-implicit-templates
2435 Never emit code for non-inline templates that are instantiated
2436 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2437 @xref{Template Instantiation}, for more information.
2439 @item -fno-implicit-inline-templates
2440 @opindex fno-implicit-inline-templates
2441 Don't emit code for implicit instantiations of inline templates, either.
2442 The default is to handle inlines differently so that compiles with and
2443 without optimization need the same set of explicit instantiations.
2445 @item -fno-implement-inlines
2446 @opindex fno-implement-inlines
2447 To save space, do not emit out-of-line copies of inline functions
2448 controlled by @code{#pragma implementation}.  This causes linker
2449 errors if these functions are not inlined everywhere they are called.
2451 @item -fms-extensions
2452 @opindex fms-extensions
2453 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2454 int and getting a pointer to member function via non-standard syntax.
2456 @item -fnew-inheriting-ctors
2457 @opindex fnew-inheriting-ctors
2458 Enable the P0136 adjustment to the semantics of C++11 constructor
2459 inheritance.  This is part of C++17 but also considered to be a Defect
2460 Report against C++11 and C++14.  This flag is enabled by default
2461 unless @option{-fabi-version=10} or lower is specified.
2463 @item -fnew-ttp-matching
2464 @opindex fnew-ttp-matching
2465 Enable the P0522 resolution to Core issue 150, template template
2466 parameters and default arguments: this allows a template with default
2467 template arguments as an argument for a template template parameter
2468 with fewer template parameters.  This flag is enabled by default for
2469 @option{-std=c++1z}.
2471 @item -fno-nonansi-builtins
2472 @opindex fno-nonansi-builtins
2473 Disable built-in declarations of functions that are not mandated by
2474 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2475 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2477 @item -fnothrow-opt
2478 @opindex fnothrow-opt
2479 Treat a @code{throw()} exception specification as if it were a
2480 @code{noexcept} specification to reduce or eliminate the text size
2481 overhead relative to a function with no exception specification.  If
2482 the function has local variables of types with non-trivial
2483 destructors, the exception specification actually makes the
2484 function smaller because the EH cleanups for those variables can be
2485 optimized away.  The semantic effect is that an exception thrown out of
2486 a function with such an exception specification results in a call
2487 to @code{terminate} rather than @code{unexpected}.
2489 @item -fno-operator-names
2490 @opindex fno-operator-names
2491 Do not treat the operator name keywords @code{and}, @code{bitand},
2492 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2493 synonyms as keywords.
2495 @item -fno-optional-diags
2496 @opindex fno-optional-diags
2497 Disable diagnostics that the standard says a compiler does not need to
2498 issue.  Currently, the only such diagnostic issued by G++ is the one for
2499 a name having multiple meanings within a class.
2501 @item -fpermissive
2502 @opindex fpermissive
2503 Downgrade some diagnostics about nonconformant code from errors to
2504 warnings.  Thus, using @option{-fpermissive} allows some
2505 nonconforming code to compile.
2507 @item -fno-pretty-templates
2508 @opindex fno-pretty-templates
2509 When an error message refers to a specialization of a function
2510 template, the compiler normally prints the signature of the
2511 template followed by the template arguments and any typedefs or
2512 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2513 rather than @code{void f(int)}) so that it's clear which template is
2514 involved.  When an error message refers to a specialization of a class
2515 template, the compiler omits any template arguments that match
2516 the default template arguments for that template.  If either of these
2517 behaviors make it harder to understand the error message rather than
2518 easier, you can use @option{-fno-pretty-templates} to disable them.
2520 @item -frepo
2521 @opindex frepo
2522 Enable automatic template instantiation at link time.  This option also
2523 implies @option{-fno-implicit-templates}.  @xref{Template
2524 Instantiation}, for more information.
2526 @item -fno-rtti
2527 @opindex fno-rtti
2528 Disable generation of information about every class with virtual
2529 functions for use by the C++ run-time type identification features
2530 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2531 of the language, you can save some space by using this flag.  Note that
2532 exception handling uses the same information, but G++ generates it as
2533 needed. The @code{dynamic_cast} operator can still be used for casts that
2534 do not require run-time type information, i.e.@: casts to @code{void *} or to
2535 unambiguous base classes.
2537 @item -fsized-deallocation
2538 @opindex fsized-deallocation
2539 Enable the built-in global declarations
2540 @smallexample
2541 void operator delete (void *, std::size_t) noexcept;
2542 void operator delete[] (void *, std::size_t) noexcept;
2543 @end smallexample
2544 as introduced in C++14.  This is useful for user-defined replacement
2545 deallocation functions that, for example, use the size of the object
2546 to make deallocation faster.  Enabled by default under
2547 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2548 warns about places that might want to add a definition.
2550 @item -fstrict-enums
2551 @opindex fstrict-enums
2552 Allow the compiler to optimize using the assumption that a value of
2553 enumerated type can only be one of the values of the enumeration (as
2554 defined in the C++ standard; basically, a value that can be
2555 represented in the minimum number of bits needed to represent all the
2556 enumerators).  This assumption may not be valid if the program uses a
2557 cast to convert an arbitrary integer value to the enumerated type.
2559 @item -fstrong-eval-order
2560 @opindex fstrong-eval-order
2561 Evaluate member access, array subscripting, and shift expressions in
2562 left-to-right order, and evaluate assignment in right-to-left order,
2563 as adopted for C++17.  Enabled by default with @option{-std=c++1z}.
2564 @option{-fstrong-eval-order=some} enables just the ordering of member
2565 access and shift expressions, and is the default without
2566 @option{-std=c++1z}.
2568 @item -ftemplate-backtrace-limit=@var{n}
2569 @opindex ftemplate-backtrace-limit
2570 Set the maximum number of template instantiation notes for a single
2571 warning or error to @var{n}.  The default value is 10.
2573 @item -ftemplate-depth=@var{n}
2574 @opindex ftemplate-depth
2575 Set the maximum instantiation depth for template classes to @var{n}.
2576 A limit on the template instantiation depth is needed to detect
2577 endless recursions during template class instantiation.  ANSI/ISO C++
2578 conforming programs must not rely on a maximum depth greater than 17
2579 (changed to 1024 in C++11).  The default value is 900, as the compiler
2580 can run out of stack space before hitting 1024 in some situations.
2582 @item -fno-threadsafe-statics
2583 @opindex fno-threadsafe-statics
2584 Do not emit the extra code to use the routines specified in the C++
2585 ABI for thread-safe initialization of local statics.  You can use this
2586 option to reduce code size slightly in code that doesn't need to be
2587 thread-safe.
2589 @item -fuse-cxa-atexit
2590 @opindex fuse-cxa-atexit
2591 Register destructors for objects with static storage duration with the
2592 @code{__cxa_atexit} function rather than the @code{atexit} function.
2593 This option is required for fully standards-compliant handling of static
2594 destructors, but only works if your C library supports
2595 @code{__cxa_atexit}.
2597 @item -fno-use-cxa-get-exception-ptr
2598 @opindex fno-use-cxa-get-exception-ptr
2599 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2600 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2601 if the runtime routine is not available.
2603 @item -fvisibility-inlines-hidden
2604 @opindex fvisibility-inlines-hidden
2605 This switch declares that the user does not attempt to compare
2606 pointers to inline functions or methods where the addresses of the two functions
2607 are taken in different shared objects.
2609 The effect of this is that GCC may, effectively, mark inline methods with
2610 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2611 appear in the export table of a DSO and do not require a PLT indirection
2612 when used within the DSO@.  Enabling this option can have a dramatic effect
2613 on load and link times of a DSO as it massively reduces the size of the
2614 dynamic export table when the library makes heavy use of templates.
2616 The behavior of this switch is not quite the same as marking the
2617 methods as hidden directly, because it does not affect static variables
2618 local to the function or cause the compiler to deduce that
2619 the function is defined in only one shared object.
2621 You may mark a method as having a visibility explicitly to negate the
2622 effect of the switch for that method.  For example, if you do want to
2623 compare pointers to a particular inline method, you might mark it as
2624 having default visibility.  Marking the enclosing class with explicit
2625 visibility has no effect.
2627 Explicitly instantiated inline methods are unaffected by this option
2628 as their linkage might otherwise cross a shared library boundary.
2629 @xref{Template Instantiation}.
2631 @item -fvisibility-ms-compat
2632 @opindex fvisibility-ms-compat
2633 This flag attempts to use visibility settings to make GCC's C++
2634 linkage model compatible with that of Microsoft Visual Studio.
2636 The flag makes these changes to GCC's linkage model:
2638 @enumerate
2639 @item
2640 It sets the default visibility to @code{hidden}, like
2641 @option{-fvisibility=hidden}.
2643 @item
2644 Types, but not their members, are not hidden by default.
2646 @item
2647 The One Definition Rule is relaxed for types without explicit
2648 visibility specifications that are defined in more than one
2649 shared object: those declarations are permitted if they are
2650 permitted when this option is not used.
2651 @end enumerate
2653 In new code it is better to use @option{-fvisibility=hidden} and
2654 export those classes that are intended to be externally visible.
2655 Unfortunately it is possible for code to rely, perhaps accidentally,
2656 on the Visual Studio behavior.
2658 Among the consequences of these changes are that static data members
2659 of the same type with the same name but defined in different shared
2660 objects are different, so changing one does not change the other;
2661 and that pointers to function members defined in different shared
2662 objects may not compare equal.  When this flag is given, it is a
2663 violation of the ODR to define types with the same name differently.
2665 @item -fno-weak
2666 @opindex fno-weak
2667 Do not use weak symbol support, even if it is provided by the linker.
2668 By default, G++ uses weak symbols if they are available.  This
2669 option exists only for testing, and should not be used by end-users;
2670 it results in inferior code and has no benefits.  This option may
2671 be removed in a future release of G++.
2673 @item -nostdinc++
2674 @opindex nostdinc++
2675 Do not search for header files in the standard directories specific to
2676 C++, but do still search the other standard directories.  (This option
2677 is used when building the C++ library.)
2678 @end table
2680 In addition, these optimization, warning, and code generation options
2681 have meanings only for C++ programs:
2683 @table @gcctabopt
2684 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2685 @opindex Wabi
2686 @opindex Wno-abi
2687 Warn when G++ it generates code that is probably not compatible with
2688 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2689 ABI with each major release, normally @option{-Wabi} will warn only if
2690 there is a check added later in a release series for an ABI issue
2691 discovered since the initial release.  @option{-Wabi} will warn about
2692 more things if an older ABI version is selected (with
2693 @option{-fabi-version=@var{n}}).
2695 @option{-Wabi} can also be used with an explicit version number to
2696 warn about compatibility with a particular @option{-fabi-version}
2697 level, e.g. @option{-Wabi=2} to warn about changes relative to
2698 @option{-fabi-version=2}.
2700 If an explicit version number is provided and
2701 @option{-fabi-compat-version} is not specified, the version number
2702 from this option is used for compatibility aliases.  If no explicit
2703 version number is provided with this option, but
2704 @option{-fabi-compat-version} is specified, that version number is
2705 used for ABI warnings.
2707 Although an effort has been made to warn about
2708 all such cases, there are probably some cases that are not warned about,
2709 even though G++ is generating incompatible code.  There may also be
2710 cases where warnings are emitted even though the code that is generated
2711 is compatible.
2713 You should rewrite your code to avoid these warnings if you are
2714 concerned about the fact that code generated by G++ may not be binary
2715 compatible with code generated by other compilers.
2717 Known incompatibilities in @option{-fabi-version=2} (which was the
2718 default from GCC 3.4 to 4.9) include:
2720 @itemize @bullet
2722 @item
2723 A template with a non-type template parameter of reference type was
2724 mangled incorrectly:
2725 @smallexample
2726 extern int N;
2727 template <int &> struct S @{@};
2728 void n (S<N>) @{2@}
2729 @end smallexample
2731 This was fixed in @option{-fabi-version=3}.
2733 @item
2734 SIMD vector types declared using @code{__attribute ((vector_size))} were
2735 mangled in a non-standard way that does not allow for overloading of
2736 functions taking vectors of different sizes.
2738 The mangling was changed in @option{-fabi-version=4}.
2740 @item
2741 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2742 qualifiers, and @code{decltype} of a plain declaration was folded away.
2744 These mangling issues were fixed in @option{-fabi-version=5}.
2746 @item
2747 Scoped enumerators passed as arguments to a variadic function are
2748 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2749 On most targets this does not actually affect the parameter passing
2750 ABI, as there is no way to pass an argument smaller than @code{int}.
2752 Also, the ABI changed the mangling of template argument packs,
2753 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2754 a class scope function used as a template argument.
2756 These issues were corrected in @option{-fabi-version=6}.
2758 @item
2759 Lambdas in default argument scope were mangled incorrectly, and the
2760 ABI changed the mangling of @code{nullptr_t}.
2762 These issues were corrected in @option{-fabi-version=7}.
2764 @item
2765 When mangling a function type with function-cv-qualifiers, the
2766 un-qualified function type was incorrectly treated as a substitution
2767 candidate.
2769 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2771 @item
2772 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2773 unaligned accesses.  Note that this did not affect the ABI of a
2774 function with a @code{nullptr_t} parameter, as parameters have a
2775 minimum alignment.
2777 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2779 @item
2780 Target-specific attributes that affect the identity of a type, such as
2781 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2782 did not affect the mangled name, leading to name collisions when
2783 function pointers were used as template arguments.
2785 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2787 @end itemize
2789 It also warns about psABI-related changes.  The known psABI changes at this
2790 point include:
2792 @itemize @bullet
2794 @item
2795 For SysV/x86-64, unions with @code{long double} members are 
2796 passed in memory as specified in psABI.  For example:
2798 @smallexample
2799 union U @{
2800   long double ld;
2801   int i;
2803 @end smallexample
2805 @noindent
2806 @code{union U} is always passed in memory.
2808 @end itemize
2810 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2811 @opindex Wabi-tag
2812 @opindex -Wabi-tag
2813 Warn when a type with an ABI tag is used in a context that does not
2814 have that ABI tag.  See @ref{C++ Attributes} for more information
2815 about ABI tags.
2817 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2818 @opindex Wctor-dtor-privacy
2819 @opindex Wno-ctor-dtor-privacy
2820 Warn when a class seems unusable because all the constructors or
2821 destructors in that class are private, and it has neither friends nor
2822 public static member functions.  Also warn if there are no non-private
2823 methods, and there's at least one private member function that isn't
2824 a constructor or destructor.
2826 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2827 @opindex Wdelete-non-virtual-dtor
2828 @opindex Wno-delete-non-virtual-dtor
2829 Warn when @code{delete} is used to destroy an instance of a class that
2830 has virtual functions and non-virtual destructor. It is unsafe to delete
2831 an instance of a derived class through a pointer to a base class if the
2832 base class does not have a virtual destructor.  This warning is enabled
2833 by @option{-Wall}.
2835 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2836 @opindex Wliteral-suffix
2837 @opindex Wno-literal-suffix
2838 Warn when a string or character literal is followed by a ud-suffix which does
2839 not begin with an underscore.  As a conforming extension, GCC treats such
2840 suffixes as separate preprocessing tokens in order to maintain backwards
2841 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2842 For example:
2844 @smallexample
2845 #define __STDC_FORMAT_MACROS
2846 #include <inttypes.h>
2847 #include <stdio.h>
2849 int main() @{
2850   int64_t i64 = 123;
2851   printf("My int64: %" PRId64"\n", i64);
2853 @end smallexample
2855 In this case, @code{PRId64} is treated as a separate preprocessing token.
2857 Additionally, warn when a user-defined literal operator is declared with
2858 a literal suffix identifier that doesn't begin with an underscore. Literal
2859 suffix identifiers that don't begin with an underscore are reserved for
2860 future standardization.
2862 This warning is enabled by default.
2864 @item -Wlto-type-mismatch
2865 @opindex Wlto-type-mismatch
2866 @opindex Wno-lto-type-mismatch
2868 During the link-time optimization warn about type mismatches in
2869 global declarations from different compilation units.
2870 Requires @option{-flto} to be enabled.  Enabled by default.
2872 @item -Wno-narrowing @r{(C++ and Objective-C++ only)}
2873 @opindex Wnarrowing
2874 @opindex Wno-narrowing
2875 For C++11 and later standards, narrowing conversions are diagnosed by default,
2876 as required by the standard.  A narrowing conversion from a constant produces
2877 an error, and a narrowing conversion from a non-constant produces a warning,
2878 but @option{-Wno-narrowing} suppresses the diagnostic.
2879 Note that this does not affect the meaning of well-formed code;
2880 narrowing conversions are still considered ill-formed in SFINAE contexts.
2882 With @option{-Wnarrowing} in C++98, warn when a narrowing
2883 conversion prohibited by C++11 occurs within
2884 @samp{@{ @}}, e.g.
2886 @smallexample
2887 int i = @{ 2.2 @}; // error: narrowing from double to int
2888 @end smallexample
2890 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2892 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2893 @opindex Wnoexcept
2894 @opindex Wno-noexcept
2895 Warn when a noexcept-expression evaluates to false because of a call
2896 to a function that does not have a non-throwing exception
2897 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2898 the compiler to never throw an exception.
2900 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2901 @opindex Wnoexcept-type
2902 @opindex Wno-noexcept-type
2903 Warn if the C++1z feature making @code{noexcept} part of a function
2904 type changes the mangled name of a symbol relative to C++14.  Enabled
2905 by @option{-Wabi} and @option{-Wc++1z-compat}.
2907 @smallexample
2908 template <class T> void f(T t) @{ t(); @};
2909 void g() noexcept;
2910 void h() @{ f(g); @} // in C++14 calls f<void(*)()>, in C++1z calls f<void(*)()noexcept>
2911 @end smallexample
2914 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2915 @opindex Wnon-virtual-dtor
2916 @opindex Wno-non-virtual-dtor
2917 Warn when a class has virtual functions and an accessible non-virtual
2918 destructor itself or in an accessible polymorphic base class, in which
2919 case it is possible but unsafe to delete an instance of a derived
2920 class through a pointer to the class itself or base class.  This
2921 warning is automatically enabled if @option{-Weffc++} is specified.
2923 @item -Wregister @r{(C++ and Objective-C++ only)}
2924 @opindex Wregister
2925 @opindex Wno-register
2926 Warn on uses of the @code{register} storage class specifier, except
2927 when it is part of the GNU @ref{Explicit Register Variables} extension.
2928 The use of the @code{register} keyword as storage class specifier has
2929 been deprecated in C++11 and removed in C++17.
2930 Enabled by default with @option{-std=c++1z}.
2932 @item -Wreorder @r{(C++ and Objective-C++ only)}
2933 @opindex Wreorder
2934 @opindex Wno-reorder
2935 @cindex reordering, warning
2936 @cindex warning for reordering of member initializers
2937 Warn when the order of member initializers given in the code does not
2938 match the order in which they must be executed.  For instance:
2940 @smallexample
2941 struct A @{
2942   int i;
2943   int j;
2944   A(): j (0), i (1) @{ @}
2946 @end smallexample
2948 @noindent
2949 The compiler rearranges the member initializers for @code{i}
2950 and @code{j} to match the declaration order of the members, emitting
2951 a warning to that effect.  This warning is enabled by @option{-Wall}.
2953 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2954 @opindex fext-numeric-literals
2955 @opindex fno-ext-numeric-literals
2956 Accept imaginary, fixed-point, or machine-defined
2957 literal number suffixes as GNU extensions.
2958 When this option is turned off these suffixes are treated
2959 as C++11 user-defined literal numeric suffixes.
2960 This is on by default for all pre-C++11 dialects and all GNU dialects:
2961 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2962 @option{-std=gnu++14}.
2963 This option is off by default
2964 for ISO C++11 onwards (@option{-std=c++11}, ...).
2965 @end table
2967 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2969 @table @gcctabopt
2970 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2971 @opindex Weffc++
2972 @opindex Wno-effc++
2973 Warn about violations of the following style guidelines from Scott Meyers'
2974 @cite{Effective C++} series of books:
2976 @itemize @bullet
2977 @item
2978 Define a copy constructor and an assignment operator for classes
2979 with dynamically-allocated memory.
2981 @item
2982 Prefer initialization to assignment in constructors.
2984 @item
2985 Have @code{operator=} return a reference to @code{*this}.
2987 @item
2988 Don't try to return a reference when you must return an object.
2990 @item
2991 Distinguish between prefix and postfix forms of increment and
2992 decrement operators.
2994 @item
2995 Never overload @code{&&}, @code{||}, or @code{,}.
2997 @end itemize
2999 This option also enables @option{-Wnon-virtual-dtor}, which is also
3000 one of the effective C++ recommendations.  However, the check is
3001 extended to warn about the lack of virtual destructor in accessible
3002 non-polymorphic bases classes too.
3004 When selecting this option, be aware that the standard library
3005 headers do not obey all of these guidelines; use @samp{grep -v}
3006 to filter out those warnings.
3008 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
3009 @opindex Wstrict-null-sentinel
3010 @opindex Wno-strict-null-sentinel
3011 Warn about the use of an uncasted @code{NULL} as sentinel.  When
3012 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
3013 to @code{__null}.  Although it is a null pointer constant rather than a
3014 null pointer, it is guaranteed to be of the same size as a pointer.
3015 But this use is not portable across different compilers.
3017 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
3018 @opindex Wno-non-template-friend
3019 @opindex Wnon-template-friend
3020 Disable warnings when non-template friend functions are declared
3021 within a template.  In very old versions of GCC that predate implementation
3022 of the ISO standard, declarations such as 
3023 @samp{friend int foo(int)}, where the name of the friend is an unqualified-id,
3024 could be interpreted as a particular specialization of a template
3025 function; the warning exists to diagnose compatibility problems, 
3026 and is enabled by default.
3028 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
3029 @opindex Wold-style-cast
3030 @opindex Wno-old-style-cast
3031 Warn if an old-style (C-style) cast to a non-void type is used within
3032 a C++ program.  The new-style casts (@code{dynamic_cast},
3033 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
3034 less vulnerable to unintended effects and much easier to search for.
3036 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
3037 @opindex Woverloaded-virtual
3038 @opindex Wno-overloaded-virtual
3039 @cindex overloaded virtual function, warning
3040 @cindex warning for overloaded virtual function
3041 Warn when a function declaration hides virtual functions from a
3042 base class.  For example, in:
3044 @smallexample
3045 struct A @{
3046   virtual void f();
3049 struct B: public A @{
3050   void f(int);
3052 @end smallexample
3054 the @code{A} class version of @code{f} is hidden in @code{B}, and code
3055 like:
3057 @smallexample
3058 B* b;
3059 b->f();
3060 @end smallexample
3062 @noindent
3063 fails to compile.
3065 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
3066 @opindex Wno-pmf-conversions
3067 @opindex Wpmf-conversions
3068 Disable the diagnostic for converting a bound pointer to member function
3069 to a plain pointer.
3071 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
3072 @opindex Wsign-promo
3073 @opindex Wno-sign-promo
3074 Warn when overload resolution chooses a promotion from unsigned or
3075 enumerated type to a signed type, over a conversion to an unsigned type of
3076 the same size.  Previous versions of G++ tried to preserve
3077 unsignedness, but the standard mandates the current behavior.
3079 @item -Wtemplates @r{(C++ and Objective-C++ only)}
3080 @opindex Wtemplates
3081 Warn when a primary template declaration is encountered.  Some coding
3082 rules disallow templates, and this may be used to enforce that rule.
3083 The warning is inactive inside a system header file, such as the STL, so
3084 one can still use the STL.  One may also instantiate or specialize
3085 templates.
3087 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
3088 @opindex Wmultiple-inheritance
3089 Warn when a class is defined with multiple direct base classes.  Some
3090 coding rules disallow multiple inheritance, and this may be used to
3091 enforce that rule.  The warning is inactive inside a system header file,
3092 such as the STL, so one can still use the STL.  One may also define
3093 classes that indirectly use multiple inheritance.
3095 @item -Wvirtual-inheritance
3096 @opindex Wvirtual-inheritance
3097 Warn when a class is defined with a virtual direct base class.  Some
3098 coding rules disallow multiple inheritance, and this may be used to
3099 enforce that rule.  The warning is inactive inside a system header file,
3100 such as the STL, so one can still use the STL.  One may also define
3101 classes that indirectly use virtual inheritance.
3103 @item -Wnamespaces
3104 @opindex Wnamespaces
3105 Warn when a namespace definition is opened.  Some coding rules disallow
3106 namespaces, and this may be used to enforce that rule.  The warning is
3107 inactive inside a system header file, such as the STL, so one can still
3108 use the STL.  One may also use using directives and qualified names.
3110 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3111 @opindex Wterminate
3112 @opindex Wno-terminate
3113 Disable the warning about a throw-expression that will immediately
3114 result in a call to @code{terminate}.
3115 @end table
3117 @node Objective-C and Objective-C++ Dialect Options
3118 @section Options Controlling Objective-C and Objective-C++ Dialects
3120 @cindex compiler options, Objective-C and Objective-C++
3121 @cindex Objective-C and Objective-C++ options, command-line
3122 @cindex options, Objective-C and Objective-C++
3123 (NOTE: This manual does not describe the Objective-C and Objective-C++
3124 languages themselves.  @xref{Standards,,Language Standards
3125 Supported by GCC}, for references.)
3127 This section describes the command-line options that are only meaningful
3128 for Objective-C and Objective-C++ programs.  You can also use most of
3129 the language-independent GNU compiler options.
3130 For example, you might compile a file @file{some_class.m} like this:
3132 @smallexample
3133 gcc -g -fgnu-runtime -O -c some_class.m
3134 @end smallexample
3136 @noindent
3137 In this example, @option{-fgnu-runtime} is an option meant only for
3138 Objective-C and Objective-C++ programs; you can use the other options with
3139 any language supported by GCC@.
3141 Note that since Objective-C is an extension of the C language, Objective-C
3142 compilations may also use options specific to the C front-end (e.g.,
3143 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3144 C++-specific options (e.g., @option{-Wabi}).
3146 Here is a list of options that are @emph{only} for compiling Objective-C
3147 and Objective-C++ programs:
3149 @table @gcctabopt
3150 @item -fconstant-string-class=@var{class-name}
3151 @opindex fconstant-string-class
3152 Use @var{class-name} as the name of the class to instantiate for each
3153 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3154 class name is @code{NXConstantString} if the GNU runtime is being used, and
3155 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3156 @option{-fconstant-cfstrings} option, if also present, overrides the
3157 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3158 to be laid out as constant CoreFoundation strings.
3160 @item -fgnu-runtime
3161 @opindex fgnu-runtime
3162 Generate object code compatible with the standard GNU Objective-C
3163 runtime.  This is the default for most types of systems.
3165 @item -fnext-runtime
3166 @opindex fnext-runtime
3167 Generate output compatible with the NeXT runtime.  This is the default
3168 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3169 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3170 used.
3172 @item -fno-nil-receivers
3173 @opindex fno-nil-receivers
3174 Assume that all Objective-C message dispatches (@code{[receiver
3175 message:arg]}) in this translation unit ensure that the receiver is
3176 not @code{nil}.  This allows for more efficient entry points in the
3177 runtime to be used.  This option is only available in conjunction with
3178 the NeXT runtime and ABI version 0 or 1.
3180 @item -fobjc-abi-version=@var{n}
3181 @opindex fobjc-abi-version
3182 Use version @var{n} of the Objective-C ABI for the selected runtime.
3183 This option is currently supported only for the NeXT runtime.  In that
3184 case, Version 0 is the traditional (32-bit) ABI without support for
3185 properties and other Objective-C 2.0 additions.  Version 1 is the
3186 traditional (32-bit) ABI with support for properties and other
3187 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3188 nothing is specified, the default is Version 0 on 32-bit target
3189 machines, and Version 2 on 64-bit target machines.
3191 @item -fobjc-call-cxx-cdtors
3192 @opindex fobjc-call-cxx-cdtors
3193 For each Objective-C class, check if any of its instance variables is a
3194 C++ object with a non-trivial default constructor.  If so, synthesize a
3195 special @code{- (id) .cxx_construct} instance method which runs
3196 non-trivial default constructors on any such instance variables, in order,
3197 and then return @code{self}.  Similarly, check if any instance variable
3198 is a C++ object with a non-trivial destructor, and if so, synthesize a
3199 special @code{- (void) .cxx_destruct} method which runs
3200 all such default destructors, in reverse order.
3202 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3203 methods thusly generated only operate on instance variables
3204 declared in the current Objective-C class, and not those inherited
3205 from superclasses.  It is the responsibility of the Objective-C
3206 runtime to invoke all such methods in an object's inheritance
3207 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3208 by the runtime immediately after a new object instance is allocated;
3209 the @code{- (void) .cxx_destruct} methods are invoked immediately
3210 before the runtime deallocates an object instance.
3212 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3213 support for invoking the @code{- (id) .cxx_construct} and
3214 @code{- (void) .cxx_destruct} methods.
3216 @item -fobjc-direct-dispatch
3217 @opindex fobjc-direct-dispatch
3218 Allow fast jumps to the message dispatcher.  On Darwin this is
3219 accomplished via the comm page.
3221 @item -fobjc-exceptions
3222 @opindex fobjc-exceptions
3223 Enable syntactic support for structured exception handling in
3224 Objective-C, similar to what is offered by C++.  This option
3225 is required to use the Objective-C keywords @code{@@try},
3226 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3227 @code{@@synchronized}.  This option is available with both the GNU
3228 runtime and the NeXT runtime (but not available in conjunction with
3229 the NeXT runtime on Mac OS X 10.2 and earlier).
3231 @item -fobjc-gc
3232 @opindex fobjc-gc
3233 Enable garbage collection (GC) in Objective-C and Objective-C++
3234 programs.  This option is only available with the NeXT runtime; the
3235 GNU runtime has a different garbage collection implementation that
3236 does not require special compiler flags.
3238 @item -fobjc-nilcheck
3239 @opindex fobjc-nilcheck
3240 For the NeXT runtime with version 2 of the ABI, check for a nil
3241 receiver in method invocations before doing the actual method call.
3242 This is the default and can be disabled using
3243 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3244 checked for nil in this way no matter what this flag is set to.
3245 Currently this flag does nothing when the GNU runtime, or an older
3246 version of the NeXT runtime ABI, is used.
3248 @item -fobjc-std=objc1
3249 @opindex fobjc-std
3250 Conform to the language syntax of Objective-C 1.0, the language
3251 recognized by GCC 4.0.  This only affects the Objective-C additions to
3252 the C/C++ language; it does not affect conformance to C/C++ standards,
3253 which is controlled by the separate C/C++ dialect option flags.  When
3254 this option is used with the Objective-C or Objective-C++ compiler,
3255 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3256 This is useful if you need to make sure that your Objective-C code can
3257 be compiled with older versions of GCC@.
3259 @item -freplace-objc-classes
3260 @opindex freplace-objc-classes
3261 Emit a special marker instructing @command{ld(1)} not to statically link in
3262 the resulting object file, and allow @command{dyld(1)} to load it in at
3263 run time instead.  This is used in conjunction with the Fix-and-Continue
3264 debugging mode, where the object file in question may be recompiled and
3265 dynamically reloaded in the course of program execution, without the need
3266 to restart the program itself.  Currently, Fix-and-Continue functionality
3267 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3268 and later.
3270 @item -fzero-link
3271 @opindex fzero-link
3272 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3273 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3274 compile time) with static class references that get initialized at load time,
3275 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3276 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3277 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3278 for individual class implementations to be modified during program execution.
3279 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3280 regardless of command-line options.
3282 @item -fno-local-ivars
3283 @opindex fno-local-ivars
3284 @opindex flocal-ivars
3285 By default instance variables in Objective-C can be accessed as if
3286 they were local variables from within the methods of the class they're
3287 declared in.  This can lead to shadowing between instance variables
3288 and other variables declared either locally inside a class method or
3289 globally with the same name.  Specifying the @option{-fno-local-ivars}
3290 flag disables this behavior thus avoiding variable shadowing issues.
3292 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3293 @opindex fivar-visibility
3294 Set the default instance variable visibility to the specified option
3295 so that instance variables declared outside the scope of any access
3296 modifier directives default to the specified visibility.
3298 @item -gen-decls
3299 @opindex gen-decls
3300 Dump interface declarations for all classes seen in the source file to a
3301 file named @file{@var{sourcename}.decl}.
3303 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3304 @opindex Wassign-intercept
3305 @opindex Wno-assign-intercept
3306 Warn whenever an Objective-C assignment is being intercepted by the
3307 garbage collector.
3309 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3310 @opindex Wno-protocol
3311 @opindex Wprotocol
3312 If a class is declared to implement a protocol, a warning is issued for
3313 every method in the protocol that is not implemented by the class.  The
3314 default behavior is to issue a warning for every method not explicitly
3315 implemented in the class, even if a method implementation is inherited
3316 from the superclass.  If you use the @option{-Wno-protocol} option, then
3317 methods inherited from the superclass are considered to be implemented,
3318 and no warning is issued for them.
3320 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3321 @opindex Wselector
3322 @opindex Wno-selector
3323 Warn if multiple methods of different types for the same selector are
3324 found during compilation.  The check is performed on the list of methods
3325 in the final stage of compilation.  Additionally, a check is performed
3326 for each selector appearing in a @code{@@selector(@dots{})}
3327 expression, and a corresponding method for that selector has been found
3328 during compilation.  Because these checks scan the method table only at
3329 the end of compilation, these warnings are not produced if the final
3330 stage of compilation is not reached, for example because an error is
3331 found during compilation, or because the @option{-fsyntax-only} option is
3332 being used.
3334 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3335 @opindex Wstrict-selector-match
3336 @opindex Wno-strict-selector-match
3337 Warn if multiple methods with differing argument and/or return types are
3338 found for a given selector when attempting to send a message using this
3339 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3340 is off (which is the default behavior), the compiler omits such warnings
3341 if any differences found are confined to types that share the same size
3342 and alignment.
3344 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3345 @opindex Wundeclared-selector
3346 @opindex Wno-undeclared-selector
3347 Warn if a @code{@@selector(@dots{})} expression referring to an
3348 undeclared selector is found.  A selector is considered undeclared if no
3349 method with that name has been declared before the
3350 @code{@@selector(@dots{})} expression, either explicitly in an
3351 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3352 an @code{@@implementation} section.  This option always performs its
3353 checks as soon as a @code{@@selector(@dots{})} expression is found,
3354 while @option{-Wselector} only performs its checks in the final stage of
3355 compilation.  This also enforces the coding style convention
3356 that methods and selectors must be declared before being used.
3358 @item -print-objc-runtime-info
3359 @opindex print-objc-runtime-info
3360 Generate C header describing the largest structure that is passed by
3361 value, if any.
3363 @end table
3365 @node Diagnostic Message Formatting Options
3366 @section Options to Control Diagnostic Messages Formatting
3367 @cindex options to control diagnostics formatting
3368 @cindex diagnostic messages
3369 @cindex message formatting
3371 Traditionally, diagnostic messages have been formatted irrespective of
3372 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3373 options described below
3374 to control the formatting algorithm for diagnostic messages, 
3375 e.g.@: how many characters per line, how often source location
3376 information should be reported.  Note that some language front ends may not
3377 honor these options.
3379 @table @gcctabopt
3380 @item -fmessage-length=@var{n}
3381 @opindex fmessage-length
3382 Try to format error messages so that they fit on lines of about
3383 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3384 done; each error message appears on a single line.  This is the
3385 default for all front ends.
3387 @item -fdiagnostics-show-location=once
3388 @opindex fdiagnostics-show-location
3389 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3390 reporter to emit source location information @emph{once}; that is, in
3391 case the message is too long to fit on a single physical line and has to
3392 be wrapped, the source location won't be emitted (as prefix) again,
3393 over and over, in subsequent continuation lines.  This is the default
3394 behavior.
3396 @item -fdiagnostics-show-location=every-line
3397 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3398 messages reporter to emit the same source location information (as
3399 prefix) for physical lines that result from the process of breaking
3400 a message which is too long to fit on a single line.
3402 @item -fdiagnostics-color[=@var{WHEN}]
3403 @itemx -fno-diagnostics-color
3404 @opindex fdiagnostics-color
3405 @cindex highlight, color
3406 @vindex GCC_COLORS @r{environment variable}
3407 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3408 or @samp{auto}.  The default depends on how the compiler has been configured,
3409 it can be any of the above @var{WHEN} options or also @samp{never}
3410 if @env{GCC_COLORS} environment variable isn't present in the environment,
3411 and @samp{auto} otherwise.
3412 @samp{auto} means to use color only when the standard error is a terminal.
3413 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3414 aliases for @option{-fdiagnostics-color=always} and
3415 @option{-fdiagnostics-color=never}, respectively.
3417 The colors are defined by the environment variable @env{GCC_COLORS}.
3418 Its value is a colon-separated list of capabilities and Select Graphic
3419 Rendition (SGR) substrings. SGR commands are interpreted by the
3420 terminal or terminal emulator.  (See the section in the documentation
3421 of your text terminal for permitted values and their meanings as
3422 character attributes.)  These substring values are integers in decimal
3423 representation and can be concatenated with semicolons.
3424 Common values to concatenate include
3425 @samp{1} for bold,
3426 @samp{4} for underline,
3427 @samp{5} for blink,
3428 @samp{7} for inverse,
3429 @samp{39} for default foreground color,
3430 @samp{30} to @samp{37} for foreground colors,
3431 @samp{90} to @samp{97} for 16-color mode foreground colors,
3432 @samp{38;5;0} to @samp{38;5;255}
3433 for 88-color and 256-color modes foreground colors,
3434 @samp{49} for default background color,
3435 @samp{40} to @samp{47} for background colors,
3436 @samp{100} to @samp{107} for 16-color mode background colors,
3437 and @samp{48;5;0} to @samp{48;5;255}
3438 for 88-color and 256-color modes background colors.
3440 The default @env{GCC_COLORS} is
3441 @smallexample
3442 error=01;31:warning=01;35:note=01;36:range1=32:range2=34:locus=01:\
3443 quote=01:fixit-insert=32:fixit-delete=31:\
3444 diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32
3445 @end smallexample
3446 @noindent
3447 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3448 @samp{01;36} is bold cyan, @samp{32} is green, @samp{34} is blue,
3449 @samp{01} is bold, and @samp{31} is red.
3450 Setting @env{GCC_COLORS} to the empty string disables colors.
3451 Supported capabilities are as follows.
3453 @table @code
3454 @item error=
3455 @vindex error GCC_COLORS @r{capability}
3456 SGR substring for error: markers.
3458 @item warning=
3459 @vindex warning GCC_COLORS @r{capability}
3460 SGR substring for warning: markers.
3462 @item note=
3463 @vindex note GCC_COLORS @r{capability}
3464 SGR substring for note: markers.
3466 @item range1=
3467 @vindex range1 GCC_COLORS @r{capability}
3468 SGR substring for first additional range.
3470 @item range2=
3471 @vindex range2 GCC_COLORS @r{capability}
3472 SGR substring for second additional range.
3474 @item locus=
3475 @vindex locus GCC_COLORS @r{capability}
3476 SGR substring for location information, @samp{file:line} or
3477 @samp{file:line:column} etc.
3479 @item quote=
3480 @vindex quote GCC_COLORS @r{capability}
3481 SGR substring for information printed within quotes.
3483 @item fixit-insert=
3484 @vindex fixit-insert GCC_COLORS @r{capability}
3485 SGR substring for fix-it hints suggesting text to
3486 be inserted or replaced.
3488 @item fixit-delete=
3489 @vindex fixit-delete GCC_COLORS @r{capability}
3490 SGR substring for fix-it hints suggesting text to
3491 be deleted.
3493 @item diff-filename=
3494 @vindex diff-filename GCC_COLORS @r{capability}
3495 SGR substring for filename headers within generated patches.
3497 @item diff-hunk=
3498 @vindex diff-hunk GCC_COLORS @r{capability}
3499 SGR substring for the starts of hunks within generated patches.
3501 @item diff-delete=
3502 @vindex diff-delete GCC_COLORS @r{capability}
3503 SGR substring for deleted lines within generated patches.
3505 @item diff-insert=
3506 @vindex diff-insert GCC_COLORS @r{capability}
3507 SGR substring for inserted lines within generated patches.
3508 @end table
3510 @item -fno-diagnostics-show-option
3511 @opindex fno-diagnostics-show-option
3512 @opindex fdiagnostics-show-option
3513 By default, each diagnostic emitted includes text indicating the
3514 command-line option that directly controls the diagnostic (if such an
3515 option is known to the diagnostic machinery).  Specifying the
3516 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3518 @item -fno-diagnostics-show-caret
3519 @opindex fno-diagnostics-show-caret
3520 @opindex fdiagnostics-show-caret
3521 By default, each diagnostic emitted includes the original source line
3522 and a caret @samp{^} indicating the column.  This option suppresses this
3523 information.  The source line is truncated to @var{n} characters, if
3524 the @option{-fmessage-length=n} option is given.  When the output is done
3525 to the terminal, the width is limited to the width given by the
3526 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3528 @item -fdiagnostics-parseable-fixits
3529 @opindex fdiagnostics-parseable-fixits
3530 Emit fix-it hints in a machine-parseable format, suitable for consumption
3531 by IDEs.  For each fix-it, a line will be printed after the relevant
3532 diagnostic, starting with the string ``fix-it:''.  For example:
3534 @smallexample
3535 fix-it:"test.c":@{45:3-45:21@}:"gtk_widget_show_all"
3536 @end smallexample
3538 The location is expressed as a half-open range, expressed as a count of
3539 bytes, starting at byte 1 for the initial column.  In the above example,
3540 bytes 3 through 20 of line 45 of ``test.c'' are to be replaced with the
3541 given string:
3543 @smallexample
3544 00000000011111111112222222222
3545 12345678901234567890123456789
3546   gtk_widget_showall (dlg);
3547   ^^^^^^^^^^^^^^^^^^
3548   gtk_widget_show_all
3549 @end smallexample
3551 The filename and replacement string escape backslash as ``\\", tab as ``\t'',
3552 newline as ``\n'', double quotes as ``\"'', non-printable characters as octal
3553 (e.g. vertical tab as ``\013'').
3555 An empty replacement string indicates that the given range is to be removed.
3556 An empty range (e.g. ``45:3-45:3'') indicates that the string is to
3557 be inserted at the given position.
3559 @item -fdiagnostics-generate-patch
3560 @opindex fdiagnostics-generate-patch
3561 Print fix-it hints to stderr in unified diff format, after any diagnostics
3562 are printed.  For example:
3564 @smallexample
3565 --- test.c
3566 +++ test.c
3567 @@ -42,5 +42,5 @@
3569  void show_cb(GtkDialog *dlg)
3570  @{
3571 -  gtk_widget_showall(dlg);
3572 +  gtk_widget_show_all(dlg);
3573  @}
3575 @end smallexample
3577 The diff may or may not be colorized, following the same rules
3578 as for diagnostics (see @option{-fdiagnostics-color}).
3580 @item -fno-show-column
3581 @opindex fno-show-column
3582 Do not print column numbers in diagnostics.  This may be necessary if
3583 diagnostics are being scanned by a program that does not understand the
3584 column numbers, such as @command{dejagnu}.
3586 @end table
3588 @node Warning Options
3589 @section Options to Request or Suppress Warnings
3590 @cindex options to control warnings
3591 @cindex warning messages
3592 @cindex messages, warning
3593 @cindex suppressing warnings
3595 Warnings are diagnostic messages that report constructions that
3596 are not inherently erroneous but that are risky or suggest there
3597 may have been an error.
3599 The following language-independent options do not enable specific
3600 warnings but control the kinds of diagnostics produced by GCC@.
3602 @table @gcctabopt
3603 @cindex syntax checking
3604 @item -fsyntax-only
3605 @opindex fsyntax-only
3606 Check the code for syntax errors, but don't do anything beyond that.
3608 @item -fmax-errors=@var{n}
3609 @opindex fmax-errors
3610 Limits the maximum number of error messages to @var{n}, at which point
3611 GCC bails out rather than attempting to continue processing the source
3612 code.  If @var{n} is 0 (the default), there is no limit on the number
3613 of error messages produced.  If @option{-Wfatal-errors} is also
3614 specified, then @option{-Wfatal-errors} takes precedence over this
3615 option.
3617 @item -w
3618 @opindex w
3619 Inhibit all warning messages.
3621 @item -Werror
3622 @opindex Werror
3623 @opindex Wno-error
3624 Make all warnings into errors.
3626 @item -Werror=
3627 @opindex Werror=
3628 @opindex Wno-error=
3629 Make the specified warning into an error.  The specifier for a warning
3630 is appended; for example @option{-Werror=switch} turns the warnings
3631 controlled by @option{-Wswitch} into errors.  This switch takes a
3632 negative form, to be used to negate @option{-Werror} for specific
3633 warnings; for example @option{-Wno-error=switch} makes
3634 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3635 is in effect.
3637 The warning message for each controllable warning includes the
3638 option that controls the warning.  That option can then be used with
3639 @option{-Werror=} and @option{-Wno-error=} as described above.
3640 (Printing of the option in the warning message can be disabled using the
3641 @option{-fno-diagnostics-show-option} flag.)
3643 Note that specifying @option{-Werror=}@var{foo} automatically implies
3644 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3645 imply anything.
3647 @item -Wfatal-errors
3648 @opindex Wfatal-errors
3649 @opindex Wno-fatal-errors
3650 This option causes the compiler to abort compilation on the first error
3651 occurred rather than trying to keep going and printing further error
3652 messages.
3654 @end table
3656 You can request many specific warnings with options beginning with
3657 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3658 implicit declarations.  Each of these specific warning options also
3659 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3660 example, @option{-Wno-implicit}.  This manual lists only one of the
3661 two forms, whichever is not the default.  For further
3662 language-specific options also refer to @ref{C++ Dialect Options} and
3663 @ref{Objective-C and Objective-C++ Dialect Options}.
3665 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3666 options, such as @option{-Wunused}, which may turn on further options,
3667 such as @option{-Wunused-value}. The combined effect of positive and
3668 negative forms is that more specific options have priority over less
3669 specific ones, independently of their position in the command-line. For
3670 options of the same specificity, the last one takes effect. Options
3671 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3672 as if they appeared at the end of the command-line.
3674 When an unrecognized warning option is requested (e.g.,
3675 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3676 that the option is not recognized.  However, if the @option{-Wno-} form
3677 is used, the behavior is slightly different: no diagnostic is
3678 produced for @option{-Wno-unknown-warning} unless other diagnostics
3679 are being produced.  This allows the use of new @option{-Wno-} options
3680 with old compilers, but if something goes wrong, the compiler
3681 warns that an unrecognized option is present.
3683 @table @gcctabopt
3684 @item -Wpedantic
3685 @itemx -pedantic
3686 @opindex pedantic
3687 @opindex Wpedantic
3688 Issue all the warnings demanded by strict ISO C and ISO C++;
3689 reject all programs that use forbidden extensions, and some other
3690 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3691 version of the ISO C standard specified by any @option{-std} option used.
3693 Valid ISO C and ISO C++ programs should compile properly with or without
3694 this option (though a rare few require @option{-ansi} or a
3695 @option{-std} option specifying the required version of ISO C)@.  However,
3696 without this option, certain GNU extensions and traditional C and C++
3697 features are supported as well.  With this option, they are rejected.
3699 @option{-Wpedantic} does not cause warning messages for use of the
3700 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3701 warnings are also disabled in the expression that follows
3702 @code{__extension__}.  However, only system header files should use
3703 these escape routes; application programs should avoid them.
3704 @xref{Alternate Keywords}.
3706 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3707 C conformance.  They soon find that it does not do quite what they want:
3708 it finds some non-ISO practices, but not all---only those for which
3709 ISO C @emph{requires} a diagnostic, and some others for which
3710 diagnostics have been added.
3712 A feature to report any failure to conform to ISO C might be useful in
3713 some instances, but would require considerable additional work and would
3714 be quite different from @option{-Wpedantic}.  We don't have plans to
3715 support such a feature in the near future.
3717 Where the standard specified with @option{-std} represents a GNU
3718 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3719 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3720 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3721 where they are required by the base standard.  (It does not make sense
3722 for such warnings to be given only for features not in the specified GNU
3723 C dialect, since by definition the GNU dialects of C include all
3724 features the compiler supports with the given option, and there would be
3725 nothing to warn about.)
3727 @item -pedantic-errors
3728 @opindex pedantic-errors
3729 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3730 requires a diagnostic, in some cases where there is undefined behavior
3731 at compile-time and in some other cases that do not prevent compilation
3732 of programs that are valid according to the standard. This is not
3733 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3734 by this option and not enabled by the latter and vice versa.
3736 @item -Wall
3737 @opindex Wall
3738 @opindex Wno-all
3739 This enables all the warnings about constructions that some users
3740 consider questionable, and that are easy to avoid (or modify to
3741 prevent the warning), even in conjunction with macros.  This also
3742 enables some language-specific warnings described in @ref{C++ Dialect
3743 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3745 @option{-Wall} turns on the following warning flags:
3747 @gccoptlist{-Waddress   @gol
3748 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3749 -Wbool-compare  @gol
3750 -Wbool-operation  @gol
3751 -Wc++11-compat  -Wc++14-compat  @gol
3752 -Wchar-subscripts  @gol
3753 -Wcomment  @gol
3754 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
3755 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3756 -Wformat   @gol
3757 -Wint-in-bool-context  @gol
3758 -Wimplicit @r{(C and Objective-C only)} @gol
3759 -Wimplicit-int @r{(C and Objective-C only)} @gol
3760 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3761 -Winit-self @r{(only for C++)} @gol
3762 -Wlogical-not-parentheses @gol
3763 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3764 -Wmaybe-uninitialized @gol
3765 -Wmemset-elt-size @gol
3766 -Wmemset-transposed-args @gol
3767 -Wmisleading-indentation @r{(only for C/C++)} @gol
3768 -Wmissing-braces @r{(only for C/ObjC)} @gol
3769 -Wnarrowing @r{(only for C++)}  @gol
3770 -Wnonnull  @gol
3771 -Wnonnull-compare  @gol
3772 -Wopenmp-simd @gol
3773 -Wparentheses  @gol
3774 -Wpointer-sign  @gol
3775 -Wreorder   @gol
3776 -Wreturn-type  @gol
3777 -Wsequence-point  @gol
3778 -Wsign-compare @r{(only in C++)}  @gol
3779 -Wsizeof-pointer-memaccess @gol
3780 -Wstrict-aliasing  @gol
3781 -Wstrict-overflow=1  @gol
3782 -Wswitch  @gol
3783 -Wtautological-compare  @gol
3784 -Wtrigraphs  @gol
3785 -Wuninitialized  @gol
3786 -Wunknown-pragmas  @gol
3787 -Wunused-function  @gol
3788 -Wunused-label     @gol
3789 -Wunused-value     @gol
3790 -Wunused-variable  @gol
3791 -Wvolatile-register-var @gol
3794 Note that some warning flags are not implied by @option{-Wall}.  Some of
3795 them warn about constructions that users generally do not consider
3796 questionable, but which occasionally you might wish to check for;
3797 others warn about constructions that are necessary or hard to avoid in
3798 some cases, and there is no simple way to modify the code to suppress
3799 the warning. Some of them are enabled by @option{-Wextra} but many of
3800 them must be enabled individually.
3802 @item -Wextra
3803 @opindex W
3804 @opindex Wextra
3805 @opindex Wno-extra
3806 This enables some extra warning flags that are not enabled by
3807 @option{-Wall}. (This option used to be called @option{-W}.  The older
3808 name is still supported, but the newer name is more descriptive.)
3810 @gccoptlist{-Wclobbered  @gol
3811 -Wempty-body  @gol
3812 -Wignored-qualifiers @gol
3813 -Wimplicit-fallthrough=3 @gol
3814 -Wmissing-field-initializers  @gol
3815 -Wmissing-parameter-type @r{(C only)}  @gol
3816 -Wold-style-declaration @r{(C only)}  @gol
3817 -Woverride-init  @gol
3818 -Wsign-compare @r{(C only)} @gol
3819 -Wtype-limits  @gol
3820 -Wuninitialized  @gol
3821 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
3822 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3823 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3826 The option @option{-Wextra} also prints warning messages for the
3827 following cases:
3829 @itemize @bullet
3831 @item
3832 A pointer is compared against integer zero with @code{<}, @code{<=},
3833 @code{>}, or @code{>=}.
3835 @item
3836 (C++ only) An enumerator and a non-enumerator both appear in a
3837 conditional expression.
3839 @item
3840 (C++ only) Ambiguous virtual bases.
3842 @item
3843 (C++ only) Subscripting an array that has been declared @code{register}.
3845 @item
3846 (C++ only) Taking the address of a variable that has been declared
3847 @code{register}.
3849 @item
3850 (C++ only) A base class is not initialized in the copy constructor
3851 of a derived class.
3853 @end itemize
3855 @item -Wchar-subscripts
3856 @opindex Wchar-subscripts
3857 @opindex Wno-char-subscripts
3858 Warn if an array subscript has type @code{char}.  This is a common cause
3859 of error, as programmers often forget that this type is signed on some
3860 machines.
3861 This warning is enabled by @option{-Wall}.
3863 @item -Wchkp
3864 @opindex Wchkp
3865 Warn about an invalid memory access that is found by Pointer Bounds Checker
3866 (@option{-fcheck-pointer-bounds}).
3868 @item -Wno-coverage-mismatch
3869 @opindex Wno-coverage-mismatch
3870 Warn if feedback profiles do not match when using the
3871 @option{-fprofile-use} option.
3872 If a source file is changed between compiling with @option{-fprofile-gen} and
3873 with @option{-fprofile-use}, the files with the profile feedback can fail
3874 to match the source file and GCC cannot use the profile feedback
3875 information.  By default, this warning is enabled and is treated as an
3876 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3877 warning or @option{-Wno-error=coverage-mismatch} can be used to
3878 disable the error.  Disabling the error for this warning can result in
3879 poorly optimized code and is useful only in the
3880 case of very minor changes such as bug fixes to an existing code-base.
3881 Completely disabling the warning is not recommended.
3883 @item -Wno-cpp
3884 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3886 Suppress warning messages emitted by @code{#warning} directives.
3888 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3889 @opindex Wdouble-promotion
3890 @opindex Wno-double-promotion
3891 Give a warning when a value of type @code{float} is implicitly
3892 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3893 floating-point unit implement @code{float} in hardware, but emulate
3894 @code{double} in software.  On such a machine, doing computations
3895 using @code{double} values is much more expensive because of the
3896 overhead required for software emulation.
3898 It is easy to accidentally do computations with @code{double} because
3899 floating-point literals are implicitly of type @code{double}.  For
3900 example, in:
3901 @smallexample
3902 @group
3903 float area(float radius)
3905    return 3.14159 * radius * radius;
3907 @end group
3908 @end smallexample
3909 the compiler performs the entire computation with @code{double}
3910 because the floating-point literal is a @code{double}.
3912 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
3913 @opindex Wduplicate-decl-specifier
3914 @opindex Wno-duplicate-decl-specifier
3915 Warn if a declaration has duplicate @code{const}, @code{volatile},
3916 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
3917 @option{-Wall}.
3919 @item -Wformat
3920 @itemx -Wformat=@var{n}
3921 @opindex Wformat
3922 @opindex Wno-format
3923 @opindex ffreestanding
3924 @opindex fno-builtin
3925 @opindex Wformat=
3926 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3927 the arguments supplied have types appropriate to the format string
3928 specified, and that the conversions specified in the format string make
3929 sense.  This includes standard functions, and others specified by format
3930 attributes (@pxref{Function Attributes}), in the @code{printf},
3931 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3932 not in the C standard) families (or other target-specific families).
3933 Which functions are checked without format attributes having been
3934 specified depends on the standard version selected, and such checks of
3935 functions without the attribute specified are disabled by
3936 @option{-ffreestanding} or @option{-fno-builtin}.
3938 The formats are checked against the format features supported by GNU
3939 libc version 2.2.  These include all ISO C90 and C99 features, as well
3940 as features from the Single Unix Specification and some BSD and GNU
3941 extensions.  Other library implementations may not support all these
3942 features; GCC does not support warning about features that go beyond a
3943 particular library's limitations.  However, if @option{-Wpedantic} is used
3944 with @option{-Wformat}, warnings are given about format features not
3945 in the selected standard version (but not for @code{strfmon} formats,
3946 since those are not in any version of the C standard).  @xref{C Dialect
3947 Options,,Options Controlling C Dialect}.
3949 @table @gcctabopt
3950 @item -Wformat=1
3951 @itemx -Wformat
3952 @opindex Wformat
3953 @opindex Wformat=1
3954 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3955 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3956 @option{-Wformat} also checks for null format arguments for several
3957 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3958 aspects of this level of format checking can be disabled by the
3959 options: @option{-Wno-format-contains-nul},
3960 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3961 @option{-Wformat} is enabled by @option{-Wall}.
3963 @item -Wno-format-contains-nul
3964 @opindex Wno-format-contains-nul
3965 @opindex Wformat-contains-nul
3966 If @option{-Wformat} is specified, do not warn about format strings that
3967 contain NUL bytes.
3969 @item -Wno-format-extra-args
3970 @opindex Wno-format-extra-args
3971 @opindex Wformat-extra-args
3972 If @option{-Wformat} is specified, do not warn about excess arguments to a
3973 @code{printf} or @code{scanf} format function.  The C standard specifies
3974 that such arguments are ignored.
3976 Where the unused arguments lie between used arguments that are
3977 specified with @samp{$} operand number specifications, normally
3978 warnings are still given, since the implementation could not know what
3979 type to pass to @code{va_arg} to skip the unused arguments.  However,
3980 in the case of @code{scanf} formats, this option suppresses the
3981 warning if the unused arguments are all pointers, since the Single
3982 Unix Specification says that such unused arguments are allowed.
3984 @item -Wformat-overflow
3985 @itemx -Wformat-overflow=@var{level}
3986 @opindex Wformat-overflow
3987 @opindex Wno-format-overflow
3988 Warn about calls to formatted input/output functions such as @code{sprintf}
3989 and @code{vsprintf} that might overflow the destination buffer.  When the
3990 exact number of bytes written by a format directive cannot be determined
3991 at compile-time it is estimated based on heuristics that depend on the
3992 @var{level} argument and on optimization.  While enabling optimization
3993 will in most cases improve the accuracy of the warning, it may also
3994 result in false positives.
3996 @table @gcctabopt
3997 @item -Wformat-overflow
3998 @item -Wformat-overflow=1
3999 @opindex Wformat-overflow
4000 @opindex Wno-format-overflow
4001 Level @var{1} of @option{-Wformat-overflow} enabled by @option{-Wformat}
4002 employs a conservative approach that warns only about calls that most
4003 likely overflow the buffer.  At this level, numeric arguments to format
4004 directives with unknown values are assumed to have the value of one, and
4005 strings of unknown length to be empty.  Numeric arguments that are known
4006 to be bounded to a subrange of their type, or string arguments whose output
4007 is bounded either by their directive's precision or by a finite set of
4008 string literals, are assumed to take on the value within the range that
4009 results in the most bytes on output.  For example, the call to @code{sprintf}
4010 below is diagnosed because even with both @var{a} and @var{b} equal to zero,
4011 the terminating NUL character (@code{'\0'}) appended by the function
4012 to the destination buffer will be written past its end.  Increasing
4013 the size of the buffer by a single byte is sufficient to avoid the
4014 warning, though it may not be sufficient to avoid the overflow.
4016 @smallexample
4017 void f (int a, int b)
4019   char buf [12];
4020   sprintf (buf, "a = %i, b = %i\n", a, b);
4022 @end smallexample
4024 @item -Wformat-overflow=2
4025 Level @var{2} warns also about calls that might overflow the destination
4026 buffer given an argument of sufficient length or magnitude.  At level
4027 @var{2}, unknown numeric arguments are assumed to have the minimum
4028 representable value for signed types with a precision greater than 1, and
4029 the maximum representable value otherwise.  Unknown string arguments whose
4030 length cannot be assumed to be bounded either by the directive's precision,
4031 or by a finite set of string literals they may evaluate to, or the character
4032 array they may point to, are assumed to be 1 character long.
4034 At level @var{2}, the call in the example above is again diagnosed, but
4035 this time because with @var{a} equal to a 32-bit @code{INT_MIN} the first
4036 @code{%i} directive will write some of its digits beyond the end of
4037 the destination buffer.  To make the call safe regardless of the values
4038 of the two variables, the size of the destination buffer must be increased
4039 to at least 34 bytes.  GCC includes the minimum size of the buffer in
4040 an informational note following the warning.
4042 An alternative to increasing the size of the destination buffer is to
4043 constrain the range of formatted values.  The maximum length of string
4044 arguments can be bounded by specifying the precision in the format
4045 directive.  When numeric arguments of format directives can be assumed
4046 to be bounded by less than the precision of their type, choosing
4047 an appropriate length modifier to the format specifier will reduce
4048 the required buffer size.  For example, if @var{a} and @var{b} in the
4049 example above can be assumed to be within the precision of
4050 the @code{short int} type then using either the @code{%hi} format
4051 directive or casting the argument to @code{short} reduces the maximum
4052 required size of the buffer to 24 bytes.
4054 @smallexample
4055 void f (int a, int b)
4057   char buf [23];
4058   sprintf (buf, "a = %hi, b = %i\n", a, (short)b);
4060 @end smallexample
4061 @end table
4063 @item -Wno-format-zero-length
4064 @opindex Wno-format-zero-length
4065 @opindex Wformat-zero-length
4066 If @option{-Wformat} is specified, do not warn about zero-length formats.
4067 The C standard specifies that zero-length formats are allowed.
4070 @item -Wformat=2
4071 @opindex Wformat=2
4072 Enable @option{-Wformat} plus additional format checks.  Currently
4073 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
4074 -Wformat-y2k}.
4076 @item -Wformat-nonliteral
4077 @opindex Wformat-nonliteral
4078 @opindex Wno-format-nonliteral
4079 If @option{-Wformat} is specified, also warn if the format string is not a
4080 string literal and so cannot be checked, unless the format function
4081 takes its format arguments as a @code{va_list}.
4083 @item -Wformat-security
4084 @opindex Wformat-security
4085 @opindex Wno-format-security
4086 If @option{-Wformat} is specified, also warn about uses of format
4087 functions that represent possible security problems.  At present, this
4088 warns about calls to @code{printf} and @code{scanf} functions where the
4089 format string is not a string literal and there are no format arguments,
4090 as in @code{printf (foo);}.  This may be a security hole if the format
4091 string came from untrusted input and contains @samp{%n}.  (This is
4092 currently a subset of what @option{-Wformat-nonliteral} warns about, but
4093 in future warnings may be added to @option{-Wformat-security} that are not
4094 included in @option{-Wformat-nonliteral}.)
4096 @item -Wformat-signedness
4097 @opindex Wformat-signedness
4098 @opindex Wno-format-signedness
4099 If @option{-Wformat} is specified, also warn if the format string
4100 requires an unsigned argument and the argument is signed and vice versa.
4102 @item -Wformat-truncation
4103 @itemx -Wformat-truncation=@var{level}
4104 @opindex Wformat-truncation
4105 @opindex Wno-format-truncation
4106 Warn about calls to formatted input/output functions such as @code{snprintf}
4107 and @code{vsnprintf} that might result in output truncation.  When the exact
4108 number of bytes written by a format directive cannot be determined at
4109 compile-time it is estimated based on heuristics that depend on
4110 the @var{level} argument and on optimization.  While enabling optimization
4111 will in most cases improve the accuracy of the warning, it may also result
4112 in false positives.  Except as noted otherwise, the option uses the same
4113 logic @option{-Wformat-overflow}.
4115 @table @gcctabopt
4116 @item -Wformat-truncation
4117 @item -Wformat-truncation=1
4118 @opindex Wformat-truncation
4119 @opindex Wno-format-overflow
4120 Level @var{1} of @option{-Wformat-truncation} enabled by @option{-Wformat}
4121 employs a conservative approach that warns only about calls to bounded
4122 functions whose return value is unused and that will most likely result
4123 in output truncation.
4125 @item -Wformat-truncation=2
4126 Level @var{2} warns also about calls to bounded functions whose return
4127 value is used and that might result in truncation given an argument of
4128 sufficient length or magnitude.
4129 @end table
4131 @item -Wformat-y2k
4132 @opindex Wformat-y2k
4133 @opindex Wno-format-y2k
4134 If @option{-Wformat} is specified, also warn about @code{strftime}
4135 formats that may yield only a two-digit year.
4136 @end table
4138 @item -Wnonnull
4139 @opindex Wnonnull
4140 @opindex Wno-nonnull
4141 Warn about passing a null pointer for arguments marked as
4142 requiring a non-null value by the @code{nonnull} function attribute.
4144 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
4145 can be disabled with the @option{-Wno-nonnull} option.
4147 @item -Wnonnull-compare
4148 @opindex Wnonnull-compare
4149 @opindex Wno-nonnull-compare
4150 Warn when comparing an argument marked with the @code{nonnull}
4151 function attribute against null inside the function.
4153 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
4154 can be disabled with the @option{-Wno-nonnull-compare} option.
4156 @item -Wnull-dereference
4157 @opindex Wnull-dereference
4158 @opindex Wno-null-dereference
4159 Warn if the compiler detects paths that trigger erroneous or
4160 undefined behavior due to dereferencing a null pointer.  This option
4161 is only active when @option{-fdelete-null-pointer-checks} is active,
4162 which is enabled by optimizations in most targets.  The precision of
4163 the warnings depends on the optimization options used.
4165 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
4166 @opindex Winit-self
4167 @opindex Wno-init-self
4168 Warn about uninitialized variables that are initialized with themselves.
4169 Note this option can only be used with the @option{-Wuninitialized} option.
4171 For example, GCC warns about @code{i} being uninitialized in the
4172 following snippet only when @option{-Winit-self} has been specified:
4173 @smallexample
4174 @group
4175 int f()
4177   int i = i;
4178   return i;
4180 @end group
4181 @end smallexample
4183 This warning is enabled by @option{-Wall} in C++.
4185 @item -Wimplicit-int @r{(C and Objective-C only)}
4186 @opindex Wimplicit-int
4187 @opindex Wno-implicit-int
4188 Warn when a declaration does not specify a type.
4189 This warning is enabled by @option{-Wall}.
4191 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
4192 @opindex Wimplicit-function-declaration
4193 @opindex Wno-implicit-function-declaration
4194 Give a warning whenever a function is used before being declared. In
4195 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
4196 enabled by default and it is made into an error by
4197 @option{-pedantic-errors}. This warning is also enabled by
4198 @option{-Wall}.
4200 @item -Wimplicit @r{(C and Objective-C only)}
4201 @opindex Wimplicit
4202 @opindex Wno-implicit
4203 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
4204 This warning is enabled by @option{-Wall}.
4206 @item -Wimplicit-fallthrough
4207 @opindex Wimplicit-fallthrough
4208 @opindex Wno-implicit-fallthrough
4209 @option{-Wimplicit-fallthrough} is the same as @option{-Wimplicit-fallthrough=3}
4210 and @option{-Wno-implicit-fallthrough} is the same as
4211 @option{-Wimplicit-fallthrough=0}.
4213 @item -Wimplicit-fallthrough=@var{n}
4214 @opindex Wimplicit-fallthrough=
4215 Warn when a switch case falls through.  For example:
4217 @smallexample
4218 @group
4219 switch (cond)
4220   @{
4221   case 1:
4222     a = 1;
4223     break;
4224   case 2:
4225     a = 2;
4226   case 3:
4227     a = 3;
4228     break;
4229   @}
4230 @end group
4231 @end smallexample
4233 This warning does not warn when the last statement of a case cannot
4234 fall through, e.g. when there is a return statement or a call to function
4235 declared with the noreturn attribute.  @option{-Wimplicit-fallthrough=}
4236 also takes into account control flow statements, such as ifs, and only
4237 warns when appropriate.  E.g.@:
4239 @smallexample
4240 @group
4241 switch (cond)
4242   @{
4243   case 1:
4244     if (i > 3) @{
4245       bar (5);
4246       break;
4247     @} else if (i < 1) @{
4248       bar (0);
4249     @} else
4250       return;
4251   default:
4252     @dots{}
4253   @}
4254 @end group
4255 @end smallexample
4257 Since there are occasions where a switch case fall through is desirable,
4258 GCC provides an attribute, @code{__attribute__ ((fallthrough))}, that is
4259 to be used along with a null statement to suppress this warning that
4260 would normally occur:
4262 @smallexample
4263 @group
4264 switch (cond)
4265   @{
4266   case 1:
4267     bar (0);
4268     __attribute__ ((fallthrough));
4269   default:
4270     @dots{}
4271   @}
4272 @end group
4273 @end smallexample
4275 C++17 provides a standard way to suppress the @option{-Wimplicit-fallthrough}
4276 warning using @code{[[fallthrough]];} instead of the GNU attribute.  In C++11
4277 or C++14 users can use @code{[[gnu::fallthrough]];}, which is a GNU extension.
4278 Instead of the these attributes, it is also possible to add a fallthrough
4279 comment to silence the warning.  The whole body of the C or C++ style comment
4280 should match the given regular expressions listed below.  The option argument
4281 @var{n} specifies what kind of comments are accepted:
4283 @itemize @bullet
4285 @item @option{-Wimplicit-fallthrough=0} disables the warning altogether.
4287 @item @option{-Wimplicit-fallthrough=1} matches @code{.*} regular
4288 expression, any comment is used as fallthrough comment.
4290 @item @option{-Wimplicit-fallthrough=2} case insensitively matches
4291 @code{.*falls?[ \t-]*thr(ough|u).*} regular expression.
4293 @item @option{-Wimplicit-fallthrough=3} case sensitively matches one of the
4294 following regular expressions:
4296 @itemize @bullet
4298 @item @code{-fallthrough}
4300 @item @code{@@fallthrough@@}
4302 @item @code{lint -fallthrough[ \t]*}
4304 @item @code{[ \t.!]*(ELSE,? |INTENTIONAL(LY)? )?@*FALL(S | |-)?THR(OUGH|U)[ \t.!]*(-[^\n\r]*)?}
4306 @item @code{[ \t.!]*(Else,? |Intentional(ly)? )?@*Fall((s | |-)[Tt]|t)hr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4308 @item @code{[ \t.!]*([Ee]lse,? |[Ii]ntentional(ly)? )?@*fall(s | |-)?thr(ough|u)[ \t.!]*(-[^\n\r]*)?}
4310 @end itemize
4312 @item @option{-Wimplicit-fallthrough=4} case sensitively matches one of the
4313 following regular expressions:
4315 @itemize @bullet
4317 @item @code{-fallthrough}
4319 @item @code{@@fallthrough@@}
4321 @item @code{lint -fallthrough[ \t]*}
4323 @item @code{[ \t]*FALLTHR(OUGH|U)[ \t]*}
4325 @end itemize
4327 @item @option{-Wimplicit-fallthrough=5} doesn't recognize any comments as
4328 fallthrough comments, only attributes disable the warning.
4330 @end itemize
4332 The comment needs to be followed after optional whitespace and other comments
4333 by @code{case} or @code{default} keywords or by a user label that precedes some
4334 @code{case} or @code{default} label.
4336 @smallexample
4337 @group
4338 switch (cond)
4339   @{
4340   case 1:
4341     bar (0);
4342     /* FALLTHRU */
4343   default:
4344     @dots{}
4345   @}
4346 @end group
4347 @end smallexample
4349 The @option{-Wimplicit-fallthrough=3} warning is enabled by @option{-Wextra}.
4351 @item -Wignored-qualifiers @r{(C and C++ only)}
4352 @opindex Wignored-qualifiers
4353 @opindex Wno-ignored-qualifiers
4354 Warn if the return type of a function has a type qualifier
4355 such as @code{const}.  For ISO C such a type qualifier has no effect,
4356 since the value returned by a function is not an lvalue.
4357 For C++, the warning is only emitted for scalar types or @code{void}.
4358 ISO C prohibits qualified @code{void} return types on function
4359 definitions, so such return types always receive a warning
4360 even without this option.
4362 This warning is also enabled by @option{-Wextra}.
4364 @item -Wignored-attributes @r{(C and C++ only)}
4365 @opindex Wignored-attributes
4366 @opindex Wno-ignored-attributes
4367 Warn when an attribute is ignored.  This is different from the
4368 @option{-Wattributes} option in that it warns whenever the compiler decides
4369 to drop an attribute, not that the attribute is either unknown, used in a
4370 wrong place, etc.  This warning is enabled by default.
4372 @item -Wmain
4373 @opindex Wmain
4374 @opindex Wno-main
4375 Warn if the type of @code{main} is suspicious.  @code{main} should be
4376 a function with external linkage, returning int, taking either zero
4377 arguments, two, or three arguments of appropriate types.  This warning
4378 is enabled by default in C++ and is enabled by either @option{-Wall}
4379 or @option{-Wpedantic}.
4381 @item -Wmisleading-indentation @r{(C and C++ only)}
4382 @opindex Wmisleading-indentation
4383 @opindex Wno-misleading-indentation
4384 Warn when the indentation of the code does not reflect the block structure.
4385 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
4386 @code{for} clauses with a guarded statement that does not use braces,
4387 followed by an unguarded statement with the same indentation.
4389 In the following example, the call to ``bar'' is misleadingly indented as
4390 if it were guarded by the ``if'' conditional.
4392 @smallexample
4393   if (some_condition ())
4394     foo ();
4395     bar ();  /* Gotcha: this is not guarded by the "if".  */
4396 @end smallexample
4398 In the case of mixed tabs and spaces, the warning uses the
4399 @option{-ftabstop=} option to determine if the statements line up
4400 (defaulting to 8).
4402 The warning is not issued for code involving multiline preprocessor logic
4403 such as the following example.
4405 @smallexample
4406   if (flagA)
4407     foo (0);
4408 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
4409   if (flagB)
4410 #endif
4411     foo (1);
4412 @end smallexample
4414 The warning is not issued after a @code{#line} directive, since this
4415 typically indicates autogenerated code, and no assumptions can be made
4416 about the layout of the file that the directive references.
4418 This warning is enabled by @option{-Wall} in C and C++.
4420 @item -Wmissing-braces
4421 @opindex Wmissing-braces
4422 @opindex Wno-missing-braces
4423 Warn if an aggregate or union initializer is not fully bracketed.  In
4424 the following example, the initializer for @code{a} is not fully
4425 bracketed, but that for @code{b} is fully bracketed.  This warning is
4426 enabled by @option{-Wall} in C.
4428 @smallexample
4429 int a[2][2] = @{ 0, 1, 2, 3 @};
4430 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
4431 @end smallexample
4433 This warning is enabled by @option{-Wall}.
4435 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
4436 @opindex Wmissing-include-dirs
4437 @opindex Wno-missing-include-dirs
4438 Warn if a user-supplied include directory does not exist.
4440 @item -Wparentheses
4441 @opindex Wparentheses
4442 @opindex Wno-parentheses
4443 Warn if parentheses are omitted in certain contexts, such
4444 as when there is an assignment in a context where a truth value
4445 is expected, or when operators are nested whose precedence people
4446 often get confused about.
4448 Also warn if a comparison like @code{x<=y<=z} appears; this is
4449 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
4450 interpretation from that of ordinary mathematical notation.
4452 Also warn for dangerous uses of the GNU extension to
4453 @code{?:} with omitted middle operand. When the condition
4454 in the @code{?}: operator is a boolean expression, the omitted value is
4455 always 1.  Often programmers expect it to be a value computed
4456 inside the conditional expression instead.
4458 This warning is enabled by @option{-Wall}.
4460 @item -Wsequence-point
4461 @opindex Wsequence-point
4462 @opindex Wno-sequence-point
4463 Warn about code that may have undefined semantics because of violations
4464 of sequence point rules in the C and C++ standards.
4466 The C and C++ standards define the order in which expressions in a C/C++
4467 program are evaluated in terms of @dfn{sequence points}, which represent
4468 a partial ordering between the execution of parts of the program: those
4469 executed before the sequence point, and those executed after it.  These
4470 occur after the evaluation of a full expression (one which is not part
4471 of a larger expression), after the evaluation of the first operand of a
4472 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4473 function is called (but after the evaluation of its arguments and the
4474 expression denoting the called function), and in certain other places.
4475 Other than as expressed by the sequence point rules, the order of
4476 evaluation of subexpressions of an expression is not specified.  All
4477 these rules describe only a partial order rather than a total order,
4478 since, for example, if two functions are called within one expression
4479 with no sequence point between them, the order in which the functions
4480 are called is not specified.  However, the standards committee have
4481 ruled that function calls do not overlap.
4483 It is not specified when between sequence points modifications to the
4484 values of objects take effect.  Programs whose behavior depends on this
4485 have undefined behavior; the C and C++ standards specify that ``Between
4486 the previous and next sequence point an object shall have its stored
4487 value modified at most once by the evaluation of an expression.
4488 Furthermore, the prior value shall be read only to determine the value
4489 to be stored.''.  If a program breaks these rules, the results on any
4490 particular implementation are entirely unpredictable.
4492 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4493 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4494 diagnosed by this option, and it may give an occasional false positive
4495 result, but in general it has been found fairly effective at detecting
4496 this sort of problem in programs.
4498 The C++17 standard will define the order of evaluation of operands in
4499 more cases: in particular it requires that the right-hand side of an
4500 assignment be evaluated before the left-hand side, so the above
4501 examples are no longer undefined.  But this warning will still warn
4502 about them, to help people avoid writing code that is undefined in C
4503 and earlier revisions of C++.
4505 The standard is worded confusingly, therefore there is some debate
4506 over the precise meaning of the sequence point rules in subtle cases.
4507 Links to discussions of the problem, including proposed formal
4508 definitions, may be found on the GCC readings page, at
4509 @uref{http://gcc.gnu.org/@/readings.html}.
4511 This warning is enabled by @option{-Wall} for C and C++.
4513 @item -Wno-return-local-addr
4514 @opindex Wno-return-local-addr
4515 @opindex Wreturn-local-addr
4516 Do not warn about returning a pointer (or in C++, a reference) to a
4517 variable that goes out of scope after the function returns.
4519 @item -Wreturn-type
4520 @opindex Wreturn-type
4521 @opindex Wno-return-type
4522 Warn whenever a function is defined with a return type that defaults
4523 to @code{int}.  Also warn about any @code{return} statement with no
4524 return value in a function whose return type is not @code{void}
4525 (falling off the end of the function body is considered returning
4526 without a value).
4528 For C only, warn about a @code{return} statement with an expression in a
4529 function whose return type is @code{void}, unless the expression type is
4530 also @code{void}.  As a GNU extension, the latter case is accepted
4531 without a warning unless @option{-Wpedantic} is used.
4533 For C++, a function without return type always produces a diagnostic
4534 message, even when @option{-Wno-return-type} is specified.  The only
4535 exceptions are @code{main} and functions defined in system headers.
4537 This warning is enabled by @option{-Wall}.
4539 @item -Wshift-count-negative
4540 @opindex Wshift-count-negative
4541 @opindex Wno-shift-count-negative
4542 Warn if shift count is negative. This warning is enabled by default.
4544 @item -Wshift-count-overflow
4545 @opindex Wshift-count-overflow
4546 @opindex Wno-shift-count-overflow
4547 Warn if shift count >= width of type. This warning is enabled by default.
4549 @item -Wshift-negative-value
4550 @opindex Wshift-negative-value
4551 @opindex Wno-shift-negative-value
4552 Warn if left shifting a negative value.  This warning is enabled by
4553 @option{-Wextra} in C99 and C++11 modes (and newer).
4555 @item -Wshift-overflow
4556 @itemx -Wshift-overflow=@var{n}
4557 @opindex Wshift-overflow
4558 @opindex Wno-shift-overflow
4559 Warn about left shift overflows.  This warning is enabled by
4560 default in C99 and C++11 modes (and newer).
4562 @table @gcctabopt
4563 @item -Wshift-overflow=1
4564 This is the warning level of @option{-Wshift-overflow} and is enabled
4565 by default in C99 and C++11 modes (and newer).  This warning level does
4566 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4567 an overflow is still rejected in contexts where an integer constant expression
4568 is required.)
4570 @item -Wshift-overflow=2
4571 This warning level also warns about left-shifting 1 into the sign bit,
4572 unless C++14 mode is active.
4573 @end table
4575 @item -Wswitch
4576 @opindex Wswitch
4577 @opindex Wno-switch
4578 Warn whenever a @code{switch} statement has an index of enumerated type
4579 and lacks a @code{case} for one or more of the named codes of that
4580 enumeration.  (The presence of a @code{default} label prevents this
4581 warning.)  @code{case} labels outside the enumeration range also
4582 provoke warnings when this option is used (even if there is a
4583 @code{default} label).
4584 This warning is enabled by @option{-Wall}.
4586 @item -Wswitch-default
4587 @opindex Wswitch-default
4588 @opindex Wno-switch-default
4589 Warn whenever a @code{switch} statement does not have a @code{default}
4590 case.
4592 @item -Wswitch-enum
4593 @opindex Wswitch-enum
4594 @opindex Wno-switch-enum
4595 Warn whenever a @code{switch} statement has an index of enumerated type
4596 and lacks a @code{case} for one or more of the named codes of that
4597 enumeration.  @code{case} labels outside the enumeration range also
4598 provoke warnings when this option is used.  The only difference
4599 between @option{-Wswitch} and this option is that this option gives a
4600 warning about an omitted enumeration code even if there is a
4601 @code{default} label.
4603 @item -Wswitch-bool
4604 @opindex Wswitch-bool
4605 @opindex Wno-switch-bool
4606 Warn whenever a @code{switch} statement has an index of boolean type
4607 and the case values are outside the range of a boolean type.
4608 It is possible to suppress this warning by casting the controlling
4609 expression to a type other than @code{bool}.  For example:
4610 @smallexample
4611 @group
4612 switch ((int) (a == 4))
4613   @{
4614   @dots{}
4615   @}
4616 @end group
4617 @end smallexample
4618 This warning is enabled by default for C and C++ programs.
4620 @item -Wswitch-unreachable
4621 @opindex Wswitch-unreachable
4622 @opindex Wno-switch-unreachable
4623 Warn whenever a @code{switch} statement contains statements between the
4624 controlling expression and the first case label, which will never be
4625 executed.  For example:
4626 @smallexample
4627 @group
4628 switch (cond)
4629   @{
4630    i = 15;
4631   @dots{}
4632    case 5:
4633   @dots{}
4634   @}
4635 @end group
4636 @end smallexample
4637 @option{-Wswitch-unreachable} does not warn if the statement between the
4638 controlling expression and the first case label is just a declaration:
4639 @smallexample
4640 @group
4641 switch (cond)
4642   @{
4643    int i;
4644   @dots{}
4645    case 5:
4646    i = 5;
4647   @dots{}
4648   @}
4649 @end group
4650 @end smallexample
4651 This warning is enabled by default for C and C++ programs.
4653 @item -Wsync-nand @r{(C and C++ only)}
4654 @opindex Wsync-nand
4655 @opindex Wno-sync-nand
4656 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4657 built-in functions are used.  These functions changed semantics in GCC 4.4.
4659 @item -Wunused-but-set-parameter
4660 @opindex Wunused-but-set-parameter
4661 @opindex Wno-unused-but-set-parameter
4662 Warn whenever a function parameter is assigned to, but otherwise unused
4663 (aside from its declaration).
4665 To suppress this warning use the @code{unused} attribute
4666 (@pxref{Variable Attributes}).
4668 This warning is also enabled by @option{-Wunused} together with
4669 @option{-Wextra}.
4671 @item -Wunused-but-set-variable
4672 @opindex Wunused-but-set-variable
4673 @opindex Wno-unused-but-set-variable
4674 Warn whenever a local variable is assigned to, but otherwise unused
4675 (aside from its declaration).
4676 This warning is enabled by @option{-Wall}.
4678 To suppress this warning use the @code{unused} attribute
4679 (@pxref{Variable Attributes}).
4681 This warning is also enabled by @option{-Wunused}, which is enabled
4682 by @option{-Wall}.
4684 @item -Wunused-function
4685 @opindex Wunused-function
4686 @opindex Wno-unused-function
4687 Warn whenever a static function is declared but not defined or a
4688 non-inline static function is unused.
4689 This warning is enabled by @option{-Wall}.
4691 @item -Wunused-label
4692 @opindex Wunused-label
4693 @opindex Wno-unused-label
4694 Warn whenever a label is declared but not used.
4695 This warning is enabled by @option{-Wall}.
4697 To suppress this warning use the @code{unused} attribute
4698 (@pxref{Variable Attributes}).
4700 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4701 @opindex Wunused-local-typedefs
4702 Warn when a typedef locally defined in a function is not used.
4703 This warning is enabled by @option{-Wall}.
4705 @item -Wunused-parameter
4706 @opindex Wunused-parameter
4707 @opindex Wno-unused-parameter
4708 Warn whenever a function parameter is unused aside from its declaration.
4710 To suppress this warning use the @code{unused} attribute
4711 (@pxref{Variable Attributes}).
4713 @item -Wno-unused-result
4714 @opindex Wunused-result
4715 @opindex Wno-unused-result
4716 Do not warn if a caller of a function marked with attribute
4717 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4718 its return value. The default is @option{-Wunused-result}.
4720 @item -Wunused-variable
4721 @opindex Wunused-variable
4722 @opindex Wno-unused-variable
4723 Warn whenever a local or static variable is unused aside from its
4724 declaration. This option implies @option{-Wunused-const-variable=1} for C,
4725 but not for C++. This warning is enabled by @option{-Wall}.
4727 To suppress this warning use the @code{unused} attribute
4728 (@pxref{Variable Attributes}).
4730 @item -Wunused-const-variable
4731 @itemx -Wunused-const-variable=@var{n}
4732 @opindex Wunused-const-variable
4733 @opindex Wno-unused-const-variable
4734 Warn whenever a constant static variable is unused aside from its declaration.
4735 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
4736 for C, but not for C++. In C this declares variable storage, but in C++ this
4737 is not an error since const variables take the place of @code{#define}s.
4739 To suppress this warning use the @code{unused} attribute
4740 (@pxref{Variable Attributes}).
4742 @table @gcctabopt
4743 @item -Wunused-const-variable=1
4744 This is the warning level that is enabled by @option{-Wunused-variable} for
4745 C.  It warns only about unused static const variables defined in the main
4746 compilation unit, but not about static const variables declared in any
4747 header included.
4749 @item -Wunused-const-variable=2
4750 This warning level also warns for unused constant static variables in
4751 headers (excluding system headers).  This is the warning level of
4752 @option{-Wunused-const-variable} and must be explicitly requested since
4753 in C++ this isn't an error and in C it might be harder to clean up all
4754 headers included.
4755 @end table
4757 @item -Wunused-value
4758 @opindex Wunused-value
4759 @opindex Wno-unused-value
4760 Warn whenever a statement computes a result that is explicitly not
4761 used. To suppress this warning cast the unused expression to
4762 @code{void}. This includes an expression-statement or the left-hand
4763 side of a comma expression that contains no side effects. For example,
4764 an expression such as @code{x[i,j]} causes a warning, while
4765 @code{x[(void)i,j]} does not.
4767 This warning is enabled by @option{-Wall}.
4769 @item -Wunused
4770 @opindex Wunused
4771 @opindex Wno-unused
4772 All the above @option{-Wunused} options combined.
4774 In order to get a warning about an unused function parameter, you must
4775 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4776 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4778 @item -Wuninitialized
4779 @opindex Wuninitialized
4780 @opindex Wno-uninitialized
4781 Warn if an automatic variable is used without first being initialized
4782 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4783 warn if a non-static reference or non-static @code{const} member
4784 appears in a class without constructors.
4786 If you want to warn about code that uses the uninitialized value of the
4787 variable in its own initializer, use the @option{-Winit-self} option.
4789 These warnings occur for individual uninitialized or clobbered
4790 elements of structure, union or array variables as well as for
4791 variables that are uninitialized or clobbered as a whole.  They do
4792 not occur for variables or elements declared @code{volatile}.  Because
4793 these warnings depend on optimization, the exact variables or elements
4794 for which there are warnings depends on the precise optimization
4795 options and version of GCC used.
4797 Note that there may be no warning about a variable that is used only
4798 to compute a value that itself is never used, because such
4799 computations may be deleted by data flow analysis before the warnings
4800 are printed.
4802 @item -Winvalid-memory-model
4803 @opindex Winvalid-memory-model
4804 @opindex Wno-invalid-memory-model
4805 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
4806 and the C11 atomic generic functions with a memory consistency argument
4807 that is either invalid for the operation or outside the range of values
4808 of the @code{memory_order} enumeration.  For example, since the
4809 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
4810 defined for the relaxed, release, and sequentially consistent memory
4811 orders the following code is diagnosed:
4813 @smallexample
4814 void store (int *i)
4816   __atomic_store_n (i, 0, memory_order_consume);
4818 @end smallexample
4820 @option{-Winvalid-memory-model} is enabled by default.
4822 @item -Wmaybe-uninitialized
4823 @opindex Wmaybe-uninitialized
4824 @opindex Wno-maybe-uninitialized
4825 For an automatic variable, if there exists a path from the function
4826 entry to a use of the variable that is initialized, but there exist
4827 some other paths for which the variable is not initialized, the compiler
4828 emits a warning if it cannot prove the uninitialized paths are not
4829 executed at run time. These warnings are made optional because GCC is
4830 not smart enough to see all the reasons why the code might be correct
4831 in spite of appearing to have an error.  Here is one example of how
4832 this can happen:
4834 @smallexample
4835 @group
4837   int x;
4838   switch (y)
4839     @{
4840     case 1: x = 1;
4841       break;
4842     case 2: x = 4;
4843       break;
4844     case 3: x = 5;
4845     @}
4846   foo (x);
4848 @end group
4849 @end smallexample
4851 @noindent
4852 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4853 always initialized, but GCC doesn't know this. To suppress the
4854 warning, you need to provide a default case with assert(0) or
4855 similar code.
4857 @cindex @code{longjmp} warnings
4858 This option also warns when a non-volatile automatic variable might be
4859 changed by a call to @code{longjmp}.  These warnings as well are possible
4860 only in optimizing compilation.
4862 The compiler sees only the calls to @code{setjmp}.  It cannot know
4863 where @code{longjmp} will be called; in fact, a signal handler could
4864 call it at any point in the code.  As a result, you may get a warning
4865 even when there is in fact no problem because @code{longjmp} cannot
4866 in fact be called at the place that would cause a problem.
4868 Some spurious warnings can be avoided if you declare all the functions
4869 you use that never return as @code{noreturn}.  @xref{Function
4870 Attributes}.
4872 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4874 @item -Wunknown-pragmas
4875 @opindex Wunknown-pragmas
4876 @opindex Wno-unknown-pragmas
4877 @cindex warning for unknown pragmas
4878 @cindex unknown pragmas, warning
4879 @cindex pragmas, warning of unknown
4880 Warn when a @code{#pragma} directive is encountered that is not understood by 
4881 GCC@.  If this command-line option is used, warnings are even issued
4882 for unknown pragmas in system header files.  This is not the case if
4883 the warnings are only enabled by the @option{-Wall} command-line option.
4885 @item -Wno-pragmas
4886 @opindex Wno-pragmas
4887 @opindex Wpragmas
4888 Do not warn about misuses of pragmas, such as incorrect parameters,
4889 invalid syntax, or conflicts between pragmas.  See also
4890 @option{-Wunknown-pragmas}.
4892 @item -Wstrict-aliasing
4893 @opindex Wstrict-aliasing
4894 @opindex Wno-strict-aliasing
4895 This option is only active when @option{-fstrict-aliasing} is active.
4896 It warns about code that might break the strict aliasing rules that the
4897 compiler is using for optimization.  The warning does not catch all
4898 cases, but does attempt to catch the more common pitfalls.  It is
4899 included in @option{-Wall}.
4900 It is equivalent to @option{-Wstrict-aliasing=3}
4902 @item -Wstrict-aliasing=n
4903 @opindex Wstrict-aliasing=n
4904 This option is only active when @option{-fstrict-aliasing} is active.
4905 It warns about code that might break the strict aliasing rules that the
4906 compiler is using for optimization.
4907 Higher levels correspond to higher accuracy (fewer false positives).
4908 Higher levels also correspond to more effort, similar to the way @option{-O} 
4909 works.
4910 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4912 Level 1: Most aggressive, quick, least accurate.
4913 Possibly useful when higher levels
4914 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4915 false negatives.  However, it has many false positives.
4916 Warns for all pointer conversions between possibly incompatible types,
4917 even if never dereferenced.  Runs in the front end only.
4919 Level 2: Aggressive, quick, not too precise.
4920 May still have many false positives (not as many as level 1 though),
4921 and few false negatives (but possibly more than level 1).
4922 Unlike level 1, it only warns when an address is taken.  Warns about
4923 incomplete types.  Runs in the front end only.
4925 Level 3 (default for @option{-Wstrict-aliasing}):
4926 Should have very few false positives and few false
4927 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4928 Takes care of the common pun+dereference pattern in the front end:
4929 @code{*(int*)&some_float}.
4930 If optimization is enabled, it also runs in the back end, where it deals
4931 with multiple statement cases using flow-sensitive points-to information.
4932 Only warns when the converted pointer is dereferenced.
4933 Does not warn about incomplete types.
4935 @item -Wstrict-overflow
4936 @itemx -Wstrict-overflow=@var{n}
4937 @opindex Wstrict-overflow
4938 @opindex Wno-strict-overflow
4939 This option is only active when @option{-fstrict-overflow} is active.
4940 It warns about cases where the compiler optimizes based on the
4941 assumption that signed overflow does not occur.  Note that it does not
4942 warn about all cases where the code might overflow: it only warns
4943 about cases where the compiler implements some optimization.  Thus
4944 this warning depends on the optimization level.
4946 An optimization that assumes that signed overflow does not occur is
4947 perfectly safe if the values of the variables involved are such that
4948 overflow never does, in fact, occur.  Therefore this warning can
4949 easily give a false positive: a warning about code that is not
4950 actually a problem.  To help focus on important issues, several
4951 warning levels are defined.  No warnings are issued for the use of
4952 undefined signed overflow when estimating how many iterations a loop
4953 requires, in particular when determining whether a loop will be
4954 executed at all.
4956 @table @gcctabopt
4957 @item -Wstrict-overflow=1
4958 Warn about cases that are both questionable and easy to avoid.  For
4959 example,  with @option{-fstrict-overflow}, the compiler simplifies
4960 @code{x + 1 > x} to @code{1}.  This level of
4961 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4962 are not, and must be explicitly requested.
4964 @item -Wstrict-overflow=2
4965 Also warn about other cases where a comparison is simplified to a
4966 constant.  For example: @code{abs (x) >= 0}.  This can only be
4967 simplified when @option{-fstrict-overflow} is in effect, because
4968 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4969 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4970 @option{-Wstrict-overflow=2}.
4972 @item -Wstrict-overflow=3
4973 Also warn about other cases where a comparison is simplified.  For
4974 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4976 @item -Wstrict-overflow=4
4977 Also warn about other simplifications not covered by the above cases.
4978 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4980 @item -Wstrict-overflow=5
4981 Also warn about cases where the compiler reduces the magnitude of a
4982 constant involved in a comparison.  For example: @code{x + 2 > y} is
4983 simplified to @code{x + 1 >= y}.  This is reported only at the
4984 highest warning level because this simplification applies to many
4985 comparisons, so this warning level gives a very large number of
4986 false positives.
4987 @end table
4989 @item -Wstringop-overflow
4990 @itemx -Wstringop-overflow=@var{type}
4991 @opindex Wstringop-overflow
4992 @opindex Wno-stringop-overflow
4993 Warn for calls to string manipulation functions such as @code{memcpy} and
4994 @code{strcpy} that are determined to overflow the destination buffer.  The
4995 optional argument is one greater than the type of Object Size Checking to
4996 perform to determine the size of the destination.  @xref{Object Size Checking}.
4997 The argument is meaningful only for functions that operate on character arrays
4998 but not for raw memory functions like @code{memcpy} which always make use
4999 of Object Size type-0.  The option also warns for calls that specify a size
5000 in excess of the largest possible object or at most @code{SIZE_MAX / 2} bytes.
5001 The option produces the best results with optimization enabled but can detect
5002 a small subset of simple buffer overflows even without optimization in
5003 calls to the GCC built-in functions like @code{__builtin_memcpy} that
5004 correspond to the standard functions.  In any case, the option warns about
5005 just a subset of buffer overflows detected by the corresponding overflow
5006 checking built-ins.  For example, the option will issue a warning for
5007 the @code{strcpy} call below because it copies at least 5 characters
5008 (the string @code{"blue"} including the terminating NUL) into the buffer
5009 of size 4.
5011 @smallexample
5012 enum Color @{ blue, purple, yellow @};
5013 const char* f (enum Color clr)
5015   static char buf [4];
5016   const char *str;
5017   switch (clr)
5018     @{
5019       case blue: str = "blue"; break;
5020       case purple: str = "purple"; break;
5021       case yellow: str = "yellow"; break;
5022     @}
5024   return strcpy (buf, str);   // warning here
5026 @end smallexample
5028 Option @option{-Wstringop-overflow=2} is enabled by default.
5030 @table @gcctabopt
5031 @item -Wstringop-overflow
5032 @item -Wstringop-overflow=1
5033 @opindex Wstringop-overflow
5034 @opindex Wno-stringop-overflow
5035 The @option{-Wstringop-overflow=1} option uses type-zero Object Size Checking
5036 to determine the sizes of destination objects.  This is the default setting
5037 of the option.  At this setting the option will not warn for writes past
5038 the end of subobjects of larger objects accessed by pointers unless the
5039 size of the largest surrounding object is known.  When the destination may
5040 be one of several objects it is assumed to be the largest one of them.  On
5041 Linux systems, when optimization is enabled at this setting the option warns
5042 for the same code as when the @code{_FORTIFY_SOURCE} macro is defined to
5043 a non-zero value.
5045 @item -Wstringop-overflow=2
5046 The @option{-Wstringop-overflow=2} option uses type-one Object Size Checking
5047 to determine the sizes of destination objects.  At this setting the option
5048 will warn about overflows when writing to members of the largest complete
5049 objects whose exact size is known.  It will, however, not warn for excessive
5050 writes to the same members of unknown objects referenced by pointers since
5051 they may point to arrays containing unknown numbers of elements.
5053 @item -Wstringop-overflow=3
5054 The @option{-Wstringop-overflow=3} option uses type-two Object Size Checking
5055 to determine the sizes of destination objects.  At this setting the option
5056 warns about overflowing the smallest object or data member.  This is the
5057 most restrictive setting of the option that may result in warnings for safe
5058 code.
5060 @item -Wstringop-overflow=4
5061 The @option{-Wstringop-overflow=4} option uses type-three Object Size Checking
5062 to determine the sizes of destination objects.  At this setting the option
5063 will warn about overflowing any data members, and when the destination is
5064 one of several objects it uses the size of the largest of them to decide
5065 whether to issue a warning.  Similarly to @option{-Wstringop-overflow=3} this
5066 setting of the option may result in warnings for benign code.
5067 @end table
5069 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
5070 @opindex Wsuggest-attribute=
5071 @opindex Wno-suggest-attribute=
5072 Warn for cases where adding an attribute may be beneficial. The
5073 attributes currently supported are listed below.
5075 @table @gcctabopt
5076 @item -Wsuggest-attribute=pure
5077 @itemx -Wsuggest-attribute=const
5078 @itemx -Wsuggest-attribute=noreturn
5079 @opindex Wsuggest-attribute=pure
5080 @opindex Wno-suggest-attribute=pure
5081 @opindex Wsuggest-attribute=const
5082 @opindex Wno-suggest-attribute=const
5083 @opindex Wsuggest-attribute=noreturn
5084 @opindex Wno-suggest-attribute=noreturn
5086 Warn about functions that might be candidates for attributes
5087 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
5088 functions visible in other compilation units or (in the case of @code{pure} and
5089 @code{const}) if it cannot prove that the function returns normally. A function
5090 returns normally if it doesn't contain an infinite loop or return abnormally
5091 by throwing, calling @code{abort} or trapping.  This analysis requires option
5092 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
5093 higher.  Higher optimization levels improve the accuracy of the analysis.
5095 @item -Wsuggest-attribute=format
5096 @itemx -Wmissing-format-attribute
5097 @opindex Wsuggest-attribute=format
5098 @opindex Wmissing-format-attribute
5099 @opindex Wno-suggest-attribute=format
5100 @opindex Wno-missing-format-attribute
5101 @opindex Wformat
5102 @opindex Wno-format
5104 Warn about function pointers that might be candidates for @code{format}
5105 attributes.  Note these are only possible candidates, not absolute ones.
5106 GCC guesses that function pointers with @code{format} attributes that
5107 are used in assignment, initialization, parameter passing or return
5108 statements should have a corresponding @code{format} attribute in the
5109 resulting type.  I.e.@: the left-hand side of the assignment or
5110 initialization, the type of the parameter variable, or the return type
5111 of the containing function respectively should also have a @code{format}
5112 attribute to avoid the warning.
5114 GCC also warns about function definitions that might be
5115 candidates for @code{format} attributes.  Again, these are only
5116 possible candidates.  GCC guesses that @code{format} attributes
5117 might be appropriate for any function that calls a function like
5118 @code{vprintf} or @code{vscanf}, but this might not always be the
5119 case, and some functions for which @code{format} attributes are
5120 appropriate may not be detected.
5121 @end table
5123 @item -Wsuggest-final-types
5124 @opindex Wno-suggest-final-types
5125 @opindex Wsuggest-final-types
5126 Warn about types with virtual methods where code quality would be improved
5127 if the type were declared with the C++11 @code{final} specifier, 
5128 or, if possible,
5129 declared in an anonymous namespace. This allows GCC to more aggressively
5130 devirtualize the polymorphic calls. This warning is more effective with link
5131 time optimization, where the information about the class hierarchy graph is
5132 more complete.
5134 @item -Wsuggest-final-methods
5135 @opindex Wno-suggest-final-methods
5136 @opindex Wsuggest-final-methods
5137 Warn about virtual methods where code quality would be improved if the method
5138 were declared with the C++11 @code{final} specifier, 
5139 or, if possible, its type were
5140 declared in an anonymous namespace or with the @code{final} specifier.
5141 This warning is
5142 more effective with link-time optimization, where the information about the
5143 class hierarchy graph is more complete. It is recommended to first consider
5144 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
5145 annotations.
5147 @item -Wsuggest-override
5148 Warn about overriding virtual functions that are not marked with the override
5149 keyword.
5151 @item -Walloc-zero
5152 @opindex Wno-alloc-zero
5153 @opindex Walloc-zero
5154 Warn about calls to allocation functions decorated with attribute
5155 @code{alloc_size} that specify zero bytes, including those to the built-in
5156 forms of the functions @code{aligned_alloc}, @code{alloca}, @code{calloc},
5157 @code{malloc}, and @code{realloc}.  Because the behavior of these functions
5158 when called with a zero size differs among implementations (and in the case
5159 of @code{realloc} has been deprecated) relying on it may result in subtle
5160 portability bugs and should be avoided.
5162 @item -Walloc-size-larger-than=@var{n}
5163 Warn about calls to functions decorated with attribute @code{alloc_size}
5164 that attempt to allocate objects larger than the specified number of bytes,
5165 or where the result of the size computation in an integer type with infinite
5166 precision would exceed @code{SIZE_MAX / 2}.  The option argument @var{n}
5167 may end in one of the standard suffixes designating a multiple of bytes
5168 such as @code{kB} and @code{KiB} for kilobyte and kibibyte, respectively,
5169 @code{MB} and @code{MiB} for megabyte and mebibyte, and so on.
5170 @xref{Function Attributes}.
5172 @item -Walloca
5173 @opindex Wno-alloca
5174 @opindex Walloca
5175 This option warns on all uses of @code{alloca} in the source.
5177 @item -Walloca-larger-than=@var{n}
5178 This option warns on calls to @code{alloca} that are not bounded by a
5179 controlling predicate limiting its argument of integer type to at most
5180 @var{n} bytes, or calls to @code{alloca} where the bound is unknown.
5181 Arguments of non-integer types are considered unbounded even if they
5182 appear to be constrained to the expected range.
5184 For example, a bounded case of @code{alloca} could be:
5186 @smallexample
5187 void func (size_t n)
5189   void *p;
5190   if (n <= 1000)
5191     p = alloca (n);
5192   else
5193     p = malloc (n);
5194   f (p);
5196 @end smallexample
5198 In the above example, passing @code{-Walloca-larger-than=1000} would not
5199 issue a warning because the call to @code{alloca} is known to be at most
5200 1000 bytes.  However, if @code{-Walloca-larger-than=500} were passed,
5201 the compiler would emit a warning.
5203 Unbounded uses, on the other hand, are uses of @code{alloca} with no
5204 controlling predicate constraining its integer argument.  For example:
5206 @smallexample
5207 void func ()
5209   void *p = alloca (n);
5210   f (p);
5212 @end smallexample
5214 If @code{-Walloca-larger-than=500} were passed, the above would trigger
5215 a warning, but this time because of the lack of bounds checking.
5217 Note, that even seemingly correct code involving signed integers could
5218 cause a warning:
5220 @smallexample
5221 void func (signed int n)
5223   if (n < 500)
5224     @{
5225       p = alloca (n);
5226       f (p);
5227     @}
5229 @end smallexample
5231 In the above example, @var{n} could be negative, causing a larger than
5232 expected argument to be implicitly cast into the @code{alloca} call.
5234 This option also warns when @code{alloca} is used in a loop.
5236 This warning is not enabled by @option{-Wall}, and is only active when
5237 @option{-ftree-vrp} is active (default for @option{-O2} and above).
5239 See also @option{-Wvla-larger-than=@var{n}}.
5241 @item -Warray-bounds
5242 @itemx -Warray-bounds=@var{n}
5243 @opindex Wno-array-bounds
5244 @opindex Warray-bounds
5245 This option is only active when @option{-ftree-vrp} is active
5246 (default for @option{-O2} and above). It warns about subscripts to arrays
5247 that are always out of bounds. This warning is enabled by @option{-Wall}.
5249 @table @gcctabopt
5250 @item -Warray-bounds=1
5251 This is the warning level of @option{-Warray-bounds} and is enabled
5252 by @option{-Wall}; higher levels are not, and must be explicitly requested.
5254 @item -Warray-bounds=2
5255 This warning level also warns about out of bounds access for
5256 arrays at the end of a struct and for arrays accessed through
5257 pointers. This warning level may give a larger number of
5258 false positives and is deactivated by default.
5259 @end table
5261 @item -Wbool-compare
5262 @opindex Wno-bool-compare
5263 @opindex Wbool-compare
5264 Warn about boolean expression compared with an integer value different from
5265 @code{true}/@code{false}.  For instance, the following comparison is
5266 always false:
5267 @smallexample
5268 int n = 5;
5269 @dots{}
5270 if ((n > 1) == 2) @{ @dots{} @}
5271 @end smallexample
5272 This warning is enabled by @option{-Wall}.
5274 @item -Wbool-operation
5275 @opindex Wno-bool-operation
5276 @opindex Wbool-operation
5277 Warn about suspicious operations on expressions of a boolean type.  For
5278 instance, bitwise negation of a boolean is very likely a bug in the program.
5279 For C, this warning also warns about incrementing or decrementing a boolean,
5280 which rarely makes sense.  (In C++, decrementing a boolean is always invalid.
5281 Incrementing a boolean is invalid in C++1z, and deprecated otherwise.)
5283 This warning is enabled by @option{-Wall}.
5285 @item -Wduplicated-branches
5286 @opindex Wno-duplicated-branches
5287 @opindex Wduplicated-branches
5288 Warn when an if-else has identical branches.  This warning detects cases like
5289 @smallexample
5290 if (p != NULL)
5291   return 0;
5292 else
5293   return 0;
5294 @end smallexample
5295 It doesn't warn when both branches contain just a null statement.  This warning
5296 also warn for conditional operators:
5297 @smallexample
5298   int i = x ? *p : *p;
5299 @end smallexample
5301 @item -Wduplicated-cond
5302 @opindex Wno-duplicated-cond
5303 @opindex Wduplicated-cond
5304 Warn about duplicated conditions in an if-else-if chain.  For instance,
5305 warn for the following code:
5306 @smallexample
5307 if (p->q != NULL) @{ @dots{} @}
5308 else if (p->q != NULL) @{ @dots{} @}
5309 @end smallexample
5311 @item -Wframe-address
5312 @opindex Wno-frame-address
5313 @opindex Wframe-address
5314 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
5315 is called with an argument greater than 0.  Such calls may return indeterminate
5316 values or crash the program.  The warning is included in @option{-Wall}.
5318 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
5319 @opindex Wno-discarded-qualifiers
5320 @opindex Wdiscarded-qualifiers
5321 Do not warn if type qualifiers on pointers are being discarded.
5322 Typically, the compiler warns if a @code{const char *} variable is
5323 passed to a function that takes a @code{char *} parameter.  This option
5324 can be used to suppress such a warning.
5326 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
5327 @opindex Wno-discarded-array-qualifiers
5328 @opindex Wdiscarded-array-qualifiers
5329 Do not warn if type qualifiers on arrays which are pointer targets
5330 are being discarded. Typically, the compiler warns if a
5331 @code{const int (*)[]} variable is passed to a function that
5332 takes a @code{int (*)[]} parameter.  This option can be used to
5333 suppress such a warning.
5335 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
5336 @opindex Wno-incompatible-pointer-types
5337 @opindex Wincompatible-pointer-types
5338 Do not warn when there is a conversion between pointers that have incompatible
5339 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
5340 which warns for pointer argument passing or assignment with different
5341 signedness.
5343 @item -Wno-int-conversion @r{(C and Objective-C only)}
5344 @opindex Wno-int-conversion
5345 @opindex Wint-conversion
5346 Do not warn about incompatible integer to pointer and pointer to integer
5347 conversions.  This warning is about implicit conversions; for explicit
5348 conversions the warnings @option{-Wno-int-to-pointer-cast} and
5349 @option{-Wno-pointer-to-int-cast} may be used.
5351 @item -Wno-div-by-zero
5352 @opindex Wno-div-by-zero
5353 @opindex Wdiv-by-zero
5354 Do not warn about compile-time integer division by zero.  Floating-point
5355 division by zero is not warned about, as it can be a legitimate way of
5356 obtaining infinities and NaNs.
5358 @item -Wsystem-headers
5359 @opindex Wsystem-headers
5360 @opindex Wno-system-headers
5361 @cindex warnings from system headers
5362 @cindex system headers, warnings from
5363 Print warning messages for constructs found in system header files.
5364 Warnings from system headers are normally suppressed, on the assumption
5365 that they usually do not indicate real problems and would only make the
5366 compiler output harder to read.  Using this command-line option tells
5367 GCC to emit warnings from system headers as if they occurred in user
5368 code.  However, note that using @option{-Wall} in conjunction with this
5369 option does @emph{not} warn about unknown pragmas in system
5370 headers---for that, @option{-Wunknown-pragmas} must also be used.
5372 @item -Wtautological-compare
5373 @opindex Wtautological-compare
5374 @opindex Wno-tautological-compare
5375 Warn if a self-comparison always evaluates to true or false.  This
5376 warning detects various mistakes such as:
5377 @smallexample
5378 int i = 1;
5379 @dots{}
5380 if (i > i) @{ @dots{} @}
5381 @end smallexample
5382 This warning is enabled by @option{-Wall}.
5384 @item -Wtrampolines
5385 @opindex Wtrampolines
5386 @opindex Wno-trampolines
5387 Warn about trampolines generated for pointers to nested functions.
5388 A trampoline is a small piece of data or code that is created at run
5389 time on the stack when the address of a nested function is taken, and is
5390 used to call the nested function indirectly.  For some targets, it is
5391 made up of data only and thus requires no special treatment.  But, for
5392 most targets, it is made up of code and thus requires the stack to be
5393 made executable in order for the program to work properly.
5395 @item -Wfloat-equal
5396 @opindex Wfloat-equal
5397 @opindex Wno-float-equal
5398 Warn if floating-point values are used in equality comparisons.
5400 The idea behind this is that sometimes it is convenient (for the
5401 programmer) to consider floating-point values as approximations to
5402 infinitely precise real numbers.  If you are doing this, then you need
5403 to compute (by analyzing the code, or in some other way) the maximum or
5404 likely maximum error that the computation introduces, and allow for it
5405 when performing comparisons (and when producing output, but that's a
5406 different problem).  In particular, instead of testing for equality, you
5407 should check to see whether the two values have ranges that overlap; and
5408 this is done with the relational operators, so equality comparisons are
5409 probably mistaken.
5411 @item -Wtraditional @r{(C and Objective-C only)}
5412 @opindex Wtraditional
5413 @opindex Wno-traditional
5414 Warn about certain constructs that behave differently in traditional and
5415 ISO C@.  Also warn about ISO C constructs that have no traditional C
5416 equivalent, and/or problematic constructs that should be avoided.
5418 @itemize @bullet
5419 @item
5420 Macro parameters that appear within string literals in the macro body.
5421 In traditional C macro replacement takes place within string literals,
5422 but in ISO C it does not.
5424 @item
5425 In traditional C, some preprocessor directives did not exist.
5426 Traditional preprocessors only considered a line to be a directive
5427 if the @samp{#} appeared in column 1 on the line.  Therefore
5428 @option{-Wtraditional} warns about directives that traditional C
5429 understands but ignores because the @samp{#} does not appear as the
5430 first character on the line.  It also suggests you hide directives like
5431 @code{#pragma} not understood by traditional C by indenting them.  Some
5432 traditional implementations do not recognize @code{#elif}, so this option
5433 suggests avoiding it altogether.
5435 @item
5436 A function-like macro that appears without arguments.
5438 @item
5439 The unary plus operator.
5441 @item
5442 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
5443 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
5444 constants.)  Note, these suffixes appear in macros defined in the system
5445 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
5446 Use of these macros in user code might normally lead to spurious
5447 warnings, however GCC's integrated preprocessor has enough context to
5448 avoid warning in these cases.
5450 @item
5451 A function declared external in one block and then used after the end of
5452 the block.
5454 @item
5455 A @code{switch} statement has an operand of type @code{long}.
5457 @item
5458 A non-@code{static} function declaration follows a @code{static} one.
5459 This construct is not accepted by some traditional C compilers.
5461 @item
5462 The ISO type of an integer constant has a different width or
5463 signedness from its traditional type.  This warning is only issued if
5464 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
5465 typically represent bit patterns, are not warned about.
5467 @item
5468 Usage of ISO string concatenation is detected.
5470 @item
5471 Initialization of automatic aggregates.
5473 @item
5474 Identifier conflicts with labels.  Traditional C lacks a separate
5475 namespace for labels.
5477 @item
5478 Initialization of unions.  If the initializer is zero, the warning is
5479 omitted.  This is done under the assumption that the zero initializer in
5480 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
5481 initializer warnings and relies on default initialization to zero in the
5482 traditional C case.
5484 @item
5485 Conversions by prototypes between fixed/floating-point values and vice
5486 versa.  The absence of these prototypes when compiling with traditional
5487 C causes serious problems.  This is a subset of the possible
5488 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
5490 @item
5491 Use of ISO C style function definitions.  This warning intentionally is
5492 @emph{not} issued for prototype declarations or variadic functions
5493 because these ISO C features appear in your code when using
5494 libiberty's traditional C compatibility macros, @code{PARAMS} and
5495 @code{VPARAMS}.  This warning is also bypassed for nested functions
5496 because that feature is already a GCC extension and thus not relevant to
5497 traditional C compatibility.
5498 @end itemize
5500 @item -Wtraditional-conversion @r{(C and Objective-C only)}
5501 @opindex Wtraditional-conversion
5502 @opindex Wno-traditional-conversion
5503 Warn if a prototype causes a type conversion that is different from what
5504 would happen to the same argument in the absence of a prototype.  This
5505 includes conversions of fixed point to floating and vice versa, and
5506 conversions changing the width or signedness of a fixed-point argument
5507 except when the same as the default promotion.
5509 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
5510 @opindex Wdeclaration-after-statement
5511 @opindex Wno-declaration-after-statement
5512 Warn when a declaration is found after a statement in a block.  This
5513 construct, known from C++, was introduced with ISO C99 and is by default
5514 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
5516 @item -Wshadow
5517 @opindex Wshadow
5518 @opindex Wno-shadow
5519 Warn whenever a local variable or type declaration shadows another
5520 variable, parameter, type, class member (in C++), or instance variable
5521 (in Objective-C) or whenever a built-in function is shadowed. Note
5522 that in C++, the compiler warns if a local variable shadows an
5523 explicit typedef, but not if it shadows a struct/class/enum.
5524 Same as @option{-Wshadow=global}.
5526 @item -Wno-shadow-ivar @r{(Objective-C only)}
5527 @opindex Wno-shadow-ivar
5528 @opindex Wshadow-ivar
5529 Do not warn whenever a local variable shadows an instance variable in an
5530 Objective-C method.
5532 @item -Wshadow=global
5533 @opindex Wshadow=local
5534 The default for @option{-Wshadow}. Warns for any (global) shadowing.
5536 @item -Wshadow=local
5537 @opindex Wshadow=local
5538 Warn when a local variable shadows another local variable or parameter.
5539 This warning is enabled by @option{-Wshadow=global}.
5541 @item -Wshadow=compatible-local
5542 @opindex Wshadow=compatible-local
5543 Warn when a local variable shadows another local variable or parameter
5544 whose type is compatible with that of the shadowing variable. In C++,
5545 type compatibility here means the type of the shadowing variable can be
5546 converted to that of the shadowed variable. The creation of this flag
5547 (in addition to @option{-Wshadow=local}) is based on the idea that when
5548 a local variable shadows another one of incompatible type, it is most
5549 likely intentional, not a bug or typo, as shown in the following example:
5551 @smallexample
5552 @group
5553 for (SomeIterator i = SomeObj.begin(); i != SomeObj.end(); ++i)
5555   for (int i = 0; i < N; ++i)
5556   @{
5557     ...
5558   @}
5559   ...
5561 @end group
5562 @end smallexample
5564 Since the two variable @code{i} in the example above have incompatible types,
5565 enabling only @option{-Wshadow=compatible-local} will not emit a warning.
5566 Because their types are incompatible, if a programmer accidentally uses one
5567 in place of the other, type checking will catch that and emit an error or
5568 warning. So not warning (about shadowing) in this case will not lead to
5569 undetected bugs. Use of this flag instead of @option{-Wshadow=local} can
5570 possibly reduce the number of warnings triggered by intentional shadowing.
5572 This warning is enabled by @option{-Wshadow=local}.
5574 @item -Wlarger-than=@var{len}
5575 @opindex Wlarger-than=@var{len}
5576 @opindex Wlarger-than-@var{len}
5577 Warn whenever an object of larger than @var{len} bytes is defined.
5579 @item -Wframe-larger-than=@var{len}
5580 @opindex Wframe-larger-than
5581 Warn if the size of a function frame is larger than @var{len} bytes.
5582 The computation done to determine the stack frame size is approximate
5583 and not conservative.
5584 The actual requirements may be somewhat greater than @var{len}
5585 even if you do not get a warning.  In addition, any space allocated
5586 via @code{alloca}, variable-length arrays, or related constructs
5587 is not included by the compiler when determining
5588 whether or not to issue a warning.
5590 @item -Wno-free-nonheap-object
5591 @opindex Wno-free-nonheap-object
5592 @opindex Wfree-nonheap-object
5593 Do not warn when attempting to free an object that was not allocated
5594 on the heap.
5596 @item -Wstack-usage=@var{len}
5597 @opindex Wstack-usage
5598 Warn if the stack usage of a function might be larger than @var{len} bytes.
5599 The computation done to determine the stack usage is conservative.
5600 Any space allocated via @code{alloca}, variable-length arrays, or related
5601 constructs is included by the compiler when determining whether or not to
5602 issue a warning.
5604 The message is in keeping with the output of @option{-fstack-usage}.
5606 @itemize
5607 @item
5608 If the stack usage is fully static but exceeds the specified amount, it's:
5610 @smallexample
5611   warning: stack usage is 1120 bytes
5612 @end smallexample
5613 @item
5614 If the stack usage is (partly) dynamic but bounded, it's:
5616 @smallexample
5617   warning: stack usage might be 1648 bytes
5618 @end smallexample
5619 @item
5620 If the stack usage is (partly) dynamic and not bounded, it's:
5622 @smallexample
5623   warning: stack usage might be unbounded
5624 @end smallexample
5625 @end itemize
5627 @item -Wunsafe-loop-optimizations
5628 @opindex Wunsafe-loop-optimizations
5629 @opindex Wno-unsafe-loop-optimizations
5630 Warn if the loop cannot be optimized because the compiler cannot
5631 assume anything on the bounds of the loop indices.  With
5632 @option{-funsafe-loop-optimizations} warn if the compiler makes
5633 such assumptions.
5635 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
5636 @opindex Wno-pedantic-ms-format
5637 @opindex Wpedantic-ms-format
5638 When used in combination with @option{-Wformat}
5639 and @option{-pedantic} without GNU extensions, this option
5640 disables the warnings about non-ISO @code{printf} / @code{scanf} format
5641 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
5642 which depend on the MS runtime.
5644 @item -Waligned-new
5645 @opindex Waligned-new
5646 @opindex Wno-aligned-new
5647 Warn about a new-expression of a type that requires greater alignment
5648 than the @code{alignof(std::max_align_t)} but uses an allocation
5649 function without an explicit alignment parameter. This option is
5650 enabled by @option{-Wall}.
5652 Normally this only warns about global allocation functions, but
5653 @option{-Waligned-new=all} also warns about class member allocation
5654 functions.
5656 @item -Wplacement-new
5657 @itemx -Wplacement-new=@var{n}
5658 @opindex Wplacement-new
5659 @opindex Wno-placement-new
5660 Warn about placement new expressions with undefined behavior, such as
5661 constructing an object in a buffer that is smaller than the type of
5662 the object.  For example, the placement new expression below is diagnosed
5663 because it attempts to construct an array of 64 integers in a buffer only
5664 64 bytes large.
5665 @smallexample
5666 char buf [64];
5667 new (buf) int[64];
5668 @end smallexample
5669 This warning is enabled by default.
5671 @table @gcctabopt
5672 @item -Wplacement-new=1
5673 This is the default warning level of @option{-Wplacement-new}.  At this
5674 level the warning is not issued for some strictly undefined constructs that
5675 GCC allows as extensions for compatibility with legacy code.  For example,
5676 the following @code{new} expression is not diagnosed at this level even
5677 though it has undefined behavior according to the C++ standard because
5678 it writes past the end of the one-element array.
5679 @smallexample
5680 struct S @{ int n, a[1]; @};
5681 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
5682 new (s->a)int [32]();
5683 @end smallexample
5685 @item -Wplacement-new=2
5686 At this level, in addition to diagnosing all the same constructs as at level
5687 1, a diagnostic is also issued for placement new expressions that construct
5688 an object in the last member of structure whose type is an array of a single
5689 element and whose size is less than the size of the object being constructed.
5690 While the previous example would be diagnosed, the following construct makes
5691 use of the flexible member array extension to avoid the warning at level 2.
5692 @smallexample
5693 struct S @{ int n, a[]; @};
5694 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
5695 new (s->a)int [32]();
5696 @end smallexample
5698 @end table
5700 @item -Wpointer-arith
5701 @opindex Wpointer-arith
5702 @opindex Wno-pointer-arith
5703 Warn about anything that depends on the ``size of'' a function type or
5704 of @code{void}.  GNU C assigns these types a size of 1, for
5705 convenience in calculations with @code{void *} pointers and pointers
5706 to functions.  In C++, warn also when an arithmetic operation involves
5707 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
5709 @item -Wpointer-compare
5710 @opindex Wpointer-compare
5711 @opindex Wno-pointer-compare
5712 Warn if a pointer is compared with a zero character constant.  This usually
5713 means that the pointer was meant to be dereferenced.  For example:
5715 @smallexample
5716 const char *p = foo ();
5717 if (p == '\0')
5718   return 42;
5719 @end smallexample
5721 Note that the code above is invalid in C++11.
5723 This warning is enabled by default.
5725 @item -Wtype-limits
5726 @opindex Wtype-limits
5727 @opindex Wno-type-limits
5728 Warn if a comparison is always true or always false due to the limited
5729 range of the data type, but do not warn for constant expressions.  For
5730 example, warn if an unsigned variable is compared against zero with
5731 @code{<} or @code{>=}.  This warning is also enabled by
5732 @option{-Wextra}.
5734 @include cppwarnopts.texi
5736 @item -Wbad-function-cast @r{(C and Objective-C only)}
5737 @opindex Wbad-function-cast
5738 @opindex Wno-bad-function-cast
5739 Warn when a function call is cast to a non-matching type.
5740 For example, warn if a call to a function returning an integer type 
5741 is cast to a pointer type.
5743 @item -Wc90-c99-compat @r{(C and Objective-C only)}
5744 @opindex Wc90-c99-compat
5745 @opindex Wno-c90-c99-compat
5746 Warn about features not present in ISO C90, but present in ISO C99.
5747 For instance, warn about use of variable length arrays, @code{long long}
5748 type, @code{bool} type, compound literals, designated initializers, and so
5749 on.  This option is independent of the standards mode.  Warnings are disabled
5750 in the expression that follows @code{__extension__}.
5752 @item -Wc99-c11-compat @r{(C and Objective-C only)}
5753 @opindex Wc99-c11-compat
5754 @opindex Wno-c99-c11-compat
5755 Warn about features not present in ISO C99, but present in ISO C11.
5756 For instance, warn about use of anonymous structures and unions,
5757 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
5758 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
5759 and so on.  This option is independent of the standards mode.  Warnings are
5760 disabled in the expression that follows @code{__extension__}.
5762 @item -Wc++-compat @r{(C and Objective-C only)}
5763 @opindex Wc++-compat
5764 Warn about ISO C constructs that are outside of the common subset of
5765 ISO C and ISO C++, e.g.@: request for implicit conversion from
5766 @code{void *} to a pointer to non-@code{void} type.
5768 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
5769 @opindex Wc++11-compat
5770 Warn about C++ constructs whose meaning differs between ISO C++ 1998
5771 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
5772 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
5773 enabled by @option{-Wall}.
5775 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
5776 @opindex Wc++14-compat
5777 Warn about C++ constructs whose meaning differs between ISO C++ 2011
5778 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
5780 @item -Wc++1z-compat @r{(C++ and Objective-C++ only)}
5781 @opindex Wc++1z-compat
5782 Warn about C++ constructs whose meaning differs between ISO C++ 2014
5783 and the forthoming ISO C++ 2017(?).  This warning is enabled by @option{-Wall}.
5785 @item -Wcast-qual
5786 @opindex Wcast-qual
5787 @opindex Wno-cast-qual
5788 Warn whenever a pointer is cast so as to remove a type qualifier from
5789 the target type.  For example, warn if a @code{const char *} is cast
5790 to an ordinary @code{char *}.
5792 Also warn when making a cast that introduces a type qualifier in an
5793 unsafe way.  For example, casting @code{char **} to @code{const char **}
5794 is unsafe, as in this example:
5796 @smallexample
5797   /* p is char ** value.  */
5798   const char **q = (const char **) p;
5799   /* Assignment of readonly string to const char * is OK.  */
5800   *q = "string";
5801   /* Now char** pointer points to read-only memory.  */
5802   **p = 'b';
5803 @end smallexample
5805 @item -Wcast-align
5806 @opindex Wcast-align
5807 @opindex Wno-cast-align
5808 Warn whenever a pointer is cast such that the required alignment of the
5809 target is increased.  For example, warn if a @code{char *} is cast to
5810 an @code{int *} on machines where integers can only be accessed at
5811 two- or four-byte boundaries.
5813 @item -Wwrite-strings
5814 @opindex Wwrite-strings
5815 @opindex Wno-write-strings
5816 When compiling C, give string constants the type @code{const
5817 char[@var{length}]} so that copying the address of one into a
5818 non-@code{const} @code{char *} pointer produces a warning.  These
5819 warnings help you find at compile time code that can try to write
5820 into a string constant, but only if you have been very careful about
5821 using @code{const} in declarations and prototypes.  Otherwise, it is
5822 just a nuisance. This is why we did not make @option{-Wall} request
5823 these warnings.
5825 When compiling C++, warn about the deprecated conversion from string
5826 literals to @code{char *}.  This warning is enabled by default for C++
5827 programs.
5829 @item -Wclobbered
5830 @opindex Wclobbered
5831 @opindex Wno-clobbered
5832 Warn for variables that might be changed by @code{longjmp} or
5833 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5835 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5836 @opindex Wconditionally-supported
5837 @opindex Wno-conditionally-supported
5838 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5840 @item -Wconversion
5841 @opindex Wconversion
5842 @opindex Wno-conversion
5843 Warn for implicit conversions that may alter a value. This includes
5844 conversions between real and integer, like @code{abs (x)} when
5845 @code{x} is @code{double}; conversions between signed and unsigned,
5846 like @code{unsigned ui = -1}; and conversions to smaller types, like
5847 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5848 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5849 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5850 conversions between signed and unsigned integers can be disabled by
5851 using @option{-Wno-sign-conversion}.
5853 For C++, also warn for confusing overload resolution for user-defined
5854 conversions; and conversions that never use a type conversion
5855 operator: conversions to @code{void}, the same type, a base class or a
5856 reference to them. Warnings about conversions between signed and
5857 unsigned integers are disabled by default in C++ unless
5858 @option{-Wsign-conversion} is explicitly enabled.
5860 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5861 @opindex Wconversion-null
5862 @opindex Wno-conversion-null
5863 Do not warn for conversions between @code{NULL} and non-pointer
5864 types. @option{-Wconversion-null} is enabled by default.
5866 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5867 @opindex Wzero-as-null-pointer-constant
5868 @opindex Wno-zero-as-null-pointer-constant
5869 Warn when a literal @samp{0} is used as null pointer constant.  This can
5870 be useful to facilitate the conversion to @code{nullptr} in C++11.
5872 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
5873 @opindex Wsubobject-linkage
5874 @opindex Wno-subobject-linkage
5875 Warn if a class type has a base or a field whose type uses the anonymous
5876 namespace or depends on a type with no linkage.  If a type A depends on
5877 a type B with no or internal linkage, defining it in multiple
5878 translation units would be an ODR violation because the meaning of B
5879 is different in each translation unit.  If A only appears in a single
5880 translation unit, the best way to silence the warning is to give it
5881 internal linkage by putting it in an anonymous namespace as well.  The
5882 compiler doesn't give this warning for types defined in the main .C
5883 file, as those are unlikely to have multiple definitions.
5884 @option{-Wsubobject-linkage} is enabled by default.
5886 @item -Wdangling-else
5887 @opindex Wdangling-else
5888 @opindex Wno-dangling-else
5889 Warn about constructions where there may be confusion to which
5890 @code{if} statement an @code{else} branch belongs.  Here is an example of
5891 such a case:
5893 @smallexample
5894 @group
5896   if (a)
5897     if (b)
5898       foo ();
5899   else
5900     bar ();
5902 @end group
5903 @end smallexample
5905 In C/C++, every @code{else} branch belongs to the innermost possible
5906 @code{if} statement, which in this example is @code{if (b)}.  This is
5907 often not what the programmer expected, as illustrated in the above
5908 example by indentation the programmer chose.  When there is the
5909 potential for this confusion, GCC issues a warning when this flag
5910 is specified.  To eliminate the warning, add explicit braces around
5911 the innermost @code{if} statement so there is no way the @code{else}
5912 can belong to the enclosing @code{if}.  The resulting code
5913 looks like this:
5915 @smallexample
5916 @group
5918   if (a)
5919     @{
5920       if (b)
5921         foo ();
5922       else
5923         bar ();
5924     @}
5926 @end group
5927 @end smallexample
5929 This warning is enabled by @option{-Wparentheses}.
5931 @item -Wdate-time
5932 @opindex Wdate-time
5933 @opindex Wno-date-time
5934 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
5935 are encountered as they might prevent bit-wise-identical reproducible
5936 compilations.
5938 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
5939 @opindex Wdelete-incomplete
5940 @opindex Wno-delete-incomplete
5941 Warn when deleting a pointer to incomplete type, which may cause
5942 undefined behavior at runtime.  This warning is enabled by default.
5944 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
5945 @opindex Wuseless-cast
5946 @opindex Wno-useless-cast
5947 Warn when an expression is casted to its own type.
5949 @item -Wempty-body
5950 @opindex Wempty-body
5951 @opindex Wno-empty-body
5952 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
5953 while} statement.  This warning is also enabled by @option{-Wextra}.
5955 @item -Wenum-compare
5956 @opindex Wenum-compare
5957 @opindex Wno-enum-compare
5958 Warn about a comparison between values of different enumerated types.
5959 In C++ enumerated type mismatches in conditional expressions are also
5960 diagnosed and the warning is enabled by default.  In C this warning is 
5961 enabled by @option{-Wall}.
5963 @item -Wjump-misses-init @r{(C, Objective-C only)}
5964 @opindex Wjump-misses-init
5965 @opindex Wno-jump-misses-init
5966 Warn if a @code{goto} statement or a @code{switch} statement jumps
5967 forward across the initialization of a variable, or jumps backward to a
5968 label after the variable has been initialized.  This only warns about
5969 variables that are initialized when they are declared.  This warning is
5970 only supported for C and Objective-C; in C++ this sort of branch is an
5971 error in any case.
5973 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
5974 can be disabled with the @option{-Wno-jump-misses-init} option.
5976 @item -Wsign-compare
5977 @opindex Wsign-compare
5978 @opindex Wno-sign-compare
5979 @cindex warning for comparison of signed and unsigned values
5980 @cindex comparison of signed and unsigned values, warning
5981 @cindex signed and unsigned values, comparison warning
5982 Warn when a comparison between signed and unsigned values could produce
5983 an incorrect result when the signed value is converted to unsigned.
5984 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
5985 also enabled by @option{-Wextra}.
5987 @item -Wsign-conversion
5988 @opindex Wsign-conversion
5989 @opindex Wno-sign-conversion
5990 Warn for implicit conversions that may change the sign of an integer
5991 value, like assigning a signed integer expression to an unsigned
5992 integer variable. An explicit cast silences the warning. In C, this
5993 option is enabled also by @option{-Wconversion}.
5995 @item -Wfloat-conversion
5996 @opindex Wfloat-conversion
5997 @opindex Wno-float-conversion
5998 Warn for implicit conversions that reduce the precision of a real value.
5999 This includes conversions from real to integer, and from higher precision
6000 real to lower precision real values.  This option is also enabled by
6001 @option{-Wconversion}.
6003 @item -Wno-scalar-storage-order
6004 @opindex -Wno-scalar-storage-order
6005 @opindex -Wscalar-storage-order
6006 Do not warn on suspicious constructs involving reverse scalar storage order.
6008 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
6009 @opindex Wsized-deallocation
6010 @opindex Wno-sized-deallocation
6011 Warn about a definition of an unsized deallocation function
6012 @smallexample
6013 void operator delete (void *) noexcept;
6014 void operator delete[] (void *) noexcept;
6015 @end smallexample
6016 without a definition of the corresponding sized deallocation function
6017 @smallexample
6018 void operator delete (void *, std::size_t) noexcept;
6019 void operator delete[] (void *, std::size_t) noexcept;
6020 @end smallexample
6021 or vice versa.  Enabled by @option{-Wextra} along with
6022 @option{-fsized-deallocation}.
6024 @item -Wsizeof-pointer-memaccess
6025 @opindex Wsizeof-pointer-memaccess
6026 @opindex Wno-sizeof-pointer-memaccess
6027 Warn for suspicious length parameters to certain string and memory built-in
6028 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
6029 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
6030 but a pointer, and suggests a possible fix, or about
6031 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
6032 @option{-Wall}.
6034 @item -Wsizeof-array-argument
6035 @opindex Wsizeof-array-argument
6036 @opindex Wno-sizeof-array-argument
6037 Warn when the @code{sizeof} operator is applied to a parameter that is
6038 declared as an array in a function definition.  This warning is enabled by
6039 default for C and C++ programs.
6041 @item -Wmemset-elt-size
6042 @opindex Wmemset-elt-size
6043 @opindex Wno-memset-elt-size
6044 Warn for suspicious calls to the @code{memset} built-in function, if the
6045 first argument references an array, and the third argument is a number
6046 equal to the number of elements, but not equal to the size of the array
6047 in memory.  This indicates that the user has omitted a multiplication by
6048 the element size.  This warning is enabled by @option{-Wall}.
6050 @item -Wmemset-transposed-args
6051 @opindex Wmemset-transposed-args
6052 @opindex Wno-memset-transposed-args
6053 Warn for suspicious calls to the @code{memset} built-in function, if the
6054 second argument is not zero and the third argument is zero.  This warns e.g.@
6055 about @code{memset (buf, sizeof buf, 0)} where most probably
6056 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
6057 is only emitted if the third argument is literal zero.  If it is some
6058 expression that is folded to zero, a cast of zero to some type, etc., 
6059 it is far less likely that the user has mistakenly exchanged the arguments 
6060 and no warning is emitted.  This warning is enabled by @option{-Wall}.
6062 @item -Waddress
6063 @opindex Waddress
6064 @opindex Wno-address
6065 Warn about suspicious uses of memory addresses. These include using
6066 the address of a function in a conditional expression, such as
6067 @code{void func(void); if (func)}, and comparisons against the memory
6068 address of a string literal, such as @code{if (x == "abc")}.  Such
6069 uses typically indicate a programmer error: the address of a function
6070 always evaluates to true, so their use in a conditional usually
6071 indicate that the programmer forgot the parentheses in a function
6072 call; and comparisons against string literals result in unspecified
6073 behavior and are not portable in C, so they usually indicate that the
6074 programmer intended to use @code{strcmp}.  This warning is enabled by
6075 @option{-Wall}.
6077 @item -Wlogical-op
6078 @opindex Wlogical-op
6079 @opindex Wno-logical-op
6080 Warn about suspicious uses of logical operators in expressions.
6081 This includes using logical operators in contexts where a
6082 bit-wise operator is likely to be expected.  Also warns when
6083 the operands of a logical operator are the same:
6084 @smallexample
6085 extern int a;
6086 if (a < 0 && a < 0) @{ @dots{} @}
6087 @end smallexample
6089 @item -Wlogical-not-parentheses
6090 @opindex Wlogical-not-parentheses
6091 @opindex Wno-logical-not-parentheses
6092 Warn about logical not used on the left hand side operand of a comparison.
6093 This option does not warn if the right operand is considered to be a boolean
6094 expression.  Its purpose is to detect suspicious code like the following:
6095 @smallexample
6096 int a;
6097 @dots{}
6098 if (!a > 1) @{ @dots{} @}
6099 @end smallexample
6101 It is possible to suppress the warning by wrapping the LHS into
6102 parentheses:
6103 @smallexample
6104 if ((!a) > 1) @{ @dots{} @}
6105 @end smallexample
6107 This warning is enabled by @option{-Wall}.
6109 @item -Waggregate-return
6110 @opindex Waggregate-return
6111 @opindex Wno-aggregate-return
6112 Warn if any functions that return structures or unions are defined or
6113 called.  (In languages where you can return an array, this also elicits
6114 a warning.)
6116 @item -Wno-aggressive-loop-optimizations
6117 @opindex Wno-aggressive-loop-optimizations
6118 @opindex Waggressive-loop-optimizations
6119 Warn if in a loop with constant number of iterations the compiler detects
6120 undefined behavior in some statement during one or more of the iterations.
6122 @item -Wno-attributes
6123 @opindex Wno-attributes
6124 @opindex Wattributes
6125 Do not warn if an unexpected @code{__attribute__} is used, such as
6126 unrecognized attributes, function attributes applied to variables,
6127 etc.  This does not stop errors for incorrect use of supported
6128 attributes.
6130 @item -Wno-builtin-declaration-mismatch
6131 @opindex Wno-builtin-declaration-mismatch
6132 @opindex Wbuiltin-declaration-mismatch
6133 Warn if a built-in function is declared with the wrong signature.
6134 This warning is enabled by default.
6136 @item -Wno-builtin-macro-redefined
6137 @opindex Wno-builtin-macro-redefined
6138 @opindex Wbuiltin-macro-redefined
6139 Do not warn if certain built-in macros are redefined.  This suppresses
6140 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
6141 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
6143 @item -Wstrict-prototypes @r{(C and Objective-C only)}
6144 @opindex Wstrict-prototypes
6145 @opindex Wno-strict-prototypes
6146 Warn if a function is declared or defined without specifying the
6147 argument types.  (An old-style function definition is permitted without
6148 a warning if preceded by a declaration that specifies the argument
6149 types.)
6151 @item -Wold-style-declaration @r{(C and Objective-C only)}
6152 @opindex Wold-style-declaration
6153 @opindex Wno-old-style-declaration
6154 Warn for obsolescent usages, according to the C Standard, in a
6155 declaration. For example, warn if storage-class specifiers like
6156 @code{static} are not the first things in a declaration.  This warning
6157 is also enabled by @option{-Wextra}.
6159 @item -Wold-style-definition @r{(C and Objective-C only)}
6160 @opindex Wold-style-definition
6161 @opindex Wno-old-style-definition
6162 Warn if an old-style function definition is used.  A warning is given
6163 even if there is a previous prototype.
6165 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
6166 @opindex Wmissing-parameter-type
6167 @opindex Wno-missing-parameter-type
6168 A function parameter is declared without a type specifier in K&R-style
6169 functions:
6171 @smallexample
6172 void foo(bar) @{ @}
6173 @end smallexample
6175 This warning is also enabled by @option{-Wextra}.
6177 @item -Wmissing-prototypes @r{(C and Objective-C only)}
6178 @opindex Wmissing-prototypes
6179 @opindex Wno-missing-prototypes
6180 Warn if a global function is defined without a previous prototype
6181 declaration.  This warning is issued even if the definition itself
6182 provides a prototype.  Use this option to detect global functions
6183 that do not have a matching prototype declaration in a header file.
6184 This option is not valid for C++ because all function declarations
6185 provide prototypes and a non-matching declaration declares an
6186 overload rather than conflict with an earlier declaration.
6187 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
6189 @item -Wmissing-declarations
6190 @opindex Wmissing-declarations
6191 @opindex Wno-missing-declarations
6192 Warn if a global function is defined without a previous declaration.
6193 Do so even if the definition itself provides a prototype.
6194 Use this option to detect global functions that are not declared in
6195 header files.  In C, no warnings are issued for functions with previous
6196 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
6197 missing prototypes.  In C++, no warnings are issued for function templates,
6198 or for inline functions, or for functions in anonymous namespaces.
6200 @item -Wmissing-field-initializers
6201 @opindex Wmissing-field-initializers
6202 @opindex Wno-missing-field-initializers
6203 @opindex W
6204 @opindex Wextra
6205 @opindex Wno-extra
6206 Warn if a structure's initializer has some fields missing.  For
6207 example, the following code causes such a warning, because
6208 @code{x.h} is implicitly zero:
6210 @smallexample
6211 struct s @{ int f, g, h; @};
6212 struct s x = @{ 3, 4 @};
6213 @end smallexample
6215 This option does not warn about designated initializers, so the following
6216 modification does not trigger a warning:
6218 @smallexample
6219 struct s @{ int f, g, h; @};
6220 struct s x = @{ .f = 3, .g = 4 @};
6221 @end smallexample
6223 In C++ this option does not warn either about the empty @{ @}
6224 initializer, for example:
6226 @smallexample
6227 struct s @{ int f, g, h; @};
6228 s x = @{ @};
6229 @end smallexample
6231 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
6232 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
6234 @item -Wno-multichar
6235 @opindex Wno-multichar
6236 @opindex Wmultichar
6237 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
6238 Usually they indicate a typo in the user's code, as they have
6239 implementation-defined values, and should not be used in portable code.
6241 @item -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]}
6242 @opindex Wnormalized=
6243 @opindex Wnormalized
6244 @opindex Wno-normalized
6245 @cindex NFC
6246 @cindex NFKC
6247 @cindex character set, input normalization
6248 In ISO C and ISO C++, two identifiers are different if they are
6249 different sequences of characters.  However, sometimes when characters
6250 outside the basic ASCII character set are used, you can have two
6251 different character sequences that look the same.  To avoid confusion,
6252 the ISO 10646 standard sets out some @dfn{normalization rules} which
6253 when applied ensure that two sequences that look the same are turned into
6254 the same sequence.  GCC can warn you if you are using identifiers that
6255 have not been normalized; this option controls that warning.
6257 There are four levels of warning supported by GCC@.  The default is
6258 @option{-Wnormalized=nfc}, which warns about any identifier that is
6259 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
6260 recommended form for most uses.  It is equivalent to
6261 @option{-Wnormalized}.
6263 Unfortunately, there are some characters allowed in identifiers by
6264 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
6265 identifiers.  That is, there's no way to use these symbols in portable
6266 ISO C or C++ and have all your identifiers in NFC@.
6267 @option{-Wnormalized=id} suppresses the warning for these characters.
6268 It is hoped that future versions of the standards involved will correct
6269 this, which is why this option is not the default.
6271 You can switch the warning off for all characters by writing
6272 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
6273 only do this if you are using some other normalization scheme (like
6274 ``D''), because otherwise you can easily create bugs that are
6275 literally impossible to see.
6277 Some characters in ISO 10646 have distinct meanings but look identical
6278 in some fonts or display methodologies, especially once formatting has
6279 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
6280 LETTER N'', displays just like a regular @code{n} that has been
6281 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
6282 normalization scheme to convert all these into a standard form as
6283 well, and GCC warns if your code is not in NFKC if you use
6284 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
6285 about every identifier that contains the letter O because it might be
6286 confused with the digit 0, and so is not the default, but may be
6287 useful as a local coding convention if the programming environment 
6288 cannot be fixed to display these characters distinctly.
6290 @item -Wno-deprecated
6291 @opindex Wno-deprecated
6292 @opindex Wdeprecated
6293 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
6295 @item -Wno-deprecated-declarations
6296 @opindex Wno-deprecated-declarations
6297 @opindex Wdeprecated-declarations
6298 Do not warn about uses of functions (@pxref{Function Attributes}),
6299 variables (@pxref{Variable Attributes}), and types (@pxref{Type
6300 Attributes}) marked as deprecated by using the @code{deprecated}
6301 attribute.
6303 @item -Wno-overflow
6304 @opindex Wno-overflow
6305 @opindex Woverflow
6306 Do not warn about compile-time overflow in constant expressions.
6308 @item -Wno-odr
6309 @opindex Wno-odr
6310 @opindex Wodr
6311 Warn about One Definition Rule violations during link-time optimization.
6312 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
6314 @item -Wopenmp-simd
6315 @opindex Wopenm-simd
6316 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
6317 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
6318 option can be used to relax the cost model.
6320 @item -Woverride-init @r{(C and Objective-C only)}
6321 @opindex Woverride-init
6322 @opindex Wno-override-init
6323 @opindex W
6324 @opindex Wextra
6325 @opindex Wno-extra
6326 Warn if an initialized field without side effects is overridden when
6327 using designated initializers (@pxref{Designated Inits, , Designated
6328 Initializers}).
6330 This warning is included in @option{-Wextra}.  To get other
6331 @option{-Wextra} warnings without this one, use @option{-Wextra
6332 -Wno-override-init}.
6334 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
6335 @opindex Woverride-init-side-effects
6336 @opindex Wno-override-init-side-effects
6337 Warn if an initialized field with side effects is overridden when
6338 using designated initializers (@pxref{Designated Inits, , Designated
6339 Initializers}).  This warning is enabled by default.
6341 @item -Wpacked
6342 @opindex Wpacked
6343 @opindex Wno-packed
6344 Warn if a structure is given the packed attribute, but the packed
6345 attribute has no effect on the layout or size of the structure.
6346 Such structures may be mis-aligned for little benefit.  For
6347 instance, in this code, the variable @code{f.x} in @code{struct bar}
6348 is misaligned even though @code{struct bar} does not itself
6349 have the packed attribute:
6351 @smallexample
6352 @group
6353 struct foo @{
6354   int x;
6355   char a, b, c, d;
6356 @} __attribute__((packed));
6357 struct bar @{
6358   char z;
6359   struct foo f;
6361 @end group
6362 @end smallexample
6364 @item -Wpacked-bitfield-compat
6365 @opindex Wpacked-bitfield-compat
6366 @opindex Wno-packed-bitfield-compat
6367 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
6368 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
6369 the change can lead to differences in the structure layout.  GCC
6370 informs you when the offset of such a field has changed in GCC 4.4.
6371 For example there is no longer a 4-bit padding between field @code{a}
6372 and @code{b} in this structure:
6374 @smallexample
6375 struct foo
6377   char a:4;
6378   char b:8;
6379 @} __attribute__ ((packed));
6380 @end smallexample
6382 This warning is enabled by default.  Use
6383 @option{-Wno-packed-bitfield-compat} to disable this warning.
6385 @item -Wpadded
6386 @opindex Wpadded
6387 @opindex Wno-padded
6388 Warn if padding is included in a structure, either to align an element
6389 of the structure or to align the whole structure.  Sometimes when this
6390 happens it is possible to rearrange the fields of the structure to
6391 reduce the padding and so make the structure smaller.
6393 @item -Wredundant-decls
6394 @opindex Wredundant-decls
6395 @opindex Wno-redundant-decls
6396 Warn if anything is declared more than once in the same scope, even in
6397 cases where multiple declaration is valid and changes nothing.
6399 @item -Wrestrict
6400 @opindex Wrestrict
6401 @opindex Wno-restrict
6402 Warn when an argument passed to a restrict-qualified parameter
6403 aliases with another argument.
6405 @item -Wnested-externs @r{(C and Objective-C only)}
6406 @opindex Wnested-externs
6407 @opindex Wno-nested-externs
6408 Warn if an @code{extern} declaration is encountered within a function.
6410 @item -Wno-inherited-variadic-ctor
6411 @opindex Winherited-variadic-ctor
6412 @opindex Wno-inherited-variadic-ctor
6413 Suppress warnings about use of C++11 inheriting constructors when the
6414 base class inherited from has a C variadic constructor; the warning is
6415 on by default because the ellipsis is not inherited.
6417 @item -Winline
6418 @opindex Winline
6419 @opindex Wno-inline
6420 Warn if a function that is declared as inline cannot be inlined.
6421 Even with this option, the compiler does not warn about failures to
6422 inline functions declared in system headers.
6424 The compiler uses a variety of heuristics to determine whether or not
6425 to inline a function.  For example, the compiler takes into account
6426 the size of the function being inlined and the amount of inlining
6427 that has already been done in the current function.  Therefore,
6428 seemingly insignificant changes in the source program can cause the
6429 warnings produced by @option{-Winline} to appear or disappear.
6431 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
6432 @opindex Wno-invalid-offsetof
6433 @opindex Winvalid-offsetof
6434 Suppress warnings from applying the @code{offsetof} macro to a non-POD
6435 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
6436 to a non-standard-layout type is undefined.  In existing C++ implementations,
6437 however, @code{offsetof} typically gives meaningful results.
6438 This flag is for users who are aware that they are
6439 writing nonportable code and who have deliberately chosen to ignore the
6440 warning about it.
6442 The restrictions on @code{offsetof} may be relaxed in a future version
6443 of the C++ standard.
6445 @item -Wint-in-bool-context
6446 @opindex Wint-in-bool-context
6447 @opindex Wno-int-in-bool-context
6448 Warn for suspicious use of integer values where boolean values are expected,
6449 such as conditional expressions (?:) using non-boolean integer constants in
6450 boolean context, like @code{if (a <= b ? 2 : 3)}.  Or left shifting of signed
6451 integers in boolean context, like @code{for (a = 0; 1 << a; a++);}.  Likewise
6452 for all kinds of multiplications regardless of the data type.
6453 This warning is enabled by @option{-Wall}.
6455 @item -Wno-int-to-pointer-cast
6456 @opindex Wno-int-to-pointer-cast
6457 @opindex Wint-to-pointer-cast
6458 Suppress warnings from casts to pointer type of an integer of a
6459 different size. In C++, casting to a pointer type of smaller size is
6460 an error. @option{Wint-to-pointer-cast} is enabled by default.
6463 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
6464 @opindex Wno-pointer-to-int-cast
6465 @opindex Wpointer-to-int-cast
6466 Suppress warnings from casts from a pointer to an integer type of a
6467 different size.
6469 @item -Winvalid-pch
6470 @opindex Winvalid-pch
6471 @opindex Wno-invalid-pch
6472 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
6473 the search path but cannot be used.
6475 @item -Wlong-long
6476 @opindex Wlong-long
6477 @opindex Wno-long-long
6478 Warn if @code{long long} type is used.  This is enabled by either
6479 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
6480 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
6482 @item -Wvariadic-macros
6483 @opindex Wvariadic-macros
6484 @opindex Wno-variadic-macros
6485 Warn if variadic macros are used in ISO C90 mode, or if the GNU
6486 alternate syntax is used in ISO C99 mode.  This is enabled by either
6487 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
6488 messages, use @option{-Wno-variadic-macros}.
6490 @item -Wvarargs
6491 @opindex Wvarargs
6492 @opindex Wno-varargs
6493 Warn upon questionable usage of the macros used to handle variable
6494 arguments like @code{va_start}.  This is default.  To inhibit the
6495 warning messages, use @option{-Wno-varargs}.
6497 @item -Wvector-operation-performance
6498 @opindex Wvector-operation-performance
6499 @opindex Wno-vector-operation-performance
6500 Warn if vector operation is not implemented via SIMD capabilities of the
6501 architecture.  Mainly useful for the performance tuning.
6502 Vector operation can be implemented @code{piecewise}, which means that the
6503 scalar operation is performed on every vector element; 
6504 @code{in parallel}, which means that the vector operation is implemented
6505 using scalars of wider type, which normally is more performance efficient;
6506 and @code{as a single scalar}, which means that vector fits into a
6507 scalar type.
6509 @item -Wno-virtual-move-assign
6510 @opindex Wvirtual-move-assign
6511 @opindex Wno-virtual-move-assign
6512 Suppress warnings about inheriting from a virtual base with a
6513 non-trivial C++11 move assignment operator.  This is dangerous because
6514 if the virtual base is reachable along more than one path, it is
6515 moved multiple times, which can mean both objects end up in the
6516 moved-from state.  If the move assignment operator is written to avoid
6517 moving from a moved-from object, this warning can be disabled.
6519 @item -Wvla
6520 @opindex Wvla
6521 @opindex Wno-vla
6522 Warn if a variable-length array is used in the code.
6523 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
6524 the variable-length array.
6526 @item -Wvla-larger-than=@var{n}
6527 If this option is used, the compiler will warn on uses of
6528 variable-length arrays where the size is either unbounded, or bounded
6529 by an argument that can be larger than @var{n} bytes.  This is similar
6530 to how @option{-Walloca-larger-than=@var{n}} works, but with
6531 variable-length arrays.
6533 Note that GCC may optimize small variable-length arrays of a known
6534 value into plain arrays, so this warning may not get triggered for
6535 such arrays.
6537 This warning is not enabled by @option{-Wall}, and is only active when
6538 @option{-ftree-vrp} is active (default for @option{-O2} and above).
6540 See also @option{-Walloca-larger-than=@var{n}}.
6542 @item -Wvolatile-register-var
6543 @opindex Wvolatile-register-var
6544 @opindex Wno-volatile-register-var
6545 Warn if a register variable is declared volatile.  The volatile
6546 modifier does not inhibit all optimizations that may eliminate reads
6547 and/or writes to register variables.  This warning is enabled by
6548 @option{-Wall}.
6550 @item -Wdisabled-optimization
6551 @opindex Wdisabled-optimization
6552 @opindex Wno-disabled-optimization
6553 Warn if a requested optimization pass is disabled.  This warning does
6554 not generally indicate that there is anything wrong with your code; it
6555 merely indicates that GCC's optimizers are unable to handle the code
6556 effectively.  Often, the problem is that your code is too big or too
6557 complex; GCC refuses to optimize programs when the optimization
6558 itself is likely to take inordinate amounts of time.
6560 @item -Wpointer-sign @r{(C and Objective-C only)}
6561 @opindex Wpointer-sign
6562 @opindex Wno-pointer-sign
6563 Warn for pointer argument passing or assignment with different signedness.
6564 This option is only supported for C and Objective-C@.  It is implied by
6565 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
6566 @option{-Wno-pointer-sign}.
6568 @item -Wstack-protector
6569 @opindex Wstack-protector
6570 @opindex Wno-stack-protector
6571 This option is only active when @option{-fstack-protector} is active.  It
6572 warns about functions that are not protected against stack smashing.
6574 @item -Woverlength-strings
6575 @opindex Woverlength-strings
6576 @opindex Wno-overlength-strings
6577 Warn about string constants that are longer than the ``minimum
6578 maximum'' length specified in the C standard.  Modern compilers
6579 generally allow string constants that are much longer than the
6580 standard's minimum limit, but very portable programs should avoid
6581 using longer strings.
6583 The limit applies @emph{after} string constant concatenation, and does
6584 not count the trailing NUL@.  In C90, the limit was 509 characters; in
6585 C99, it was raised to 4095.  C++98 does not specify a normative
6586 minimum maximum, so we do not diagnose overlength strings in C++@.
6588 This option is implied by @option{-Wpedantic}, and can be disabled with
6589 @option{-Wno-overlength-strings}.
6591 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
6592 @opindex Wunsuffixed-float-constants
6594 Issue a warning for any floating constant that does not have
6595 a suffix.  When used together with @option{-Wsystem-headers} it
6596 warns about such constants in system header files.  This can be useful
6597 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
6598 from the decimal floating-point extension to C99.
6600 @item -Wno-designated-init @r{(C and Objective-C only)}
6601 Suppress warnings when a positional initializer is used to initialize
6602 a structure that has been marked with the @code{designated_init}
6603 attribute.
6605 @item -Whsa
6606 Issue a warning when HSAIL cannot be emitted for the compiled function or
6607 OpenMP construct.
6609 @end table
6611 @node Debugging Options
6612 @section Options for Debugging Your Program
6613 @cindex options, debugging
6614 @cindex debugging information options
6616 To tell GCC to emit extra information for use by a debugger, in almost 
6617 all cases you need only to add @option{-g} to your other options.
6619 GCC allows you to use @option{-g} with
6620 @option{-O}.  The shortcuts taken by optimized code may occasionally
6621 be surprising: some variables you declared may not exist
6622 at all; flow of control may briefly move where you did not expect it;
6623 some statements may not be executed because they compute constant
6624 results or their values are already at hand; some statements may
6625 execute in different places because they have been moved out of loops.
6626 Nevertheless it is possible to debug optimized output.  This makes
6627 it reasonable to use the optimizer for programs that might have bugs.
6629 If you are not using some other optimization option, consider
6630 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
6631 With no @option{-O} option at all, some compiler passes that collect
6632 information useful for debugging do not run at all, so that
6633 @option{-Og} may result in a better debugging experience.
6635 @table @gcctabopt
6636 @item -g
6637 @opindex g
6638 Produce debugging information in the operating system's native format
6639 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
6640 information.
6642 On most systems that use stabs format, @option{-g} enables use of extra
6643 debugging information that only GDB can use; this extra information
6644 makes debugging work better in GDB but probably makes other debuggers
6645 crash or
6646 refuse to read the program.  If you want to control for certain whether
6647 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
6648 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
6650 @item -ggdb
6651 @opindex ggdb
6652 Produce debugging information for use by GDB@.  This means to use the
6653 most expressive format available (DWARF, stabs, or the native format
6654 if neither of those are supported), including GDB extensions if at all
6655 possible.
6657 @item -gdwarf
6658 @itemx -gdwarf-@var{version}
6659 @opindex gdwarf
6660 Produce debugging information in DWARF format (if that is supported).
6661 The value of @var{version} may be either 2, 3, 4 or 5; the default version
6662 for most targets is 4.  DWARF Version 5 is only experimental.
6664 Note that with DWARF Version 2, some ports require and always
6665 use some non-conflicting DWARF 3 extensions in the unwind tables.
6667 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
6668 for maximum benefit.
6670 GCC no longer supports DWARF Version 1, which is substantially
6671 different than Version 2 and later.  For historical reasons, some
6672 other DWARF-related options (including @option{-feliminate-dwarf2-dups} 
6673 and @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
6674 in their names, but apply to all currently-supported versions of DWARF.
6676 @item -gstabs
6677 @opindex gstabs
6678 Produce debugging information in stabs format (if that is supported),
6679 without GDB extensions.  This is the format used by DBX on most BSD
6680 systems.  On MIPS, Alpha and System V Release 4 systems this option
6681 produces stabs debugging output that is not understood by DBX or SDB@.
6682 On System V Release 4 systems this option requires the GNU assembler.
6684 @item -gstabs+
6685 @opindex gstabs+
6686 Produce debugging information in stabs format (if that is supported),
6687 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6688 use of these extensions is likely to make other debuggers crash or
6689 refuse to read the program.
6691 @item -gcoff
6692 @opindex gcoff
6693 Produce debugging information in COFF format (if that is supported).
6694 This is the format used by SDB on most System V systems prior to
6695 System V Release 4.
6697 @item -gxcoff
6698 @opindex gxcoff
6699 Produce debugging information in XCOFF format (if that is supported).
6700 This is the format used by the DBX debugger on IBM RS/6000 systems.
6702 @item -gxcoff+
6703 @opindex gxcoff+
6704 Produce debugging information in XCOFF format (if that is supported),
6705 using GNU extensions understood only by the GNU debugger (GDB)@.  The
6706 use of these extensions is likely to make other debuggers crash or
6707 refuse to read the program, and may cause assemblers other than the GNU
6708 assembler (GAS) to fail with an error.
6710 @item -gvms
6711 @opindex gvms
6712 Produce debugging information in Alpha/VMS debug format (if that is
6713 supported).  This is the format used by DEBUG on Alpha/VMS systems.
6715 @item -g@var{level}
6716 @itemx -ggdb@var{level}
6717 @itemx -gstabs@var{level}
6718 @itemx -gcoff@var{level}
6719 @itemx -gxcoff@var{level}
6720 @itemx -gvms@var{level}
6721 Request debugging information and also use @var{level} to specify how
6722 much information.  The default level is 2.
6724 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
6725 @option{-g}.
6727 Level 1 produces minimal information, enough for making backtraces in
6728 parts of the program that you don't plan to debug.  This includes
6729 descriptions of functions and external variables, and line number
6730 tables, but no information about local variables.
6732 Level 3 includes extra information, such as all the macro definitions
6733 present in the program.  Some debuggers support macro expansion when
6734 you use @option{-g3}.
6736 @option{-gdwarf} does not accept a concatenated debug level, to avoid
6737 confusion with @option{-gdwarf-@var{level}}.
6738 Instead use an additional @option{-g@var{level}} option to change the
6739 debug level for DWARF.
6741 @item -feliminate-unused-debug-symbols
6742 @opindex feliminate-unused-debug-symbols
6743 Produce debugging information in stabs format (if that is supported),
6744 for only symbols that are actually used.
6746 @item -femit-class-debug-always
6747 @opindex femit-class-debug-always
6748 Instead of emitting debugging information for a C++ class in only one
6749 object file, emit it in all object files using the class.  This option
6750 should be used only with debuggers that are unable to handle the way GCC
6751 normally emits debugging information for classes because using this
6752 option increases the size of debugging information by as much as a
6753 factor of two.
6755 @item -fno-merge-debug-strings
6756 @opindex fmerge-debug-strings
6757 @opindex fno-merge-debug-strings
6758 Direct the linker to not merge together strings in the debugging
6759 information that are identical in different object files.  Merging is
6760 not supported by all assemblers or linkers.  Merging decreases the size
6761 of the debug information in the output file at the cost of increasing
6762 link processing time.  Merging is enabled by default.
6764 @item -fdebug-prefix-map=@var{old}=@var{new}
6765 @opindex fdebug-prefix-map
6766 When compiling files in directory @file{@var{old}}, record debugging
6767 information describing them as in @file{@var{new}} instead.
6769 @item -fvar-tracking
6770 @opindex fvar-tracking
6771 Run variable tracking pass.  It computes where variables are stored at each
6772 position in code.  Better debugging information is then generated
6773 (if the debugging information format supports this information).
6775 It is enabled by default when compiling with optimization (@option{-Os},
6776 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6777 the debug info format supports it.
6779 @item -fvar-tracking-assignments
6780 @opindex fvar-tracking-assignments
6781 @opindex fno-var-tracking-assignments
6782 Annotate assignments to user variables early in the compilation and
6783 attempt to carry the annotations over throughout the compilation all the
6784 way to the end, in an attempt to improve debug information while
6785 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6787 It can be enabled even if var-tracking is disabled, in which case
6788 annotations are created and maintained, but discarded at the end.
6789 By default, this flag is enabled together with @option{-fvar-tracking},
6790 except when selective scheduling is enabled.
6792 @item -gsplit-dwarf
6793 @opindex gsplit-dwarf
6794 Separate as much DWARF debugging information as possible into a
6795 separate output file with the extension @file{.dwo}.  This option allows
6796 the build system to avoid linking files with debug information.  To
6797 be useful, this option requires a debugger capable of reading @file{.dwo}
6798 files.
6800 @item -gpubnames
6801 @opindex gpubnames
6802 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
6804 @item -ggnu-pubnames
6805 @opindex ggnu-pubnames
6806 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
6807 suitable for conversion into a GDB@ index.  This option is only useful
6808 with a linker that can produce GDB@ index version 7.
6810 @item -fdebug-types-section
6811 @opindex fdebug-types-section
6812 @opindex fno-debug-types-section
6813 When using DWARF Version 4 or higher, type DIEs can be put into
6814 their own @code{.debug_types} section instead of making them part of the
6815 @code{.debug_info} section.  It is more efficient to put them in a separate
6816 comdat sections since the linker can then remove duplicates.
6817 But not all DWARF consumers support @code{.debug_types} sections yet
6818 and on some objects @code{.debug_types} produces larger instead of smaller
6819 debugging information.
6821 @item -grecord-gcc-switches
6822 @item -gno-record-gcc-switches
6823 @opindex grecord-gcc-switches
6824 @opindex gno-record-gcc-switches
6825 This switch causes the command-line options used to invoke the
6826 compiler that may affect code generation to be appended to the
6827 DW_AT_producer attribute in DWARF debugging information.  The options
6828 are concatenated with spaces separating them from each other and from
6829 the compiler version.  
6830 It is enabled by default.
6831 See also @option{-frecord-gcc-switches} for another
6832 way of storing compiler options into the object file.  
6834 @item -gstrict-dwarf
6835 @opindex gstrict-dwarf
6836 Disallow using extensions of later DWARF standard version than selected
6837 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
6838 DWARF extensions from later standard versions is allowed.
6840 @item -gno-strict-dwarf
6841 @opindex gno-strict-dwarf
6842 Allow using extensions of later DWARF standard version than selected with
6843 @option{-gdwarf-@var{version}}.
6845 @item -gcolumn-info
6846 @item -gno-column-info
6847 @opindex gcolumn-info
6848 @opindex gno-column-info
6849 Emit location column information into DWARF debugging information, rather
6850 than just file and line.
6851 This option is disabled by default.
6853 @item -gz@r{[}=@var{type}@r{]}
6854 @opindex gz
6855 Produce compressed debug sections in DWARF format, if that is supported.
6856 If @var{type} is not given, the default type depends on the capabilities
6857 of the assembler and linker used.  @var{type} may be one of
6858 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
6859 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
6860 compression in traditional GNU format).  If the linker doesn't support
6861 writing compressed debug sections, the option is rejected.  Otherwise,
6862 if the assembler does not support them, @option{-gz} is silently ignored
6863 when producing object files.
6865 @item -feliminate-dwarf2-dups
6866 @opindex feliminate-dwarf2-dups
6867 Compress DWARF debugging information by eliminating duplicated
6868 information about each symbol.  This option only makes sense when
6869 generating DWARF debugging information.
6871 @item -femit-struct-debug-baseonly
6872 @opindex femit-struct-debug-baseonly
6873 Emit debug information for struct-like types
6874 only when the base name of the compilation source file
6875 matches the base name of file in which the struct is defined.
6877 This option substantially reduces the size of debugging information,
6878 but at significant potential loss in type information to the debugger.
6879 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6880 See @option{-femit-struct-debug-detailed} for more detailed control.
6882 This option works only with DWARF debug output.
6884 @item -femit-struct-debug-reduced
6885 @opindex femit-struct-debug-reduced
6886 Emit debug information for struct-like types
6887 only when the base name of the compilation source file
6888 matches the base name of file in which the type is defined,
6889 unless the struct is a template or defined in a system header.
6891 This option significantly reduces the size of debugging information,
6892 with some potential loss in type information to the debugger.
6893 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6894 See @option{-femit-struct-debug-detailed} for more detailed control.
6896 This option works only with DWARF debug output.
6898 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6899 @opindex femit-struct-debug-detailed
6900 Specify the struct-like types
6901 for which the compiler generates debug information.
6902 The intent is to reduce duplicate struct debug information
6903 between different object files within the same program.
6905 This option is a detailed version of
6906 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6907 which serves for most needs.
6909 A specification has the syntax@*
6910 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6912 The optional first word limits the specification to
6913 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6914 A struct type is used directly when it is the type of a variable, member.
6915 Indirect uses arise through pointers to structs.
6916 That is, when use of an incomplete struct is valid, the use is indirect.
6917 An example is
6918 @samp{struct one direct; struct two * indirect;}.
6920 The optional second word limits the specification to
6921 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6922 Generic structs are a bit complicated to explain.
6923 For C++, these are non-explicit specializations of template classes,
6924 or non-template classes within the above.
6925 Other programming languages have generics,
6926 but @option{-femit-struct-debug-detailed} does not yet implement them.
6928 The third word specifies the source files for those
6929 structs for which the compiler should emit debug information.
6930 The values @samp{none} and @samp{any} have the normal meaning.
6931 The value @samp{base} means that
6932 the base of name of the file in which the type declaration appears
6933 must match the base of the name of the main compilation file.
6934 In practice, this means that when compiling @file{foo.c}, debug information
6935 is generated for types declared in that file and @file{foo.h},
6936 but not other header files.
6937 The value @samp{sys} means those types satisfying @samp{base}
6938 or declared in system or compiler headers.
6940 You may need to experiment to determine the best settings for your application.
6942 The default is @option{-femit-struct-debug-detailed=all}.
6944 This option works only with DWARF debug output.
6946 @item -fno-dwarf2-cfi-asm
6947 @opindex fdwarf2-cfi-asm
6948 @opindex fno-dwarf2-cfi-asm
6949 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
6950 instead of using GAS @code{.cfi_*} directives.
6952 @item -fno-eliminate-unused-debug-types
6953 @opindex feliminate-unused-debug-types
6954 @opindex fno-eliminate-unused-debug-types
6955 Normally, when producing DWARF output, GCC avoids producing debug symbol 
6956 output for types that are nowhere used in the source file being compiled.
6957 Sometimes it is useful to have GCC emit debugging
6958 information for all types declared in a compilation
6959 unit, regardless of whether or not they are actually used
6960 in that compilation unit, for example 
6961 if, in the debugger, you want to cast a value to a type that is
6962 not actually used in your program (but is declared).  More often,
6963 however, this results in a significant amount of wasted space.
6964 @end table
6966 @node Optimize Options
6967 @section Options That Control Optimization
6968 @cindex optimize options
6969 @cindex options, optimization
6971 These options control various sorts of optimizations.
6973 Without any optimization option, the compiler's goal is to reduce the
6974 cost of compilation and to make debugging produce the expected
6975 results.  Statements are independent: if you stop the program with a
6976 breakpoint between statements, you can then assign a new value to any
6977 variable or change the program counter to any other statement in the
6978 function and get exactly the results you expect from the source
6979 code.
6981 Turning on optimization flags makes the compiler attempt to improve
6982 the performance and/or code size at the expense of compilation time
6983 and possibly the ability to debug the program.
6985 The compiler performs optimization based on the knowledge it has of the
6986 program.  Compiling multiple files at once to a single output file mode allows
6987 the compiler to use information gained from all of the files when compiling
6988 each of them.
6990 Not all optimizations are controlled directly by a flag.  Only
6991 optimizations that have a flag are listed in this section.
6993 Most optimizations are only enabled if an @option{-O} level is set on
6994 the command line.  Otherwise they are disabled, even if individual
6995 optimization flags are specified.
6997 Depending on the target and how GCC was configured, a slightly different
6998 set of optimizations may be enabled at each @option{-O} level than
6999 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
7000 to find out the exact set of optimizations that are enabled at each level.
7001 @xref{Overall Options}, for examples.
7003 @table @gcctabopt
7004 @item -O
7005 @itemx -O1
7006 @opindex O
7007 @opindex O1
7008 Optimize.  Optimizing compilation takes somewhat more time, and a lot
7009 more memory for a large function.
7011 With @option{-O}, the compiler tries to reduce code size and execution
7012 time, without performing any optimizations that take a great deal of
7013 compilation time.
7015 @option{-O} turns on the following optimization flags:
7016 @gccoptlist{
7017 -fauto-inc-dec @gol
7018 -fbranch-count-reg @gol
7019 -fcombine-stack-adjustments @gol
7020 -fcompare-elim @gol
7021 -fcprop-registers @gol
7022 -fdce @gol
7023 -fdefer-pop @gol
7024 -fdelayed-branch @gol
7025 -fdse @gol
7026 -fforward-propagate @gol
7027 -fguess-branch-probability @gol
7028 -fif-conversion2 @gol
7029 -fif-conversion @gol
7030 -finline-functions-called-once @gol
7031 -fipa-pure-const @gol
7032 -fipa-profile @gol
7033 -fipa-reference @gol
7034 -fmerge-constants @gol
7035 -fmove-loop-invariants @gol
7036 -freorder-blocks @gol
7037 -fshrink-wrap @gol
7038 -fshrink-wrap-separate @gol
7039 -fsplit-wide-types @gol
7040 -fssa-backprop @gol
7041 -fssa-phiopt @gol
7042 -ftree-bit-ccp @gol
7043 -ftree-ccp @gol
7044 -ftree-ch @gol
7045 -ftree-coalesce-vars @gol
7046 -ftree-copy-prop @gol
7047 -ftree-dce @gol
7048 -ftree-dominator-opts @gol
7049 -ftree-dse @gol
7050 -ftree-forwprop @gol
7051 -ftree-fre @gol
7052 -ftree-phiprop @gol
7053 -ftree-sink @gol
7054 -ftree-slsr @gol
7055 -ftree-sra @gol
7056 -ftree-pta @gol
7057 -ftree-ter @gol
7058 -funit-at-a-time}
7060 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
7061 where doing so does not interfere with debugging.
7063 @item -O2
7064 @opindex O2
7065 Optimize even more.  GCC performs nearly all supported optimizations
7066 that do not involve a space-speed tradeoff.
7067 As compared to @option{-O}, this option increases both compilation time
7068 and the performance of the generated code.
7070 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
7071 also turns on the following optimization flags:
7072 @gccoptlist{-fthread-jumps @gol
7073 -falign-functions  -falign-jumps @gol
7074 -falign-loops  -falign-labels @gol
7075 -fcaller-saves @gol
7076 -fcrossjumping @gol
7077 -fcse-follow-jumps  -fcse-skip-blocks @gol
7078 -fdelete-null-pointer-checks @gol
7079 -fdevirtualize -fdevirtualize-speculatively @gol
7080 -fexpensive-optimizations @gol
7081 -fgcse  -fgcse-lm  @gol
7082 -fhoist-adjacent-loads @gol
7083 -finline-small-functions @gol
7084 -findirect-inlining @gol
7085 -fipa-cp @gol
7086 -fipa-bit-cp @gol
7087 -fipa-vrp @gol
7088 -fipa-sra @gol
7089 -fipa-icf @gol
7090 -fisolate-erroneous-paths-dereference @gol
7091 -flra-remat @gol
7092 -foptimize-sibling-calls @gol
7093 -foptimize-strlen @gol
7094 -fpartial-inlining @gol
7095 -fpeephole2 @gol
7096 -freorder-blocks-algorithm=stc @gol
7097 -freorder-blocks-and-partition -freorder-functions @gol
7098 -frerun-cse-after-loop  @gol
7099 -fsched-interblock  -fsched-spec @gol
7100 -fschedule-insns  -fschedule-insns2 @gol
7101 -fstore-merging @gol
7102 -fstrict-aliasing -fstrict-overflow @gol
7103 -ftree-builtin-call-dce @gol
7104 -ftree-switch-conversion -ftree-tail-merge @gol
7105 -fcode-hoisting @gol
7106 -ftree-pre @gol
7107 -ftree-vrp @gol
7108 -fipa-ra}
7110 Please note the warning under @option{-fgcse} about
7111 invoking @option{-O2} on programs that use computed gotos.
7113 @item -O3
7114 @opindex O3
7115 Optimize yet more.  @option{-O3} turns on all optimizations specified
7116 by @option{-O2} and also turns on the @option{-finline-functions},
7117 @option{-funswitch-loops}, @option{-fpredictive-commoning},
7118 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
7119 @option{-ftree-loop-distribute-patterns}, @option{-fsplit-paths}
7120 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
7121 @option{-ftree-partial-pre}, @option{-fpeel-loops}
7122 and @option{-fipa-cp-clone} options.
7124 @item -O0
7125 @opindex O0
7126 Reduce compilation time and make debugging produce the expected
7127 results.  This is the default.
7129 @item -Os
7130 @opindex Os
7131 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
7132 do not typically increase code size.  It also performs further
7133 optimizations designed to reduce code size.
7135 @option{-Os} disables the following optimization flags:
7136 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
7137 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
7138 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
7140 @item -Ofast
7141 @opindex Ofast
7142 Disregard strict standards compliance.  @option{-Ofast} enables all
7143 @option{-O3} optimizations.  It also enables optimizations that are not
7144 valid for all standard-compliant programs.
7145 It turns on @option{-ffast-math} and the Fortran-specific
7146 @option{-fno-protect-parens} and @option{-fstack-arrays}.
7148 @item -Og
7149 @opindex Og
7150 Optimize debugging experience.  @option{-Og} enables optimizations
7151 that do not interfere with debugging. It should be the optimization
7152 level of choice for the standard edit-compile-debug cycle, offering
7153 a reasonable level of optimization while maintaining fast compilation
7154 and a good debugging experience.
7155 @end table
7157 If you use multiple @option{-O} options, with or without level numbers,
7158 the last such option is the one that is effective.
7160 Options of the form @option{-f@var{flag}} specify machine-independent
7161 flags.  Most flags have both positive and negative forms; the negative
7162 form of @option{-ffoo} is @option{-fno-foo}.  In the table
7163 below, only one of the forms is listed---the one you typically 
7164 use.  You can figure out the other form by either removing @samp{no-}
7165 or adding it.
7167 The following options control specific optimizations.  They are either
7168 activated by @option{-O} options or are related to ones that are.  You
7169 can use the following flags in the rare cases when ``fine-tuning'' of
7170 optimizations to be performed is desired.
7172 @table @gcctabopt
7173 @item -fno-defer-pop
7174 @opindex fno-defer-pop
7175 Always pop the arguments to each function call as soon as that function
7176 returns.  For machines that must pop arguments after a function call,
7177 the compiler normally lets arguments accumulate on the stack for several
7178 function calls and pops them all at once.
7180 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7182 @item -fforward-propagate
7183 @opindex fforward-propagate
7184 Perform a forward propagation pass on RTL@.  The pass tries to combine two
7185 instructions and checks if the result can be simplified.  If loop unrolling
7186 is active, two passes are performed and the second is scheduled after
7187 loop unrolling.
7189 This option is enabled by default at optimization levels @option{-O},
7190 @option{-O2}, @option{-O3}, @option{-Os}.
7192 @item -ffp-contract=@var{style}
7193 @opindex ffp-contract
7194 @option{-ffp-contract=off} disables floating-point expression contraction.
7195 @option{-ffp-contract=fast} enables floating-point expression contraction
7196 such as forming of fused multiply-add operations if the target has
7197 native support for them.
7198 @option{-ffp-contract=on} enables floating-point expression contraction
7199 if allowed by the language standard.  This is currently not implemented
7200 and treated equal to @option{-ffp-contract=off}.
7202 The default is @option{-ffp-contract=fast}.
7204 @item -fomit-frame-pointer
7205 @opindex fomit-frame-pointer
7206 Don't keep the frame pointer in a register for functions that
7207 don't need one.  This avoids the instructions to save, set up and
7208 restore frame pointers; it also makes an extra register available
7209 in many functions.  @strong{It also makes debugging impossible on
7210 some machines.}
7212 On some machines, such as the VAX, this flag has no effect, because
7213 the standard calling sequence automatically handles the frame pointer
7214 and nothing is saved by pretending it doesn't exist.  The
7215 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
7216 whether a target machine supports this flag.  @xref{Registers,,Register
7217 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
7219 The default setting (when not optimizing for
7220 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
7221 @option{-fomit-frame-pointer}.  You can configure GCC with the
7222 @option{--enable-frame-pointer} configure option to change the default.
7224 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7226 @item -foptimize-sibling-calls
7227 @opindex foptimize-sibling-calls
7228 Optimize sibling and tail recursive calls.
7230 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7232 @item -foptimize-strlen
7233 @opindex foptimize-strlen
7234 Optimize various standard C string functions (e.g. @code{strlen},
7235 @code{strchr} or @code{strcpy}) and
7236 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
7238 Enabled at levels @option{-O2}, @option{-O3}.
7240 @item -fno-inline
7241 @opindex fno-inline
7242 Do not expand any functions inline apart from those marked with
7243 the @code{always_inline} attribute.  This is the default when not
7244 optimizing.
7246 Single functions can be exempted from inlining by marking them
7247 with the @code{noinline} attribute.
7249 @item -finline-small-functions
7250 @opindex finline-small-functions
7251 Integrate functions into their callers when their body is smaller than expected
7252 function call code (so overall size of program gets smaller).  The compiler
7253 heuristically decides which functions are simple enough to be worth integrating
7254 in this way.  This inlining applies to all functions, even those not declared
7255 inline.
7257 Enabled at level @option{-O2}.
7259 @item -findirect-inlining
7260 @opindex findirect-inlining
7261 Inline also indirect calls that are discovered to be known at compile
7262 time thanks to previous inlining.  This option has any effect only
7263 when inlining itself is turned on by the @option{-finline-functions}
7264 or @option{-finline-small-functions} options.
7266 Enabled at level @option{-O2}.
7268 @item -finline-functions
7269 @opindex finline-functions
7270 Consider all functions for inlining, even if they are not declared inline.
7271 The compiler heuristically decides which functions are worth integrating
7272 in this way.
7274 If all calls to a given function are integrated, and the function is
7275 declared @code{static}, then the function is normally not output as
7276 assembler code in its own right.
7278 Enabled at level @option{-O3}.
7280 @item -finline-functions-called-once
7281 @opindex finline-functions-called-once
7282 Consider all @code{static} functions called once for inlining into their
7283 caller even if they are not marked @code{inline}.  If a call to a given
7284 function is integrated, then the function is not output as assembler code
7285 in its own right.
7287 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
7289 @item -fearly-inlining
7290 @opindex fearly-inlining
7291 Inline functions marked by @code{always_inline} and functions whose body seems
7292 smaller than the function call overhead early before doing
7293 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
7294 makes profiling significantly cheaper and usually inlining faster on programs
7295 having large chains of nested wrapper functions.
7297 Enabled by default.
7299 @item -fipa-sra
7300 @opindex fipa-sra
7301 Perform interprocedural scalar replacement of aggregates, removal of
7302 unused parameters and replacement of parameters passed by reference
7303 by parameters passed by value.
7305 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
7307 @item -finline-limit=@var{n}
7308 @opindex finline-limit
7309 By default, GCC limits the size of functions that can be inlined.  This flag
7310 allows coarse control of this limit.  @var{n} is the size of functions that
7311 can be inlined in number of pseudo instructions.
7313 Inlining is actually controlled by a number of parameters, which may be
7314 specified individually by using @option{--param @var{name}=@var{value}}.
7315 The @option{-finline-limit=@var{n}} option sets some of these parameters
7316 as follows:
7318 @table @gcctabopt
7319 @item max-inline-insns-single
7320 is set to @var{n}/2.
7321 @item max-inline-insns-auto
7322 is set to @var{n}/2.
7323 @end table
7325 See below for a documentation of the individual
7326 parameters controlling inlining and for the defaults of these parameters.
7328 @emph{Note:} there may be no value to @option{-finline-limit} that results
7329 in default behavior.
7331 @emph{Note:} pseudo instruction represents, in this particular context, an
7332 abstract measurement of function's size.  In no way does it represent a count
7333 of assembly instructions and as such its exact meaning might change from one
7334 release to an another.
7336 @item -fno-keep-inline-dllexport
7337 @opindex fno-keep-inline-dllexport
7338 This is a more fine-grained version of @option{-fkeep-inline-functions},
7339 which applies only to functions that are declared using the @code{dllexport}
7340 attribute or declspec.  @xref{Function Attributes,,Declaring Attributes of
7341 Functions}.
7343 @item -fkeep-inline-functions
7344 @opindex fkeep-inline-functions
7345 In C, emit @code{static} functions that are declared @code{inline}
7346 into the object file, even if the function has been inlined into all
7347 of its callers.  This switch does not affect functions using the
7348 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
7349 inline functions into the object file.
7351 @item -fkeep-static-functions
7352 @opindex fkeep-static-functions
7353 Emit @code{static} functions into the object file, even if the function
7354 is never used.
7356 @item -fkeep-static-consts
7357 @opindex fkeep-static-consts
7358 Emit variables declared @code{static const} when optimization isn't turned
7359 on, even if the variables aren't referenced.
7361 GCC enables this option by default.  If you want to force the compiler to
7362 check if a variable is referenced, regardless of whether or not
7363 optimization is turned on, use the @option{-fno-keep-static-consts} option.
7365 @item -fmerge-constants
7366 @opindex fmerge-constants
7367 Attempt to merge identical constants (string constants and floating-point
7368 constants) across compilation units.
7370 This option is the default for optimized compilation if the assembler and
7371 linker support it.  Use @option{-fno-merge-constants} to inhibit this
7372 behavior.
7374 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7376 @item -fmerge-all-constants
7377 @opindex fmerge-all-constants
7378 Attempt to merge identical constants and identical variables.
7380 This option implies @option{-fmerge-constants}.  In addition to
7381 @option{-fmerge-constants} this considers e.g.@: even constant initialized
7382 arrays or initialized constant variables with integral or floating-point
7383 types.  Languages like C or C++ require each variable, including multiple
7384 instances of the same variable in recursive calls, to have distinct locations,
7385 so using this option results in non-conforming
7386 behavior.
7388 @item -fmodulo-sched
7389 @opindex fmodulo-sched
7390 Perform swing modulo scheduling immediately before the first scheduling
7391 pass.  This pass looks at innermost loops and reorders their
7392 instructions by overlapping different iterations.
7394 @item -fmodulo-sched-allow-regmoves
7395 @opindex fmodulo-sched-allow-regmoves
7396 Perform more aggressive SMS-based modulo scheduling with register moves
7397 allowed.  By setting this flag certain anti-dependences edges are
7398 deleted, which triggers the generation of reg-moves based on the
7399 life-range analysis.  This option is effective only with
7400 @option{-fmodulo-sched} enabled.
7402 @item -fno-branch-count-reg
7403 @opindex fno-branch-count-reg
7404 Avoid running a pass scanning for opportunities to use ``decrement and
7405 branch'' instructions on a count register instead of generating sequences
7406 of instructions that decrement a register, compare it against zero, and
7407 then branch based upon the result.  This option is only meaningful on
7408 architectures that support such instructions, which include x86, PowerPC,
7409 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
7410 doesn't remove the decrement and branch instructions from the generated
7411 instruction stream introduced by other optimization passes.
7413 Enabled by default at @option{-O1} and higher.
7415 The default is @option{-fbranch-count-reg}.
7417 @item -fno-function-cse
7418 @opindex fno-function-cse
7419 Do not put function addresses in registers; make each instruction that
7420 calls a constant function contain the function's address explicitly.
7422 This option results in less efficient code, but some strange hacks
7423 that alter the assembler output may be confused by the optimizations
7424 performed when this option is not used.
7426 The default is @option{-ffunction-cse}
7428 @item -fno-zero-initialized-in-bss
7429 @opindex fno-zero-initialized-in-bss
7430 If the target supports a BSS section, GCC by default puts variables that
7431 are initialized to zero into BSS@.  This can save space in the resulting
7432 code.
7434 This option turns off this behavior because some programs explicitly
7435 rely on variables going to the data section---e.g., so that the
7436 resulting executable can find the beginning of that section and/or make
7437 assumptions based on that.
7439 The default is @option{-fzero-initialized-in-bss}.
7441 @item -fthread-jumps
7442 @opindex fthread-jumps
7443 Perform optimizations that check to see if a jump branches to a
7444 location where another comparison subsumed by the first is found.  If
7445 so, the first branch is redirected to either the destination of the
7446 second branch or a point immediately following it, depending on whether
7447 the condition is known to be true or false.
7449 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7451 @item -fsplit-wide-types
7452 @opindex fsplit-wide-types
7453 When using a type that occupies multiple registers, such as @code{long
7454 long} on a 32-bit system, split the registers apart and allocate them
7455 independently.  This normally generates better code for those types,
7456 but may make debugging more difficult.
7458 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
7459 @option{-Os}.
7461 @item -fcse-follow-jumps
7462 @opindex fcse-follow-jumps
7463 In common subexpression elimination (CSE), scan through jump instructions
7464 when the target of the jump is not reached by any other path.  For
7465 example, when CSE encounters an @code{if} statement with an
7466 @code{else} clause, CSE follows the jump when the condition
7467 tested is false.
7469 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7471 @item -fcse-skip-blocks
7472 @opindex fcse-skip-blocks
7473 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
7474 follow jumps that conditionally skip over blocks.  When CSE
7475 encounters a simple @code{if} statement with no else clause,
7476 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
7477 body of the @code{if}.
7479 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7481 @item -frerun-cse-after-loop
7482 @opindex frerun-cse-after-loop
7483 Re-run common subexpression elimination after loop optimizations are
7484 performed.
7486 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7488 @item -fgcse
7489 @opindex fgcse
7490 Perform a global common subexpression elimination pass.
7491 This pass also performs global constant and copy propagation.
7493 @emph{Note:} When compiling a program using computed gotos, a GCC
7494 extension, you may get better run-time performance if you disable
7495 the global common subexpression elimination pass by adding
7496 @option{-fno-gcse} to the command line.
7498 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7500 @item -fgcse-lm
7501 @opindex fgcse-lm
7502 When @option{-fgcse-lm} is enabled, global common subexpression elimination
7503 attempts to move loads that are only killed by stores into themselves.  This
7504 allows a loop containing a load/store sequence to be changed to a load outside
7505 the loop, and a copy/store within the loop.
7507 Enabled by default when @option{-fgcse} is enabled.
7509 @item -fgcse-sm
7510 @opindex fgcse-sm
7511 When @option{-fgcse-sm} is enabled, a store motion pass is run after
7512 global common subexpression elimination.  This pass attempts to move
7513 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
7514 loops containing a load/store sequence can be changed to a load before
7515 the loop and a store after the loop.
7517 Not enabled at any optimization level.
7519 @item -fgcse-las
7520 @opindex fgcse-las
7521 When @option{-fgcse-las} is enabled, the global common subexpression
7522 elimination pass eliminates redundant loads that come after stores to the
7523 same memory location (both partial and full redundancies).
7525 Not enabled at any optimization level.
7527 @item -fgcse-after-reload
7528 @opindex fgcse-after-reload
7529 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
7530 pass is performed after reload.  The purpose of this pass is to clean up
7531 redundant spilling.
7533 @item -faggressive-loop-optimizations
7534 @opindex faggressive-loop-optimizations
7535 This option tells the loop optimizer to use language constraints to
7536 derive bounds for the number of iterations of a loop.  This assumes that
7537 loop code does not invoke undefined behavior by for example causing signed
7538 integer overflows or out-of-bound array accesses.  The bounds for the
7539 number of iterations of a loop are used to guide loop unrolling and peeling
7540 and loop exit test optimizations.
7541 This option is enabled by default.
7543 @item -funconstrained-commons
7544 @opindex funconstrained-commons
7545 This option tells the compiler that variables declared in common blocks
7546 (e.g. Fortran) may later be overridden with longer trailing arrays. This
7547 prevents certain optimizations that depend on knowing the array bounds.
7549 @item -fcrossjumping
7550 @opindex fcrossjumping
7551 Perform cross-jumping transformation.
7552 This transformation unifies equivalent code and saves code size.  The
7553 resulting code may or may not perform better than without cross-jumping.
7555 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7557 @item -fauto-inc-dec
7558 @opindex fauto-inc-dec
7559 Combine increments or decrements of addresses with memory accesses.
7560 This pass is always skipped on architectures that do not have
7561 instructions to support this.  Enabled by default at @option{-O} and
7562 higher on architectures that support this.
7564 @item -fdce
7565 @opindex fdce
7566 Perform dead code elimination (DCE) on RTL@.
7567 Enabled by default at @option{-O} and higher.
7569 @item -fdse
7570 @opindex fdse
7571 Perform dead store elimination (DSE) on RTL@.
7572 Enabled by default at @option{-O} and higher.
7574 @item -fif-conversion
7575 @opindex fif-conversion
7576 Attempt to transform conditional jumps into branch-less equivalents.  This
7577 includes use of conditional moves, min, max, set flags and abs instructions, and
7578 some tricks doable by standard arithmetics.  The use of conditional execution
7579 on chips where it is available is controlled by @option{-fif-conversion2}.
7581 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7583 @item -fif-conversion2
7584 @opindex fif-conversion2
7585 Use conditional execution (where available) to transform conditional jumps into
7586 branch-less equivalents.
7588 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7590 @item -fdeclone-ctor-dtor
7591 @opindex fdeclone-ctor-dtor
7592 The C++ ABI requires multiple entry points for constructors and
7593 destructors: one for a base subobject, one for a complete object, and
7594 one for a virtual destructor that calls operator delete afterwards.
7595 For a hierarchy with virtual bases, the base and complete variants are
7596 clones, which means two copies of the function.  With this option, the
7597 base and complete variants are changed to be thunks that call a common
7598 implementation.
7600 Enabled by @option{-Os}.
7602 @item -fdelete-null-pointer-checks
7603 @opindex fdelete-null-pointer-checks
7604 Assume that programs cannot safely dereference null pointers, and that
7605 no code or data element resides at address zero.
7606 This option enables simple constant
7607 folding optimizations at all optimization levels.  In addition, other
7608 optimization passes in GCC use this flag to control global dataflow
7609 analyses that eliminate useless checks for null pointers; these assume
7610 that a memory access to address zero always results in a trap, so
7611 that if a pointer is checked after it has already been dereferenced,
7612 it cannot be null.
7614 Note however that in some environments this assumption is not true.
7615 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
7616 for programs that depend on that behavior.
7618 This option is enabled by default on most targets.  On Nios II ELF, it
7619 defaults to off.  On AVR and CR16, this option is completely disabled.  
7621 Passes that use the dataflow information
7622 are enabled independently at different optimization levels.
7624 @item -fdevirtualize
7625 @opindex fdevirtualize
7626 Attempt to convert calls to virtual functions to direct calls.  This
7627 is done both within a procedure and interprocedurally as part of
7628 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
7629 propagation (@option{-fipa-cp}).
7630 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7632 @item -fdevirtualize-speculatively
7633 @opindex fdevirtualize-speculatively
7634 Attempt to convert calls to virtual functions to speculative direct calls.
7635 Based on the analysis of the type inheritance graph, determine for a given call
7636 the set of likely targets. If the set is small, preferably of size 1, change
7637 the call into a conditional deciding between direct and indirect calls.  The
7638 speculative calls enable more optimizations, such as inlining.  When they seem
7639 useless after further optimization, they are converted back into original form.
7641 @item -fdevirtualize-at-ltrans
7642 @opindex fdevirtualize-at-ltrans
7643 Stream extra information needed for aggressive devirtualization when running
7644 the link-time optimizer in local transformation mode.  
7645 This option enables more devirtualization but
7646 significantly increases the size of streamed data. For this reason it is
7647 disabled by default.
7649 @item -fexpensive-optimizations
7650 @opindex fexpensive-optimizations
7651 Perform a number of minor optimizations that are relatively expensive.
7653 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7655 @item -free
7656 @opindex free
7657 Attempt to remove redundant extension instructions.  This is especially
7658 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
7659 registers after writing to their lower 32-bit half.
7661 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
7662 @option{-O3}, @option{-Os}.
7664 @item -fno-lifetime-dse
7665 @opindex fno-lifetime-dse
7666 In C++ the value of an object is only affected by changes within its
7667 lifetime: when the constructor begins, the object has an indeterminate
7668 value, and any changes during the lifetime of the object are dead when
7669 the object is destroyed.  Normally dead store elimination will take
7670 advantage of this; if your code relies on the value of the object
7671 storage persisting beyond the lifetime of the object, you can use this
7672 flag to disable this optimization.  To preserve stores before the
7673 constructor starts (e.g. because your operator new clears the object
7674 storage) but still treat the object as dead after the destructor you,
7675 can use @option{-flifetime-dse=1}.  The default behavior can be
7676 explicitly selected with @option{-flifetime-dse=2}.
7677 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
7679 @item -flive-range-shrinkage
7680 @opindex flive-range-shrinkage
7681 Attempt to decrease register pressure through register live range
7682 shrinkage.  This is helpful for fast processors with small or moderate
7683 size register sets.
7685 @item -fira-algorithm=@var{algorithm}
7686 @opindex fira-algorithm
7687 Use the specified coloring algorithm for the integrated register
7688 allocator.  The @var{algorithm} argument can be @samp{priority}, which
7689 specifies Chow's priority coloring, or @samp{CB}, which specifies
7690 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
7691 for all architectures, but for those targets that do support it, it is
7692 the default because it generates better code.
7694 @item -fira-region=@var{region}
7695 @opindex fira-region
7696 Use specified regions for the integrated register allocator.  The
7697 @var{region} argument should be one of the following:
7699 @table @samp
7701 @item all
7702 Use all loops as register allocation regions.
7703 This can give the best results for machines with a small and/or
7704 irregular register set.
7706 @item mixed
7707 Use all loops except for loops with small register pressure 
7708 as the regions.  This value usually gives
7709 the best results in most cases and for most architectures,
7710 and is enabled by default when compiling with optimization for speed
7711 (@option{-O}, @option{-O2}, @dots{}).
7713 @item one
7714 Use all functions as a single region.  
7715 This typically results in the smallest code size, and is enabled by default for
7716 @option{-Os} or @option{-O0}.
7718 @end table
7720 @item -fira-hoist-pressure
7721 @opindex fira-hoist-pressure
7722 Use IRA to evaluate register pressure in the code hoisting pass for
7723 decisions to hoist expressions.  This option usually results in smaller
7724 code, but it can slow the compiler down.
7726 This option is enabled at level @option{-Os} for all targets.
7728 @item -fira-loop-pressure
7729 @opindex fira-loop-pressure
7730 Use IRA to evaluate register pressure in loops for decisions to move
7731 loop invariants.  This option usually results in generation
7732 of faster and smaller code on machines with large register files (>= 32
7733 registers), but it can slow the compiler down.
7735 This option is enabled at level @option{-O3} for some targets.
7737 @item -fno-ira-share-save-slots
7738 @opindex fno-ira-share-save-slots
7739 Disable sharing of stack slots used for saving call-used hard
7740 registers living through a call.  Each hard register gets a
7741 separate stack slot, and as a result function stack frames are
7742 larger.
7744 @item -fno-ira-share-spill-slots
7745 @opindex fno-ira-share-spill-slots
7746 Disable sharing of stack slots allocated for pseudo-registers.  Each
7747 pseudo-register that does not get a hard register gets a separate
7748 stack slot, and as a result function stack frames are larger.
7750 @item -flra-remat
7751 @opindex flra-remat
7752 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
7753 values of spilled pseudos, LRA tries to rematerialize (recalculate)
7754 values if it is profitable.
7756 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7758 @item -fdelayed-branch
7759 @opindex fdelayed-branch
7760 If supported for the target machine, attempt to reorder instructions
7761 to exploit instruction slots available after delayed branch
7762 instructions.
7764 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7766 @item -fschedule-insns
7767 @opindex fschedule-insns
7768 If supported for the target machine, attempt to reorder instructions to
7769 eliminate execution stalls due to required data being unavailable.  This
7770 helps machines that have slow floating point or memory load instructions
7771 by allowing other instructions to be issued until the result of the load
7772 or floating-point instruction is required.
7774 Enabled at levels @option{-O2}, @option{-O3}.
7776 @item -fschedule-insns2
7777 @opindex fschedule-insns2
7778 Similar to @option{-fschedule-insns}, but requests an additional pass of
7779 instruction scheduling after register allocation has been done.  This is
7780 especially useful on machines with a relatively small number of
7781 registers and where memory load instructions take more than one cycle.
7783 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7785 @item -fno-sched-interblock
7786 @opindex fno-sched-interblock
7787 Don't schedule instructions across basic blocks.  This is normally
7788 enabled by default when scheduling before register allocation, i.e.@:
7789 with @option{-fschedule-insns} or at @option{-O2} or higher.
7791 @item -fno-sched-spec
7792 @opindex fno-sched-spec
7793 Don't allow speculative motion of non-load instructions.  This is normally
7794 enabled by default when scheduling before register allocation, i.e.@:
7795 with @option{-fschedule-insns} or at @option{-O2} or higher.
7797 @item -fsched-pressure
7798 @opindex fsched-pressure
7799 Enable register pressure sensitive insn scheduling before register
7800 allocation.  This only makes sense when scheduling before register
7801 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7802 @option{-O2} or higher.  Usage of this option can improve the
7803 generated code and decrease its size by preventing register pressure
7804 increase above the number of available hard registers and subsequent
7805 spills in register allocation.
7807 @item -fsched-spec-load
7808 @opindex fsched-spec-load
7809 Allow speculative motion of some load instructions.  This only makes
7810 sense when scheduling before register allocation, i.e.@: with
7811 @option{-fschedule-insns} or at @option{-O2} or higher.
7813 @item -fsched-spec-load-dangerous
7814 @opindex fsched-spec-load-dangerous
7815 Allow speculative motion of more load instructions.  This only makes
7816 sense when scheduling before register allocation, i.e.@: with
7817 @option{-fschedule-insns} or at @option{-O2} or higher.
7819 @item -fsched-stalled-insns
7820 @itemx -fsched-stalled-insns=@var{n}
7821 @opindex fsched-stalled-insns
7822 Define how many insns (if any) can be moved prematurely from the queue
7823 of stalled insns into the ready list during the second scheduling pass.
7824 @option{-fno-sched-stalled-insns} means that no insns are moved
7825 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7826 on how many queued insns can be moved prematurely.
7827 @option{-fsched-stalled-insns} without a value is equivalent to
7828 @option{-fsched-stalled-insns=1}.
7830 @item -fsched-stalled-insns-dep
7831 @itemx -fsched-stalled-insns-dep=@var{n}
7832 @opindex fsched-stalled-insns-dep
7833 Define how many insn groups (cycles) are examined for a dependency
7834 on a stalled insn that is a candidate for premature removal from the queue
7835 of stalled insns.  This has an effect only during the second scheduling pass,
7836 and only if @option{-fsched-stalled-insns} is used.
7837 @option{-fno-sched-stalled-insns-dep} is equivalent to
7838 @option{-fsched-stalled-insns-dep=0}.
7839 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7840 @option{-fsched-stalled-insns-dep=1}.
7842 @item -fsched2-use-superblocks
7843 @opindex fsched2-use-superblocks
7844 When scheduling after register allocation, use superblock scheduling.
7845 This allows motion across basic block boundaries,
7846 resulting in faster schedules.  This option is experimental, as not all machine
7847 descriptions used by GCC model the CPU closely enough to avoid unreliable
7848 results from the algorithm.
7850 This only makes sense when scheduling after register allocation, i.e.@: with
7851 @option{-fschedule-insns2} or at @option{-O2} or higher.
7853 @item -fsched-group-heuristic
7854 @opindex fsched-group-heuristic
7855 Enable the group heuristic in the scheduler.  This heuristic favors
7856 the instruction that belongs to a schedule group.  This is enabled
7857 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7858 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7860 @item -fsched-critical-path-heuristic
7861 @opindex fsched-critical-path-heuristic
7862 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7863 instructions on the critical path.  This is enabled by default when
7864 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7865 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7867 @item -fsched-spec-insn-heuristic
7868 @opindex fsched-spec-insn-heuristic
7869 Enable the speculative instruction heuristic in the scheduler.  This
7870 heuristic favors speculative instructions with greater dependency weakness.
7871 This is enabled by default when scheduling is enabled, i.e.@:
7872 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7873 or at @option{-O2} or higher.
7875 @item -fsched-rank-heuristic
7876 @opindex fsched-rank-heuristic
7877 Enable the rank heuristic in the scheduler.  This heuristic favors
7878 the instruction belonging to a basic block with greater size or frequency.
7879 This is enabled by default when scheduling is enabled, i.e.@:
7880 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7881 at @option{-O2} or higher.
7883 @item -fsched-last-insn-heuristic
7884 @opindex fsched-last-insn-heuristic
7885 Enable the last-instruction heuristic in the scheduler.  This heuristic
7886 favors the instruction that is less dependent on the last instruction
7887 scheduled.  This is enabled by default when scheduling is enabled,
7888 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7889 at @option{-O2} or higher.
7891 @item -fsched-dep-count-heuristic
7892 @opindex fsched-dep-count-heuristic
7893 Enable the dependent-count heuristic in the scheduler.  This heuristic
7894 favors the instruction that has more instructions depending on it.
7895 This is enabled by default when scheduling is enabled, i.e.@:
7896 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7897 at @option{-O2} or higher.
7899 @item -freschedule-modulo-scheduled-loops
7900 @opindex freschedule-modulo-scheduled-loops
7901 Modulo scheduling is performed before traditional scheduling.  If a loop
7902 is modulo scheduled, later scheduling passes may change its schedule.  
7903 Use this option to control that behavior.
7905 @item -fselective-scheduling
7906 @opindex fselective-scheduling
7907 Schedule instructions using selective scheduling algorithm.  Selective
7908 scheduling runs instead of the first scheduler pass.
7910 @item -fselective-scheduling2
7911 @opindex fselective-scheduling2
7912 Schedule instructions using selective scheduling algorithm.  Selective
7913 scheduling runs instead of the second scheduler pass.
7915 @item -fsel-sched-pipelining
7916 @opindex fsel-sched-pipelining
7917 Enable software pipelining of innermost loops during selective scheduling.
7918 This option has no effect unless one of @option{-fselective-scheduling} or
7919 @option{-fselective-scheduling2} is turned on.
7921 @item -fsel-sched-pipelining-outer-loops
7922 @opindex fsel-sched-pipelining-outer-loops
7923 When pipelining loops during selective scheduling, also pipeline outer loops.
7924 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7926 @item -fsemantic-interposition
7927 @opindex fsemantic-interposition
7928 Some object formats, like ELF, allow interposing of symbols by the 
7929 dynamic linker.
7930 This means that for symbols exported from the DSO, the compiler cannot perform
7931 interprocedural propagation, inlining and other optimizations in anticipation
7932 that the function or variable in question may change. While this feature is
7933 useful, for example, to rewrite memory allocation functions by a debugging
7934 implementation, it is expensive in the terms of code quality.
7935 With @option{-fno-semantic-interposition} the compiler assumes that 
7936 if interposition happens for functions the overwriting function will have 
7937 precisely the same semantics (and side effects). 
7938 Similarly if interposition happens
7939 for variables, the constructor of the variable will be the same. The flag
7940 has no effect for functions explicitly declared inline 
7941 (where it is never allowed for interposition to change semantics) 
7942 and for symbols explicitly declared weak.
7944 @item -fshrink-wrap
7945 @opindex fshrink-wrap
7946 Emit function prologues only before parts of the function that need it,
7947 rather than at the top of the function.  This flag is enabled by default at
7948 @option{-O} and higher.
7950 @item -fshrink-wrap-separate
7951 @opindex fshrink-wrap-separate
7952 Shrink-wrap separate parts of the prologue and epilogue separately, so that
7953 those parts are only executed when needed.
7954 This option is on by default, but has no effect unless @option{-fshrink-wrap}
7955 is also turned on and the target supports this.
7957 @item -fcaller-saves
7958 @opindex fcaller-saves
7959 Enable allocation of values to registers that are clobbered by
7960 function calls, by emitting extra instructions to save and restore the
7961 registers around such calls.  Such allocation is done only when it
7962 seems to result in better code.
7964 This option is always enabled by default on certain machines, usually
7965 those which have no call-preserved registers to use instead.
7967 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7969 @item -fcombine-stack-adjustments
7970 @opindex fcombine-stack-adjustments
7971 Tracks stack adjustments (pushes and pops) and stack memory references
7972 and then tries to find ways to combine them.
7974 Enabled by default at @option{-O1} and higher.
7976 @item -fipa-ra
7977 @opindex fipa-ra
7978 Use caller save registers for allocation if those registers are not used by
7979 any called function.  In that case it is not necessary to save and restore
7980 them around calls.  This is only possible if called functions are part of
7981 same compilation unit as current function and they are compiled before it.
7983 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}, however the option
7984 is disabled if generated code will be instrumented for profiling
7985 (@option{-p}, or @option{-pg}) or if callee's register usage cannot be known
7986 exactly (this happens on targets that do not expose prologues
7987 and epilogues in RTL).
7989 @item -fconserve-stack
7990 @opindex fconserve-stack
7991 Attempt to minimize stack usage.  The compiler attempts to use less
7992 stack space, even if that makes the program slower.  This option
7993 implies setting the @option{large-stack-frame} parameter to 100
7994 and the @option{large-stack-frame-growth} parameter to 400.
7996 @item -ftree-reassoc
7997 @opindex ftree-reassoc
7998 Perform reassociation on trees.  This flag is enabled by default
7999 at @option{-O} and higher.
8001 @item -fcode-hoisting
8002 @opindex fcode-hoisting
8003 Perform code hoisting.  Code hoisting tries to move the
8004 evaluation of expressions executed on all paths to the function exit
8005 as early as possible.  This is especially useful as a code size
8006 optimization, but it often helps for code speed as well.
8007 This flag is enabled by default at @option{-O2} and higher.
8009 @item -ftree-pre
8010 @opindex ftree-pre
8011 Perform partial redundancy elimination (PRE) on trees.  This flag is
8012 enabled by default at @option{-O2} and @option{-O3}.
8014 @item -ftree-partial-pre
8015 @opindex ftree-partial-pre
8016 Make partial redundancy elimination (PRE) more aggressive.  This flag is
8017 enabled by default at @option{-O3}.
8019 @item -ftree-forwprop
8020 @opindex ftree-forwprop
8021 Perform forward propagation on trees.  This flag is enabled by default
8022 at @option{-O} and higher.
8024 @item -ftree-fre
8025 @opindex ftree-fre
8026 Perform full redundancy elimination (FRE) on trees.  The difference
8027 between FRE and PRE is that FRE only considers expressions
8028 that are computed on all paths leading to the redundant computation.
8029 This analysis is faster than PRE, though it exposes fewer redundancies.
8030 This flag is enabled by default at @option{-O} and higher.
8032 @item -ftree-phiprop
8033 @opindex ftree-phiprop
8034 Perform hoisting of loads from conditional pointers on trees.  This
8035 pass is enabled by default at @option{-O} and higher.
8037 @item -fhoist-adjacent-loads
8038 @opindex fhoist-adjacent-loads
8039 Speculatively hoist loads from both branches of an if-then-else if the
8040 loads are from adjacent locations in the same structure and the target
8041 architecture has a conditional move instruction.  This flag is enabled
8042 by default at @option{-O2} and higher.
8044 @item -ftree-copy-prop
8045 @opindex ftree-copy-prop
8046 Perform copy propagation on trees.  This pass eliminates unnecessary
8047 copy operations.  This flag is enabled by default at @option{-O} and
8048 higher.
8050 @item -fipa-pure-const
8051 @opindex fipa-pure-const
8052 Discover which functions are pure or constant.
8053 Enabled by default at @option{-O} and higher.
8055 @item -fipa-reference
8056 @opindex fipa-reference
8057 Discover which static variables do not escape the
8058 compilation unit.
8059 Enabled by default at @option{-O} and higher.
8061 @item -fipa-pta
8062 @opindex fipa-pta
8063 Perform interprocedural pointer analysis and interprocedural modification
8064 and reference analysis.  This option can cause excessive memory and
8065 compile-time usage on large compilation units.  It is not enabled by
8066 default at any optimization level.
8068 @item -fipa-profile
8069 @opindex fipa-profile
8070 Perform interprocedural profile propagation.  The functions called only from
8071 cold functions are marked as cold. Also functions executed once (such as
8072 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
8073 functions and loop less parts of functions executed once are then optimized for
8074 size.
8075 Enabled by default at @option{-O} and higher.
8077 @item -fipa-cp
8078 @opindex fipa-cp
8079 Perform interprocedural constant propagation.
8080 This optimization analyzes the program to determine when values passed
8081 to functions are constants and then optimizes accordingly.
8082 This optimization can substantially increase performance
8083 if the application has constants passed to functions.
8084 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
8086 @item -fipa-cp-clone
8087 @opindex fipa-cp-clone
8088 Perform function cloning to make interprocedural constant propagation stronger.
8089 When enabled, interprocedural constant propagation performs function cloning
8090 when externally visible function can be called with constant arguments.
8091 Because this optimization can create multiple copies of functions,
8092 it may significantly increase code size
8093 (see @option{--param ipcp-unit-growth=@var{value}}).
8094 This flag is enabled by default at @option{-O3}.
8096 @item -fipa-bit-cp
8097 @opindex -fipa-bit-cp
8098 When enabled, perform interprocedural bitwise constant
8099 propagation. This flag is enabled by default at @option{-O2}. It
8100 requires that @option{-fipa-cp} is enabled.
8102 @item -fipa-vrp
8103 @opindex -fipa-vrp
8104 When enabled, perform interprocedural propagation of value
8105 ranges. This flag is enabled by default at @option{-O2}. It requires
8106 that @option{-fipa-cp} is enabled.
8108 @item -fipa-icf
8109 @opindex fipa-icf
8110 Perform Identical Code Folding for functions and read-only variables.
8111 The optimization reduces code size and may disturb unwind stacks by replacing
8112 a function by equivalent one with a different name. The optimization works
8113 more effectively with link-time optimization enabled.
8115 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
8116 works on different levels and thus the optimizations are not same - there are
8117 equivalences that are found only by GCC and equivalences found only by Gold.
8119 This flag is enabled by default at @option{-O2} and @option{-Os}.
8121 @item -fisolate-erroneous-paths-dereference
8122 @opindex fisolate-erroneous-paths-dereference
8123 Detect paths that trigger erroneous or undefined behavior due to
8124 dereferencing a null pointer.  Isolate those paths from the main control
8125 flow and turn the statement with erroneous or undefined behavior into a trap.
8126 This flag is enabled by default at @option{-O2} and higher and depends on
8127 @option{-fdelete-null-pointer-checks} also being enabled.
8129 @item -fisolate-erroneous-paths-attribute
8130 @opindex fisolate-erroneous-paths-attribute
8131 Detect paths that trigger erroneous or undefined behavior due a null value
8132 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
8133 attribute.  Isolate those paths from the main control flow and turn the
8134 statement with erroneous or undefined behavior into a trap.  This is not
8135 currently enabled, but may be enabled by @option{-O2} in the future.
8137 @item -ftree-sink
8138 @opindex ftree-sink
8139 Perform forward store motion on trees.  This flag is
8140 enabled by default at @option{-O} and higher.
8142 @item -ftree-bit-ccp
8143 @opindex ftree-bit-ccp
8144 Perform sparse conditional bit constant propagation on trees and propagate
8145 pointer alignment information.
8146 This pass only operates on local scalar variables and is enabled by default
8147 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
8149 @item -ftree-ccp
8150 @opindex ftree-ccp
8151 Perform sparse conditional constant propagation (CCP) on trees.  This
8152 pass only operates on local scalar variables and is enabled by default
8153 at @option{-O} and higher.
8155 @item -fssa-backprop
8156 @opindex fssa-backprop
8157 Propagate information about uses of a value up the definition chain
8158 in order to simplify the definitions.  For example, this pass strips
8159 sign operations if the sign of a value never matters.  The flag is
8160 enabled by default at @option{-O} and higher.
8162 @item -fssa-phiopt
8163 @opindex fssa-phiopt
8164 Perform pattern matching on SSA PHI nodes to optimize conditional
8165 code.  This pass is enabled by default at @option{-O} and higher.
8167 @item -ftree-switch-conversion
8168 @opindex ftree-switch-conversion
8169 Perform conversion of simple initializations in a switch to
8170 initializations from a scalar array.  This flag is enabled by default
8171 at @option{-O2} and higher.
8173 @item -ftree-tail-merge
8174 @opindex ftree-tail-merge
8175 Look for identical code sequences.  When found, replace one with a jump to the
8176 other.  This optimization is known as tail merging or cross jumping.  This flag
8177 is enabled by default at @option{-O2} and higher.  The compilation time
8178 in this pass can
8179 be limited using @option{max-tail-merge-comparisons} parameter and
8180 @option{max-tail-merge-iterations} parameter.
8182 @item -ftree-dce
8183 @opindex ftree-dce
8184 Perform dead code elimination (DCE) on trees.  This flag is enabled by
8185 default at @option{-O} and higher.
8187 @item -ftree-builtin-call-dce
8188 @opindex ftree-builtin-call-dce
8189 Perform conditional dead code elimination (DCE) for calls to built-in functions
8190 that may set @code{errno} but are otherwise side-effect free.  This flag is
8191 enabled by default at @option{-O2} and higher if @option{-Os} is not also
8192 specified.
8194 @item -ftree-dominator-opts
8195 @opindex ftree-dominator-opts
8196 Perform a variety of simple scalar cleanups (constant/copy
8197 propagation, redundancy elimination, range propagation and expression
8198 simplification) based on a dominator tree traversal.  This also
8199 performs jump threading (to reduce jumps to jumps). This flag is
8200 enabled by default at @option{-O} and higher.
8202 @item -ftree-dse
8203 @opindex ftree-dse
8204 Perform dead store elimination (DSE) on trees.  A dead store is a store into
8205 a memory location that is later overwritten by another store without
8206 any intervening loads.  In this case the earlier store can be deleted.  This
8207 flag is enabled by default at @option{-O} and higher.
8209 @item -ftree-ch
8210 @opindex ftree-ch
8211 Perform loop header copying on trees.  This is beneficial since it increases
8212 effectiveness of code motion optimizations.  It also saves one jump.  This flag
8213 is enabled by default at @option{-O} and higher.  It is not enabled
8214 for @option{-Os}, since it usually increases code size.
8216 @item -ftree-loop-optimize
8217 @opindex ftree-loop-optimize
8218 Perform loop optimizations on trees.  This flag is enabled by default
8219 at @option{-O} and higher.
8221 @item -ftree-loop-linear
8222 @itemx -floop-interchange
8223 @itemx -floop-strip-mine
8224 @itemx -floop-block
8225 @itemx -floop-unroll-and-jam
8226 @opindex ftree-loop-linear
8227 @opindex floop-interchange
8228 @opindex floop-strip-mine
8229 @opindex floop-block
8230 @opindex floop-unroll-and-jam
8231 Perform loop nest optimizations.  Same as
8232 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
8233 to be configured with @option{--with-isl} to enable the Graphite loop
8234 transformation infrastructure.
8236 @item -fgraphite-identity
8237 @opindex fgraphite-identity
8238 Enable the identity transformation for graphite.  For every SCoP we generate
8239 the polyhedral representation and transform it back to gimple.  Using
8240 @option{-fgraphite-identity} we can check the costs or benefits of the
8241 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
8242 are also performed by the code generator isl, like index splitting and
8243 dead code elimination in loops.
8245 @item -floop-nest-optimize
8246 @opindex floop-nest-optimize
8247 Enable the isl based loop nest optimizer.  This is a generic loop nest
8248 optimizer based on the Pluto optimization algorithms.  It calculates a loop
8249 structure optimized for data-locality and parallelism.  This option
8250 is experimental.
8252 @item -floop-parallelize-all
8253 @opindex floop-parallelize-all
8254 Use the Graphite data dependence analysis to identify loops that can
8255 be parallelized.  Parallelize all the loops that can be analyzed to
8256 not contain loop carried dependences without checking that it is
8257 profitable to parallelize the loops.
8259 @item -ftree-coalesce-vars
8260 @opindex ftree-coalesce-vars
8261 While transforming the program out of the SSA representation, attempt to
8262 reduce copying by coalescing versions of different user-defined
8263 variables, instead of just compiler temporaries.  This may severely
8264 limit the ability to debug an optimized program compiled with
8265 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
8266 prevents SSA coalescing of user variables.  This option is enabled by
8267 default if optimization is enabled, and it does very little otherwise.
8269 @item -ftree-loop-if-convert
8270 @opindex ftree-loop-if-convert
8271 Attempt to transform conditional jumps in the innermost loops to
8272 branch-less equivalents.  The intent is to remove control-flow from
8273 the innermost loops in order to improve the ability of the
8274 vectorization pass to handle these loops.  This is enabled by default
8275 if vectorization is enabled.
8277 @item -ftree-loop-distribution
8278 @opindex ftree-loop-distribution
8279 Perform loop distribution.  This flag can improve cache performance on
8280 big loop bodies and allow further loop optimizations, like
8281 parallelization or vectorization, to take place.  For example, the loop
8282 @smallexample
8283 DO I = 1, N
8284   A(I) = B(I) + C
8285   D(I) = E(I) * F
8286 ENDDO
8287 @end smallexample
8288 is transformed to
8289 @smallexample
8290 DO I = 1, N
8291    A(I) = B(I) + C
8292 ENDDO
8293 DO I = 1, N
8294    D(I) = E(I) * F
8295 ENDDO
8296 @end smallexample
8298 @item -ftree-loop-distribute-patterns
8299 @opindex ftree-loop-distribute-patterns
8300 Perform loop distribution of patterns that can be code generated with
8301 calls to a library.  This flag is enabled by default at @option{-O3}.
8303 This pass distributes the initialization loops and generates a call to
8304 memset zero.  For example, the loop
8305 @smallexample
8306 DO I = 1, N
8307   A(I) = 0
8308   B(I) = A(I) + I
8309 ENDDO
8310 @end smallexample
8311 is transformed to
8312 @smallexample
8313 DO I = 1, N
8314    A(I) = 0
8315 ENDDO
8316 DO I = 1, N
8317    B(I) = A(I) + I
8318 ENDDO
8319 @end smallexample
8320 and the initialization loop is transformed into a call to memset zero.
8322 @item -ftree-loop-im
8323 @opindex ftree-loop-im
8324 Perform loop invariant motion on trees.  This pass moves only invariants that
8325 are hard to handle at RTL level (function calls, operations that expand to
8326 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
8327 operands of conditions that are invariant out of the loop, so that we can use
8328 just trivial invariantness analysis in loop unswitching.  The pass also includes
8329 store motion.
8331 @item -ftree-loop-ivcanon
8332 @opindex ftree-loop-ivcanon
8333 Create a canonical counter for number of iterations in loops for which
8334 determining number of iterations requires complicated analysis.  Later
8335 optimizations then may determine the number easily.  Useful especially
8336 in connection with unrolling.
8338 @item -fivopts
8339 @opindex fivopts
8340 Perform induction variable optimizations (strength reduction, induction
8341 variable merging and induction variable elimination) on trees.
8343 @item -ftree-parallelize-loops=n
8344 @opindex ftree-parallelize-loops
8345 Parallelize loops, i.e., split their iteration space to run in n threads.
8346 This is only possible for loops whose iterations are independent
8347 and can be arbitrarily reordered.  The optimization is only
8348 profitable on multiprocessor machines, for loops that are CPU-intensive,
8349 rather than constrained e.g.@: by memory bandwidth.  This option
8350 implies @option{-pthread}, and thus is only supported on targets
8351 that have support for @option{-pthread}.
8353 @item -ftree-pta
8354 @opindex ftree-pta
8355 Perform function-local points-to analysis on trees.  This flag is
8356 enabled by default at @option{-O} and higher.
8358 @item -ftree-sra
8359 @opindex ftree-sra
8360 Perform scalar replacement of aggregates.  This pass replaces structure
8361 references with scalars to prevent committing structures to memory too
8362 early.  This flag is enabled by default at @option{-O} and higher.
8364 @item -fstore-merging
8365 @opindex fstore-merging
8366 Perform merging of narrow stores to consecutive memory addresses.  This pass
8367 merges contiguous stores of immediate values narrower than a word into fewer
8368 wider stores to reduce the number of instructions.  This is enabled by default
8369 at @option{-O2} and higher as well as @option{-Os}.
8371 @item -ftree-ter
8372 @opindex ftree-ter
8373 Perform temporary expression replacement during the SSA->normal phase.  Single
8374 use/single def temporaries are replaced at their use location with their
8375 defining expression.  This results in non-GIMPLE code, but gives the expanders
8376 much more complex trees to work on resulting in better RTL generation.  This is
8377 enabled by default at @option{-O} and higher.
8379 @item -ftree-slsr
8380 @opindex ftree-slsr
8381 Perform straight-line strength reduction on trees.  This recognizes related
8382 expressions involving multiplications and replaces them by less expensive
8383 calculations when possible.  This is enabled by default at @option{-O} and
8384 higher.
8386 @item -ftree-vectorize
8387 @opindex ftree-vectorize
8388 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
8389 and @option{-ftree-slp-vectorize} if not explicitly specified.
8391 @item -ftree-loop-vectorize
8392 @opindex ftree-loop-vectorize
8393 Perform loop vectorization on trees. This flag is enabled by default at
8394 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8396 @item -ftree-slp-vectorize
8397 @opindex ftree-slp-vectorize
8398 Perform basic block vectorization on trees. This flag is enabled by default at
8399 @option{-O3} and when @option{-ftree-vectorize} is enabled.
8401 @item -fvect-cost-model=@var{model}
8402 @opindex fvect-cost-model
8403 Alter the cost model used for vectorization.  The @var{model} argument
8404 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
8405 With the @samp{unlimited} model the vectorized code-path is assumed
8406 to be profitable while with the @samp{dynamic} model a runtime check
8407 guards the vectorized code-path to enable it only for iteration
8408 counts that will likely execute faster than when executing the original
8409 scalar loop.  The @samp{cheap} model disables vectorization of
8410 loops where doing so would be cost prohibitive for example due to
8411 required runtime checks for data dependence or alignment but otherwise
8412 is equal to the @samp{dynamic} model.
8413 The default cost model depends on other optimization flags and is
8414 either @samp{dynamic} or @samp{cheap}.
8416 @item -fsimd-cost-model=@var{model}
8417 @opindex fsimd-cost-model
8418 Alter the cost model used for vectorization of loops marked with the OpenMP
8419 or Cilk Plus simd directive.  The @var{model} argument should be one of
8420 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
8421 have the same meaning as described in @option{-fvect-cost-model} and by
8422 default a cost model defined with @option{-fvect-cost-model} is used.
8424 @item -ftree-vrp
8425 @opindex ftree-vrp
8426 Perform Value Range Propagation on trees.  This is similar to the
8427 constant propagation pass, but instead of values, ranges of values are
8428 propagated.  This allows the optimizers to remove unnecessary range
8429 checks like array bound checks and null pointer checks.  This is
8430 enabled by default at @option{-O2} and higher.  Null pointer check
8431 elimination is only done if @option{-fdelete-null-pointer-checks} is
8432 enabled.
8434 @item -fsplit-paths
8435 @opindex fsplit-paths
8436 Split paths leading to loop backedges.  This can improve dead code
8437 elimination and common subexpression elimination.  This is enabled by
8438 default at @option{-O2} and above.
8440 @item -fsplit-ivs-in-unroller
8441 @opindex fsplit-ivs-in-unroller
8442 Enables expression of values of induction variables in later iterations
8443 of the unrolled loop using the value in the first iteration.  This breaks
8444 long dependency chains, thus improving efficiency of the scheduling passes.
8446 A combination of @option{-fweb} and CSE is often sufficient to obtain the
8447 same effect.  However, that is not reliable in cases where the loop body
8448 is more complicated than a single basic block.  It also does not work at all
8449 on some architectures due to restrictions in the CSE pass.
8451 This optimization is enabled by default.
8453 @item -fvariable-expansion-in-unroller
8454 @opindex fvariable-expansion-in-unroller
8455 With this option, the compiler creates multiple copies of some
8456 local variables when unrolling a loop, which can result in superior code.
8458 @item -fpartial-inlining
8459 @opindex fpartial-inlining
8460 Inline parts of functions.  This option has any effect only
8461 when inlining itself is turned on by the @option{-finline-functions}
8462 or @option{-finline-small-functions} options.
8464 Enabled at level @option{-O2}.
8466 @item -fpredictive-commoning
8467 @opindex fpredictive-commoning
8468 Perform predictive commoning optimization, i.e., reusing computations
8469 (especially memory loads and stores) performed in previous
8470 iterations of loops.
8472 This option is enabled at level @option{-O3}.
8474 @item -fprefetch-loop-arrays
8475 @opindex fprefetch-loop-arrays
8476 If supported by the target machine, generate instructions to prefetch
8477 memory to improve the performance of loops that access large arrays.
8479 This option may generate better or worse code; results are highly
8480 dependent on the structure of loops within the source code.
8482 Disabled at level @option{-Os}.
8484 @item -fno-printf-return-value
8485 @opindex fno-printf-return-value
8486 Do not substitute constants for known return value of formatted output
8487 functions such as @code{sprintf}, @code{snprintf}, @code{vsprintf}, and
8488 @code{vsnprintf} (but not @code{printf} of @code{fprintf}).  This
8489 transformation allows GCC to optimize or even eliminate branches based
8490 on the known return value of these functions called with arguments that
8491 are either constant, or whose values are known to be in a range that
8492 makes determining the exact return value possible.  For example, when
8493 @option{-fprintf-return-value} is in effect, both the branch and the
8494 body of the @code{if} statement (but not the call to @code{snprint})
8495 can be optimized away when @code{i} is a 32-bit or smaller integer
8496 because the return value is guaranteed to be at most 8.
8498 @smallexample
8499 char buf[9];
8500 if (snprintf (buf, "%08x", i) >= sizeof buf)
8501   @dots{}
8502 @end smallexample
8504 The @option{-fprintf-return-value} option relies on other optimizations
8505 and yields best results with @option{-O2}.  It works in tandem with the
8506 @option{-Wformat-overflow} and @option{-Wformat-truncation} options.
8507 The @option{-fprintf-return-value} option is enabled by default.
8509 @item -fno-peephole
8510 @itemx -fno-peephole2
8511 @opindex fno-peephole
8512 @opindex fno-peephole2
8513 Disable any machine-specific peephole optimizations.  The difference
8514 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
8515 are implemented in the compiler; some targets use one, some use the
8516 other, a few use both.
8518 @option{-fpeephole} is enabled by default.
8519 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8521 @item -fno-guess-branch-probability
8522 @opindex fno-guess-branch-probability
8523 Do not guess branch probabilities using heuristics.
8525 GCC uses heuristics to guess branch probabilities if they are
8526 not provided by profiling feedback (@option{-fprofile-arcs}).  These
8527 heuristics are based on the control flow graph.  If some branch probabilities
8528 are specified by @code{__builtin_expect}, then the heuristics are
8529 used to guess branch probabilities for the rest of the control flow graph,
8530 taking the @code{__builtin_expect} info into account.  The interactions
8531 between the heuristics and @code{__builtin_expect} can be complex, and in
8532 some cases, it may be useful to disable the heuristics so that the effects
8533 of @code{__builtin_expect} are easier to understand.
8535 The default is @option{-fguess-branch-probability} at levels
8536 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8538 @item -freorder-blocks
8539 @opindex freorder-blocks
8540 Reorder basic blocks in the compiled function in order to reduce number of
8541 taken branches and improve code locality.
8543 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8545 @item -freorder-blocks-algorithm=@var{algorithm}
8546 @opindex freorder-blocks-algorithm
8547 Use the specified algorithm for basic block reordering.  The
8548 @var{algorithm} argument can be @samp{simple}, which does not increase
8549 code size (except sometimes due to secondary effects like alignment),
8550 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
8551 put all often executed code together, minimizing the number of branches
8552 executed by making extra copies of code.
8554 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
8555 @samp{stc} at levels @option{-O2}, @option{-O3}.
8557 @item -freorder-blocks-and-partition
8558 @opindex freorder-blocks-and-partition
8559 In addition to reordering basic blocks in the compiled function, in order
8560 to reduce number of taken branches, partitions hot and cold basic blocks
8561 into separate sections of the assembly and @file{.o} files, to improve
8562 paging and cache locality performance.
8564 This optimization is automatically turned off in the presence of
8565 exception handling, for linkonce sections, for functions with a user-defined
8566 section attribute and on any architecture that does not support named
8567 sections.
8569 Enabled for x86 at levels @option{-O2}, @option{-O3}.
8571 @item -freorder-functions
8572 @opindex freorder-functions
8573 Reorder functions in the object file in order to
8574 improve code locality.  This is implemented by using special
8575 subsections @code{.text.hot} for most frequently executed functions and
8576 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
8577 the linker so object file format must support named sections and linker must
8578 place them in a reasonable way.
8580 Also profile feedback must be available to make this option effective.  See
8581 @option{-fprofile-arcs} for details.
8583 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8585 @item -fstrict-aliasing
8586 @opindex fstrict-aliasing
8587 Allow the compiler to assume the strictest aliasing rules applicable to
8588 the language being compiled.  For C (and C++), this activates
8589 optimizations based on the type of expressions.  In particular, an
8590 object of one type is assumed never to reside at the same address as an
8591 object of a different type, unless the types are almost the same.  For
8592 example, an @code{unsigned int} can alias an @code{int}, but not a
8593 @code{void*} or a @code{double}.  A character type may alias any other
8594 type.
8596 @anchor{Type-punning}Pay special attention to code like this:
8597 @smallexample
8598 union a_union @{
8599   int i;
8600   double d;
8603 int f() @{
8604   union a_union t;
8605   t.d = 3.0;
8606   return t.i;
8608 @end smallexample
8609 The practice of reading from a different union member than the one most
8610 recently written to (called ``type-punning'') is common.  Even with
8611 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
8612 is accessed through the union type.  So, the code above works as
8613 expected.  @xref{Structures unions enumerations and bit-fields
8614 implementation}.  However, this code might not:
8615 @smallexample
8616 int f() @{
8617   union a_union t;
8618   int* ip;
8619   t.d = 3.0;
8620   ip = &t.i;
8621   return *ip;
8623 @end smallexample
8625 Similarly, access by taking the address, casting the resulting pointer
8626 and dereferencing the result has undefined behavior, even if the cast
8627 uses a union type, e.g.:
8628 @smallexample
8629 int f() @{
8630   double d = 3.0;
8631   return ((union a_union *) &d)->i;
8633 @end smallexample
8635 The @option{-fstrict-aliasing} option is enabled at levels
8636 @option{-O2}, @option{-O3}, @option{-Os}.
8638 @item -fstrict-overflow
8639 @opindex fstrict-overflow
8640 Allow the compiler to assume strict signed overflow rules, depending
8641 on the language being compiled.  For C (and C++) this means that
8642 overflow when doing arithmetic with signed numbers is undefined, which
8643 means that the compiler may assume that it does not happen.  This
8644 permits various optimizations.  For example, the compiler assumes
8645 that an expression like @code{i + 10 > i} is always true for
8646 signed @code{i}.  This assumption is only valid if signed overflow is
8647 undefined, as the expression is false if @code{i + 10} overflows when
8648 using twos complement arithmetic.  When this option is in effect any
8649 attempt to determine whether an operation on signed numbers 
8650 overflows must be written carefully to not actually involve overflow.
8652 This option also allows the compiler to assume strict pointer
8653 semantics: given a pointer to an object, if adding an offset to that
8654 pointer does not produce a pointer to the same object, the addition is
8655 undefined.  This permits the compiler to conclude that @code{p + u >
8656 p} is always true for a pointer @code{p} and unsigned integer
8657 @code{u}.  This assumption is only valid because pointer wraparound is
8658 undefined, as the expression is false if @code{p + u} overflows using
8659 twos complement arithmetic.
8661 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
8662 that integer signed overflow is fully defined: it wraps.  When
8663 @option{-fwrapv} is used, there is no difference between
8664 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
8665 integers.  With @option{-fwrapv} certain types of overflow are
8666 permitted.  For example, if the compiler gets an overflow when doing
8667 arithmetic on constants, the overflowed value can still be used with
8668 @option{-fwrapv}, but not otherwise.
8670 The @option{-fstrict-overflow} option is enabled at levels
8671 @option{-O2}, @option{-O3}, @option{-Os}.
8673 @item -falign-functions
8674 @itemx -falign-functions=@var{n}
8675 @opindex falign-functions
8676 Align the start of functions to the next power-of-two greater than
8677 @var{n}, skipping up to @var{n} bytes.  For instance,
8678 @option{-falign-functions=32} aligns functions to the next 32-byte
8679 boundary, but @option{-falign-functions=24} aligns to the next
8680 32-byte boundary only if this can be done by skipping 23 bytes or less.
8682 @option{-fno-align-functions} and @option{-falign-functions=1} are
8683 equivalent and mean that functions are not aligned.
8685 Some assemblers only support this flag when @var{n} is a power of two;
8686 in that case, it is rounded up.
8688 If @var{n} is not specified or is zero, use a machine-dependent default.
8690 Enabled at levels @option{-O2}, @option{-O3}.
8692 @item -flimit-function-alignment
8693 If this option is enabled, the compiler tries to avoid unnecessarily
8694 overaligning functions. It attempts to instruct the assembler to align
8695 by the amount specified by @option{-falign-functions}, but not to
8696 skip more bytes than the size of the function.
8698 @item -falign-labels
8699 @itemx -falign-labels=@var{n}
8700 @opindex falign-labels
8701 Align all branch targets to a power-of-two boundary, skipping up to
8702 @var{n} bytes like @option{-falign-functions}.  This option can easily
8703 make code slower, because it must insert dummy operations for when the
8704 branch target is reached in the usual flow of the code.
8706 @option{-fno-align-labels} and @option{-falign-labels=1} are
8707 equivalent and mean that labels are not aligned.
8709 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
8710 are greater than this value, then their values are used instead.
8712 If @var{n} is not specified or is zero, use a machine-dependent default
8713 which is very likely to be @samp{1}, meaning no alignment.
8715 Enabled at levels @option{-O2}, @option{-O3}.
8717 @item -falign-loops
8718 @itemx -falign-loops=@var{n}
8719 @opindex falign-loops
8720 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
8721 like @option{-falign-functions}.  If the loops are
8722 executed many times, this makes up for any execution of the dummy
8723 operations.
8725 @option{-fno-align-loops} and @option{-falign-loops=1} are
8726 equivalent and mean that loops are not aligned.
8728 If @var{n} is not specified or is zero, use a machine-dependent default.
8730 Enabled at levels @option{-O2}, @option{-O3}.
8732 @item -falign-jumps
8733 @itemx -falign-jumps=@var{n}
8734 @opindex falign-jumps
8735 Align branch targets to a power-of-two boundary, for branch targets
8736 where the targets can only be reached by jumping, skipping up to @var{n}
8737 bytes like @option{-falign-functions}.  In this case, no dummy operations
8738 need be executed.
8740 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
8741 equivalent and mean that loops are not aligned.
8743 If @var{n} is not specified or is zero, use a machine-dependent default.
8745 Enabled at levels @option{-O2}, @option{-O3}.
8747 @item -funit-at-a-time
8748 @opindex funit-at-a-time
8749 This option is left for compatibility reasons. @option{-funit-at-a-time}
8750 has no effect, while @option{-fno-unit-at-a-time} implies
8751 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
8753 Enabled by default.
8755 @item -fno-toplevel-reorder
8756 @opindex fno-toplevel-reorder
8757 Do not reorder top-level functions, variables, and @code{asm}
8758 statements.  Output them in the same order that they appear in the
8759 input file.  When this option is used, unreferenced static variables
8760 are not removed.  This option is intended to support existing code
8761 that relies on a particular ordering.  For new code, it is better to
8762 use attributes when possible.
8764 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
8765 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
8766 targets.
8768 @item -fweb
8769 @opindex fweb
8770 Constructs webs as commonly used for register allocation purposes and assign
8771 each web individual pseudo register.  This allows the register allocation pass
8772 to operate on pseudos directly, but also strengthens several other optimization
8773 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
8774 however, make debugging impossible, since variables no longer stay in a
8775 ``home register''.
8777 Enabled by default with @option{-funroll-loops}.
8779 @item -fwhole-program
8780 @opindex fwhole-program
8781 Assume that the current compilation unit represents the whole program being
8782 compiled.  All public functions and variables with the exception of @code{main}
8783 and those merged by attribute @code{externally_visible} become static functions
8784 and in effect are optimized more aggressively by interprocedural optimizers.
8786 This option should not be used in combination with @option{-flto}.
8787 Instead relying on a linker plugin should provide safer and more precise
8788 information.
8790 @item -flto[=@var{n}]
8791 @opindex flto
8792 This option runs the standard link-time optimizer.  When invoked
8793 with source code, it generates GIMPLE (one of GCC's internal
8794 representations) and writes it to special ELF sections in the object
8795 file.  When the object files are linked together, all the function
8796 bodies are read from these ELF sections and instantiated as if they
8797 had been part of the same translation unit.
8799 To use the link-time optimizer, @option{-flto} and optimization
8800 options should be specified at compile time and during the final link.
8801 It is recommended that you compile all the files participating in the
8802 same link with the same options and also specify those options at
8803 link time.  
8804 For example:
8806 @smallexample
8807 gcc -c -O2 -flto foo.c
8808 gcc -c -O2 -flto bar.c
8809 gcc -o myprog -flto -O2 foo.o bar.o
8810 @end smallexample
8812 The first two invocations to GCC save a bytecode representation
8813 of GIMPLE into special ELF sections inside @file{foo.o} and
8814 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8815 @file{foo.o} and @file{bar.o}, merges the two files into a single
8816 internal image, and compiles the result as usual.  Since both
8817 @file{foo.o} and @file{bar.o} are merged into a single image, this
8818 causes all the interprocedural analyses and optimizations in GCC to
8819 work across the two files as if they were a single one.  This means,
8820 for example, that the inliner is able to inline functions in
8821 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8823 Another (simpler) way to enable link-time optimization is:
8825 @smallexample
8826 gcc -o myprog -flto -O2 foo.c bar.c
8827 @end smallexample
8829 The above generates bytecode for @file{foo.c} and @file{bar.c},
8830 merges them together into a single GIMPLE representation and optimizes
8831 them as usual to produce @file{myprog}.
8833 The only important thing to keep in mind is that to enable link-time
8834 optimizations you need to use the GCC driver to perform the link step.
8835 GCC then automatically performs link-time optimization if any of the
8836 objects involved were compiled with the @option{-flto} command-line option.  
8837 You generally
8838 should specify the optimization options to be used for link-time
8839 optimization though GCC tries to be clever at guessing an
8840 optimization level to use from the options used at compile time
8841 if you fail to specify one at link time.  You can always override
8842 the automatic decision to do link-time optimization
8843 by passing @option{-fno-lto} to the link command.
8845 To make whole program optimization effective, it is necessary to make
8846 certain whole program assumptions.  The compiler needs to know
8847 what functions and variables can be accessed by libraries and runtime
8848 outside of the link-time optimized unit.  When supported by the linker,
8849 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8850 to the compiler about used and externally visible symbols.  When
8851 the linker plugin is not available, @option{-fwhole-program} should be
8852 used to allow the compiler to make these assumptions, which leads
8853 to more aggressive optimization decisions.
8855 When @option{-fuse-linker-plugin} is not enabled, when a file is
8856 compiled with @option{-flto}, the generated object file is larger than
8857 a regular object file because it contains GIMPLE bytecodes and the usual
8858 final code (see @option{-ffat-lto-objects}.  This means that
8859 object files with LTO information can be linked as normal object
8860 files; if @option{-fno-lto} is passed to the linker, no
8861 interprocedural optimizations are applied.  Note that when
8862 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
8863 but you cannot perform a regular, non-LTO link on them.
8865 Additionally, the optimization flags used to compile individual files
8866 are not necessarily related to those used at link time.  For instance,
8868 @smallexample
8869 gcc -c -O0 -ffat-lto-objects -flto foo.c
8870 gcc -c -O0 -ffat-lto-objects -flto bar.c
8871 gcc -o myprog -O3 foo.o bar.o
8872 @end smallexample
8874 This produces individual object files with unoptimized assembler
8875 code, but the resulting binary @file{myprog} is optimized at
8876 @option{-O3}.  If, instead, the final binary is generated with
8877 @option{-fno-lto}, then @file{myprog} is not optimized.
8879 When producing the final binary, GCC only
8880 applies link-time optimizations to those files that contain bytecode.
8881 Therefore, you can mix and match object files and libraries with
8882 GIMPLE bytecodes and final object code.  GCC automatically selects
8883 which files to optimize in LTO mode and which files to link without
8884 further processing.
8886 There are some code generation flags preserved by GCC when
8887 generating bytecodes, as they need to be used during the final link
8888 stage.  Generally options specified at link time override those
8889 specified at compile time.
8891 If you do not specify an optimization level option @option{-O} at
8892 link time, then GCC uses the highest optimization level 
8893 used when compiling the object files.
8895 Currently, the following options and their settings are taken from
8896 the first object file that explicitly specifies them: 
8897 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8898 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8899 and all the @option{-m} target flags.
8901 Certain ABI-changing flags are required to match in all compilation units,
8902 and trying to override this at link time with a conflicting value
8903 is ignored.  This includes options such as @option{-freg-struct-return}
8904 and @option{-fpcc-struct-return}. 
8906 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8907 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8908 are passed through to the link stage and merged conservatively for
8909 conflicting translation units.  Specifically
8910 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8911 precedence; and for example @option{-ffp-contract=off} takes precedence
8912 over @option{-ffp-contract=fast}.  You can override them at link time.
8914 If LTO encounters objects with C linkage declared with incompatible
8915 types in separate translation units to be linked together (undefined
8916 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8917 issued.  The behavior is still undefined at run time.  Similar
8918 diagnostics may be raised for other languages.
8920 Another feature of LTO is that it is possible to apply interprocedural
8921 optimizations on files written in different languages:
8923 @smallexample
8924 gcc -c -flto foo.c
8925 g++ -c -flto bar.cc
8926 gfortran -c -flto baz.f90
8927 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8928 @end smallexample
8930 Notice that the final link is done with @command{g++} to get the C++
8931 runtime libraries and @option{-lgfortran} is added to get the Fortran
8932 runtime libraries.  In general, when mixing languages in LTO mode, you
8933 should use the same link command options as when mixing languages in a
8934 regular (non-LTO) compilation.
8936 If object files containing GIMPLE bytecode are stored in a library archive, say
8937 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8938 are using a linker with plugin support.  To create static libraries suitable
8939 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8940 and @command{ranlib}; 
8941 to show the symbols of object files with GIMPLE bytecode, use
8942 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8943 and @command{nm} have been compiled with plugin support.  At link time, use the the
8944 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8945 the LTO optimization process:
8947 @smallexample
8948 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8949 @end smallexample
8951 With the linker plugin enabled, the linker extracts the needed
8952 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8953 to make them part of the aggregated GIMPLE image to be optimized.
8955 If you are not using a linker with plugin support and/or do not
8956 enable the linker plugin, then the objects inside @file{libfoo.a}
8957 are extracted and linked as usual, but they do not participate
8958 in the LTO optimization process.  In order to make a static library suitable
8959 for both LTO optimization and usual linkage, compile its object files with
8960 @option{-flto} @option{-ffat-lto-objects}.
8962 Link-time optimizations do not require the presence of the whole program to
8963 operate.  If the program does not require any symbols to be exported, it is
8964 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8965 the interprocedural optimizers to use more aggressive assumptions which may
8966 lead to improved optimization opportunities.
8967 Use of @option{-fwhole-program} is not needed when linker plugin is
8968 active (see @option{-fuse-linker-plugin}).
8970 The current implementation of LTO makes no
8971 attempt to generate bytecode that is portable between different
8972 types of hosts.  The bytecode files are versioned and there is a
8973 strict version check, so bytecode files generated in one version of
8974 GCC do not work with an older or newer version of GCC.
8976 Link-time optimization does not work well with generation of debugging
8977 information.  Combining @option{-flto} with
8978 @option{-g} is currently experimental and expected to produce unexpected
8979 results.
8981 If you specify the optional @var{n}, the optimization and code
8982 generation done at link time is executed in parallel using @var{n}
8983 parallel jobs by utilizing an installed @command{make} program.  The
8984 environment variable @env{MAKE} may be used to override the program
8985 used.  The default value for @var{n} is 1.
8987 You can also specify @option{-flto=jobserver} to use GNU make's
8988 job server mode to determine the number of parallel jobs. This
8989 is useful when the Makefile calling GCC is already executing in parallel.
8990 You must prepend a @samp{+} to the command recipe in the parent Makefile
8991 for this to work.  This option likely only works if @env{MAKE} is
8992 GNU make.
8994 @item -flto-partition=@var{alg}
8995 @opindex flto-partition
8996 Specify the partitioning algorithm used by the link-time optimizer.
8997 The value is either @samp{1to1} to specify a partitioning mirroring
8998 the original source files or @samp{balanced} to specify partitioning
8999 into equally sized chunks (whenever possible) or @samp{max} to create
9000 new partition for every symbol where possible.  Specifying @samp{none}
9001 as an algorithm disables partitioning and streaming completely. 
9002 The default value is @samp{balanced}. While @samp{1to1} can be used
9003 as an workaround for various code ordering issues, the @samp{max}
9004 partitioning is intended for internal testing only.
9005 The value @samp{one} specifies that exactly one partition should be
9006 used while the value @samp{none} bypasses partitioning and executes
9007 the link-time optimization step directly from the WPA phase.
9009 @item -flto-odr-type-merging
9010 @opindex flto-odr-type-merging
9011 Enable streaming of mangled types names of C++ types and their unification
9012 at link time.  This increases size of LTO object files, but enables
9013 diagnostics about One Definition Rule violations.
9015 @item -flto-compression-level=@var{n}
9016 @opindex flto-compression-level
9017 This option specifies the level of compression used for intermediate
9018 language written to LTO object files, and is only meaningful in
9019 conjunction with LTO mode (@option{-flto}).  Valid
9020 values are 0 (no compression) to 9 (maximum compression).  Values
9021 outside this range are clamped to either 0 or 9.  If the option is not
9022 given, a default balanced compression setting is used.
9024 @item -fuse-linker-plugin
9025 @opindex fuse-linker-plugin
9026 Enables the use of a linker plugin during link-time optimization.  This
9027 option relies on plugin support in the linker, which is available in gold
9028 or in GNU ld 2.21 or newer.
9030 This option enables the extraction of object files with GIMPLE bytecode out
9031 of library archives. This improves the quality of optimization by exposing
9032 more code to the link-time optimizer.  This information specifies what
9033 symbols can be accessed externally (by non-LTO object or during dynamic
9034 linking).  Resulting code quality improvements on binaries (and shared
9035 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
9036 See @option{-flto} for a description of the effect of this flag and how to
9037 use it.
9039 This option is enabled by default when LTO support in GCC is enabled
9040 and GCC was configured for use with
9041 a linker supporting plugins (GNU ld 2.21 or newer or gold).
9043 @item -ffat-lto-objects
9044 @opindex ffat-lto-objects
9045 Fat LTO objects are object files that contain both the intermediate language
9046 and the object code. This makes them usable for both LTO linking and normal
9047 linking. This option is effective only when compiling with @option{-flto}
9048 and is ignored at link time.
9050 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
9051 requires the complete toolchain to be aware of LTO. It requires a linker with
9052 linker plugin support for basic functionality.  Additionally,
9053 @command{nm}, @command{ar} and @command{ranlib}
9054 need to support linker plugins to allow a full-featured build environment
9055 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
9056 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
9057 to these tools. With non fat LTO makefiles need to be modified to use them.
9059 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
9060 support.
9062 @item -fcompare-elim
9063 @opindex fcompare-elim
9064 After register allocation and post-register allocation instruction splitting,
9065 identify arithmetic instructions that compute processor flags similar to a
9066 comparison operation based on that arithmetic.  If possible, eliminate the
9067 explicit comparison operation.
9069 This pass only applies to certain targets that cannot explicitly represent
9070 the comparison operation before register allocation is complete.
9072 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9074 @item -fcprop-registers
9075 @opindex fcprop-registers
9076 After register allocation and post-register allocation instruction splitting,
9077 perform a copy-propagation pass to try to reduce scheduling dependencies
9078 and occasionally eliminate the copy.
9080 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
9082 @item -fprofile-correction
9083 @opindex fprofile-correction
9084 Profiles collected using an instrumented binary for multi-threaded programs may
9085 be inconsistent due to missed counter updates. When this option is specified,
9086 GCC uses heuristics to correct or smooth out such inconsistencies. By
9087 default, GCC emits an error message when an inconsistent profile is detected.
9089 @item -fprofile-use
9090 @itemx -fprofile-use=@var{path}
9091 @opindex fprofile-use
9092 Enable profile feedback-directed optimizations, 
9093 and the following optimizations
9094 which are generally profitable only with profile feedback available:
9095 @option{-fbranch-probabilities}, @option{-fvpt},
9096 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9097 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
9099 Before you can use this option, you must first generate profiling information.
9100 @xref{Instrumentation Options}, for information about the
9101 @option{-fprofile-generate} option.
9103 By default, GCC emits an error message if the feedback profiles do not
9104 match the source code.  This error can be turned into a warning by using
9105 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
9106 code.
9108 If @var{path} is specified, GCC looks at the @var{path} to find
9109 the profile feedback data files. See @option{-fprofile-dir}.
9111 @item -fauto-profile
9112 @itemx -fauto-profile=@var{path}
9113 @opindex fauto-profile
9114 Enable sampling-based feedback-directed optimizations, 
9115 and the following optimizations
9116 which are generally profitable only with profile feedback available:
9117 @option{-fbranch-probabilities}, @option{-fvpt},
9118 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
9119 @option{-ftree-vectorize},
9120 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
9121 @option{-fpredictive-commoning}, @option{-funswitch-loops},
9122 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
9124 @var{path} is the name of a file containing AutoFDO profile information.
9125 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
9127 Producing an AutoFDO profile data file requires running your program
9128 with the @command{perf} utility on a supported GNU/Linux target system.
9129 For more information, see @uref{https://perf.wiki.kernel.org/}.
9131 E.g.
9132 @smallexample
9133 perf record -e br_inst_retired:near_taken -b -o perf.data \
9134     -- your_program
9135 @end smallexample
9137 Then use the @command{create_gcov} tool to convert the raw profile data
9138 to a format that can be used by GCC.@  You must also supply the 
9139 unstripped binary for your program to this tool.  
9140 See @uref{https://github.com/google/autofdo}.
9142 E.g.
9143 @smallexample
9144 create_gcov --binary=your_program.unstripped --profile=perf.data \
9145     --gcov=profile.afdo
9146 @end smallexample
9147 @end table
9149 The following options control compiler behavior regarding floating-point 
9150 arithmetic.  These options trade off between speed and
9151 correctness.  All must be specifically enabled.
9153 @table @gcctabopt
9154 @item -ffloat-store
9155 @opindex ffloat-store
9156 Do not store floating-point variables in registers, and inhibit other
9157 options that might change whether a floating-point value is taken from a
9158 register or memory.
9160 @cindex floating-point precision
9161 This option prevents undesirable excess precision on machines such as
9162 the 68000 where the floating registers (of the 68881) keep more
9163 precision than a @code{double} is supposed to have.  Similarly for the
9164 x86 architecture.  For most programs, the excess precision does only
9165 good, but a few programs rely on the precise definition of IEEE floating
9166 point.  Use @option{-ffloat-store} for such programs, after modifying
9167 them to store all pertinent intermediate computations into variables.
9169 @item -fexcess-precision=@var{style}
9170 @opindex fexcess-precision
9171 This option allows further control over excess precision on machines
9172 where floating-point operations occur in a format with more precision or
9173 range than the IEEE standard and interchange floating-point types.  By
9174 default, @option{-fexcess-precision=fast} is in effect; this means that
9175 operations may be carried out in a wider precision than the types specified
9176 in the source if that would result in faster code, and it is unpredictable
9177 when rounding to the types specified in the source code takes place.
9178 When compiling C, if @option{-fexcess-precision=standard} is specified then
9179 excess precision follows the rules specified in ISO C99; in particular,
9180 both casts and assignments cause values to be rounded to their
9181 semantic types (whereas @option{-ffloat-store} only affects
9182 assignments).  This option is enabled by default for C if a strict
9183 conformance option such as @option{-std=c99} is used.
9184 @option{-ffast-math} enables @option{-fexcess-precision=fast} by default
9185 regardless of whether a strict conformance option is used.
9187 @opindex mfpmath
9188 @option{-fexcess-precision=standard} is not implemented for languages
9189 other than C.  On the x86, it has no effect if @option{-mfpmath=sse}
9190 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
9191 semantics apply without excess precision, and in the latter, rounding
9192 is unpredictable.
9194 @item -ffast-math
9195 @opindex ffast-math
9196 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
9197 @option{-ffinite-math-only}, @option{-fno-rounding-math},
9198 @option{-fno-signaling-nans}, @option{-fcx-limited-range} and
9199 @option{-fexcess-precision=fast}.
9201 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
9203 This option is not turned on by any @option{-O} option besides
9204 @option{-Ofast} since it can result in incorrect output for programs
9205 that depend on an exact implementation of IEEE or ISO rules/specifications
9206 for math functions. It may, however, yield faster code for programs
9207 that do not require the guarantees of these specifications.
9209 @item -fno-math-errno
9210 @opindex fno-math-errno
9211 Do not set @code{errno} after calling math functions that are executed
9212 with a single instruction, e.g., @code{sqrt}.  A program that relies on
9213 IEEE exceptions for math error handling may want to use this flag
9214 for speed while maintaining IEEE arithmetic compatibility.
9216 This option is not turned on by any @option{-O} option since
9217 it can result in incorrect output for programs that depend on
9218 an exact implementation of IEEE or ISO rules/specifications for
9219 math functions. It may, however, yield faster code for programs
9220 that do not require the guarantees of these specifications.
9222 The default is @option{-fmath-errno}.
9224 On Darwin systems, the math library never sets @code{errno}.  There is
9225 therefore no reason for the compiler to consider the possibility that
9226 it might, and @option{-fno-math-errno} is the default.
9228 @item -funsafe-math-optimizations
9229 @opindex funsafe-math-optimizations
9231 Allow optimizations for floating-point arithmetic that (a) assume
9232 that arguments and results are valid and (b) may violate IEEE or
9233 ANSI standards.  When used at link time, it may include libraries
9234 or startup files that change the default FPU control word or other
9235 similar optimizations.
9237 This option is not turned on by any @option{-O} option since
9238 it can result in incorrect output for programs that depend on
9239 an exact implementation of IEEE or ISO rules/specifications for
9240 math functions. It may, however, yield faster code for programs
9241 that do not require the guarantees of these specifications.
9242 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
9243 @option{-fassociative-math} and @option{-freciprocal-math}.
9245 The default is @option{-fno-unsafe-math-optimizations}.
9247 @item -fassociative-math
9248 @opindex fassociative-math
9250 Allow re-association of operands in series of floating-point operations.
9251 This violates the ISO C and C++ language standard by possibly changing
9252 computation result.  NOTE: re-ordering may change the sign of zero as
9253 well as ignore NaNs and inhibit or create underflow or overflow (and
9254 thus cannot be used on code that relies on rounding behavior like
9255 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
9256 and thus may not be used when ordered comparisons are required.
9257 This option requires that both @option{-fno-signed-zeros} and
9258 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
9259 much sense with @option{-frounding-math}. For Fortran the option
9260 is automatically enabled when both @option{-fno-signed-zeros} and
9261 @option{-fno-trapping-math} are in effect.
9263 The default is @option{-fno-associative-math}.
9265 @item -freciprocal-math
9266 @opindex freciprocal-math
9268 Allow the reciprocal of a value to be used instead of dividing by
9269 the value if this enables optimizations.  For example @code{x / y}
9270 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
9271 is subject to common subexpression elimination.  Note that this loses
9272 precision and increases the number of flops operating on the value.
9274 The default is @option{-fno-reciprocal-math}.
9276 @item -ffinite-math-only
9277 @opindex ffinite-math-only
9278 Allow optimizations for floating-point arithmetic that assume
9279 that arguments and results are not NaNs or +-Infs.
9281 This option is not turned on by any @option{-O} option since
9282 it can result in incorrect output for programs that depend on
9283 an exact implementation of IEEE or ISO rules/specifications for
9284 math functions. It may, however, yield faster code for programs
9285 that do not require the guarantees of these specifications.
9287 The default is @option{-fno-finite-math-only}.
9289 @item -fno-signed-zeros
9290 @opindex fno-signed-zeros
9291 Allow optimizations for floating-point arithmetic that ignore the
9292 signedness of zero.  IEEE arithmetic specifies the behavior of
9293 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
9294 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
9295 This option implies that the sign of a zero result isn't significant.
9297 The default is @option{-fsigned-zeros}.
9299 @item -fno-trapping-math
9300 @opindex fno-trapping-math
9301 Compile code assuming that floating-point operations cannot generate
9302 user-visible traps.  These traps include division by zero, overflow,
9303 underflow, inexact result and invalid operation.  This option requires
9304 that @option{-fno-signaling-nans} be in effect.  Setting this option may
9305 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
9307 This option should never be turned on by any @option{-O} option since
9308 it can result in incorrect output for programs that depend on
9309 an exact implementation of IEEE or ISO rules/specifications for
9310 math functions.
9312 The default is @option{-ftrapping-math}.
9314 @item -frounding-math
9315 @opindex frounding-math
9316 Disable transformations and optimizations that assume default floating-point
9317 rounding behavior.  This is round-to-zero for all floating point
9318 to integer conversions, and round-to-nearest for all other arithmetic
9319 truncations.  This option should be specified for programs that change
9320 the FP rounding mode dynamically, or that may be executed with a
9321 non-default rounding mode.  This option disables constant folding of
9322 floating-point expressions at compile time (which may be affected by
9323 rounding mode) and arithmetic transformations that are unsafe in the
9324 presence of sign-dependent rounding modes.
9326 The default is @option{-fno-rounding-math}.
9328 This option is experimental and does not currently guarantee to
9329 disable all GCC optimizations that are affected by rounding mode.
9330 Future versions of GCC may provide finer control of this setting
9331 using C99's @code{FENV_ACCESS} pragma.  This command-line option
9332 will be used to specify the default state for @code{FENV_ACCESS}.
9334 @item -fsignaling-nans
9335 @opindex fsignaling-nans
9336 Compile code assuming that IEEE signaling NaNs may generate user-visible
9337 traps during floating-point operations.  Setting this option disables
9338 optimizations that may change the number of exceptions visible with
9339 signaling NaNs.  This option implies @option{-ftrapping-math}.
9341 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
9342 be defined.
9344 The default is @option{-fno-signaling-nans}.
9346 This option is experimental and does not currently guarantee to
9347 disable all GCC optimizations that affect signaling NaN behavior.
9349 @item -fno-fp-int-builtin-inexact
9350 @opindex fno-fp-int-builtin-inexact
9351 Do not allow the built-in functions @code{ceil}, @code{floor},
9352 @code{round} and @code{trunc}, and their @code{float} and @code{long
9353 double} variants, to generate code that raises the ``inexact''
9354 floating-point exception for noninteger arguments.  ISO C99 and C11
9355 allow these functions to raise the ``inexact'' exception, but ISO/IEC
9356 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
9357 functions to do so.
9359 The default is @option{-ffp-int-builtin-inexact}, allowing the
9360 exception to be raised.  This option does nothing unless
9361 @option{-ftrapping-math} is in effect.
9363 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
9364 generate a call to a library function then the ``inexact'' exception
9365 may be raised if the library implementation does not follow TS 18661.
9367 @item -fsingle-precision-constant
9368 @opindex fsingle-precision-constant
9369 Treat floating-point constants as single precision instead of
9370 implicitly converting them to double-precision constants.
9372 @item -fcx-limited-range
9373 @opindex fcx-limited-range
9374 When enabled, this option states that a range reduction step is not
9375 needed when performing complex division.  Also, there is no checking
9376 whether the result of a complex multiplication or division is @code{NaN
9377 + I*NaN}, with an attempt to rescue the situation in that case.  The
9378 default is @option{-fno-cx-limited-range}, but is enabled by
9379 @option{-ffast-math}.
9381 This option controls the default setting of the ISO C99
9382 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
9383 all languages.
9385 @item -fcx-fortran-rules
9386 @opindex fcx-fortran-rules
9387 Complex multiplication and division follow Fortran rules.  Range
9388 reduction is done as part of complex division, but there is no checking
9389 whether the result of a complex multiplication or division is @code{NaN
9390 + I*NaN}, with an attempt to rescue the situation in that case.
9392 The default is @option{-fno-cx-fortran-rules}.
9394 @end table
9396 The following options control optimizations that may improve
9397 performance, but are not enabled by any @option{-O} options.  This
9398 section includes experimental options that may produce broken code.
9400 @table @gcctabopt
9401 @item -fbranch-probabilities
9402 @opindex fbranch-probabilities
9403 After running a program compiled with @option{-fprofile-arcs}
9404 (@pxref{Instrumentation Options}),
9405 you can compile it a second time using
9406 @option{-fbranch-probabilities}, to improve optimizations based on
9407 the number of times each branch was taken.  When a program
9408 compiled with @option{-fprofile-arcs} exits, it saves arc execution
9409 counts to a file called @file{@var{sourcename}.gcda} for each source
9410 file.  The information in this data file is very dependent on the
9411 structure of the generated code, so you must use the same source code
9412 and the same optimization options for both compilations.
9414 With @option{-fbranch-probabilities}, GCC puts a
9415 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
9416 These can be used to improve optimization.  Currently, they are only
9417 used in one place: in @file{reorg.c}, instead of guessing which path a
9418 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
9419 exactly determine which path is taken more often.
9421 @item -fprofile-values
9422 @opindex fprofile-values
9423 If combined with @option{-fprofile-arcs}, it adds code so that some
9424 data about values of expressions in the program is gathered.
9426 With @option{-fbranch-probabilities}, it reads back the data gathered
9427 from profiling values of expressions for usage in optimizations.
9429 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
9431 @item -fprofile-reorder-functions
9432 @opindex fprofile-reorder-functions
9433 Function reordering based on profile instrumentation collects
9434 first time of execution of a function and orders these functions
9435 in ascending order.
9437 Enabled with @option{-fprofile-use}.
9439 @item -fvpt
9440 @opindex fvpt
9441 If combined with @option{-fprofile-arcs}, this option instructs the compiler
9442 to add code to gather information about values of expressions.
9444 With @option{-fbranch-probabilities}, it reads back the data gathered
9445 and actually performs the optimizations based on them.
9446 Currently the optimizations include specialization of division operations
9447 using the knowledge about the value of the denominator.
9449 @item -frename-registers
9450 @opindex frename-registers
9451 Attempt to avoid false dependencies in scheduled code by making use
9452 of registers left over after register allocation.  This optimization
9453 most benefits processors with lots of registers.  Depending on the
9454 debug information format adopted by the target, however, it can
9455 make debugging impossible, since variables no longer stay in
9456 a ``home register''.
9458 Enabled by default with @option{-funroll-loops}.
9460 @item -fschedule-fusion
9461 @opindex fschedule-fusion
9462 Performs a target dependent pass over the instruction stream to schedule
9463 instructions of same type together because target machine can execute them
9464 more efficiently if they are adjacent to each other in the instruction flow.
9466 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
9468 @item -ftracer
9469 @opindex ftracer
9470 Perform tail duplication to enlarge superblock size.  This transformation
9471 simplifies the control flow of the function allowing other optimizations to do
9472 a better job.
9474 Enabled with @option{-fprofile-use}.
9476 @item -funroll-loops
9477 @opindex funroll-loops
9478 Unroll loops whose number of iterations can be determined at compile time or
9479 upon entry to the loop.  @option{-funroll-loops} implies
9480 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
9481 It also turns on complete loop peeling (i.e.@: complete removal of loops with
9482 a small constant number of iterations).  This option makes code larger, and may
9483 or may not make it run faster.
9485 Enabled with @option{-fprofile-use}.
9487 @item -funroll-all-loops
9488 @opindex funroll-all-loops
9489 Unroll all loops, even if their number of iterations is uncertain when
9490 the loop is entered.  This usually makes programs run more slowly.
9491 @option{-funroll-all-loops} implies the same options as
9492 @option{-funroll-loops}.
9494 @item -fpeel-loops
9495 @opindex fpeel-loops
9496 Peels loops for which there is enough information that they do not
9497 roll much (from profile feedback or static analysis).  It also turns on
9498 complete loop peeling (i.e.@: complete removal of loops with small constant
9499 number of iterations).
9501 Enabled with @option{-O3} and/or @option{-fprofile-use}.
9503 @item -fmove-loop-invariants
9504 @opindex fmove-loop-invariants
9505 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
9506 at level @option{-O1}
9508 @item -fsplit-loops
9509 @opindex fsplit-loops
9510 Split a loop into two if it contains a condition that's always true
9511 for one side of the iteration space and false for the other.
9513 @item -funswitch-loops
9514 @opindex funswitch-loops
9515 Move branches with loop invariant conditions out of the loop, with duplicates
9516 of the loop on both branches (modified according to result of the condition).
9518 @item -ffunction-sections
9519 @itemx -fdata-sections
9520 @opindex ffunction-sections
9521 @opindex fdata-sections
9522 Place each function or data item into its own section in the output
9523 file if the target supports arbitrary sections.  The name of the
9524 function or the name of the data item determines the section's name
9525 in the output file.
9527 Use these options on systems where the linker can perform optimizations
9528 to improve locality of reference in the instruction space.  Most systems
9529 using the ELF object format and SPARC processors running Solaris 2 have
9530 linkers with such optimizations.  AIX may have these optimizations in
9531 the future.
9533 Only use these options when there are significant benefits from doing
9534 so.  When you specify these options, the assembler and linker
9535 create larger object and executable files and are also slower.
9536 You cannot use @command{gprof} on all systems if you
9537 specify this option, and you may have problems with debugging if
9538 you specify both this option and @option{-g}.
9540 @item -fbranch-target-load-optimize
9541 @opindex fbranch-target-load-optimize
9542 Perform branch target register load optimization before prologue / epilogue
9543 threading.
9544 The use of target registers can typically be exposed only during reload,
9545 thus hoisting loads out of loops and doing inter-block scheduling needs
9546 a separate optimization pass.
9548 @item -fbranch-target-load-optimize2
9549 @opindex fbranch-target-load-optimize2
9550 Perform branch target register load optimization after prologue / epilogue
9551 threading.
9553 @item -fbtr-bb-exclusive
9554 @opindex fbtr-bb-exclusive
9555 When performing branch target register load optimization, don't reuse
9556 branch target registers within any basic block.
9558 @item -fstdarg-opt
9559 @opindex fstdarg-opt
9560 Optimize the prologue of variadic argument functions with respect to usage of
9561 those arguments.
9563 @item -fsection-anchors
9564 @opindex fsection-anchors
9565 Try to reduce the number of symbolic address calculations by using
9566 shared ``anchor'' symbols to address nearby objects.  This transformation
9567 can help to reduce the number of GOT entries and GOT accesses on some
9568 targets.
9570 For example, the implementation of the following function @code{foo}:
9572 @smallexample
9573 static int a, b, c;
9574 int foo (void) @{ return a + b + c; @}
9575 @end smallexample
9577 @noindent
9578 usually calculates the addresses of all three variables, but if you
9579 compile it with @option{-fsection-anchors}, it accesses the variables
9580 from a common anchor point instead.  The effect is similar to the
9581 following pseudocode (which isn't valid C):
9583 @smallexample
9584 int foo (void)
9586   register int *xr = &x;
9587   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
9589 @end smallexample
9591 Not all targets support this option.
9593 @item --param @var{name}=@var{value}
9594 @opindex param
9595 In some places, GCC uses various constants to control the amount of
9596 optimization that is done.  For example, GCC does not inline functions
9597 that contain more than a certain number of instructions.  You can
9598 control some of these constants on the command line using the
9599 @option{--param} option.
9601 The names of specific parameters, and the meaning of the values, are
9602 tied to the internals of the compiler, and are subject to change
9603 without notice in future releases.
9605 In each case, the @var{value} is an integer.  The allowable choices for
9606 @var{name} are:
9608 @table @gcctabopt
9609 @item predictable-branch-outcome
9610 When branch is predicted to be taken with probability lower than this threshold
9611 (in percent), then it is considered well predictable. The default is 10.
9613 @item max-rtl-if-conversion-insns
9614 RTL if-conversion tries to remove conditional branches around a block and
9615 replace them with conditionally executed instructions.  This parameter
9616 gives the maximum number of instructions in a block which should be
9617 considered for if-conversion.  The default is 10, though the compiler will
9618 also use other heuristics to decide whether if-conversion is likely to be
9619 profitable.
9621 @item max-rtl-if-conversion-predictable-cost
9622 @item max-rtl-if-conversion-unpredictable-cost
9623 RTL if-conversion will try to remove conditional branches around a block
9624 and replace them with conditionally executed instructions.  These parameters
9625 give the maximum permissible cost for the sequence that would be generated
9626 by if-conversion depending on whether the branch is statically determined
9627 to be predictable or not.  The units for this parameter are the same as
9628 those for the GCC internal seq_cost metric.  The compiler will try to
9629 provide a reasonable default for this parameter using the BRANCH_COST
9630 target macro.
9632 @item max-crossjump-edges
9633 The maximum number of incoming edges to consider for cross-jumping.
9634 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
9635 the number of edges incoming to each block.  Increasing values mean
9636 more aggressive optimization, making the compilation time increase with
9637 probably small improvement in executable size.
9639 @item min-crossjump-insns
9640 The minimum number of instructions that must be matched at the end
9641 of two blocks before cross-jumping is performed on them.  This
9642 value is ignored in the case where all instructions in the block being
9643 cross-jumped from are matched.  The default value is 5.
9645 @item max-grow-copy-bb-insns
9646 The maximum code size expansion factor when copying basic blocks
9647 instead of jumping.  The expansion is relative to a jump instruction.
9648 The default value is 8.
9650 @item max-goto-duplication-insns
9651 The maximum number of instructions to duplicate to a block that jumps
9652 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
9653 passes, GCC factors computed gotos early in the compilation process,
9654 and unfactors them as late as possible.  Only computed jumps at the
9655 end of a basic blocks with no more than max-goto-duplication-insns are
9656 unfactored.  The default value is 8.
9658 @item max-delay-slot-insn-search
9659 The maximum number of instructions to consider when looking for an
9660 instruction to fill a delay slot.  If more than this arbitrary number of
9661 instructions are searched, the time savings from filling the delay slot
9662 are minimal, so stop searching.  Increasing values mean more
9663 aggressive optimization, making the compilation time increase with probably
9664 small improvement in execution time.
9666 @item max-delay-slot-live-search
9667 When trying to fill delay slots, the maximum number of instructions to
9668 consider when searching for a block with valid live register
9669 information.  Increasing this arbitrarily chosen value means more
9670 aggressive optimization, increasing the compilation time.  This parameter
9671 should be removed when the delay slot code is rewritten to maintain the
9672 control-flow graph.
9674 @item max-gcse-memory
9675 The approximate maximum amount of memory that can be allocated in
9676 order to perform the global common subexpression elimination
9677 optimization.  If more memory than specified is required, the
9678 optimization is not done.
9680 @item max-gcse-insertion-ratio
9681 If the ratio of expression insertions to deletions is larger than this value
9682 for any expression, then RTL PRE inserts or removes the expression and thus
9683 leaves partially redundant computations in the instruction stream.  The default value is 20.
9685 @item max-pending-list-length
9686 The maximum number of pending dependencies scheduling allows
9687 before flushing the current state and starting over.  Large functions
9688 with few branches or calls can create excessively large lists which
9689 needlessly consume memory and resources.
9691 @item max-modulo-backtrack-attempts
9692 The maximum number of backtrack attempts the scheduler should make
9693 when modulo scheduling a loop.  Larger values can exponentially increase
9694 compilation time.
9696 @item max-inline-insns-single
9697 Several parameters control the tree inliner used in GCC@.
9698 This number sets the maximum number of instructions (counted in GCC's
9699 internal representation) in a single function that the tree inliner
9700 considers for inlining.  This only affects functions declared
9701 inline and methods implemented in a class declaration (C++).
9702 The default value is 400.
9704 @item max-inline-insns-auto
9705 When you use @option{-finline-functions} (included in @option{-O3}),
9706 a lot of functions that would otherwise not be considered for inlining
9707 by the compiler are investigated.  To those functions, a different
9708 (more restrictive) limit compared to functions declared inline can
9709 be applied.
9710 The default value is 40.
9712 @item inline-min-speedup
9713 When estimated performance improvement of caller + callee runtime exceeds this
9714 threshold (in percent), the function can be inlined regardless of the limit on
9715 @option{--param max-inline-insns-single} and @option{--param
9716 max-inline-insns-auto}.
9718 @item large-function-insns
9719 The limit specifying really large functions.  For functions larger than this
9720 limit after inlining, inlining is constrained by
9721 @option{--param large-function-growth}.  This parameter is useful primarily
9722 to avoid extreme compilation time caused by non-linear algorithms used by the
9723 back end.
9724 The default value is 2700.
9726 @item large-function-growth
9727 Specifies maximal growth of large function caused by inlining in percents.
9728 The default value is 100 which limits large function growth to 2.0 times
9729 the original size.
9731 @item large-unit-insns
9732 The limit specifying large translation unit.  Growth caused by inlining of
9733 units larger than this limit is limited by @option{--param inline-unit-growth}.
9734 For small units this might be too tight.
9735 For example, consider a unit consisting of function A
9736 that is inline and B that just calls A three times.  If B is small relative to
9737 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
9738 large units consisting of small inlineable functions, however, the overall unit
9739 growth limit is needed to avoid exponential explosion of code size.  Thus for
9740 smaller units, the size is increased to @option{--param large-unit-insns}
9741 before applying @option{--param inline-unit-growth}.  The default is 10000.
9743 @item inline-unit-growth
9744 Specifies maximal overall growth of the compilation unit caused by inlining.
9745 The default value is 20 which limits unit growth to 1.2 times the original
9746 size. Cold functions (either marked cold via an attribute or by profile
9747 feedback) are not accounted into the unit size.
9749 @item ipcp-unit-growth
9750 Specifies maximal overall growth of the compilation unit caused by
9751 interprocedural constant propagation.  The default value is 10 which limits
9752 unit growth to 1.1 times the original size.
9754 @item large-stack-frame
9755 The limit specifying large stack frames.  While inlining the algorithm is trying
9756 to not grow past this limit too much.  The default value is 256 bytes.
9758 @item large-stack-frame-growth
9759 Specifies maximal growth of large stack frames caused by inlining in percents.
9760 The default value is 1000 which limits large stack frame growth to 11 times
9761 the original size.
9763 @item max-inline-insns-recursive
9764 @itemx max-inline-insns-recursive-auto
9765 Specifies the maximum number of instructions an out-of-line copy of a
9766 self-recursive inline
9767 function can grow into by performing recursive inlining.
9769 @option{--param max-inline-insns-recursive} applies to functions
9770 declared inline.
9771 For functions not declared inline, recursive inlining
9772 happens only when @option{-finline-functions} (included in @option{-O3}) is
9773 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
9774 default value is 450.
9776 @item max-inline-recursive-depth
9777 @itemx max-inline-recursive-depth-auto
9778 Specifies the maximum recursion depth used for recursive inlining.
9780 @option{--param max-inline-recursive-depth} applies to functions
9781 declared inline.  For functions not declared inline, recursive inlining
9782 happens only when @option{-finline-functions} (included in @option{-O3}) is
9783 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
9784 default value is 8.
9786 @item min-inline-recursive-probability
9787 Recursive inlining is profitable only for function having deep recursion
9788 in average and can hurt for function having little recursion depth by
9789 increasing the prologue size or complexity of function body to other
9790 optimizers.
9792 When profile feedback is available (see @option{-fprofile-generate}) the actual
9793 recursion depth can be guessed from the probability that function recurses
9794 via a given call expression.  This parameter limits inlining only to call
9795 expressions whose probability exceeds the given threshold (in percents).
9796 The default value is 10.
9798 @item early-inlining-insns
9799 Specify growth that the early inliner can make.  In effect it increases
9800 the amount of inlining for code having a large abstraction penalty.
9801 The default value is 14.
9803 @item max-early-inliner-iterations
9804 Limit of iterations of the early inliner.  This basically bounds
9805 the number of nested indirect calls the early inliner can resolve.
9806 Deeper chains are still handled by late inlining.
9808 @item comdat-sharing-probability
9809 Probability (in percent) that C++ inline function with comdat visibility
9810 are shared across multiple compilation units.  The default value is 20.
9812 @item profile-func-internal-id
9813 A parameter to control whether to use function internal id in profile
9814 database lookup. If the value is 0, the compiler uses an id that
9815 is based on function assembler name and filename, which makes old profile
9816 data more tolerant to source changes such as function reordering etc.
9817 The default value is 0.
9819 @item min-vect-loop-bound
9820 The minimum number of iterations under which loops are not vectorized
9821 when @option{-ftree-vectorize} is used.  The number of iterations after
9822 vectorization needs to be greater than the value specified by this option
9823 to allow vectorization.  The default value is 0.
9825 @item gcse-cost-distance-ratio
9826 Scaling factor in calculation of maximum distance an expression
9827 can be moved by GCSE optimizations.  This is currently supported only in the
9828 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9829 is with simple expressions, i.e., the expressions that have cost
9830 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9831 hoisting of simple expressions.  The default value is 10.
9833 @item gcse-unrestricted-cost
9834 Cost, roughly measured as the cost of a single typical machine
9835 instruction, at which GCSE optimizations do not constrain
9836 the distance an expression can travel.  This is currently
9837 supported only in the code hoisting pass.  The lesser the cost,
9838 the more aggressive code hoisting is.  Specifying 0 
9839 allows all expressions to travel unrestricted distances.
9840 The default value is 3.
9842 @item max-hoist-depth
9843 The depth of search in the dominator tree for expressions to hoist.
9844 This is used to avoid quadratic behavior in hoisting algorithm.
9845 The value of 0 does not limit on the search, but may slow down compilation
9846 of huge functions.  The default value is 30.
9848 @item max-tail-merge-comparisons
9849 The maximum amount of similar bbs to compare a bb with.  This is used to
9850 avoid quadratic behavior in tree tail merging.  The default value is 10.
9852 @item max-tail-merge-iterations
9853 The maximum amount of iterations of the pass over the function.  This is used to
9854 limit compilation time in tree tail merging.  The default value is 2.
9856 @item store-merging-allow-unaligned
9857 Allow the store merging pass to introduce unaligned stores if it is legal to
9858 do so.  The default value is 1.
9860 @item max-stores-to-merge
9861 The maximum number of stores to attempt to merge into wider stores in the store
9862 merging pass.  The minimum value is 2 and the default is 64.
9864 @item max-unrolled-insns
9865 The maximum number of instructions that a loop may have to be unrolled.
9866 If a loop is unrolled, this parameter also determines how many times
9867 the loop code is unrolled.
9869 @item max-average-unrolled-insns
9870 The maximum number of instructions biased by probabilities of their execution
9871 that a loop may have to be unrolled.  If a loop is unrolled,
9872 this parameter also determines how many times the loop code is unrolled.
9874 @item max-unroll-times
9875 The maximum number of unrollings of a single loop.
9877 @item max-peeled-insns
9878 The maximum number of instructions that a loop may have to be peeled.
9879 If a loop is peeled, this parameter also determines how many times
9880 the loop code is peeled.
9882 @item max-peel-times
9883 The maximum number of peelings of a single loop.
9885 @item max-peel-branches
9886 The maximum number of branches on the hot path through the peeled sequence.
9888 @item max-completely-peeled-insns
9889 The maximum number of insns of a completely peeled loop.
9891 @item max-completely-peel-times
9892 The maximum number of iterations of a loop to be suitable for complete peeling.
9894 @item max-completely-peel-loop-nest-depth
9895 The maximum depth of a loop nest suitable for complete peeling.
9897 @item max-unswitch-insns
9898 The maximum number of insns of an unswitched loop.
9900 @item max-unswitch-level
9901 The maximum number of branches unswitched in a single loop.
9903 @item max-loop-headers-insns
9904 The maximum number of insns in loop header duplicated by he copy loop headers
9905 pass.
9907 @item lim-expensive
9908 The minimum cost of an expensive expression in the loop invariant motion.
9910 @item iv-consider-all-candidates-bound
9911 Bound on number of candidates for induction variables, below which
9912 all candidates are considered for each use in induction variable
9913 optimizations.  If there are more candidates than this,
9914 only the most relevant ones are considered to avoid quadratic time complexity.
9916 @item iv-max-considered-uses
9917 The induction variable optimizations give up on loops that contain more
9918 induction variable uses.
9920 @item iv-always-prune-cand-set-bound
9921 If the number of candidates in the set is smaller than this value,
9922 always try to remove unnecessary ivs from the set
9923 when adding a new one.
9925 @item avg-loop-niter
9926 Average number of iterations of a loop.
9928 @item dse-max-object-size
9929 Maximum size (in bytes) of objects tracked bytewise by dead store elimination.
9930 Larger values may result in larger compilation times.
9932 @item scev-max-expr-size
9933 Bound on size of expressions used in the scalar evolutions analyzer.
9934 Large expressions slow the analyzer.
9936 @item scev-max-expr-complexity
9937 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9938 Complex expressions slow the analyzer.
9940 @item max-tree-if-conversion-phi-args
9941 Maximum number of arguments in a PHI supported by TREE if conversion
9942 unless the loop is marked with simd pragma.
9944 @item vect-max-version-for-alignment-checks
9945 The maximum number of run-time checks that can be performed when
9946 doing loop versioning for alignment in the vectorizer.
9948 @item vect-max-version-for-alias-checks
9949 The maximum number of run-time checks that can be performed when
9950 doing loop versioning for alias in the vectorizer.
9952 @item vect-max-peeling-for-alignment
9953 The maximum number of loop peels to enhance access alignment
9954 for vectorizer. Value -1 means no limit.
9956 @item max-iterations-to-track
9957 The maximum number of iterations of a loop the brute-force algorithm
9958 for analysis of the number of iterations of the loop tries to evaluate.
9960 @item hot-bb-count-ws-permille
9961 A basic block profile count is considered hot if it contributes to 
9962 the given permillage (i.e. 0...1000) of the entire profiled execution.
9964 @item hot-bb-frequency-fraction
9965 Select fraction of the entry block frequency of executions of basic block in
9966 function given basic block needs to have to be considered hot.
9968 @item max-predicted-iterations
9969 The maximum number of loop iterations we predict statically.  This is useful
9970 in cases where a function contains a single loop with known bound and
9971 another loop with unknown bound.
9972 The known number of iterations is predicted correctly, while
9973 the unknown number of iterations average to roughly 10.  This means that the
9974 loop without bounds appears artificially cold relative to the other one.
9976 @item builtin-expect-probability
9977 Control the probability of the expression having the specified value. This
9978 parameter takes a percentage (i.e. 0 ... 100) as input.
9979 The default probability of 90 is obtained empirically.
9981 @item align-threshold
9983 Select fraction of the maximal frequency of executions of a basic block in
9984 a function to align the basic block.
9986 @item align-loop-iterations
9988 A loop expected to iterate at least the selected number of iterations is
9989 aligned.
9991 @item tracer-dynamic-coverage
9992 @itemx tracer-dynamic-coverage-feedback
9994 This value is used to limit superblock formation once the given percentage of
9995 executed instructions is covered.  This limits unnecessary code size
9996 expansion.
9998 The @option{tracer-dynamic-coverage-feedback} parameter
9999 is used only when profile
10000 feedback is available.  The real profiles (as opposed to statically estimated
10001 ones) are much less balanced allowing the threshold to be larger value.
10003 @item tracer-max-code-growth
10004 Stop tail duplication once code growth has reached given percentage.  This is
10005 a rather artificial limit, as most of the duplicates are eliminated later in
10006 cross jumping, so it may be set to much higher values than is the desired code
10007 growth.
10009 @item tracer-min-branch-ratio
10011 Stop reverse growth when the reverse probability of best edge is less than this
10012 threshold (in percent).
10014 @item tracer-min-branch-probability
10015 @itemx tracer-min-branch-probability-feedback
10017 Stop forward growth if the best edge has probability lower than this
10018 threshold.
10020 Similarly to @option{tracer-dynamic-coverage} two parameters are
10021 provided.  @option{tracer-min-branch-probability-feedback} is used for
10022 compilation with profile feedback and @option{tracer-min-branch-probability}
10023 compilation without.  The value for compilation with profile feedback
10024 needs to be more conservative (higher) in order to make tracer
10025 effective.
10027 @item max-cse-path-length
10029 The maximum number of basic blocks on path that CSE considers.
10030 The default is 10.
10032 @item max-cse-insns
10033 The maximum number of instructions CSE processes before flushing.
10034 The default is 1000.
10036 @item ggc-min-expand
10038 GCC uses a garbage collector to manage its own memory allocation.  This
10039 parameter specifies the minimum percentage by which the garbage
10040 collector's heap should be allowed to expand between collections.
10041 Tuning this may improve compilation speed; it has no effect on code
10042 generation.
10044 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
10045 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
10046 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
10047 GCC is not able to calculate RAM on a particular platform, the lower
10048 bound of 30% is used.  Setting this parameter and
10049 @option{ggc-min-heapsize} to zero causes a full collection to occur at
10050 every opportunity.  This is extremely slow, but can be useful for
10051 debugging.
10053 @item ggc-min-heapsize
10055 Minimum size of the garbage collector's heap before it begins bothering
10056 to collect garbage.  The first collection occurs after the heap expands
10057 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
10058 tuning this may improve compilation speed, and has no effect on code
10059 generation.
10061 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
10062 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
10063 with a lower bound of 4096 (four megabytes) and an upper bound of
10064 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
10065 particular platform, the lower bound is used.  Setting this parameter
10066 very large effectively disables garbage collection.  Setting this
10067 parameter and @option{ggc-min-expand} to zero causes a full collection
10068 to occur at every opportunity.
10070 @item max-reload-search-insns
10071 The maximum number of instruction reload should look backward for equivalent
10072 register.  Increasing values mean more aggressive optimization, making the
10073 compilation time increase with probably slightly better performance.
10074 The default value is 100.
10076 @item max-cselib-memory-locations
10077 The maximum number of memory locations cselib should take into account.
10078 Increasing values mean more aggressive optimization, making the compilation time
10079 increase with probably slightly better performance.  The default value is 500.
10081 @item max-sched-ready-insns
10082 The maximum number of instructions ready to be issued the scheduler should
10083 consider at any given time during the first scheduling pass.  Increasing
10084 values mean more thorough searches, making the compilation time increase
10085 with probably little benefit.  The default value is 100.
10087 @item max-sched-region-blocks
10088 The maximum number of blocks in a region to be considered for
10089 interblock scheduling.  The default value is 10.
10091 @item max-pipeline-region-blocks
10092 The maximum number of blocks in a region to be considered for
10093 pipelining in the selective scheduler.  The default value is 15.
10095 @item max-sched-region-insns
10096 The maximum number of insns in a region to be considered for
10097 interblock scheduling.  The default value is 100.
10099 @item max-pipeline-region-insns
10100 The maximum number of insns in a region to be considered for
10101 pipelining in the selective scheduler.  The default value is 200.
10103 @item min-spec-prob
10104 The minimum probability (in percents) of reaching a source block
10105 for interblock speculative scheduling.  The default value is 40.
10107 @item max-sched-extend-regions-iters
10108 The maximum number of iterations through CFG to extend regions.
10109 A value of 0 (the default) disables region extensions.
10111 @item max-sched-insn-conflict-delay
10112 The maximum conflict delay for an insn to be considered for speculative motion.
10113 The default value is 3.
10115 @item sched-spec-prob-cutoff
10116 The minimal probability of speculation success (in percents), so that
10117 speculative insns are scheduled.
10118 The default value is 40.
10120 @item sched-state-edge-prob-cutoff
10121 The minimum probability an edge must have for the scheduler to save its
10122 state across it.
10123 The default value is 10.
10125 @item sched-mem-true-dep-cost
10126 Minimal distance (in CPU cycles) between store and load targeting same
10127 memory locations.  The default value is 1.
10129 @item selsched-max-lookahead
10130 The maximum size of the lookahead window of selective scheduling.  It is a
10131 depth of search for available instructions.
10132 The default value is 50.
10134 @item selsched-max-sched-times
10135 The maximum number of times that an instruction is scheduled during
10136 selective scheduling.  This is the limit on the number of iterations
10137 through which the instruction may be pipelined.  The default value is 2.
10139 @item selsched-insns-to-rename
10140 The maximum number of best instructions in the ready list that are considered
10141 for renaming in the selective scheduler.  The default value is 2.
10143 @item sms-min-sc
10144 The minimum value of stage count that swing modulo scheduler
10145 generates.  The default value is 2.
10147 @item max-last-value-rtl
10148 The maximum size measured as number of RTLs that can be recorded in an expression
10149 in combiner for a pseudo register as last known value of that register.  The default
10150 is 10000.
10152 @item max-combine-insns
10153 The maximum number of instructions the RTL combiner tries to combine.
10154 The default value is 2 at @option{-Og} and 4 otherwise.
10156 @item integer-share-limit
10157 Small integer constants can use a shared data structure, reducing the
10158 compiler's memory usage and increasing its speed.  This sets the maximum
10159 value of a shared integer constant.  The default value is 256.
10161 @item ssp-buffer-size
10162 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
10163 protection when @option{-fstack-protection} is used.
10165 @item min-size-for-stack-sharing
10166 The minimum size of variables taking part in stack slot sharing when not
10167 optimizing. The default value is 32.
10169 @item max-jump-thread-duplication-stmts
10170 Maximum number of statements allowed in a block that needs to be
10171 duplicated when threading jumps.
10173 @item max-fields-for-field-sensitive
10174 Maximum number of fields in a structure treated in
10175 a field sensitive manner during pointer analysis.  The default is zero
10176 for @option{-O0} and @option{-O1},
10177 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
10179 @item prefetch-latency
10180 Estimate on average number of instructions that are executed before
10181 prefetch finishes.  The distance prefetched ahead is proportional
10182 to this constant.  Increasing this number may also lead to less
10183 streams being prefetched (see @option{simultaneous-prefetches}).
10185 @item simultaneous-prefetches
10186 Maximum number of prefetches that can run at the same time.
10188 @item l1-cache-line-size
10189 The size of cache line in L1 cache, in bytes.
10191 @item l1-cache-size
10192 The size of L1 cache, in kilobytes.
10194 @item l2-cache-size
10195 The size of L2 cache, in kilobytes.
10197 @item min-insn-to-prefetch-ratio
10198 The minimum ratio between the number of instructions and the
10199 number of prefetches to enable prefetching in a loop.
10201 @item prefetch-min-insn-to-mem-ratio
10202 The minimum ratio between the number of instructions and the
10203 number of memory references to enable prefetching in a loop.
10205 @item use-canonical-types
10206 Whether the compiler should use the ``canonical'' type system.  By
10207 default, this should always be 1, which uses a more efficient internal
10208 mechanism for comparing types in C++ and Objective-C++.  However, if
10209 bugs in the canonical type system are causing compilation failures,
10210 set this value to 0 to disable canonical types.
10212 @item switch-conversion-max-branch-ratio
10213 Switch initialization conversion refuses to create arrays that are
10214 bigger than @option{switch-conversion-max-branch-ratio} times the number of
10215 branches in the switch.
10217 @item max-partial-antic-length
10218 Maximum length of the partial antic set computed during the tree
10219 partial redundancy elimination optimization (@option{-ftree-pre}) when
10220 optimizing at @option{-O3} and above.  For some sorts of source code
10221 the enhanced partial redundancy elimination optimization can run away,
10222 consuming all of the memory available on the host machine.  This
10223 parameter sets a limit on the length of the sets that are computed,
10224 which prevents the runaway behavior.  Setting a value of 0 for
10225 this parameter allows an unlimited set length.
10227 @item sccvn-max-scc-size
10228 Maximum size of a strongly connected component (SCC) during SCCVN
10229 processing.  If this limit is hit, SCCVN processing for the whole
10230 function is not done and optimizations depending on it are
10231 disabled.  The default maximum SCC size is 10000.
10233 @item sccvn-max-alias-queries-per-access
10234 Maximum number of alias-oracle queries we perform when looking for
10235 redundancies for loads and stores.  If this limit is hit the search
10236 is aborted and the load or store is not considered redundant.  The
10237 number of queries is algorithmically limited to the number of
10238 stores on all paths from the load to the function entry.
10239 The default maximum number of queries is 1000.
10241 @item ira-max-loops-num
10242 IRA uses regional register allocation by default.  If a function
10243 contains more loops than the number given by this parameter, only at most
10244 the given number of the most frequently-executed loops form regions
10245 for regional register allocation.  The default value of the
10246 parameter is 100.
10248 @item ira-max-conflict-table-size 
10249 Although IRA uses a sophisticated algorithm to compress the conflict
10250 table, the table can still require excessive amounts of memory for
10251 huge functions.  If the conflict table for a function could be more
10252 than the size in MB given by this parameter, the register allocator
10253 instead uses a faster, simpler, and lower-quality
10254 algorithm that does not require building a pseudo-register conflict table.  
10255 The default value of the parameter is 2000.
10257 @item ira-loop-reserved-regs
10258 IRA can be used to evaluate more accurate register pressure in loops
10259 for decisions to move loop invariants (see @option{-O3}).  The number
10260 of available registers reserved for some other purposes is given
10261 by this parameter.  The default value of the parameter is 2, which is
10262 the minimal number of registers needed by typical instructions.
10263 This value is the best found from numerous experiments.
10265 @item lra-inheritance-ebb-probability-cutoff
10266 LRA tries to reuse values reloaded in registers in subsequent insns.
10267 This optimization is called inheritance.  EBB is used as a region to
10268 do this optimization.  The parameter defines a minimal fall-through
10269 edge probability in percentage used to add BB to inheritance EBB in
10270 LRA.  The default value of the parameter is 40.  The value was chosen
10271 from numerous runs of SPEC2000 on x86-64.
10273 @item loop-invariant-max-bbs-in-loop
10274 Loop invariant motion can be very expensive, both in compilation time and
10275 in amount of needed compile-time memory, with very large loops.  Loops
10276 with more basic blocks than this parameter won't have loop invariant
10277 motion optimization performed on them.  The default value of the
10278 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
10280 @item loop-max-datarefs-for-datadeps
10281 Building data dependencies is expensive for very large loops.  This
10282 parameter limits the number of data references in loops that are
10283 considered for data dependence analysis.  These large loops are no
10284 handled by the optimizations using loop data dependencies.
10285 The default value is 1000.
10287 @item max-vartrack-size
10288 Sets a maximum number of hash table slots to use during variable
10289 tracking dataflow analysis of any function.  If this limit is exceeded
10290 with variable tracking at assignments enabled, analysis for that
10291 function is retried without it, after removing all debug insns from
10292 the function.  If the limit is exceeded even without debug insns, var
10293 tracking analysis is completely disabled for the function.  Setting
10294 the parameter to zero makes it unlimited.
10296 @item max-vartrack-expr-depth
10297 Sets a maximum number of recursion levels when attempting to map
10298 variable names or debug temporaries to value expressions.  This trades
10299 compilation time for more complete debug information.  If this is set too
10300 low, value expressions that are available and could be represented in
10301 debug information may end up not being used; setting this higher may
10302 enable the compiler to find more complex debug expressions, but compile
10303 time and memory use may grow.  The default is 12.
10305 @item min-nondebug-insn-uid
10306 Use uids starting at this parameter for nondebug insns.  The range below
10307 the parameter is reserved exclusively for debug insns created by
10308 @option{-fvar-tracking-assignments}, but debug insns may get
10309 (non-overlapping) uids above it if the reserved range is exhausted.
10311 @item ipa-sra-ptr-growth-factor
10312 IPA-SRA replaces a pointer to an aggregate with one or more new
10313 parameters only when their cumulative size is less or equal to
10314 @option{ipa-sra-ptr-growth-factor} times the size of the original
10315 pointer parameter.
10317 @item sra-max-scalarization-size-Ospeed
10318 @item sra-max-scalarization-size-Osize
10319 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
10320 replace scalar parts of aggregates with uses of independent scalar
10321 variables.  These parameters control the maximum size, in storage units,
10322 of aggregate which is considered for replacement when compiling for
10323 speed
10324 (@option{sra-max-scalarization-size-Ospeed}) or size
10325 (@option{sra-max-scalarization-size-Osize}) respectively.
10327 @item tm-max-aggregate-size
10328 When making copies of thread-local variables in a transaction, this
10329 parameter specifies the size in bytes after which variables are
10330 saved with the logging functions as opposed to save/restore code
10331 sequence pairs.  This option only applies when using
10332 @option{-fgnu-tm}.
10334 @item graphite-max-nb-scop-params
10335 To avoid exponential effects in the Graphite loop transforms, the
10336 number of parameters in a Static Control Part (SCoP) is bounded.  The
10337 default value is 10 parameters.  A variable whose value is unknown at
10338 compilation time and defined outside a SCoP is a parameter of the SCoP.
10340 @item graphite-max-bbs-per-function
10341 To avoid exponential effects in the detection of SCoPs, the size of
10342 the functions analyzed by Graphite is bounded.  The default value is
10343 100 basic blocks.
10345 @item loop-block-tile-size
10346 Loop blocking or strip mining transforms, enabled with
10347 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
10348 loop in the loop nest by a given number of iterations.  The strip
10349 length can be changed using the @option{loop-block-tile-size}
10350 parameter.  The default value is 51 iterations.
10352 @item loop-unroll-jam-size
10353 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
10354 default value is 4.
10356 @item loop-unroll-jam-depth
10357 Specify the dimension to be unrolled (counting from the most inner loop)
10358 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
10360 @item ipa-cp-value-list-size
10361 IPA-CP attempts to track all possible values and types passed to a function's
10362 parameter in order to propagate them and perform devirtualization.
10363 @option{ipa-cp-value-list-size} is the maximum number of values and types it
10364 stores per one formal parameter of a function.
10366 @item ipa-cp-eval-threshold
10367 IPA-CP calculates its own score of cloning profitability heuristics
10368 and performs those cloning opportunities with scores that exceed
10369 @option{ipa-cp-eval-threshold}.
10371 @item ipa-cp-recursion-penalty
10372 Percentage penalty the recursive functions will receive when they
10373 are evaluated for cloning.
10375 @item ipa-cp-single-call-penalty
10376 Percentage penalty functions containing a single call to another
10377 function will receive when they are evaluated for cloning.
10380 @item ipa-max-agg-items
10381 IPA-CP is also capable to propagate a number of scalar values passed
10382 in an aggregate. @option{ipa-max-agg-items} controls the maximum
10383 number of such values per one parameter.
10385 @item ipa-cp-loop-hint-bonus
10386 When IPA-CP determines that a cloning candidate would make the number
10387 of iterations of a loop known, it adds a bonus of
10388 @option{ipa-cp-loop-hint-bonus} to the profitability score of
10389 the candidate.
10391 @item ipa-cp-array-index-hint-bonus
10392 When IPA-CP determines that a cloning candidate would make the index of
10393 an array access known, it adds a bonus of
10394 @option{ipa-cp-array-index-hint-bonus} to the profitability
10395 score of the candidate.
10397 @item ipa-max-aa-steps
10398 During its analysis of function bodies, IPA-CP employs alias analysis
10399 in order to track values pointed to by function parameters.  In order
10400 not spend too much time analyzing huge functions, it gives up and
10401 consider all memory clobbered after examining
10402 @option{ipa-max-aa-steps} statements modifying memory.
10404 @item lto-partitions
10405 Specify desired number of partitions produced during WHOPR compilation.
10406 The number of partitions should exceed the number of CPUs used for compilation.
10407 The default value is 32.
10409 @item lto-min-partition
10410 Size of minimal partition for WHOPR (in estimated instructions).
10411 This prevents expenses of splitting very small programs into too many
10412 partitions.
10414 @item lto-max-partition
10415 Size of max partition for WHOPR (in estimated instructions).
10416 to provide an upper bound for individual size of partition.
10417 Meant to be used only with balanced partitioning.
10419 @item cxx-max-namespaces-for-diagnostic-help
10420 The maximum number of namespaces to consult for suggestions when C++
10421 name lookup fails for an identifier.  The default is 1000.
10423 @item sink-frequency-threshold
10424 The maximum relative execution frequency (in percents) of the target block
10425 relative to a statement's original block to allow statement sinking of a
10426 statement.  Larger numbers result in more aggressive statement sinking.
10427 The default value is 75.  A small positive adjustment is applied for
10428 statements with memory operands as those are even more profitable so sink.
10430 @item max-stores-to-sink
10431 The maximum number of conditional store pairs that can be sunk.  Set to 0
10432 if either vectorization (@option{-ftree-vectorize}) or if-conversion
10433 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
10435 @item allow-store-data-races
10436 Allow optimizers to introduce new data races on stores.
10437 Set to 1 to allow, otherwise to 0.  This option is enabled by default
10438 at optimization level @option{-Ofast}.
10440 @item case-values-threshold
10441 The smallest number of different values for which it is best to use a
10442 jump-table instead of a tree of conditional branches.  If the value is
10443 0, use the default for the machine.  The default is 0.
10445 @item tree-reassoc-width
10446 Set the maximum number of instructions executed in parallel in
10447 reassociated tree. This parameter overrides target dependent
10448 heuristics used by default if has non zero value.
10450 @item sched-pressure-algorithm
10451 Choose between the two available implementations of
10452 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
10453 and is the more likely to prevent instructions from being reordered.
10454 Algorithm 2 was designed to be a compromise between the relatively
10455 conservative approach taken by algorithm 1 and the rather aggressive
10456 approach taken by the default scheduler.  It relies more heavily on
10457 having a regular register file and accurate register pressure classes.
10458 See @file{haifa-sched.c} in the GCC sources for more details.
10460 The default choice depends on the target.
10462 @item max-slsr-cand-scan
10463 Set the maximum number of existing candidates that are considered when
10464 seeking a basis for a new straight-line strength reduction candidate.
10466 @item asan-globals
10467 Enable buffer overflow detection for global objects.  This kind
10468 of protection is enabled by default if you are using
10469 @option{-fsanitize=address} option.
10470 To disable global objects protection use @option{--param asan-globals=0}.
10472 @item asan-stack
10473 Enable buffer overflow detection for stack objects.  This kind of
10474 protection is enabled by default when using @option{-fsanitize=address}.
10475 To disable stack protection use @option{--param asan-stack=0} option.
10477 @item asan-instrument-reads
10478 Enable buffer overflow detection for memory reads.  This kind of
10479 protection is enabled by default when using @option{-fsanitize=address}.
10480 To disable memory reads protection use
10481 @option{--param asan-instrument-reads=0}.
10483 @item asan-instrument-writes
10484 Enable buffer overflow detection for memory writes.  This kind of
10485 protection is enabled by default when using @option{-fsanitize=address}.
10486 To disable memory writes protection use
10487 @option{--param asan-instrument-writes=0} option.
10489 @item asan-memintrin
10490 Enable detection for built-in functions.  This kind of protection
10491 is enabled by default when using @option{-fsanitize=address}.
10492 To disable built-in functions protection use
10493 @option{--param asan-memintrin=0}.
10495 @item asan-use-after-return
10496 Enable detection of use-after-return.  This kind of protection
10497 is enabled by default when using the @option{-fsanitize=address} option.
10498 To disable it use @option{--param asan-use-after-return=0}.
10500 Note: By default the check is disabled at run time.  To enable it,
10501 add @code{detect_stack_use_after_return=1} to the environment variable
10502 @env{ASAN_OPTIONS}.
10504 @item asan-instrumentation-with-call-threshold
10505 If number of memory accesses in function being instrumented
10506 is greater or equal to this number, use callbacks instead of inline checks.
10507 E.g. to disable inline code use
10508 @option{--param asan-instrumentation-with-call-threshold=0}.
10510 @item use-after-scope-direct-emission-threshold
10511 If the size of a local variable in bytes is smaller or equal to this
10512 number, directly poison (or unpoison) shadow memory instead of using
10513 run-time callbacks.  The default value is 256.
10515 @item chkp-max-ctor-size
10516 Static constructors generated by Pointer Bounds Checker may become very
10517 large and significantly increase compile time at optimization level
10518 @option{-O1} and higher.  This parameter is a maximum number of statements
10519 in a single generated constructor.  Default value is 5000.
10521 @item max-fsm-thread-path-insns
10522 Maximum number of instructions to copy when duplicating blocks on a
10523 finite state automaton jump thread path.  The default is 100.
10525 @item max-fsm-thread-length
10526 Maximum number of basic blocks on a finite state automaton jump thread
10527 path.  The default is 10.
10529 @item max-fsm-thread-paths
10530 Maximum number of new jump thread paths to create for a finite state
10531 automaton.  The default is 50.
10533 @item parloops-chunk-size
10534 Chunk size of omp schedule for loops parallelized by parloops.  The default
10535 is 0.
10537 @item parloops-schedule
10538 Schedule type of omp schedule for loops parallelized by parloops (static,
10539 dynamic, guided, auto, runtime).  The default is static.
10541 @item max-ssa-name-query-depth
10542 Maximum depth of recursion when querying properties of SSA names in things
10543 like fold routines.  One level of recursion corresponds to following a
10544 use-def chain.
10546 @item hsa-gen-debug-stores
10547 Enable emission of special debug stores within HSA kernels which are
10548 then read and reported by libgomp plugin.  Generation of these stores
10549 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
10550 enable it.
10552 @item max-speculative-devirt-maydefs
10553 The maximum number of may-defs we analyze when looking for a must-def
10554 specifying the dynamic type of an object that invokes a virtual call
10555 we may be able to devirtualize speculatively.
10557 @item max-vrp-switch-assertions
10558 The maximum number of assertions to add along the default edge of a switch
10559 statement during VRP.  The default is 10.
10560 @end table
10561 @end table
10563 @node Instrumentation Options
10564 @section Program Instrumentation Options
10565 @cindex instrumentation options
10566 @cindex program instrumentation options
10567 @cindex run-time error checking options
10568 @cindex profiling options
10569 @cindex options, program instrumentation
10570 @cindex options, run-time error checking
10571 @cindex options, profiling
10573 GCC supports a number of command-line options that control adding
10574 run-time instrumentation to the code it normally generates.  
10575 For example, one purpose of instrumentation is collect profiling
10576 statistics for use in finding program hot spots, code coverage
10577 analysis, or profile-guided optimizations.
10578 Another class of program instrumentation is adding run-time checking 
10579 to detect programming errors like invalid pointer
10580 dereferences or out-of-bounds array accesses, as well as deliberately
10581 hostile attacks such as stack smashing or C++ vtable hijacking.
10582 There is also a general hook which can be used to implement other
10583 forms of tracing or function-level instrumentation for debug or
10584 program analysis purposes.
10586 @table @gcctabopt
10587 @cindex @command{prof}
10588 @item -p
10589 @opindex p
10590 Generate extra code to write profile information suitable for the
10591 analysis program @command{prof}.  You must use this option when compiling
10592 the source files you want data about, and you must also use it when
10593 linking.
10595 @cindex @command{gprof}
10596 @item -pg
10597 @opindex pg
10598 Generate extra code to write profile information suitable for the
10599 analysis program @command{gprof}.  You must use this option when compiling
10600 the source files you want data about, and you must also use it when
10601 linking.
10603 @item -fprofile-arcs
10604 @opindex fprofile-arcs
10605 Add code so that program flow @dfn{arcs} are instrumented.  During
10606 execution the program records how many times each branch and call is
10607 executed and how many times it is taken or returns.  On targets that support
10608 constructors with priority support, profiling properly handles constructors,
10609 destructors and C++ constructors (and destructors) of classes which are used
10610 as a type of a global variable.
10612 When the compiled
10613 program exits it saves this data to a file called
10614 @file{@var{auxname}.gcda} for each source file.  The data may be used for
10615 profile-directed optimizations (@option{-fbranch-probabilities}), or for
10616 test coverage analysis (@option{-ftest-coverage}).  Each object file's
10617 @var{auxname} is generated from the name of the output file, if
10618 explicitly specified and it is not the final executable, otherwise it is
10619 the basename of the source file.  In both cases any suffix is removed
10620 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
10621 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
10622 @xref{Cross-profiling}.
10624 @cindex @command{gcov}
10625 @item --coverage
10626 @opindex coverage
10628 This option is used to compile and link code instrumented for coverage
10629 analysis.  The option is a synonym for @option{-fprofile-arcs}
10630 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
10631 linking).  See the documentation for those options for more details.
10633 @itemize
10635 @item
10636 Compile the source files with @option{-fprofile-arcs} plus optimization
10637 and code generation options.  For test coverage analysis, use the
10638 additional @option{-ftest-coverage} option.  You do not need to profile
10639 every source file in a program.
10641 @item
10642 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
10643 (the latter implies the former).
10645 @item
10646 Run the program on a representative workload to generate the arc profile
10647 information.  This may be repeated any number of times.  You can run
10648 concurrent instances of your program, and provided that the file system
10649 supports locking, the data files will be correctly updated.  Also
10650 @code{fork} calls are detected and correctly handled (double counting
10651 will not happen).
10653 @item
10654 For profile-directed optimizations, compile the source files again with
10655 the same optimization and code generation options plus
10656 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
10657 Control Optimization}).
10659 @item
10660 For test coverage analysis, use @command{gcov} to produce human readable
10661 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
10662 @command{gcov} documentation for further information.
10664 @end itemize
10666 With @option{-fprofile-arcs}, for each function of your program GCC
10667 creates a program flow graph, then finds a spanning tree for the graph.
10668 Only arcs that are not on the spanning tree have to be instrumented: the
10669 compiler adds code to count the number of times that these arcs are
10670 executed.  When an arc is the only exit or only entrance to a block, the
10671 instrumentation code can be added to the block; otherwise, a new basic
10672 block must be created to hold the instrumentation code.
10674 @need 2000
10675 @item -ftest-coverage
10676 @opindex ftest-coverage
10677 Produce a notes file that the @command{gcov} code-coverage utility
10678 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
10679 show program coverage.  Each source file's note file is called
10680 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
10681 above for a description of @var{auxname} and instructions on how to
10682 generate test coverage data.  Coverage data matches the source files
10683 more closely if you do not optimize.
10685 @item -fprofile-dir=@var{path}
10686 @opindex fprofile-dir
10688 Set the directory to search for the profile data files in to @var{path}.
10689 This option affects only the profile data generated by
10690 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
10691 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
10692 and its related options.  Both absolute and relative paths can be used.
10693 By default, GCC uses the current directory as @var{path}, thus the
10694 profile data file appears in the same directory as the object file.
10696 @item -fprofile-generate
10697 @itemx -fprofile-generate=@var{path}
10698 @opindex fprofile-generate
10700 Enable options usually used for instrumenting application to produce
10701 profile useful for later recompilation with profile feedback based
10702 optimization.  You must use @option{-fprofile-generate} both when
10703 compiling and when linking your program.
10705 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
10707 If @var{path} is specified, GCC looks at the @var{path} to find
10708 the profile feedback data files. See @option{-fprofile-dir}.
10710 To optimize the program based on the collected profile information, use
10711 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
10713 @item -fprofile-update=@var{method}
10714 @opindex fprofile-update
10716 Alter the update method for an application instrumented for profile
10717 feedback based optimization.  The @var{method} argument should be one of
10718 @samp{single}, @samp{atomic} or @samp{prefer-atomic}.
10719 The first one is useful for single-threaded applications,
10720 while the second one prevents profile corruption by emitting thread-safe code.
10722 @strong{Warning:} When an application does not properly join all threads
10723 (or creates an detached thread), a profile file can be still corrupted.
10725 Using @samp{prefer-atomic} would be transformed either to @samp{atomic},
10726 when supported by a target, or to @samp{single} otherwise.  The GCC driver
10727 automatically selects @samp{prefer-atomic} when @option{-pthread}
10728 is present in the command line.
10730 @item -fsanitize=address
10731 @opindex fsanitize=address
10732 Enable AddressSanitizer, a fast memory error detector.
10733 Memory access instructions are instrumented to detect
10734 out-of-bounds and use-after-free bugs.
10735 The option enables @option{-fsanitize-address-use-after-scope}.
10736 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
10737 more details.  The run-time behavior can be influenced using the
10738 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
10739 the available options are shown at startup of the instrumented program.  See
10740 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
10741 for a list of supported options.
10742 The option cannot be combined with @option{-fsanitize=thread}
10743 and/or @option{-fcheck-pointer-bounds}.
10745 @item -fsanitize=kernel-address
10746 @opindex fsanitize=kernel-address
10747 Enable AddressSanitizer for Linux kernel.
10748 See @uref{https://github.com/google/kasan/wiki} for more details.
10749 The option cannot be combined with @option{-fcheck-pointer-bounds}.
10751 @item -fsanitize=thread
10752 @opindex fsanitize=thread
10753 Enable ThreadSanitizer, a fast data race detector.
10754 Memory access instructions are instrumented to detect
10755 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
10756 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
10757 environment variable; see
10758 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
10759 supported options.
10760 The option cannot be combined with @option{-fsanitize=address},
10761 @option{-fsanitize=leak} and/or @option{-fcheck-pointer-bounds}.
10763 Note that sanitized atomic builtins cannot throw exceptions when
10764 operating on invalid memory addresses with non-call exceptions
10765 (@option{-fnon-call-exceptions}).
10767 @item -fsanitize=leak
10768 @opindex fsanitize=leak
10769 Enable LeakSanitizer, a memory leak detector.
10770 This option only matters for linking of executables and
10771 the executable is linked against a library that overrides @code{malloc}
10772 and other allocator functions.  See
10773 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
10774 details.  The run-time behavior can be influenced using the
10775 @env{LSAN_OPTIONS} environment variable.
10776 The option cannot be combined with @option{-fsanitize=thread}.
10778 @item -fsanitize=undefined
10779 @opindex fsanitize=undefined
10780 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
10781 Various computations are instrumented to detect undefined behavior
10782 at runtime.  Current suboptions are:
10784 @table @gcctabopt
10786 @item -fsanitize=shift
10787 @opindex fsanitize=shift
10788 This option enables checking that the result of a shift operation is
10789 not undefined.  Note that what exactly is considered undefined differs
10790 slightly between C and C++, as well as between ISO C90 and C99, etc.
10791 This option has two suboptions, @option{-fsanitize=shift-base} and
10792 @option{-fsanitize=shift-exponent}.
10794 @item -fsanitize=shift-exponent
10795 @opindex fsanitize=shift-exponent
10796 This option enables checking that the second argument of a shift operation
10797 is not negative and is smaller than the precision of the promoted first
10798 argument.
10800 @item -fsanitize=shift-base
10801 @opindex fsanitize=shift-base
10802 If the second argument of a shift operation is within range, check that the
10803 result of a shift operation is not undefined.  Note that what exactly is
10804 considered undefined differs slightly between C and C++, as well as between
10805 ISO C90 and C99, etc.
10807 @item -fsanitize=integer-divide-by-zero
10808 @opindex fsanitize=integer-divide-by-zero
10809 Detect integer division by zero as well as @code{INT_MIN / -1} division.
10811 @item -fsanitize=unreachable
10812 @opindex fsanitize=unreachable
10813 With this option, the compiler turns the @code{__builtin_unreachable}
10814 call into a diagnostics message call instead.  When reaching the
10815 @code{__builtin_unreachable} call, the behavior is undefined.
10817 @item -fsanitize=vla-bound
10818 @opindex fsanitize=vla-bound
10819 This option instructs the compiler to check that the size of a variable
10820 length array is positive.
10822 @item -fsanitize=null
10823 @opindex fsanitize=null
10824 This option enables pointer checking.  Particularly, the application
10825 built with this option turned on will issue an error message when it
10826 tries to dereference a NULL pointer, or if a reference (possibly an
10827 rvalue reference) is bound to a NULL pointer, or if a method is invoked
10828 on an object pointed by a NULL pointer.
10830 @item -fsanitize=return
10831 @opindex fsanitize=return
10832 This option enables return statement checking.  Programs
10833 built with this option turned on will issue an error message
10834 when the end of a non-void function is reached without actually
10835 returning a value.  This option works in C++ only.
10837 @item -fsanitize=signed-integer-overflow
10838 @opindex fsanitize=signed-integer-overflow
10839 This option enables signed integer overflow checking.  We check that
10840 the result of @code{+}, @code{*}, and both unary and binary @code{-}
10841 does not overflow in the signed arithmetics.  Note, integer promotion
10842 rules must be taken into account.  That is, the following is not an
10843 overflow:
10844 @smallexample
10845 signed char a = SCHAR_MAX;
10846 a++;
10847 @end smallexample
10849 @item -fsanitize=bounds
10850 @opindex fsanitize=bounds
10851 This option enables instrumentation of array bounds.  Various out of bounds
10852 accesses are detected.  Flexible array members, flexible array member-like
10853 arrays, and initializers of variables with static storage are not instrumented.
10854 The option cannot be combined with @option{-fcheck-pointer-bounds}.
10856 @item -fsanitize=bounds-strict
10857 @opindex fsanitize=bounds-strict
10858 This option enables strict instrumentation of array bounds.  Most out of bounds
10859 accesses are detected, including flexible array members and flexible array
10860 member-like arrays.  Initializers of variables with static storage are not
10861 instrumented.  The option cannot be combined
10862 with @option{-fcheck-pointer-bounds}.
10864 @item -fsanitize=alignment
10865 @opindex fsanitize=alignment
10867 This option enables checking of alignment of pointers when they are
10868 dereferenced, or when a reference is bound to insufficiently aligned target,
10869 or when a method or constructor is invoked on insufficiently aligned object.
10871 @item -fsanitize=object-size
10872 @opindex fsanitize=object-size
10873 This option enables instrumentation of memory references using the
10874 @code{__builtin_object_size} function.  Various out of bounds pointer
10875 accesses are detected.
10877 @item -fsanitize=float-divide-by-zero
10878 @opindex fsanitize=float-divide-by-zero
10879 Detect floating-point division by zero.  Unlike other similar options,
10880 @option{-fsanitize=float-divide-by-zero} is not enabled by
10881 @option{-fsanitize=undefined}, since floating-point division by zero can
10882 be a legitimate way of obtaining infinities and NaNs.
10884 @item -fsanitize=float-cast-overflow
10885 @opindex fsanitize=float-cast-overflow
10886 This option enables floating-point type to integer conversion checking.
10887 We check that the result of the conversion does not overflow.
10888 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
10889 not enabled by @option{-fsanitize=undefined}.
10890 This option does not work well with @code{FE_INVALID} exceptions enabled.
10892 @item -fsanitize=nonnull-attribute
10893 @opindex fsanitize=nonnull-attribute
10895 This option enables instrumentation of calls, checking whether null values
10896 are not passed to arguments marked as requiring a non-null value by the
10897 @code{nonnull} function attribute.
10899 @item -fsanitize=returns-nonnull-attribute
10900 @opindex fsanitize=returns-nonnull-attribute
10902 This option enables instrumentation of return statements in functions
10903 marked with @code{returns_nonnull} function attribute, to detect returning
10904 of null values from such functions.
10906 @item -fsanitize=bool
10907 @opindex fsanitize=bool
10909 This option enables instrumentation of loads from bool.  If a value other
10910 than 0/1 is loaded, a run-time error is issued.
10912 @item -fsanitize=enum
10913 @opindex fsanitize=enum
10915 This option enables instrumentation of loads from an enum type.  If
10916 a value outside the range of values for the enum type is loaded,
10917 a run-time error is issued.
10919 @item -fsanitize=vptr
10920 @opindex fsanitize=vptr
10922 This option enables instrumentation of C++ member function calls, member
10923 accesses and some conversions between pointers to base and derived classes,
10924 to verify the referenced object has the correct dynamic type.
10926 @end table
10928 While @option{-ftrapv} causes traps for signed overflows to be emitted,
10929 @option{-fsanitize=undefined} gives a diagnostic message.
10930 This currently works only for the C family of languages.
10932 @item -fno-sanitize=all
10933 @opindex fno-sanitize=all
10935 This option disables all previously enabled sanitizers.
10936 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
10937 together.
10939 @item -fasan-shadow-offset=@var{number}
10940 @opindex fasan-shadow-offset
10941 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
10942 It is useful for experimenting with different shadow memory layouts in
10943 Kernel AddressSanitizer.
10945 @item -fsanitize-sections=@var{s1},@var{s2},...
10946 @opindex fsanitize-sections
10947 Sanitize global variables in selected user-defined sections.  @var{si} may
10948 contain wildcards.
10950 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
10951 @opindex fsanitize-recover
10952 @opindex fno-sanitize-recover
10953 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
10954 mentioned in comma-separated list of @var{opts}.  Enabling this option
10955 for a sanitizer component causes it to attempt to continue
10956 running the program as if no error happened.  This means multiple
10957 runtime errors can be reported in a single program run, and the exit
10958 code of the program may indicate success even when errors
10959 have been reported.  The @option{-fno-sanitize-recover=} option
10960 can be used to alter
10961 this behavior: only the first detected error is reported
10962 and program then exits with a non-zero exit code.
10964 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
10965 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
10966 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
10967 @option{-fsanitize=bounds-strict},
10968 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
10969 For these sanitizers error recovery is turned on by default,
10970 except @option{-fsanitize=address}, for which this feature is experimental.
10971 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
10972 accepted, the former enables recovery for all sanitizers that support it,
10973 the latter disables recovery for all sanitizers that support it.
10975 Even if a recovery mode is turned on the compiler side, it needs to be also
10976 enabled on the runtime library side, otherwise the failures are still fatal.
10977 The runtime library defaults to @code{halt_on_error=0} for
10978 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
10979 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
10980 setting the @code{halt_on_error} flag in the corresponding environment variable.
10982 Syntax without an explicit @var{opts} parameter is deprecated.  It is
10983 equivalent to specifying an @var{opts} list of:
10985 @smallexample
10986 undefined,float-cast-overflow,float-divide-by-zero,bounds-strict
10987 @end smallexample
10989 @item -fsanitize-address-use-after-scope
10990 @opindex fsanitize-address-use-after-scope
10991 Enable sanitization of local variables to detect use-after-scope bugs.
10992 The option sets @option{-fstack-reuse} to @samp{none}.
10994 @item -fsanitize-undefined-trap-on-error
10995 @opindex fsanitize-undefined-trap-on-error
10996 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
10997 report undefined behavior using @code{__builtin_trap} rather than
10998 a @code{libubsan} library routine.  The advantage of this is that the
10999 @code{libubsan} library is not needed and is not linked in, so this
11000 is usable even in freestanding environments.
11002 @item -fsanitize-coverage=trace-pc
11003 @opindex fsanitize-coverage=trace-pc
11004 Enable coverage-guided fuzzing code instrumentation.
11005 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
11007 @item -fbounds-check
11008 @opindex fbounds-check
11009 For front ends that support it, generate additional code to check that
11010 indices used to access arrays are within the declared range.  This is
11011 currently only supported by the Fortran front end, where this option
11012 defaults to false.
11014 @item -fcheck-pointer-bounds
11015 @opindex fcheck-pointer-bounds
11016 @opindex fno-check-pointer-bounds
11017 @cindex Pointer Bounds Checker options
11018 Enable Pointer Bounds Checker instrumentation.  Each memory reference
11019 is instrumented with checks of the pointer used for memory access against
11020 bounds associated with that pointer.  
11022 Currently there
11023 is only an implementation for Intel MPX available, thus x86 GNU/Linux target
11024 and @option{-mmpx} are required to enable this feature.  
11025 MPX-based instrumentation requires
11026 a runtime library to enable MPX in hardware and handle bounds
11027 violation signals.  By default when @option{-fcheck-pointer-bounds}
11028 and @option{-mmpx} options are used to link a program, the GCC driver
11029 links against the @file{libmpx} and @file{libmpxwrappers} libraries.
11030 Bounds checking on calls to dynamic libraries requires a linker
11031 with @option{-z bndplt} support; if GCC was configured with a linker
11032 without support for this option (including the Gold linker and older
11033 versions of ld), a warning is given if you link with @option{-mmpx}
11034 without also specifying @option{-static}, since the overall effectiveness
11035 of the bounds checking protection is reduced.
11036 See also @option{-static-libmpxwrappers}.
11038 MPX-based instrumentation
11039 may be used for debugging and also may be included in production code
11040 to increase program security.  Depending on usage, you may
11041 have different requirements for the runtime library.  The current version
11042 of the MPX runtime library is more oriented for use as a debugging
11043 tool.  MPX runtime library usage implies @option{-lpthread}.  See
11044 also @option{-static-libmpx}.  The runtime library  behavior can be
11045 influenced using various @env{CHKP_RT_*} environment variables.  See
11046 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
11047 for more details.
11049 Generated instrumentation may be controlled by various
11050 @option{-fchkp-*} options and by the @code{bnd_variable_size}
11051 structure field attribute (@pxref{Type Attributes}) and
11052 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
11053 (@pxref{Function Attributes}).  GCC also provides a number of built-in
11054 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
11055 Bounds Checker builtins}, for more information.
11057 @item -fchkp-check-incomplete-type
11058 @opindex fchkp-check-incomplete-type
11059 @opindex fno-chkp-check-incomplete-type
11060 Generate pointer bounds checks for variables with incomplete type.
11061 Enabled by default.
11063 @item -fchkp-narrow-bounds
11064 @opindex fchkp-narrow-bounds
11065 @opindex fno-chkp-narrow-bounds
11066 Controls bounds used by Pointer Bounds Checker for pointers to object
11067 fields.  If narrowing is enabled then field bounds are used.  Otherwise
11068 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
11069 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
11071 @item -fchkp-first-field-has-own-bounds
11072 @opindex fchkp-first-field-has-own-bounds
11073 @opindex fno-chkp-first-field-has-own-bounds
11074 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
11075 first field in the structure.  By default a pointer to the first field has
11076 the same bounds as a pointer to the whole structure.
11078 @item -fchkp-flexible-struct-trailing-arrays
11079 @opindex fchkp-flexible-struct-trailing-arrays
11080 @opindex fno-chkp-flexible-struct-trailing-arrays
11081 Forces Pointer Bounds Checker to treat all trailing arrays in structures as
11082 possibly flexible.  By default only array fields with zero length or that are
11083 marked with attribute bnd_variable_size are treated as flexible.
11085 @item -fchkp-narrow-to-innermost-array
11086 @opindex fchkp-narrow-to-innermost-array
11087 @opindex fno-chkp-narrow-to-innermost-array
11088 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
11089 case of nested static array access.  By default this option is disabled and
11090 bounds of the outermost array are used.
11092 @item -fchkp-optimize
11093 @opindex fchkp-optimize
11094 @opindex fno-chkp-optimize
11095 Enables Pointer Bounds Checker optimizations.  Enabled by default at
11096 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
11098 @item -fchkp-use-fast-string-functions
11099 @opindex fchkp-use-fast-string-functions
11100 @opindex fno-chkp-use-fast-string-functions
11101 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
11102 by Pointer Bounds Checker.  Disabled by default.
11104 @item -fchkp-use-nochk-string-functions
11105 @opindex fchkp-use-nochk-string-functions
11106 @opindex fno-chkp-use-nochk-string-functions
11107 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
11108 by Pointer Bounds Checker.  Disabled by default.
11110 @item -fchkp-use-static-bounds
11111 @opindex fchkp-use-static-bounds
11112 @opindex fno-chkp-use-static-bounds
11113 Allow Pointer Bounds Checker to generate static bounds holding
11114 bounds of static variables.  Enabled by default.
11116 @item -fchkp-use-static-const-bounds
11117 @opindex fchkp-use-static-const-bounds
11118 @opindex fno-chkp-use-static-const-bounds
11119 Use statically-initialized bounds for constant bounds instead of
11120 generating them each time they are required.  By default enabled when
11121 @option{-fchkp-use-static-bounds} is enabled.
11123 @item -fchkp-treat-zero-dynamic-size-as-infinite
11124 @opindex fchkp-treat-zero-dynamic-size-as-infinite
11125 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
11126 With this option, objects with incomplete type whose
11127 dynamically-obtained size is zero are treated as having infinite size
11128 instead by Pointer Bounds
11129 Checker.  This option may be helpful if a program is linked with a library
11130 missing size information for some symbols.  Disabled by default.
11132 @item -fchkp-check-read
11133 @opindex fchkp-check-read
11134 @opindex fno-chkp-check-read
11135 Instructs Pointer Bounds Checker to generate checks for all read
11136 accesses to memory.  Enabled by default.
11138 @item -fchkp-check-write
11139 @opindex fchkp-check-write
11140 @opindex fno-chkp-check-write
11141 Instructs Pointer Bounds Checker to generate checks for all write
11142 accesses to memory.  Enabled by default.
11144 @item -fchkp-store-bounds
11145 @opindex fchkp-store-bounds
11146 @opindex fno-chkp-store-bounds
11147 Instructs Pointer Bounds Checker to generate bounds stores for
11148 pointer writes.  Enabled by default.
11150 @item -fchkp-instrument-calls
11151 @opindex fchkp-instrument-calls
11152 @opindex fno-chkp-instrument-calls
11153 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
11154 Enabled by default.
11156 @item -fchkp-instrument-marked-only
11157 @opindex fchkp-instrument-marked-only
11158 @opindex fno-chkp-instrument-marked-only
11159 Instructs Pointer Bounds Checker to instrument only functions
11160 marked with the @code{bnd_instrument} attribute
11161 (@pxref{Function Attributes}).  Disabled by default.
11163 @item -fchkp-use-wrappers
11164 @opindex fchkp-use-wrappers
11165 @opindex fno-chkp-use-wrappers
11166 Allows Pointer Bounds Checker to replace calls to built-in functions
11167 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
11168 is used to link a program, the GCC driver automatically links
11169 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
11170 Enabled by default.
11172 @item -fstack-protector
11173 @opindex fstack-protector
11174 Emit extra code to check for buffer overflows, such as stack smashing
11175 attacks.  This is done by adding a guard variable to functions with
11176 vulnerable objects.  This includes functions that call @code{alloca}, and
11177 functions with buffers larger than 8 bytes.  The guards are initialized
11178 when a function is entered and then checked when the function exits.
11179 If a guard check fails, an error message is printed and the program exits.
11181 @item -fstack-protector-all
11182 @opindex fstack-protector-all
11183 Like @option{-fstack-protector} except that all functions are protected.
11185 @item -fstack-protector-strong
11186 @opindex fstack-protector-strong
11187 Like @option{-fstack-protector} but includes additional functions to
11188 be protected --- those that have local array definitions, or have
11189 references to local frame addresses.
11191 @item -fstack-protector-explicit
11192 @opindex fstack-protector-explicit
11193 Like @option{-fstack-protector} but only protects those functions which
11194 have the @code{stack_protect} attribute.
11196 @item -fstack-check
11197 @opindex fstack-check
11198 Generate code to verify that you do not go beyond the boundary of the
11199 stack.  You should specify this flag if you are running in an
11200 environment with multiple threads, but you only rarely need to specify it in
11201 a single-threaded environment since stack overflow is automatically
11202 detected on nearly all systems if there is only one stack.
11204 Note that this switch does not actually cause checking to be done; the
11205 operating system or the language runtime must do that.  The switch causes
11206 generation of code to ensure that they see the stack being extended.
11208 You can additionally specify a string parameter: @samp{no} means no
11209 checking, @samp{generic} means force the use of old-style checking,
11210 @samp{specific} means use the best checking method and is equivalent
11211 to bare @option{-fstack-check}.
11213 Old-style checking is a generic mechanism that requires no specific
11214 target support in the compiler but comes with the following drawbacks:
11216 @enumerate
11217 @item
11218 Modified allocation strategy for large objects: they are always
11219 allocated dynamically if their size exceeds a fixed threshold.
11221 @item
11222 Fixed limit on the size of the static frame of functions: when it is
11223 topped by a particular function, stack checking is not reliable and
11224 a warning is issued by the compiler.
11226 @item
11227 Inefficiency: because of both the modified allocation strategy and the
11228 generic implementation, code performance is hampered.
11229 @end enumerate
11231 Note that old-style stack checking is also the fallback method for
11232 @samp{specific} if no target support has been added in the compiler.
11234 @item -fstack-limit-register=@var{reg}
11235 @itemx -fstack-limit-symbol=@var{sym}
11236 @itemx -fno-stack-limit
11237 @opindex fstack-limit-register
11238 @opindex fstack-limit-symbol
11239 @opindex fno-stack-limit
11240 Generate code to ensure that the stack does not grow beyond a certain value,
11241 either the value of a register or the address of a symbol.  If a larger
11242 stack is required, a signal is raised at run time.  For most targets,
11243 the signal is raised before the stack overruns the boundary, so
11244 it is possible to catch the signal without taking special precautions.
11246 For instance, if the stack starts at absolute address @samp{0x80000000}
11247 and grows downwards, you can use the flags
11248 @option{-fstack-limit-symbol=__stack_limit} and
11249 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
11250 of 128KB@.  Note that this may only work with the GNU linker.
11252 You can locally override stack limit checking by using the
11253 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
11255 @item -fsplit-stack
11256 @opindex fsplit-stack
11257 Generate code to automatically split the stack before it overflows.
11258 The resulting program has a discontiguous stack which can only
11259 overflow if the program is unable to allocate any more memory.  This
11260 is most useful when running threaded programs, as it is no longer
11261 necessary to calculate a good stack size to use for each thread.  This
11262 is currently only implemented for the x86 targets running
11263 GNU/Linux.
11265 When code compiled with @option{-fsplit-stack} calls code compiled
11266 without @option{-fsplit-stack}, there may not be much stack space
11267 available for the latter code to run.  If compiling all code,
11268 including library code, with @option{-fsplit-stack} is not an option,
11269 then the linker can fix up these calls so that the code compiled
11270 without @option{-fsplit-stack} always has a large stack.  Support for
11271 this is implemented in the gold linker in GNU binutils release 2.21
11272 and later.
11274 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
11275 @opindex fvtable-verify
11276 This option is only available when compiling C++ code.
11277 It turns on (or off, if using @option{-fvtable-verify=none}) the security
11278 feature that verifies at run time, for every virtual call, that
11279 the vtable pointer through which the call is made is valid for the type of
11280 the object, and has not been corrupted or overwritten.  If an invalid vtable
11281 pointer is detected at run time, an error is reported and execution of the
11282 program is immediately halted.
11284 This option causes run-time data structures to be built at program startup,
11285 which are used for verifying the vtable pointers.  
11286 The options @samp{std} and @samp{preinit}
11287 control the timing of when these data structures are built.  In both cases the
11288 data structures are built before execution reaches @code{main}.  Using
11289 @option{-fvtable-verify=std} causes the data structures to be built after
11290 shared libraries have been loaded and initialized.
11291 @option{-fvtable-verify=preinit} causes them to be built before shared
11292 libraries have been loaded and initialized.
11294 If this option appears multiple times in the command line with different
11295 values specified, @samp{none} takes highest priority over both @samp{std} and
11296 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
11298 @item -fvtv-debug
11299 @opindex fvtv-debug
11300 When used in conjunction with @option{-fvtable-verify=std} or 
11301 @option{-fvtable-verify=preinit}, causes debug versions of the 
11302 runtime functions for the vtable verification feature to be called.  
11303 This flag also causes the compiler to log information about which 
11304 vtable pointers it finds for each class.
11305 This information is written to a file named @file{vtv_set_ptr_data.log} 
11306 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
11307 if that is defined or the current working directory otherwise.
11309 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
11310 file, be sure to delete any existing one.
11312 @item -fvtv-counts
11313 @opindex fvtv-counts
11314 This is a debugging flag.  When used in conjunction with
11315 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
11316 causes the compiler to keep track of the total number of virtual calls
11317 it encounters and the number of verifications it inserts.  It also
11318 counts the number of calls to certain run-time library functions
11319 that it inserts and logs this information for each compilation unit.
11320 The compiler writes this information to a file named
11321 @file{vtv_count_data.log} in the directory named by the environment
11322 variable @env{VTV_LOGS_DIR} if that is defined or the current working
11323 directory otherwise.  It also counts the size of the vtable pointer sets
11324 for each class, and writes this information to @file{vtv_class_set_sizes.log}
11325 in the same directory.
11327 Note:  This feature @emph{appends} data to the log files.  To get fresh log
11328 files, be sure to delete any existing ones.
11330 @item -finstrument-functions
11331 @opindex finstrument-functions
11332 Generate instrumentation calls for entry and exit to functions.  Just
11333 after function entry and just before function exit, the following
11334 profiling functions are called with the address of the current
11335 function and its call site.  (On some platforms,
11336 @code{__builtin_return_address} does not work beyond the current
11337 function, so the call site information may not be available to the
11338 profiling functions otherwise.)
11340 @smallexample
11341 void __cyg_profile_func_enter (void *this_fn,
11342                                void *call_site);
11343 void __cyg_profile_func_exit  (void *this_fn,
11344                                void *call_site);
11345 @end smallexample
11347 The first argument is the address of the start of the current function,
11348 which may be looked up exactly in the symbol table.
11350 This instrumentation is also done for functions expanded inline in other
11351 functions.  The profiling calls indicate where, conceptually, the
11352 inline function is entered and exited.  This means that addressable
11353 versions of such functions must be available.  If all your uses of a
11354 function are expanded inline, this may mean an additional expansion of
11355 code size.  If you use @code{extern inline} in your C code, an
11356 addressable version of such functions must be provided.  (This is
11357 normally the case anyway, but if you get lucky and the optimizer always
11358 expands the functions inline, you might have gotten away without
11359 providing static copies.)
11361 A function may be given the attribute @code{no_instrument_function}, in
11362 which case this instrumentation is not done.  This can be used, for
11363 example, for the profiling functions listed above, high-priority
11364 interrupt routines, and any functions from which the profiling functions
11365 cannot safely be called (perhaps signal handlers, if the profiling
11366 routines generate output or allocate memory).
11368 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
11369 @opindex finstrument-functions-exclude-file-list
11371 Set the list of functions that are excluded from instrumentation (see
11372 the description of @option{-finstrument-functions}).  If the file that
11373 contains a function definition matches with one of @var{file}, then
11374 that function is not instrumented.  The match is done on substrings:
11375 if the @var{file} parameter is a substring of the file name, it is
11376 considered to be a match.
11378 For example:
11380 @smallexample
11381 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
11382 @end smallexample
11384 @noindent
11385 excludes any inline function defined in files whose pathnames
11386 contain @file{/bits/stl} or @file{include/sys}.
11388 If, for some reason, you want to include letter @samp{,} in one of
11389 @var{sym}, write @samp{\,}. For example,
11390 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
11391 (note the single quote surrounding the option).
11393 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
11394 @opindex finstrument-functions-exclude-function-list
11396 This is similar to @option{-finstrument-functions-exclude-file-list},
11397 but this option sets the list of function names to be excluded from
11398 instrumentation.  The function name to be matched is its user-visible
11399 name, such as @code{vector<int> blah(const vector<int> &)}, not the
11400 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
11401 match is done on substrings: if the @var{sym} parameter is a substring
11402 of the function name, it is considered to be a match.  For C99 and C++
11403 extended identifiers, the function name must be given in UTF-8, not
11404 using universal character names.
11406 @end table
11409 @node Preprocessor Options
11410 @section Options Controlling the Preprocessor
11411 @cindex preprocessor options
11412 @cindex options, preprocessor
11414 These options control the C preprocessor, which is run on each C source
11415 file before actual compilation.
11417 If you use the @option{-E} option, nothing is done except preprocessing.
11418 Some of these options make sense only together with @option{-E} because
11419 they cause the preprocessor output to be unsuitable for actual
11420 compilation.
11422 In addition to the options listed here, there are a number of options 
11423 to control search paths for include files documented in 
11424 @ref{Directory Options}.  
11425 Options to control preprocessor diagnostics are listed in 
11426 @ref{Warning Options}.
11428 @table @gcctabopt
11429 @include cppopts.texi
11431 @item -Wp,@var{option}
11432 @opindex Wp
11433 You can use @option{-Wp,@var{option}} to bypass the compiler driver
11434 and pass @var{option} directly through to the preprocessor.  If
11435 @var{option} contains commas, it is split into multiple options at the
11436 commas.  However, many options are modified, translated or interpreted
11437 by the compiler driver before being passed to the preprocessor, and
11438 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
11439 interface is undocumented and subject to change, so whenever possible
11440 you should avoid using @option{-Wp} and let the driver handle the
11441 options instead.
11443 @item -Xpreprocessor @var{option}
11444 @opindex Xpreprocessor
11445 Pass @var{option} as an option to the preprocessor.  You can use this to
11446 supply system-specific preprocessor options that GCC does not 
11447 recognize.
11449 If you want to pass an option that takes an argument, you must use
11450 @option{-Xpreprocessor} twice, once for the option and once for the argument.
11452 @item -no-integrated-cpp
11453 @opindex no-integrated-cpp
11454 Perform preprocessing as a separate pass before compilation.
11455 By default, GCC performs preprocessing as an integrated part of
11456 input tokenization and parsing.
11457 If this option is provided, the appropriate language front end
11458 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
11459 and Objective-C, respectively) is instead invoked twice,
11460 once for preprocessing only and once for actual compilation
11461 of the preprocessed input.
11462 This option may be useful in conjunction with the @option{-B} or
11463 @option{-wrapper} options to specify an alternate preprocessor or
11464 perform additional processing of the program source between
11465 normal preprocessing and compilation.
11467 @end table
11469 @node Assembler Options
11470 @section Passing Options to the Assembler
11472 @c prevent bad page break with this line
11473 You can pass options to the assembler.
11475 @table @gcctabopt
11476 @item -Wa,@var{option}
11477 @opindex Wa
11478 Pass @var{option} as an option to the assembler.  If @var{option}
11479 contains commas, it is split into multiple options at the commas.
11481 @item -Xassembler @var{option}
11482 @opindex Xassembler
11483 Pass @var{option} as an option to the assembler.  You can use this to
11484 supply system-specific assembler options that GCC does not
11485 recognize.
11487 If you want to pass an option that takes an argument, you must use
11488 @option{-Xassembler} twice, once for the option and once for the argument.
11490 @end table
11492 @node Link Options
11493 @section Options for Linking
11494 @cindex link options
11495 @cindex options, linking
11497 These options come into play when the compiler links object files into
11498 an executable output file.  They are meaningless if the compiler is
11499 not doing a link step.
11501 @table @gcctabopt
11502 @cindex file names
11503 @item @var{object-file-name}
11504 A file name that does not end in a special recognized suffix is
11505 considered to name an object file or library.  (Object files are
11506 distinguished from libraries by the linker according to the file
11507 contents.)  If linking is done, these object files are used as input
11508 to the linker.
11510 @item -c
11511 @itemx -S
11512 @itemx -E
11513 @opindex c
11514 @opindex S
11515 @opindex E
11516 If any of these options is used, then the linker is not run, and
11517 object file names should not be used as arguments.  @xref{Overall
11518 Options}.
11520 @item -fuse-ld=bfd
11521 @opindex fuse-ld=bfd
11522 Use the @command{bfd} linker instead of the default linker.
11524 @item -fuse-ld=gold
11525 @opindex fuse-ld=gold
11526 Use the @command{gold} linker instead of the default linker.
11528 @cindex Libraries
11529 @item -l@var{library}
11530 @itemx -l @var{library}
11531 @opindex l
11532 Search the library named @var{library} when linking.  (The second
11533 alternative with the library as a separate argument is only for
11534 POSIX compliance and is not recommended.)
11536 It makes a difference where in the command you write this option; the
11537 linker searches and processes libraries and object files in the order they
11538 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
11539 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
11540 to functions in @samp{z}, those functions may not be loaded.
11542 The linker searches a standard list of directories for the library,
11543 which is actually a file named @file{lib@var{library}.a}.  The linker
11544 then uses this file as if it had been specified precisely by name.
11546 The directories searched include several standard system directories
11547 plus any that you specify with @option{-L}.
11549 Normally the files found this way are library files---archive files
11550 whose members are object files.  The linker handles an archive file by
11551 scanning through it for members which define symbols that have so far
11552 been referenced but not defined.  But if the file that is found is an
11553 ordinary object file, it is linked in the usual fashion.  The only
11554 difference between using an @option{-l} option and specifying a file name
11555 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
11556 and searches several directories.
11558 @item -lobjc
11559 @opindex lobjc
11560 You need this special case of the @option{-l} option in order to
11561 link an Objective-C or Objective-C++ program.
11563 @item -nostartfiles
11564 @opindex nostartfiles
11565 Do not use the standard system startup files when linking.
11566 The standard system libraries are used normally, unless @option{-nostdlib}
11567 or @option{-nodefaultlibs} is used.
11569 @item -nodefaultlibs
11570 @opindex nodefaultlibs
11571 Do not use the standard system libraries when linking.
11572 Only the libraries you specify are passed to the linker, and options
11573 specifying linkage of the system libraries, such as @option{-static-libgcc}
11574 or @option{-shared-libgcc}, are ignored.  
11575 The standard startup files are used normally, unless @option{-nostartfiles}
11576 is used.  
11578 The compiler may generate calls to @code{memcmp},
11579 @code{memset}, @code{memcpy} and @code{memmove}.
11580 These entries are usually resolved by entries in
11581 libc.  These entry points should be supplied through some other
11582 mechanism when this option is specified.
11584 @item -nostdlib
11585 @opindex nostdlib
11586 Do not use the standard system startup files or libraries when linking.
11587 No startup files and only the libraries you specify are passed to
11588 the linker, and options specifying linkage of the system libraries, such as
11589 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
11591 The compiler may generate calls to @code{memcmp}, @code{memset},
11592 @code{memcpy} and @code{memmove}.
11593 These entries are usually resolved by entries in
11594 libc.  These entry points should be supplied through some other
11595 mechanism when this option is specified.
11597 @cindex @option{-lgcc}, use with @option{-nostdlib}
11598 @cindex @option{-nostdlib} and unresolved references
11599 @cindex unresolved references and @option{-nostdlib}
11600 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
11601 @cindex @option{-nodefaultlibs} and unresolved references
11602 @cindex unresolved references and @option{-nodefaultlibs}
11603 One of the standard libraries bypassed by @option{-nostdlib} and
11604 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
11605 which GCC uses to overcome shortcomings of particular machines, or special
11606 needs for some languages.
11607 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
11608 Collection (GCC) Internals},
11609 for more discussion of @file{libgcc.a}.)
11610 In most cases, you need @file{libgcc.a} even when you want to avoid
11611 other standard libraries.  In other words, when you specify @option{-nostdlib}
11612 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
11613 This ensures that you have no unresolved references to internal GCC
11614 library subroutines.
11615 (An example of such an internal subroutine is @code{__main}, used to ensure C++
11616 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
11617 GNU Compiler Collection (GCC) Internals}.)
11619 @item -pie
11620 @opindex pie
11621 Produce a position independent executable on targets that support it.
11622 For predictable results, you must also specify the same set of options
11623 used for compilation (@option{-fpie}, @option{-fPIE},
11624 or model suboptions) when you specify this linker option.
11626 @item -no-pie
11627 @opindex no-pie
11628 Don't produce a position independent executable.
11630 @item -pthread
11631 @opindex pthread
11632 Link with the POSIX threads library.  This option is supported on 
11633 GNU/Linux targets, most other Unix derivatives, and also on 
11634 x86 Cygwin and MinGW targets.  On some targets this option also sets 
11635 flags for the preprocessor, so it should be used consistently for both
11636 compilation and linking.
11638 @item -rdynamic
11639 @opindex rdynamic
11640 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
11641 that support it. This instructs the linker to add all symbols, not
11642 only used ones, to the dynamic symbol table. This option is needed
11643 for some uses of @code{dlopen} or to allow obtaining backtraces
11644 from within a program.
11646 @item -s
11647 @opindex s
11648 Remove all symbol table and relocation information from the executable.
11650 @item -static
11651 @opindex static
11652 On systems that support dynamic linking, this prevents linking with the shared
11653 libraries.  On other systems, this option has no effect.
11655 @item -shared
11656 @opindex shared
11657 Produce a shared object which can then be linked with other objects to
11658 form an executable.  Not all systems support this option.  For predictable
11659 results, you must also specify the same set of options used for compilation
11660 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
11661 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
11662 needs to build supplementary stub code for constructors to work.  On
11663 multi-libbed systems, @samp{gcc -shared} must select the correct support
11664 libraries to link against.  Failing to supply the correct flags may lead
11665 to subtle defects.  Supplying them in cases where they are not necessary
11666 is innocuous.}
11668 @item -shared-libgcc
11669 @itemx -static-libgcc
11670 @opindex shared-libgcc
11671 @opindex static-libgcc
11672 On systems that provide @file{libgcc} as a shared library, these options
11673 force the use of either the shared or static version, respectively.
11674 If no shared version of @file{libgcc} was built when the compiler was
11675 configured, these options have no effect.
11677 There are several situations in which an application should use the
11678 shared @file{libgcc} instead of the static version.  The most common
11679 of these is when the application wishes to throw and catch exceptions
11680 across different shared libraries.  In that case, each of the libraries
11681 as well as the application itself should use the shared @file{libgcc}.
11683 Therefore, the G++ and driver automatically adds @option{-shared-libgcc}
11684  whenever you build a shared library or a main executable, because C++
11685  programs typically use exceptions, so this is the right thing to do.
11687 If, instead, you use the GCC driver to create shared libraries, you may
11688 find that they are not always linked with the shared @file{libgcc}.
11689 If GCC finds, at its configuration time, that you have a non-GNU linker
11690 or a GNU linker that does not support option @option{--eh-frame-hdr},
11691 it links the shared version of @file{libgcc} into shared libraries
11692 by default.  Otherwise, it takes advantage of the linker and optimizes
11693 away the linking with the shared version of @file{libgcc}, linking with
11694 the static version of libgcc by default.  This allows exceptions to
11695 propagate through such shared libraries, without incurring relocation
11696 costs at library load time.
11698 However, if a library or main executable is supposed to throw or catch
11699 exceptions, you must link it using the G++ driver, as appropriate
11700 for the languages used in the program, or using the option
11701 @option{-shared-libgcc}, such that it is linked with the shared
11702 @file{libgcc}.
11704 @item -static-libasan
11705 @opindex static-libasan
11706 When the @option{-fsanitize=address} option is used to link a program,
11707 the GCC driver automatically links against @option{libasan}.  If
11708 @file{libasan} is available as a shared library, and the @option{-static}
11709 option is not used, then this links against the shared version of
11710 @file{libasan}.  The @option{-static-libasan} option directs the GCC
11711 driver to link @file{libasan} statically, without necessarily linking
11712 other libraries statically.
11714 @item -static-libtsan
11715 @opindex static-libtsan
11716 When the @option{-fsanitize=thread} option is used to link a program,
11717 the GCC driver automatically links against @option{libtsan}.  If
11718 @file{libtsan} is available as a shared library, and the @option{-static}
11719 option is not used, then this links against the shared version of
11720 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
11721 driver to link @file{libtsan} statically, without necessarily linking
11722 other libraries statically.
11724 @item -static-liblsan
11725 @opindex static-liblsan
11726 When the @option{-fsanitize=leak} option is used to link a program,
11727 the GCC driver automatically links against @option{liblsan}.  If
11728 @file{liblsan} is available as a shared library, and the @option{-static}
11729 option is not used, then this links against the shared version of
11730 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
11731 driver to link @file{liblsan} statically, without necessarily linking
11732 other libraries statically.
11734 @item -static-libubsan
11735 @opindex static-libubsan
11736 When the @option{-fsanitize=undefined} option is used to link a program,
11737 the GCC driver automatically links against @option{libubsan}.  If
11738 @file{libubsan} is available as a shared library, and the @option{-static}
11739 option is not used, then this links against the shared version of
11740 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
11741 driver to link @file{libubsan} statically, without necessarily linking
11742 other libraries statically.
11744 @item -static-libmpx
11745 @opindex static-libmpx
11746 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
11747 used to link a program, the GCC driver automatically links against
11748 @file{libmpx}.  If @file{libmpx} is available as a shared library,
11749 and the @option{-static} option is not used, then this links against
11750 the shared version of @file{libmpx}.  The @option{-static-libmpx}
11751 option directs the GCC driver to link @file{libmpx} statically,
11752 without necessarily linking other libraries statically.
11754 @item -static-libmpxwrappers
11755 @opindex static-libmpxwrappers
11756 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
11757 to link a program without also using @option{-fno-chkp-use-wrappers}, the
11758 GCC driver automatically links against @file{libmpxwrappers}.  If
11759 @file{libmpxwrappers} is available as a shared library, and the
11760 @option{-static} option is not used, then this links against the shared
11761 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
11762 option directs the GCC driver to link @file{libmpxwrappers} statically,
11763 without necessarily linking other libraries statically.
11765 @item -static-libstdc++
11766 @opindex static-libstdc++
11767 When the @command{g++} program is used to link a C++ program, it
11768 normally automatically links against @option{libstdc++}.  If
11769 @file{libstdc++} is available as a shared library, and the
11770 @option{-static} option is not used, then this links against the
11771 shared version of @file{libstdc++}.  That is normally fine.  However, it
11772 is sometimes useful to freeze the version of @file{libstdc++} used by
11773 the program without going all the way to a fully static link.  The
11774 @option{-static-libstdc++} option directs the @command{g++} driver to
11775 link @file{libstdc++} statically, without necessarily linking other
11776 libraries statically.
11778 @item -symbolic
11779 @opindex symbolic
11780 Bind references to global symbols when building a shared object.  Warn
11781 about any unresolved references (unless overridden by the link editor
11782 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
11783 this option.
11785 @item -T @var{script}
11786 @opindex T
11787 @cindex linker script
11788 Use @var{script} as the linker script.  This option is supported by most
11789 systems using the GNU linker.  On some targets, such as bare-board
11790 targets without an operating system, the @option{-T} option may be required
11791 when linking to avoid references to undefined symbols.
11793 @item -Xlinker @var{option}
11794 @opindex Xlinker
11795 Pass @var{option} as an option to the linker.  You can use this to
11796 supply system-specific linker options that GCC does not recognize.
11798 If you want to pass an option that takes a separate argument, you must use
11799 @option{-Xlinker} twice, once for the option and once for the argument.
11800 For example, to pass @option{-assert definitions}, you must write
11801 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
11802 @option{-Xlinker "-assert definitions"}, because this passes the entire
11803 string as a single argument, which is not what the linker expects.
11805 When using the GNU linker, it is usually more convenient to pass
11806 arguments to linker options using the @option{@var{option}=@var{value}}
11807 syntax than as separate arguments.  For example, you can specify
11808 @option{-Xlinker -Map=output.map} rather than
11809 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
11810 this syntax for command-line options.
11812 @item -Wl,@var{option}
11813 @opindex Wl
11814 Pass @var{option} as an option to the linker.  If @var{option} contains
11815 commas, it is split into multiple options at the commas.  You can use this
11816 syntax to pass an argument to the option.
11817 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
11818 linker.  When using the GNU linker, you can also get the same effect with
11819 @option{-Wl,-Map=output.map}.
11821 @item -u @var{symbol}
11822 @opindex u
11823 Pretend the symbol @var{symbol} is undefined, to force linking of
11824 library modules to define it.  You can use @option{-u} multiple times with
11825 different symbols to force loading of additional library modules.
11827 @item -z @var{keyword}
11828 @opindex z
11829 @option{-z} is passed directly on to the linker along with the keyword
11830 @var{keyword}. See the section in the documentation of your linker for
11831 permitted values and their meanings.
11832 @end table
11834 @node Directory Options
11835 @section Options for Directory Search
11836 @cindex directory options
11837 @cindex options, directory search
11838 @cindex search path
11840 These options specify directories to search for header files, for
11841 libraries and for parts of the compiler:
11843 @table @gcctabopt
11844 @include cppdiropts.texi
11846 @item -iplugindir=@var{dir}
11847 @opindex iplugindir=
11848 Set the directory to search for plugins that are passed
11849 by @option{-fplugin=@var{name}} instead of
11850 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
11851 to be used by the user, but only passed by the driver.
11853 @item -L@var{dir}
11854 @opindex L
11855 Add directory @var{dir} to the list of directories to be searched
11856 for @option{-l}.
11858 @item -B@var{prefix}
11859 @opindex B
11860 This option specifies where to find the executables, libraries,
11861 include files, and data files of the compiler itself.
11863 The compiler driver program runs one or more of the subprograms
11864 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
11865 @var{prefix} as a prefix for each program it tries to run, both with and
11866 without @samp{@var{machine}/@var{version}/} for the corresponding target
11867 machine and compiler version.
11869 For each subprogram to be run, the compiler driver first tries the
11870 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
11871 is not specified, the driver tries two standard prefixes, 
11872 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
11873 those results in a file name that is found, the unmodified program
11874 name is searched for using the directories specified in your
11875 @env{PATH} environment variable.
11877 The compiler checks to see if the path provided by @option{-B}
11878 refers to a directory, and if necessary it adds a directory
11879 separator character at the end of the path.
11881 @option{-B} prefixes that effectively specify directory names also apply
11882 to libraries in the linker, because the compiler translates these
11883 options into @option{-L} options for the linker.  They also apply to
11884 include files in the preprocessor, because the compiler translates these
11885 options into @option{-isystem} options for the preprocessor.  In this case,
11886 the compiler appends @samp{include} to the prefix.
11888 The runtime support file @file{libgcc.a} can also be searched for using
11889 the @option{-B} prefix, if needed.  If it is not found there, the two
11890 standard prefixes above are tried, and that is all.  The file is left
11891 out of the link if it is not found by those means.
11893 Another way to specify a prefix much like the @option{-B} prefix is to use
11894 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11895 Variables}.
11897 As a special kludge, if the path provided by @option{-B} is
11898 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11899 9, then it is replaced by @file{[dir/]include}.  This is to help
11900 with boot-strapping the compiler.
11902 @item -no-canonical-prefixes
11903 @opindex no-canonical-prefixes
11904 Do not expand any symbolic links, resolve references to @samp{/../}
11905 or @samp{/./}, or make the path absolute when generating a relative
11906 prefix.
11908 @item --sysroot=@var{dir}
11909 @opindex sysroot
11910 Use @var{dir} as the logical root directory for headers and libraries.
11911 For example, if the compiler normally searches for headers in
11912 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11913 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11915 If you use both this option and the @option{-isysroot} option, then
11916 the @option{--sysroot} option applies to libraries, but the
11917 @option{-isysroot} option applies to header files.
11919 The GNU linker (beginning with version 2.16) has the necessary support
11920 for this option.  If your linker does not support this option, the
11921 header file aspect of @option{--sysroot} still works, but the
11922 library aspect does not.
11924 @item --no-sysroot-suffix
11925 @opindex no-sysroot-suffix
11926 For some targets, a suffix is added to the root directory specified
11927 with @option{--sysroot}, depending on the other options used, so that
11928 headers may for example be found in
11929 @file{@var{dir}/@var{suffix}/usr/include} instead of
11930 @file{@var{dir}/usr/include}.  This option disables the addition of
11931 such a suffix.
11933 @end table
11935 @node Code Gen Options
11936 @section Options for Code Generation Conventions
11937 @cindex code generation conventions
11938 @cindex options, code generation
11939 @cindex run-time options
11941 These machine-independent options control the interface conventions
11942 used in code generation.
11944 Most of them have both positive and negative forms; the negative form
11945 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
11946 one of the forms is listed---the one that is not the default.  You
11947 can figure out the other form by either removing @samp{no-} or adding
11950 @table @gcctabopt
11951 @item -fstack-reuse=@var{reuse-level}
11952 @opindex fstack_reuse
11953 This option controls stack space reuse for user declared local/auto variables
11954 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
11955 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
11956 local variables and temporaries, @samp{named_vars} enables the reuse only for
11957 user defined local variables with names, and @samp{none} disables stack reuse
11958 completely. The default value is @samp{all}. The option is needed when the
11959 program extends the lifetime of a scoped local variable or a compiler generated
11960 temporary beyond the end point defined by the language.  When a lifetime of
11961 a variable ends, and if the variable lives in memory, the optimizing compiler
11962 has the freedom to reuse its stack space with other temporaries or scoped
11963 local variables whose live range does not overlap with it. Legacy code extending
11964 local lifetime is likely to break with the stack reuse optimization.
11966 For example,
11968 @smallexample
11969    int *p;
11970    @{
11971      int local1;
11973      p = &local1;
11974      local1 = 10;
11975      ....
11976    @}
11977    @{
11978       int local2;
11979       local2 = 20;
11980       ...
11981    @}
11983    if (*p == 10)  // out of scope use of local1
11984      @{
11986      @}
11987 @end smallexample
11989 Another example:
11990 @smallexample
11992    struct A
11993    @{
11994        A(int k) : i(k), j(k) @{ @}
11995        int i;
11996        int j;
11997    @};
11999    A *ap;
12001    void foo(const A& ar)
12002    @{
12003       ap = &ar;
12004    @}
12006    void bar()
12007    @{
12008       foo(A(10)); // temp object's lifetime ends when foo returns
12010       @{
12011         A a(20);
12012         ....
12013       @}
12014       ap->i+= 10;  // ap references out of scope temp whose space
12015                    // is reused with a. What is the value of ap->i?
12016    @}
12018 @end smallexample
12020 The lifetime of a compiler generated temporary is well defined by the C++
12021 standard. When a lifetime of a temporary ends, and if the temporary lives
12022 in memory, the optimizing compiler has the freedom to reuse its stack
12023 space with other temporaries or scoped local variables whose live range
12024 does not overlap with it. However some of the legacy code relies on
12025 the behavior of older compilers in which temporaries' stack space is
12026 not reused, the aggressive stack reuse can lead to runtime errors. This
12027 option is used to control the temporary stack reuse optimization.
12029 @item -ftrapv
12030 @opindex ftrapv
12031 This option generates traps for signed overflow on addition, subtraction,
12032 multiplication operations.
12033 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12034 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12035 @option{-fwrapv} being effective.  Note that only active options override, so
12036 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12037 results in @option{-ftrapv} being effective.
12039 @item -fwrapv
12040 @opindex fwrapv
12041 This option instructs the compiler to assume that signed arithmetic
12042 overflow of addition, subtraction and multiplication wraps around
12043 using twos-complement representation.  This flag enables some optimizations
12044 and disables others.
12045 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
12046 @option{-ftrapv} @option{-fwrapv} on the command-line results in
12047 @option{-fwrapv} being effective.  Note that only active options override, so
12048 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
12049 results in @option{-ftrapv} being effective.
12051 @item -fexceptions
12052 @opindex fexceptions
12053 Enable exception handling.  Generates extra code needed to propagate
12054 exceptions.  For some targets, this implies GCC generates frame
12055 unwind information for all functions, which can produce significant data
12056 size overhead, although it does not affect execution.  If you do not
12057 specify this option, GCC enables it by default for languages like
12058 C++ that normally require exception handling, and disables it for
12059 languages like C that do not normally require it.  However, you may need
12060 to enable this option when compiling C code that needs to interoperate
12061 properly with exception handlers written in C++.  You may also wish to
12062 disable this option if you are compiling older C++ programs that don't
12063 use exception handling.
12065 @item -fnon-call-exceptions
12066 @opindex fnon-call-exceptions
12067 Generate code that allows trapping instructions to throw exceptions.
12068 Note that this requires platform-specific runtime support that does
12069 not exist everywhere.  Moreover, it only allows @emph{trapping}
12070 instructions to throw exceptions, i.e.@: memory references or floating-point
12071 instructions.  It does not allow exceptions to be thrown from
12072 arbitrary signal handlers such as @code{SIGALRM}.
12074 @item -fdelete-dead-exceptions
12075 @opindex fdelete-dead-exceptions
12076 Consider that instructions that may throw exceptions but don't otherwise
12077 contribute to the execution of the program can be optimized away.
12078 This option is enabled by default for the Ada front end, as permitted by
12079 the Ada language specification.
12080 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
12082 @item -funwind-tables
12083 @opindex funwind-tables
12084 Similar to @option{-fexceptions}, except that it just generates any needed
12085 static data, but does not affect the generated code in any other way.
12086 You normally do not need to enable this option; instead, a language processor
12087 that needs this handling enables it on your behalf.
12089 @item -fasynchronous-unwind-tables
12090 @opindex fasynchronous-unwind-tables
12091 Generate unwind table in DWARF format, if supported by target machine.  The
12092 table is exact at each instruction boundary, so it can be used for stack
12093 unwinding from asynchronous events (such as debugger or garbage collector).
12095 @item -fno-gnu-unique
12096 @opindex fno-gnu-unique
12097 On systems with recent GNU assembler and C library, the C++ compiler
12098 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
12099 of template static data members and static local variables in inline
12100 functions are unique even in the presence of @code{RTLD_LOCAL}; this
12101 is necessary to avoid problems with a library used by two different
12102 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
12103 therefore disagreeing with the other one about the binding of the
12104 symbol.  But this causes @code{dlclose} to be ignored for affected
12105 DSOs; if your program relies on reinitialization of a DSO via
12106 @code{dlclose} and @code{dlopen}, you can use
12107 @option{-fno-gnu-unique}.
12109 @item -fpcc-struct-return
12110 @opindex fpcc-struct-return
12111 Return ``short'' @code{struct} and @code{union} values in memory like
12112 longer ones, rather than in registers.  This convention is less
12113 efficient, but it has the advantage of allowing intercallability between
12114 GCC-compiled files and files compiled with other compilers, particularly
12115 the Portable C Compiler (pcc).
12117 The precise convention for returning structures in memory depends
12118 on the target configuration macros.
12120 Short structures and unions are those whose size and alignment match
12121 that of some integer type.
12123 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
12124 switch is not binary compatible with code compiled with the
12125 @option{-freg-struct-return} switch.
12126 Use it to conform to a non-default application binary interface.
12128 @item -freg-struct-return
12129 @opindex freg-struct-return
12130 Return @code{struct} and @code{union} values in registers when possible.
12131 This is more efficient for small structures than
12132 @option{-fpcc-struct-return}.
12134 If you specify neither @option{-fpcc-struct-return} nor
12135 @option{-freg-struct-return}, GCC defaults to whichever convention is
12136 standard for the target.  If there is no standard convention, GCC
12137 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
12138 the principal compiler.  In those cases, we can choose the standard, and
12139 we chose the more efficient register return alternative.
12141 @strong{Warning:} code compiled with the @option{-freg-struct-return}
12142 switch is not binary compatible with code compiled with the
12143 @option{-fpcc-struct-return} switch.
12144 Use it to conform to a non-default application binary interface.
12146 @item -fshort-enums
12147 @opindex fshort-enums
12148 Allocate to an @code{enum} type only as many bytes as it needs for the
12149 declared range of possible values.  Specifically, the @code{enum} type
12150 is equivalent to the smallest integer type that has enough room.
12152 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
12153 code that is not binary compatible with code generated without that switch.
12154 Use it to conform to a non-default application binary interface.
12156 @item -fshort-wchar
12157 @opindex fshort-wchar
12158 Override the underlying type for @code{wchar_t} to be @code{short
12159 unsigned int} instead of the default for the target.  This option is
12160 useful for building programs to run under WINE@.
12162 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
12163 code that is not binary compatible with code generated without that switch.
12164 Use it to conform to a non-default application binary interface.
12166 @item -fno-common
12167 @opindex fno-common
12168 @cindex tentative definitions
12169 In C code, this option controls the placement of global variables 
12170 defined without an initializer, known as @dfn{tentative definitions} 
12171 in the C standard.  Tentative definitions are distinct from declarations 
12172 of a variable with the @code{extern} keyword, which do not allocate storage.
12174 Unix C compilers have traditionally allocated storage for
12175 uninitialized global variables in a common block.  This allows the
12176 linker to resolve all tentative definitions of the same variable
12177 in different compilation units to the same object, or to a non-tentative
12178 definition.  
12179 This is the behavior specified by @option{-fcommon}, and is the default for 
12180 GCC on most targets.  
12181 On the other hand, this behavior is not required by ISO
12182 C, and on some targets may carry a speed or code size penalty on
12183 variable references.
12185 The @option{-fno-common} option specifies that the compiler should instead
12186 place uninitialized global variables in the data section of the object file.
12187 This inhibits the merging of tentative definitions by the linker so
12188 you get a multiple-definition error if the same 
12189 variable is defined in more than one compilation unit.
12190 Compiling with @option{-fno-common} is useful on targets for which
12191 it provides better performance, or if you wish to verify that the
12192 program will work on other systems that always treat uninitialized
12193 variable definitions this way.
12195 @item -fno-ident
12196 @opindex fno-ident
12197 Ignore the @code{#ident} directive.
12199 @item -finhibit-size-directive
12200 @opindex finhibit-size-directive
12201 Don't output a @code{.size} assembler directive, or anything else that
12202 would cause trouble if the function is split in the middle, and the
12203 two halves are placed at locations far apart in memory.  This option is
12204 used when compiling @file{crtstuff.c}; you should not need to use it
12205 for anything else.
12207 @item -fverbose-asm
12208 @opindex fverbose-asm
12209 Put extra commentary information in the generated assembly code to
12210 make it more readable.  This option is generally only of use to those
12211 who actually need to read the generated assembly code (perhaps while
12212 debugging the compiler itself).
12214 @option{-fno-verbose-asm}, the default, causes the
12215 extra information to be omitted and is useful when comparing two assembler
12216 files.
12218 The added comments include:
12220 @itemize @bullet
12222 @item
12223 information on the compiler version and command-line options,
12225 @item
12226 the source code lines associated with the assembly instructions,
12227 in the form FILENAME:LINENUMBER:CONTENT OF LINE,
12229 @item
12230 hints on which high-level expressions correspond to
12231 the various assembly instruction operands.
12233 @end itemize
12235 For example, given this C source file:
12237 @smallexample
12238 int test (int n)
12240   int i;
12241   int total = 0;
12243   for (i = 0; i < n; i++)
12244     total += i * i;
12246   return total;
12248 @end smallexample
12250 compiling to (x86_64) assembly via @option{-S} and emitting the result
12251 direct to stdout via @option{-o} @option{-}
12253 @smallexample
12254 gcc -S test.c -fverbose-asm -Os -o -
12255 @end smallexample
12257 gives output similar to this:
12259 @smallexample
12260         .file   "test.c"
12261 # GNU C11 (GCC) version 7.0.0 20160809 (experimental) (x86_64-pc-linux-gnu)
12262   [...snip...]
12263 # options passed:
12264   [...snip...]
12266         .text
12267         .globl  test
12268         .type   test, @@function
12269 test:
12270 .LFB0:
12271         .cfi_startproc
12272 # test.c:4:   int total = 0;
12273         xorl    %eax, %eax      # <retval>
12274 # test.c:6:   for (i = 0; i < n; i++)
12275         xorl    %edx, %edx      # i
12276 .L2:
12277 # test.c:6:   for (i = 0; i < n; i++)
12278         cmpl    %edi, %edx      # n, i
12279         jge     .L5     #,
12280 # test.c:7:     total += i * i;
12281         movl    %edx, %ecx      # i, tmp92
12282         imull   %edx, %ecx      # i, tmp92
12283 # test.c:6:   for (i = 0; i < n; i++)
12284         incl    %edx    # i
12285 # test.c:7:     total += i * i;
12286         addl    %ecx, %eax      # tmp92, <retval>
12287         jmp     .L2     #
12288 .L5:
12289 # test.c:10: @}
12290         ret
12291         .cfi_endproc
12292 .LFE0:
12293         .size   test, .-test
12294         .ident  "GCC: (GNU) 7.0.0 20160809 (experimental)"
12295         .section        .note.GNU-stack,"",@@progbits
12296 @end smallexample
12298 The comments are intended for humans rather than machines and hence the
12299 precise format of the comments is subject to change.
12301 @item -frecord-gcc-switches
12302 @opindex frecord-gcc-switches
12303 This switch causes the command line used to invoke the
12304 compiler to be recorded into the object file that is being created.
12305 This switch is only implemented on some targets and the exact format
12306 of the recording is target and binary file format dependent, but it
12307 usually takes the form of a section containing ASCII text.  This
12308 switch is related to the @option{-fverbose-asm} switch, but that
12309 switch only records information in the assembler output file as
12310 comments, so it never reaches the object file.
12311 See also @option{-grecord-gcc-switches} for another
12312 way of storing compiler options into the object file.
12314 @item -fpic
12315 @opindex fpic
12316 @cindex global offset table
12317 @cindex PIC
12318 Generate position-independent code (PIC) suitable for use in a shared
12319 library, if supported for the target machine.  Such code accesses all
12320 constant addresses through a global offset table (GOT)@.  The dynamic
12321 loader resolves the GOT entries when the program starts (the dynamic
12322 loader is not part of GCC; it is part of the operating system).  If
12323 the GOT size for the linked executable exceeds a machine-specific
12324 maximum size, you get an error message from the linker indicating that
12325 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
12326 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
12327 on the m68k and RS/6000.  The x86 has no such limit.)
12329 Position-independent code requires special support, and therefore works
12330 only on certain machines.  For the x86, GCC supports PIC for System V
12331 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
12332 position-independent.
12334 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12335 are defined to 1.
12337 @item -fPIC
12338 @opindex fPIC
12339 If supported for the target machine, emit position-independent code,
12340 suitable for dynamic linking and avoiding any limit on the size of the
12341 global offset table.  This option makes a difference on AArch64, m68k,
12342 PowerPC and SPARC@.
12344 Position-independent code requires special support, and therefore works
12345 only on certain machines.
12347 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
12348 are defined to 2.
12350 @item -fpie
12351 @itemx -fPIE
12352 @opindex fpie
12353 @opindex fPIE
12354 These options are similar to @option{-fpic} and @option{-fPIC}, but
12355 generated position independent code can be only linked into executables.
12356 Usually these options are used when @option{-pie} GCC option is
12357 used during linking.
12359 @option{-fpie} and @option{-fPIE} both define the macros
12360 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
12361 for @option{-fpie} and 2 for @option{-fPIE}.
12363 @item -fno-plt
12364 @opindex fno-plt
12365 Do not use the PLT for external function calls in position-independent code.
12366 Instead, load the callee address at call sites from the GOT and branch to it.
12367 This leads to more efficient code by eliminating PLT stubs and exposing
12368 GOT loads to optimizations.  On architectures such as 32-bit x86 where
12369 PLT stubs expect the GOT pointer in a specific register, this gives more
12370 register allocation freedom to the compiler.
12371 Lazy binding requires use of the PLT; 
12372 with @option{-fno-plt} all external symbols are resolved at load time.
12374 Alternatively, the function attribute @code{noplt} can be used to avoid calls
12375 through the PLT for specific external functions.
12377 In position-dependent code, a few targets also convert calls to
12378 functions that are marked to not use the PLT to use the GOT instead.
12380 @item -fno-jump-tables
12381 @opindex fno-jump-tables
12382 Do not use jump tables for switch statements even where it would be
12383 more efficient than other code generation strategies.  This option is
12384 of use in conjunction with @option{-fpic} or @option{-fPIC} for
12385 building code that forms part of a dynamic linker and cannot
12386 reference the address of a jump table.  On some targets, jump tables
12387 do not require a GOT and this option is not needed.
12389 @item -ffixed-@var{reg}
12390 @opindex ffixed
12391 Treat the register named @var{reg} as a fixed register; generated code
12392 should never refer to it (except perhaps as a stack pointer, frame
12393 pointer or in some other fixed role).
12395 @var{reg} must be the name of a register.  The register names accepted
12396 are machine-specific and are defined in the @code{REGISTER_NAMES}
12397 macro in the machine description macro file.
12399 This flag does not have a negative form, because it specifies a
12400 three-way choice.
12402 @item -fcall-used-@var{reg}
12403 @opindex fcall-used
12404 Treat the register named @var{reg} as an allocable register that is
12405 clobbered by function calls.  It may be allocated for temporaries or
12406 variables that do not live across a call.  Functions compiled this way
12407 do not save and restore the register @var{reg}.
12409 It is an error to use this flag with the frame pointer or stack pointer.
12410 Use of this flag for other registers that have fixed pervasive roles in
12411 the machine's execution model produces disastrous results.
12413 This flag does not have a negative form, because it specifies a
12414 three-way choice.
12416 @item -fcall-saved-@var{reg}
12417 @opindex fcall-saved
12418 Treat the register named @var{reg} as an allocable register saved by
12419 functions.  It may be allocated even for temporaries or variables that
12420 live across a call.  Functions compiled this way save and restore
12421 the register @var{reg} if they use it.
12423 It is an error to use this flag with the frame pointer or stack pointer.
12424 Use of this flag for other registers that have fixed pervasive roles in
12425 the machine's execution model produces disastrous results.
12427 A different sort of disaster results from the use of this flag for
12428 a register in which function values may be returned.
12430 This flag does not have a negative form, because it specifies a
12431 three-way choice.
12433 @item -fpack-struct[=@var{n}]
12434 @opindex fpack-struct
12435 Without a value specified, pack all structure members together without
12436 holes.  When a value is specified (which must be a small power of two), pack
12437 structure members according to this value, representing the maximum
12438 alignment (that is, objects with default alignment requirements larger than
12439 this are output potentially unaligned at the next fitting location.
12441 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
12442 code that is not binary compatible with code generated without that switch.
12443 Additionally, it makes the code suboptimal.
12444 Use it to conform to a non-default application binary interface.
12446 @item -fleading-underscore
12447 @opindex fleading-underscore
12448 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
12449 change the way C symbols are represented in the object file.  One use
12450 is to help link with legacy assembly code.
12452 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
12453 generate code that is not binary compatible with code generated without that
12454 switch.  Use it to conform to a non-default application binary interface.
12455 Not all targets provide complete support for this switch.
12457 @item -ftls-model=@var{model}
12458 @opindex ftls-model
12459 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
12460 The @var{model} argument should be one of @samp{global-dynamic},
12461 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
12462 Note that the choice is subject to optimization: the compiler may use
12463 a more efficient model for symbols not visible outside of the translation
12464 unit, or if @option{-fpic} is not given on the command line.
12466 The default without @option{-fpic} is @samp{initial-exec}; with
12467 @option{-fpic} the default is @samp{global-dynamic}.
12469 @item -ftrampolines
12470 @opindex ftrampolines
12471 For targets that normally need trampolines for nested functions, always
12472 generate them instead of using descriptors.  Otherwise, for targets that
12473 do not need them, like for example HP-PA or IA-64, do nothing.
12475 A trampoline is a small piece of code that is created at run time on the
12476 stack when the address of a nested function is taken, and is used to call
12477 the nested function indirectly.  Therefore, it requires the stack to be
12478 made executable in order for the program to work properly.
12480 @option{-fno-trampolines} is enabled by default on a language by language
12481 basis to let the compiler avoid generating them, if it computes that this
12482 is safe, and replace them with descriptors.  Descriptors are made up of data
12483 only, but the generated code must be prepared to deal with them.  As of this
12484 writing, @option{-fno-trampolines} is enabled by default only for Ada.
12486 Moreover, code compiled with @option{-ftrampolines} and code compiled with
12487 @option{-fno-trampolines} are not binary compatible if nested functions are
12488 present.  This option must therefore be used on a program-wide basis and be
12489 manipulated with extreme care.
12491 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
12492 @opindex fvisibility
12493 Set the default ELF image symbol visibility to the specified option---all
12494 symbols are marked with this unless overridden within the code.
12495 Using this feature can very substantially improve linking and
12496 load times of shared object libraries, produce more optimized
12497 code, provide near-perfect API export and prevent symbol clashes.
12498 It is @strong{strongly} recommended that you use this in any shared objects
12499 you distribute.
12501 Despite the nomenclature, @samp{default} always means public; i.e.,
12502 available to be linked against from outside the shared object.
12503 @samp{protected} and @samp{internal} are pretty useless in real-world
12504 usage so the only other commonly used option is @samp{hidden}.
12505 The default if @option{-fvisibility} isn't specified is
12506 @samp{default}, i.e., make every symbol public.
12508 A good explanation of the benefits offered by ensuring ELF
12509 symbols have the correct visibility is given by ``How To Write
12510 Shared Libraries'' by Ulrich Drepper (which can be found at
12511 @w{@uref{https://www.akkadia.org/drepper/}})---however a superior
12512 solution made possible by this option to marking things hidden when
12513 the default is public is to make the default hidden and mark things
12514 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
12515 and @code{__attribute__ ((visibility("default")))} instead of
12516 @code{__declspec(dllexport)} you get almost identical semantics with
12517 identical syntax.  This is a great boon to those working with
12518 cross-platform projects.
12520 For those adding visibility support to existing code, you may find
12521 @code{#pragma GCC visibility} of use.  This works by you enclosing
12522 the declarations you wish to set visibility for with (for example)
12523 @code{#pragma GCC visibility push(hidden)} and
12524 @code{#pragma GCC visibility pop}.
12525 Bear in mind that symbol visibility should be viewed @strong{as
12526 part of the API interface contract} and thus all new code should
12527 always specify visibility when it is not the default; i.e., declarations
12528 only for use within the local DSO should @strong{always} be marked explicitly
12529 as hidden as so to avoid PLT indirection overheads---making this
12530 abundantly clear also aids readability and self-documentation of the code.
12531 Note that due to ISO C++ specification requirements, @code{operator new} and
12532 @code{operator delete} must always be of default visibility.
12534 Be aware that headers from outside your project, in particular system
12535 headers and headers from any other library you use, may not be
12536 expecting to be compiled with visibility other than the default.  You
12537 may need to explicitly say @code{#pragma GCC visibility push(default)}
12538 before including any such headers.
12540 @code{extern} declarations are not affected by @option{-fvisibility}, so
12541 a lot of code can be recompiled with @option{-fvisibility=hidden} with
12542 no modifications.  However, this means that calls to @code{extern}
12543 functions with no explicit visibility use the PLT, so it is more
12544 effective to use @code{__attribute ((visibility))} and/or
12545 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
12546 declarations should be treated as hidden.
12548 Note that @option{-fvisibility} does affect C++ vague linkage
12549 entities. This means that, for instance, an exception class that is
12550 be thrown between DSOs must be explicitly marked with default
12551 visibility so that the @samp{type_info} nodes are unified between
12552 the DSOs.
12554 An overview of these techniques, their benefits and how to use them
12555 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
12557 @item -fstrict-volatile-bitfields
12558 @opindex fstrict-volatile-bitfields
12559 This option should be used if accesses to volatile bit-fields (or other
12560 structure fields, although the compiler usually honors those types
12561 anyway) should use a single access of the width of the
12562 field's type, aligned to a natural alignment if possible.  For
12563 example, targets with memory-mapped peripheral registers might require
12564 all such accesses to be 16 bits wide; with this flag you can
12565 declare all peripheral bit-fields as @code{unsigned short} (assuming short
12566 is 16 bits on these targets) to force GCC to use 16-bit accesses
12567 instead of, perhaps, a more efficient 32-bit access.
12569 If this option is disabled, the compiler uses the most efficient
12570 instruction.  In the previous example, that might be a 32-bit load
12571 instruction, even though that accesses bytes that do not contain
12572 any portion of the bit-field, or memory-mapped registers unrelated to
12573 the one being updated.
12575 In some cases, such as when the @code{packed} attribute is applied to a 
12576 structure field, it may not be possible to access the field with a single
12577 read or write that is correctly aligned for the target machine.  In this
12578 case GCC falls back to generating multiple accesses rather than code that 
12579 will fault or truncate the result at run time.
12581 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
12582 not allowed to touch non bit-field members.  It is therefore recommended
12583 to define all bits of the field's type as bit-field members.
12585 The default value of this option is determined by the application binary
12586 interface for the target processor.
12588 @item -fsync-libcalls
12589 @opindex fsync-libcalls
12590 This option controls whether any out-of-line instance of the @code{__sync}
12591 family of functions may be used to implement the C++11 @code{__atomic}
12592 family of functions.
12594 The default value of this option is enabled, thus the only useful form
12595 of the option is @option{-fno-sync-libcalls}.  This option is used in
12596 the implementation of the @file{libatomic} runtime library.
12598 @end table
12600 @node Developer Options
12601 @section GCC Developer Options
12602 @cindex developer options
12603 @cindex debugging GCC
12604 @cindex debug dump options
12605 @cindex dump options
12606 @cindex compilation statistics
12608 This section describes command-line options that are primarily of
12609 interest to GCC developers, including options to support compiler
12610 testing and investigation of compiler bugs and compile-time
12611 performance problems.  This includes options that produce debug dumps
12612 at various points in the compilation; that print statistics such as
12613 memory use and execution time; and that print information about GCC's
12614 configuration, such as where it searches for libraries.  You should
12615 rarely need to use any of these options for ordinary compilation and
12616 linking tasks.
12618 @table @gcctabopt
12620 @item -d@var{letters}
12621 @itemx -fdump-rtl-@var{pass}
12622 @itemx -fdump-rtl-@var{pass}=@var{filename}
12623 @opindex d
12624 @opindex fdump-rtl-@var{pass}
12625 Says to make debugging dumps during compilation at times specified by
12626 @var{letters}.  This is used for debugging the RTL-based passes of the
12627 compiler.  The file names for most of the dumps are made by appending
12628 a pass number and a word to the @var{dumpname}, and the files are
12629 created in the directory of the output file.  In case of
12630 @option{=@var{filename}} option, the dump is output on the given file
12631 instead of the pass numbered dump files.  Note that the pass number is
12632 assigned as passes are registered into the pass manager.  Most passes
12633 are registered in the order that they will execute and for these passes
12634 the number corresponds to the pass execution order.  However, passes
12635 registered by plugins, passes specific to compilation targets, or
12636 passes that are otherwise registered after all the other passes are
12637 numbered higher than a pass named "final", even if they are executed
12638 earlier.  @var{dumpname} is generated from the name of the output
12639 file if explicitly specified and not an executable, otherwise it is
12640 the basename of the source file.  
12642 Some @option{-d@var{letters}} switches have different meaning when
12643 @option{-E} is used for preprocessing.  @xref{Preprocessor Options},
12644 for information about preprocessor-specific dump options.
12646 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
12647 @option{-d} option @var{letters}.  Here are the possible
12648 letters for use in @var{pass} and @var{letters}, and their meanings:
12650 @table @gcctabopt
12652 @item -fdump-rtl-alignments
12653 @opindex fdump-rtl-alignments
12654 Dump after branch alignments have been computed.
12656 @item -fdump-rtl-asmcons
12657 @opindex fdump-rtl-asmcons
12658 Dump after fixing rtl statements that have unsatisfied in/out constraints.
12660 @item -fdump-rtl-auto_inc_dec
12661 @opindex fdump-rtl-auto_inc_dec
12662 Dump after auto-inc-dec discovery.  This pass is only run on
12663 architectures that have auto inc or auto dec instructions.
12665 @item -fdump-rtl-barriers
12666 @opindex fdump-rtl-barriers
12667 Dump after cleaning up the barrier instructions.
12669 @item -fdump-rtl-bbpart
12670 @opindex fdump-rtl-bbpart
12671 Dump after partitioning hot and cold basic blocks.
12673 @item -fdump-rtl-bbro
12674 @opindex fdump-rtl-bbro
12675 Dump after block reordering.
12677 @item -fdump-rtl-btl1
12678 @itemx -fdump-rtl-btl2
12679 @opindex fdump-rtl-btl2
12680 @opindex fdump-rtl-btl2
12681 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
12682 after the two branch
12683 target load optimization passes.
12685 @item -fdump-rtl-bypass
12686 @opindex fdump-rtl-bypass
12687 Dump after jump bypassing and control flow optimizations.
12689 @item -fdump-rtl-combine
12690 @opindex fdump-rtl-combine
12691 Dump after the RTL instruction combination pass.
12693 @item -fdump-rtl-compgotos
12694 @opindex fdump-rtl-compgotos
12695 Dump after duplicating the computed gotos.
12697 @item -fdump-rtl-ce1
12698 @itemx -fdump-rtl-ce2
12699 @itemx -fdump-rtl-ce3
12700 @opindex fdump-rtl-ce1
12701 @opindex fdump-rtl-ce2
12702 @opindex fdump-rtl-ce3
12703 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
12704 @option{-fdump-rtl-ce3} enable dumping after the three
12705 if conversion passes.
12707 @item -fdump-rtl-cprop_hardreg
12708 @opindex fdump-rtl-cprop_hardreg
12709 Dump after hard register copy propagation.
12711 @item -fdump-rtl-csa
12712 @opindex fdump-rtl-csa
12713 Dump after combining stack adjustments.
12715 @item -fdump-rtl-cse1
12716 @itemx -fdump-rtl-cse2
12717 @opindex fdump-rtl-cse1
12718 @opindex fdump-rtl-cse2
12719 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
12720 the two common subexpression elimination passes.
12722 @item -fdump-rtl-dce
12723 @opindex fdump-rtl-dce
12724 Dump after the standalone dead code elimination passes.
12726 @item -fdump-rtl-dbr
12727 @opindex fdump-rtl-dbr
12728 Dump after delayed branch scheduling.
12730 @item -fdump-rtl-dce1
12731 @itemx -fdump-rtl-dce2
12732 @opindex fdump-rtl-dce1
12733 @opindex fdump-rtl-dce2
12734 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
12735 the two dead store elimination passes.
12737 @item -fdump-rtl-eh
12738 @opindex fdump-rtl-eh
12739 Dump after finalization of EH handling code.
12741 @item -fdump-rtl-eh_ranges
12742 @opindex fdump-rtl-eh_ranges
12743 Dump after conversion of EH handling range regions.
12745 @item -fdump-rtl-expand
12746 @opindex fdump-rtl-expand
12747 Dump after RTL generation.
12749 @item -fdump-rtl-fwprop1
12750 @itemx -fdump-rtl-fwprop2
12751 @opindex fdump-rtl-fwprop1
12752 @opindex fdump-rtl-fwprop2
12753 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
12754 dumping after the two forward propagation passes.
12756 @item -fdump-rtl-gcse1
12757 @itemx -fdump-rtl-gcse2
12758 @opindex fdump-rtl-gcse1
12759 @opindex fdump-rtl-gcse2
12760 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
12761 after global common subexpression elimination.
12763 @item -fdump-rtl-init-regs
12764 @opindex fdump-rtl-init-regs
12765 Dump after the initialization of the registers.
12767 @item -fdump-rtl-initvals
12768 @opindex fdump-rtl-initvals
12769 Dump after the computation of the initial value sets.
12771 @item -fdump-rtl-into_cfglayout
12772 @opindex fdump-rtl-into_cfglayout
12773 Dump after converting to cfglayout mode.
12775 @item -fdump-rtl-ira
12776 @opindex fdump-rtl-ira
12777 Dump after iterated register allocation.
12779 @item -fdump-rtl-jump
12780 @opindex fdump-rtl-jump
12781 Dump after the second jump optimization.
12783 @item -fdump-rtl-loop2
12784 @opindex fdump-rtl-loop2
12785 @option{-fdump-rtl-loop2} enables dumping after the rtl
12786 loop optimization passes.
12788 @item -fdump-rtl-mach
12789 @opindex fdump-rtl-mach
12790 Dump after performing the machine dependent reorganization pass, if that
12791 pass exists.
12793 @item -fdump-rtl-mode_sw
12794 @opindex fdump-rtl-mode_sw
12795 Dump after removing redundant mode switches.
12797 @item -fdump-rtl-rnreg
12798 @opindex fdump-rtl-rnreg
12799 Dump after register renumbering.
12801 @item -fdump-rtl-outof_cfglayout
12802 @opindex fdump-rtl-outof_cfglayout
12803 Dump after converting from cfglayout mode.
12805 @item -fdump-rtl-peephole2
12806 @opindex fdump-rtl-peephole2
12807 Dump after the peephole pass.
12809 @item -fdump-rtl-postreload
12810 @opindex fdump-rtl-postreload
12811 Dump after post-reload optimizations.
12813 @item -fdump-rtl-pro_and_epilogue
12814 @opindex fdump-rtl-pro_and_epilogue
12815 Dump after generating the function prologues and epilogues.
12817 @item -fdump-rtl-sched1
12818 @itemx -fdump-rtl-sched2
12819 @opindex fdump-rtl-sched1
12820 @opindex fdump-rtl-sched2
12821 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
12822 after the basic block scheduling passes.
12824 @item -fdump-rtl-ree
12825 @opindex fdump-rtl-ree
12826 Dump after sign/zero extension elimination.
12828 @item -fdump-rtl-seqabstr
12829 @opindex fdump-rtl-seqabstr
12830 Dump after common sequence discovery.
12832 @item -fdump-rtl-shorten
12833 @opindex fdump-rtl-shorten
12834 Dump after shortening branches.
12836 @item -fdump-rtl-sibling
12837 @opindex fdump-rtl-sibling
12838 Dump after sibling call optimizations.
12840 @item -fdump-rtl-split1
12841 @itemx -fdump-rtl-split2
12842 @itemx -fdump-rtl-split3
12843 @itemx -fdump-rtl-split4
12844 @itemx -fdump-rtl-split5
12845 @opindex fdump-rtl-split1
12846 @opindex fdump-rtl-split2
12847 @opindex fdump-rtl-split3
12848 @opindex fdump-rtl-split4
12849 @opindex fdump-rtl-split5
12850 These options enable dumping after five rounds of
12851 instruction splitting.
12853 @item -fdump-rtl-sms
12854 @opindex fdump-rtl-sms
12855 Dump after modulo scheduling.  This pass is only run on some
12856 architectures.
12858 @item -fdump-rtl-stack
12859 @opindex fdump-rtl-stack
12860 Dump after conversion from GCC's ``flat register file'' registers to the
12861 x87's stack-like registers.  This pass is only run on x86 variants.
12863 @item -fdump-rtl-subreg1
12864 @itemx -fdump-rtl-subreg2
12865 @opindex fdump-rtl-subreg1
12866 @opindex fdump-rtl-subreg2
12867 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
12868 the two subreg expansion passes.
12870 @item -fdump-rtl-unshare
12871 @opindex fdump-rtl-unshare
12872 Dump after all rtl has been unshared.
12874 @item -fdump-rtl-vartrack
12875 @opindex fdump-rtl-vartrack
12876 Dump after variable tracking.
12878 @item -fdump-rtl-vregs
12879 @opindex fdump-rtl-vregs
12880 Dump after converting virtual registers to hard registers.
12882 @item -fdump-rtl-web
12883 @opindex fdump-rtl-web
12884 Dump after live range splitting.
12886 @item -fdump-rtl-regclass
12887 @itemx -fdump-rtl-subregs_of_mode_init
12888 @itemx -fdump-rtl-subregs_of_mode_finish
12889 @itemx -fdump-rtl-dfinit
12890 @itemx -fdump-rtl-dfinish
12891 @opindex fdump-rtl-regclass
12892 @opindex fdump-rtl-subregs_of_mode_init
12893 @opindex fdump-rtl-subregs_of_mode_finish
12894 @opindex fdump-rtl-dfinit
12895 @opindex fdump-rtl-dfinish
12896 These dumps are defined but always produce empty files.
12898 @item -da
12899 @itemx -fdump-rtl-all
12900 @opindex da
12901 @opindex fdump-rtl-all
12902 Produce all the dumps listed above.
12904 @item -dA
12905 @opindex dA
12906 Annotate the assembler output with miscellaneous debugging information.
12908 @item -dD
12909 @opindex dD
12910 Dump all macro definitions, at the end of preprocessing, in addition to
12911 normal output.
12913 @item -dH
12914 @opindex dH
12915 Produce a core dump whenever an error occurs.
12917 @item -dp
12918 @opindex dp
12919 Annotate the assembler output with a comment indicating which
12920 pattern and alternative is used.  The length of each instruction is
12921 also printed.
12923 @item -dP
12924 @opindex dP
12925 Dump the RTL in the assembler output as a comment before each instruction.
12926 Also turns on @option{-dp} annotation.
12928 @item -dx
12929 @opindex dx
12930 Just generate RTL for a function instead of compiling it.  Usually used
12931 with @option{-fdump-rtl-expand}.
12932 @end table
12934 @item -fdump-noaddr
12935 @opindex fdump-noaddr
12936 When doing debugging dumps, suppress address output.  This makes it more
12937 feasible to use diff on debugging dumps for compiler invocations with
12938 different compiler binaries and/or different
12939 text / bss / data / heap / stack / dso start locations.
12941 @item -freport-bug
12942 @opindex freport-bug
12943 Collect and dump debug information into a temporary file if an
12944 internal compiler error (ICE) occurs.
12946 @item -fdump-unnumbered
12947 @opindex fdump-unnumbered
12948 When doing debugging dumps, suppress instruction numbers and address output.
12949 This makes it more feasible to use diff on debugging dumps for compiler
12950 invocations with different options, in particular with and without
12951 @option{-g}.
12953 @item -fdump-unnumbered-links
12954 @opindex fdump-unnumbered-links
12955 When doing debugging dumps (see @option{-d} option above), suppress
12956 instruction numbers for the links to the previous and next instructions
12957 in a sequence.
12959 @item -fdump-translation-unit @r{(C++ only)}
12960 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
12961 @opindex fdump-translation-unit
12962 Dump a representation of the tree structure for the entire translation
12963 unit to a file.  The file name is made by appending @file{.tu} to the
12964 source file name, and the file is created in the same directory as the
12965 output file.  If the @samp{-@var{options}} form is used, @var{options}
12966 controls the details of the dump as described for the
12967 @option{-fdump-tree} options.
12969 @item -fdump-class-hierarchy @r{(C++ only)}
12970 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
12971 @opindex fdump-class-hierarchy
12972 Dump a representation of each class's hierarchy and virtual function
12973 table layout to a file.  The file name is made by appending
12974 @file{.class} to the source file name, and the file is created in the
12975 same directory as the output file.  If the @samp{-@var{options}} form
12976 is used, @var{options} controls the details of the dump as described
12977 for the @option{-fdump-tree} options.
12979 @item -fdump-ipa-@var{switch}
12980 @opindex fdump-ipa
12981 Control the dumping at various stages of inter-procedural analysis
12982 language tree to a file.  The file name is generated by appending a
12983 switch specific suffix to the source file name, and the file is created
12984 in the same directory as the output file.  The following dumps are
12985 possible:
12987 @table @samp
12988 @item all
12989 Enables all inter-procedural analysis dumps.
12991 @item cgraph
12992 Dumps information about call-graph optimization, unused function removal,
12993 and inlining decisions.
12995 @item inline
12996 Dump after function inlining.
12998 @end table
13000 @item -fdump-passes
13001 @opindex fdump-passes
13002 Print on @file{stderr} the list of optimization passes that are turned
13003 on and off by the current command-line options.
13005 @item -fdump-statistics-@var{option}
13006 @opindex fdump-statistics
13007 Enable and control dumping of pass statistics in a separate file.  The
13008 file name is generated by appending a suffix ending in
13009 @samp{.statistics} to the source file name, and the file is created in
13010 the same directory as the output file.  If the @samp{-@var{option}}
13011 form is used, @samp{-stats} causes counters to be summed over the
13012 whole compilation unit while @samp{-details} dumps every event as
13013 the passes generate them.  The default with no option is to sum
13014 counters for each function compiled.
13016 @item -fdump-tree-all
13017 @itemx -fdump-tree-@var{switch}
13018 @itemx -fdump-tree-@var{switch}-@var{options}
13019 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
13020 @opindex fdump-tree-all
13021 @opindex fdump-tree
13022 Control the dumping at various stages of processing the intermediate
13023 language tree to a file.  The file name is generated by appending a
13024 switch-specific suffix to the source file name, and the file is
13025 created in the same directory as the output file. In case of
13026 @option{=@var{filename}} option, the dump is output on the given file
13027 instead of the auto named dump files.  If the @samp{-@var{options}}
13028 form is used, @var{options} is a list of @samp{-} separated options
13029 which control the details of the dump.  Not all options are applicable
13030 to all dumps; those that are not meaningful are ignored.  The
13031 following options are available
13033 @table @samp
13034 @item address
13035 Print the address of each node.  Usually this is not meaningful as it
13036 changes according to the environment and source file.  Its primary use
13037 is for tying up a dump file with a debug environment.
13038 @item asmname
13039 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
13040 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
13041 use working backward from mangled names in the assembly file.
13042 @item slim
13043 When dumping front-end intermediate representations, inhibit dumping
13044 of members of a scope or body of a function merely because that scope
13045 has been reached.  Only dump such items when they are directly reachable
13046 by some other path.
13048 When dumping pretty-printed trees, this option inhibits dumping the
13049 bodies of control structures.
13051 When dumping RTL, print the RTL in slim (condensed) form instead of
13052 the default LISP-like representation.
13053 @item raw
13054 Print a raw representation of the tree.  By default, trees are
13055 pretty-printed into a C-like representation.
13056 @item details
13057 Enable more detailed dumps (not honored by every dump option). Also
13058 include information from the optimization passes.
13059 @item stats
13060 Enable dumping various statistics about the pass (not honored by every dump
13061 option).
13062 @item blocks
13063 Enable showing basic block boundaries (disabled in raw dumps).
13064 @item graph
13065 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
13066 dump a representation of the control flow graph suitable for viewing with
13067 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
13068 the file is pretty-printed as a subgraph, so that GraphViz can render them
13069 all in a single plot.
13071 This option currently only works for RTL dumps, and the RTL is always
13072 dumped in slim form.
13073 @item vops
13074 Enable showing virtual operands for every statement.
13075 @item lineno
13076 Enable showing line numbers for statements.
13077 @item uid
13078 Enable showing the unique ID (@code{DECL_UID}) for each variable.
13079 @item verbose
13080 Enable showing the tree dump for each statement.
13081 @item eh
13082 Enable showing the EH region number holding each statement.
13083 @item scev
13084 Enable showing scalar evolution analysis details.
13085 @item optimized
13086 Enable showing optimization information (only available in certain
13087 passes).
13088 @item missed
13089 Enable showing missed optimization information (only available in certain
13090 passes).
13091 @item note
13092 Enable other detailed optimization information (only available in
13093 certain passes).
13094 @item =@var{filename}
13095 Instead of an auto named dump file, output into the given file
13096 name. The file names @file{stdout} and @file{stderr} are treated
13097 specially and are considered already open standard streams. For
13098 example,
13100 @smallexample
13101 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
13102      -fdump-tree-pre=/dev/stderr file.c
13103 @end smallexample
13105 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
13106 output on to @file{stderr}. If two conflicting dump filenames are
13107 given for the same pass, then the latter option overrides the earlier
13108 one.
13110 @item all
13111 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
13112 and @option{lineno}.
13114 @item optall
13115 Turn on all optimization options, i.e., @option{optimized},
13116 @option{missed}, and @option{note}.
13117 @end table
13119 To determine what tree dumps are available or find the dump for a pass
13120 of interest follow the steps below.
13122 @enumerate
13123 @item
13124 Invoke GCC with @option{-fdump-passes} and in the @file{stderr} output
13125 look for a code that corresponds to the pass you are interested in.
13126 For example, the codes @code{tree-evrp}, @code{tree-vrp1}, and
13127 @code{tree-vrp2} correspond to the three Value Range Propagation passes.
13128 The number at the end distinguishes distinct invocations of the same pass.
13129 @item
13130 To enable the creation of the dump file, append the pass code to
13131 the @option{-fdump-} option prefix and invoke GCC with it.  For example,
13132 to enable the dump from the Early Value Range Propagation pass, invoke
13133 GCC with the @option{-fdump-tree-evrp} option.  Optionally, you may
13134 specify the name of the dump file.  If you don't specify one, GCC
13135 creates as described below.
13136 @item
13137 Find the pass dump in a file whose name is composed of three components
13138 separated by a period: the name of the source file GCC was invoked to
13139 compile, a numeric suffix indicating the pass number followed by the
13140 letter @samp{t} for tree passes (and the letter @samp{r} for RTL passes),
13141 and finally the pass code.  For example, the Early VRP pass dump might
13142 be in a file named @file{myfile.c.038t.evrp} in the current working
13143 directory.  Note that the numeric codes are not stable and may change
13144 from one version of GCC to another.
13145 @end enumerate
13147 @item -fopt-info
13148 @itemx -fopt-info-@var{options}
13149 @itemx -fopt-info-@var{options}=@var{filename}
13150 @opindex fopt-info
13151 Controls optimization dumps from various optimization passes. If the
13152 @samp{-@var{options}} form is used, @var{options} is a list of
13153 @samp{-} separated option keywords to select the dump details and
13154 optimizations.  
13156 The @var{options} can be divided into two groups: options describing the
13157 verbosity of the dump, and options describing which optimizations
13158 should be included. The options from both the groups can be freely
13159 mixed as they are non-overlapping. However, in case of any conflicts,
13160 the later options override the earlier options on the command
13161 line. 
13163 The following options control the dump verbosity:
13165 @table @samp
13166 @item optimized
13167 Print information when an optimization is successfully applied. It is
13168 up to a pass to decide which information is relevant. For example, the
13169 vectorizer passes print the source location of loops which are
13170 successfully vectorized.
13171 @item missed
13172 Print information about missed optimizations. Individual passes
13173 control which information to include in the output. 
13174 @item note
13175 Print verbose information about optimizations, such as certain
13176 transformations, more detailed messages about decisions etc.
13177 @item all
13178 Print detailed optimization information. This includes
13179 @samp{optimized}, @samp{missed}, and @samp{note}.
13180 @end table
13182 One or more of the following option keywords can be used to describe a
13183 group of optimizations:
13185 @table @samp
13186 @item ipa
13187 Enable dumps from all interprocedural optimizations.
13188 @item loop
13189 Enable dumps from all loop optimizations.
13190 @item inline
13191 Enable dumps from all inlining optimizations.
13192 @item omp
13193 Enable dumps from all OMP (Offloading and Multi Processing) optimizations.
13194 @item vec
13195 Enable dumps from all vectorization optimizations.
13196 @item optall
13197 Enable dumps from all optimizations. This is a superset of
13198 the optimization groups listed above.
13199 @end table
13201 If @var{options} is
13202 omitted, it defaults to @samp{optimized-optall}, which means to dump all
13203 info about successful optimizations from all the passes.  
13205 If the @var{filename} is provided, then the dumps from all the
13206 applicable optimizations are concatenated into the @var{filename}.
13207 Otherwise the dump is output onto @file{stderr}. Though multiple
13208 @option{-fopt-info} options are accepted, only one of them can include
13209 a @var{filename}. If other filenames are provided then all but the
13210 first such option are ignored.
13212 Note that the output @var{filename} is overwritten
13213 in case of multiple translation units. If a combined output from
13214 multiple translation units is desired, @file{stderr} should be used
13215 instead.
13217 In the following example, the optimization info is output to
13218 @file{stderr}:
13220 @smallexample
13221 gcc -O3 -fopt-info
13222 @end smallexample
13224 This example:
13225 @smallexample
13226 gcc -O3 -fopt-info-missed=missed.all
13227 @end smallexample
13229 @noindent
13230 outputs missed optimization report from all the passes into
13231 @file{missed.all}, and this one:
13233 @smallexample
13234 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
13235 @end smallexample
13237 @noindent
13238 prints information about missed optimization opportunities from
13239 vectorization passes on @file{stderr}.  
13240 Note that @option{-fopt-info-vec-missed} is equivalent to 
13241 @option{-fopt-info-missed-vec}.
13243 As another example,
13244 @smallexample
13245 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
13246 @end smallexample
13248 @noindent
13249 outputs information about missed optimizations as well as
13250 optimized locations from all the inlining passes into
13251 @file{inline.txt}.
13253 Finally, consider:
13255 @smallexample
13256 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
13257 @end smallexample
13259 @noindent
13260 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
13261 in conflict since only one output file is allowed. In this case, only
13262 the first option takes effect and the subsequent options are
13263 ignored. Thus only @file{vec.miss} is produced which contains
13264 dumps from the vectorizer about missed opportunities.
13266 @item -fsched-verbose=@var{n}
13267 @opindex fsched-verbose
13268 On targets that use instruction scheduling, this option controls the
13269 amount of debugging output the scheduler prints to the dump files.
13271 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
13272 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
13273 For @var{n} greater than one, it also output basic block probabilities,
13274 detailed ready list information and unit/insn info.  For @var{n} greater
13275 than two, it includes RTL at abort point, control-flow and regions info.
13276 And for @var{n} over four, @option{-fsched-verbose} also includes
13277 dependence info.
13281 @item -fenable-@var{kind}-@var{pass}
13282 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
13283 @opindex fdisable-
13284 @opindex fenable-
13286 This is a set of options that are used to explicitly disable/enable
13287 optimization passes.  These options are intended for use for debugging GCC.
13288 Compiler users should use regular options for enabling/disabling
13289 passes instead.
13291 @table @gcctabopt
13293 @item -fdisable-ipa-@var{pass}
13294 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
13295 statically invoked in the compiler multiple times, the pass name should be
13296 appended with a sequential number starting from 1.
13298 @item -fdisable-rtl-@var{pass}
13299 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
13300 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13301 statically invoked in the compiler multiple times, the pass name should be
13302 appended with a sequential number starting from 1.  @var{range-list} is a 
13303 comma-separated list of function ranges or assembler names.  Each range is a number
13304 pair separated by a colon.  The range is inclusive in both ends.  If the range
13305 is trivial, the number pair can be simplified as a single number.  If the
13306 function's call graph node's @var{uid} falls within one of the specified ranges,
13307 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
13308 function header of a dump file, and the pass names can be dumped by using
13309 option @option{-fdump-passes}.
13311 @item -fdisable-tree-@var{pass}
13312 @itemx -fdisable-tree-@var{pass}=@var{range-list}
13313 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
13314 option arguments.
13316 @item -fenable-ipa-@var{pass}
13317 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
13318 statically invoked in the compiler multiple times, the pass name should be
13319 appended with a sequential number starting from 1.
13321 @item -fenable-rtl-@var{pass}
13322 @itemx -fenable-rtl-@var{pass}=@var{range-list}
13323 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
13324 description and examples.
13326 @item -fenable-tree-@var{pass}
13327 @itemx -fenable-tree-@var{pass}=@var{range-list}
13328 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
13329 of option arguments.
13331 @end table
13333 Here are some examples showing uses of these options.
13335 @smallexample
13337 # disable ccp1 for all functions
13338    -fdisable-tree-ccp1
13339 # disable complete unroll for function whose cgraph node uid is 1
13340    -fenable-tree-cunroll=1
13341 # disable gcse2 for functions at the following ranges [1,1],
13342 # [300,400], and [400,1000]
13343 # disable gcse2 for functions foo and foo2
13344    -fdisable-rtl-gcse2=foo,foo2
13345 # disable early inlining
13346    -fdisable-tree-einline
13347 # disable ipa inlining
13348    -fdisable-ipa-inline
13349 # enable tree full unroll
13350    -fenable-tree-unroll
13352 @end smallexample
13354 @item -fchecking
13355 @itemx -fchecking=@var{n}
13356 @opindex fchecking
13357 @opindex fno-checking
13358 Enable internal consistency checking.  The default depends on
13359 the compiler configuration.  @option{-fchecking=2} enables further
13360 internal consistency checking that might affect code generation.
13362 @item -frandom-seed=@var{string}
13363 @opindex frandom-seed
13364 This option provides a seed that GCC uses in place of
13365 random numbers in generating certain symbol names
13366 that have to be different in every compiled file.  It is also used to
13367 place unique stamps in coverage data files and the object files that
13368 produce them.  You can use the @option{-frandom-seed} option to produce
13369 reproducibly identical object files.
13371 The @var{string} can either be a number (decimal, octal or hex) or an
13372 arbitrary string (in which case it's converted to a number by
13373 computing CRC32).
13375 The @var{string} should be different for every file you compile.
13377 @item -save-temps
13378 @itemx -save-temps=cwd
13379 @opindex save-temps
13380 Store the usual ``temporary'' intermediate files permanently; place them
13381 in the current directory and name them based on the source file.  Thus,
13382 compiling @file{foo.c} with @option{-c -save-temps} produces files
13383 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
13384 preprocessed @file{foo.i} output file even though the compiler now
13385 normally uses an integrated preprocessor.
13387 When used in combination with the @option{-x} command-line option,
13388 @option{-save-temps} is sensible enough to avoid over writing an
13389 input source file with the same extension as an intermediate file.
13390 The corresponding intermediate file may be obtained by renaming the
13391 source file before using @option{-save-temps}.
13393 If you invoke GCC in parallel, compiling several different source
13394 files that share a common base name in different subdirectories or the
13395 same source file compiled for multiple output destinations, it is
13396 likely that the different parallel compilers will interfere with each
13397 other, and overwrite the temporary files.  For instance:
13399 @smallexample
13400 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
13401 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
13402 @end smallexample
13404 may result in @file{foo.i} and @file{foo.o} being written to
13405 simultaneously by both compilers.
13407 @item -save-temps=obj
13408 @opindex save-temps=obj
13409 Store the usual ``temporary'' intermediate files permanently.  If the
13410 @option{-o} option is used, the temporary files are based on the
13411 object file.  If the @option{-o} option is not used, the
13412 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
13414 For example:
13416 @smallexample
13417 gcc -save-temps=obj -c foo.c
13418 gcc -save-temps=obj -c bar.c -o dir/xbar.o
13419 gcc -save-temps=obj foobar.c -o dir2/yfoobar
13420 @end smallexample
13422 @noindent
13423 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
13424 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
13425 @file{dir2/yfoobar.o}.
13427 @item -time@r{[}=@var{file}@r{]}
13428 @opindex time
13429 Report the CPU time taken by each subprocess in the compilation
13430 sequence.  For C source files, this is the compiler proper and assembler
13431 (plus the linker if linking is done).
13433 Without the specification of an output file, the output looks like this:
13435 @smallexample
13436 # cc1 0.12 0.01
13437 # as 0.00 0.01
13438 @end smallexample
13440 The first number on each line is the ``user time'', that is time spent
13441 executing the program itself.  The second number is ``system time'',
13442 time spent executing operating system routines on behalf of the program.
13443 Both numbers are in seconds.
13445 With the specification of an output file, the output is appended to the
13446 named file, and it looks like this:
13448 @smallexample
13449 0.12 0.01 cc1 @var{options}
13450 0.00 0.01 as @var{options}
13451 @end smallexample
13453 The ``user time'' and the ``system time'' are moved before the program
13454 name, and the options passed to the program are displayed, so that one
13455 can later tell what file was being compiled, and with which options.
13457 @item -fdump-final-insns@r{[}=@var{file}@r{]}
13458 @opindex fdump-final-insns
13459 Dump the final internal representation (RTL) to @var{file}.  If the
13460 optional argument is omitted (or if @var{file} is @code{.}), the name
13461 of the dump file is determined by appending @code{.gkd} to the
13462 compilation output file name.
13464 @item -fcompare-debug@r{[}=@var{opts}@r{]}
13465 @opindex fcompare-debug
13466 @opindex fno-compare-debug
13467 If no error occurs during compilation, run the compiler a second time,
13468 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
13469 passed to the second compilation.  Dump the final internal
13470 representation in both compilations, and print an error if they differ.
13472 If the equal sign is omitted, the default @option{-gtoggle} is used.
13474 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
13475 and nonzero, implicitly enables @option{-fcompare-debug}.  If
13476 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
13477 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
13478 is used.
13480 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
13481 is equivalent to @option{-fno-compare-debug}, which disables the dumping
13482 of the final representation and the second compilation, preventing even
13483 @env{GCC_COMPARE_DEBUG} from taking effect.
13485 To verify full coverage during @option{-fcompare-debug} testing, set
13486 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
13487 which GCC rejects as an invalid option in any actual compilation
13488 (rather than preprocessing, assembly or linking).  To get just a
13489 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
13490 not overridden} will do.
13492 @item -fcompare-debug-second
13493 @opindex fcompare-debug-second
13494 This option is implicitly passed to the compiler for the second
13495 compilation requested by @option{-fcompare-debug}, along with options to
13496 silence warnings, and omitting other options that would cause
13497 side-effect compiler outputs to files or to the standard output.  Dump
13498 files and preserved temporary files are renamed so as to contain the
13499 @code{.gk} additional extension during the second compilation, to avoid
13500 overwriting those generated by the first.
13502 When this option is passed to the compiler driver, it causes the
13503 @emph{first} compilation to be skipped, which makes it useful for little
13504 other than debugging the compiler proper.
13506 @item -gtoggle
13507 @opindex gtoggle
13508 Turn off generation of debug info, if leaving out this option
13509 generates it, or turn it on at level 2 otherwise.  The position of this
13510 argument in the command line does not matter; it takes effect after all
13511 other options are processed, and it does so only once, no matter how
13512 many times it is given.  This is mainly intended to be used with
13513 @option{-fcompare-debug}.
13515 @item -fvar-tracking-assignments-toggle
13516 @opindex fvar-tracking-assignments-toggle
13517 @opindex fno-var-tracking-assignments-toggle
13518 Toggle @option{-fvar-tracking-assignments}, in the same way that
13519 @option{-gtoggle} toggles @option{-g}.
13521 @item -Q
13522 @opindex Q
13523 Makes the compiler print out each function name as it is compiled, and
13524 print some statistics about each pass when it finishes.
13526 @item -ftime-report
13527 @opindex ftime-report
13528 Makes the compiler print some statistics about the time consumed by each
13529 pass when it finishes.
13531 @item -ftime-report-details
13532 @opindex ftime-report-details
13533 Record the time consumed by infrastructure parts separately for each pass.
13535 @item -fira-verbose=@var{n}
13536 @opindex fira-verbose
13537 Control the verbosity of the dump file for the integrated register allocator.
13538 The default value is 5.  If the value @var{n} is greater or equal to 10,
13539 the dump output is sent to stderr using the same format as @var{n} minus 10.
13541 @item -flto-report
13542 @opindex flto-report
13543 Prints a report with internal details on the workings of the link-time
13544 optimizer.  The contents of this report vary from version to version.
13545 It is meant to be useful to GCC developers when processing object
13546 files in LTO mode (via @option{-flto}).
13548 Disabled by default.
13550 @item -flto-report-wpa
13551 @opindex flto-report-wpa
13552 Like @option{-flto-report}, but only print for the WPA phase of Link
13553 Time Optimization.
13555 @item -fmem-report
13556 @opindex fmem-report
13557 Makes the compiler print some statistics about permanent memory
13558 allocation when it finishes.
13560 @item -fmem-report-wpa
13561 @opindex fmem-report-wpa
13562 Makes the compiler print some statistics about permanent memory
13563 allocation for the WPA phase only.
13565 @item -fpre-ipa-mem-report
13566 @opindex fpre-ipa-mem-report
13567 @item -fpost-ipa-mem-report
13568 @opindex fpost-ipa-mem-report
13569 Makes the compiler print some statistics about permanent memory
13570 allocation before or after interprocedural optimization.
13572 @item -fprofile-report
13573 @opindex fprofile-report
13574 Makes the compiler print some statistics about consistency of the
13575 (estimated) profile and effect of individual passes.
13577 @item -fstack-usage
13578 @opindex fstack-usage
13579 Makes the compiler output stack usage information for the program, on a
13580 per-function basis.  The filename for the dump is made by appending
13581 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
13582 the output file, if explicitly specified and it is not an executable,
13583 otherwise it is the basename of the source file.  An entry is made up
13584 of three fields:
13586 @itemize
13587 @item
13588 The name of the function.
13589 @item
13590 A number of bytes.
13591 @item
13592 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
13593 @end itemize
13595 The qualifier @code{static} means that the function manipulates the stack
13596 statically: a fixed number of bytes are allocated for the frame on function
13597 entry and released on function exit; no stack adjustments are otherwise made
13598 in the function.  The second field is this fixed number of bytes.
13600 The qualifier @code{dynamic} means that the function manipulates the stack
13601 dynamically: in addition to the static allocation described above, stack
13602 adjustments are made in the body of the function, for example to push/pop
13603 arguments around function calls.  If the qualifier @code{bounded} is also
13604 present, the amount of these adjustments is bounded at compile time and
13605 the second field is an upper bound of the total amount of stack used by
13606 the function.  If it is not present, the amount of these adjustments is
13607 not bounded at compile time and the second field only represents the
13608 bounded part.
13610 @item -fstats
13611 @opindex fstats
13612 Emit statistics about front-end processing at the end of the compilation.
13613 This option is supported only by the C++ front end, and
13614 the information is generally only useful to the G++ development team.
13616 @item -fdbg-cnt-list
13617 @opindex fdbg-cnt-list
13618 Print the name and the counter upper bound for all debug counters.
13621 @item -fdbg-cnt=@var{counter-value-list}
13622 @opindex fdbg-cnt
13623 Set the internal debug counter upper bound.  @var{counter-value-list}
13624 is a comma-separated list of @var{name}:@var{value} pairs
13625 which sets the upper bound of each debug counter @var{name} to @var{value}.
13626 All debug counters have the initial upper bound of @code{UINT_MAX};
13627 thus @code{dbg_cnt} returns true always unless the upper bound
13628 is set by this option.
13629 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
13630 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
13632 @item -print-file-name=@var{library}
13633 @opindex print-file-name
13634 Print the full absolute name of the library file @var{library} that
13635 would be used when linking---and don't do anything else.  With this
13636 option, GCC does not compile or link anything; it just prints the
13637 file name.
13639 @item -print-multi-directory
13640 @opindex print-multi-directory
13641 Print the directory name corresponding to the multilib selected by any
13642 other switches present in the command line.  This directory is supposed
13643 to exist in @env{GCC_EXEC_PREFIX}.
13645 @item -print-multi-lib
13646 @opindex print-multi-lib
13647 Print the mapping from multilib directory names to compiler switches
13648 that enable them.  The directory name is separated from the switches by
13649 @samp{;}, and each switch starts with an @samp{@@} instead of the
13650 @samp{-}, without spaces between multiple switches.  This is supposed to
13651 ease shell processing.
13653 @item -print-multi-os-directory
13654 @opindex print-multi-os-directory
13655 Print the path to OS libraries for the selected
13656 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
13657 present in the @file{lib} subdirectory and no multilibs are used, this is
13658 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
13659 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
13660 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
13661 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
13663 @item -print-multiarch
13664 @opindex print-multiarch
13665 Print the path to OS libraries for the selected multiarch,
13666 relative to some @file{lib} subdirectory.
13668 @item -print-prog-name=@var{program}
13669 @opindex print-prog-name
13670 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
13672 @item -print-libgcc-file-name
13673 @opindex print-libgcc-file-name
13674 Same as @option{-print-file-name=libgcc.a}.
13676 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
13677 but you do want to link with @file{libgcc.a}.  You can do:
13679 @smallexample
13680 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
13681 @end smallexample
13683 @item -print-search-dirs
13684 @opindex print-search-dirs
13685 Print the name of the configured installation directory and a list of
13686 program and library directories @command{gcc} searches---and don't do anything else.
13688 This is useful when @command{gcc} prints the error message
13689 @samp{installation problem, cannot exec cpp0: No such file or directory}.
13690 To resolve this you either need to put @file{cpp0} and the other compiler
13691 components where @command{gcc} expects to find them, or you can set the environment
13692 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
13693 Don't forget the trailing @samp{/}.
13694 @xref{Environment Variables}.
13696 @item -print-sysroot
13697 @opindex print-sysroot
13698 Print the target sysroot directory that is used during
13699 compilation.  This is the target sysroot specified either at configure
13700 time or using the @option{--sysroot} option, possibly with an extra
13701 suffix that depends on compilation options.  If no target sysroot is
13702 specified, the option prints nothing.
13704 @item -print-sysroot-headers-suffix
13705 @opindex print-sysroot-headers-suffix
13706 Print the suffix added to the target sysroot when searching for
13707 headers, or give an error if the compiler is not configured with such
13708 a suffix---and don't do anything else.
13710 @item -dumpmachine
13711 @opindex dumpmachine
13712 Print the compiler's target machine (for example,
13713 @samp{i686-pc-linux-gnu})---and don't do anything else.
13715 @item -dumpversion
13716 @opindex dumpversion
13717 Print the compiler version (for example, @code{3.0}, @code{6.3.0} or @code{7})---and don't do
13718 anything else.  This is the compiler version used in filesystem paths,
13719 specs, can be depending on how the compiler has been configured just
13720 a single number (major version), two numbers separated by dot (major and
13721 minor version) or three numbers separated by dots (major, minor and patchlevel
13722 version).
13724 @item -dumpfullversion
13725 @opindex dumpfullversion
13726 Print the full compiler version, always 3 numbers separated by dots,
13727 major, minor and patchlevel version.
13729 @item -dumpspecs
13730 @opindex dumpspecs
13731 Print the compiler's built-in specs---and don't do anything else.  (This
13732 is used when GCC itself is being built.)  @xref{Spec Files}.
13733 @end table
13735 @node Submodel Options
13736 @section Machine-Dependent Options
13737 @cindex submodel options
13738 @cindex specifying hardware config
13739 @cindex hardware models and configurations, specifying
13740 @cindex target-dependent options
13741 @cindex machine-dependent options
13743 Each target machine supported by GCC can have its own options---for
13744 example, to allow you to compile for a particular processor variant or
13745 ABI, or to control optimizations specific to that machine.  By
13746 convention, the names of machine-specific options start with
13747 @samp{-m}.
13749 Some configurations of the compiler also support additional target-specific
13750 options, usually for compatibility with other compilers on the same
13751 platform.
13753 @c This list is ordered alphanumerically by subsection name.
13754 @c It should be the same order and spelling as these options are listed
13755 @c in Machine Dependent Options
13757 @menu
13758 * AArch64 Options::
13759 * Adapteva Epiphany Options::
13760 * ARC Options::
13761 * ARM Options::
13762 * AVR Options::
13763 * Blackfin Options::
13764 * C6X Options::
13765 * CRIS Options::
13766 * CR16 Options::
13767 * Darwin Options::
13768 * DEC Alpha Options::
13769 * FR30 Options::
13770 * FT32 Options::
13771 * FRV Options::
13772 * GNU/Linux Options::
13773 * H8/300 Options::
13774 * HPPA Options::
13775 * IA-64 Options::
13776 * LM32 Options::
13777 * M32C Options::
13778 * M32R/D Options::
13779 * M680x0 Options::
13780 * MCore Options::
13781 * MeP Options::
13782 * MicroBlaze Options::
13783 * MIPS Options::
13784 * MMIX Options::
13785 * MN10300 Options::
13786 * Moxie Options::
13787 * MSP430 Options::
13788 * NDS32 Options::
13789 * Nios II Options::
13790 * Nvidia PTX Options::
13791 * PDP-11 Options::
13792 * picoChip Options::
13793 * PowerPC Options::
13794 * RISC-V Options::
13795 * RL78 Options::
13796 * RS/6000 and PowerPC Options::
13797 * RX Options::
13798 * S/390 and zSeries Options::
13799 * Score Options::
13800 * SH Options::
13801 * Solaris 2 Options::
13802 * SPARC Options::
13803 * SPU Options::
13804 * System V Options::
13805 * TILE-Gx Options::
13806 * TILEPro Options::
13807 * V850 Options::
13808 * VAX Options::
13809 * Visium Options::
13810 * VMS Options::
13811 * VxWorks Options::
13812 * x86 Options::
13813 * x86 Windows Options::
13814 * Xstormy16 Options::
13815 * Xtensa Options::
13816 * zSeries Options::
13817 @end menu
13819 @node AArch64 Options
13820 @subsection AArch64 Options
13821 @cindex AArch64 Options
13823 These options are defined for AArch64 implementations:
13825 @table @gcctabopt
13827 @item -mabi=@var{name}
13828 @opindex mabi
13829 Generate code for the specified data model.  Permissible values
13830 are @samp{ilp32} for SysV-like data model where int, long int and pointers
13831 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
13832 but long int and pointers are 64 bits.
13834 The default depends on the specific target configuration.  Note that
13835 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
13836 entire program with the same ABI, and link with a compatible set of libraries.
13838 @item -mbig-endian
13839 @opindex mbig-endian
13840 Generate big-endian code.  This is the default when GCC is configured for an
13841 @samp{aarch64_be-*-*} target.
13843 @item -mgeneral-regs-only
13844 @opindex mgeneral-regs-only
13845 Generate code which uses only the general-purpose registers.  This will prevent
13846 the compiler from using floating-point and Advanced SIMD registers but will not
13847 impose any restrictions on the assembler.
13849 @item -mlittle-endian
13850 @opindex mlittle-endian
13851 Generate little-endian code.  This is the default when GCC is configured for an
13852 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
13854 @item -mcmodel=tiny
13855 @opindex mcmodel=tiny
13856 Generate code for the tiny code model.  The program and its statically defined
13857 symbols must be within 1MB of each other.  Programs can be statically or
13858 dynamically linked.
13860 @item -mcmodel=small
13861 @opindex mcmodel=small
13862 Generate code for the small code model.  The program and its statically defined
13863 symbols must be within 4GB of each other.  Programs can be statically or
13864 dynamically linked.  This is the default code model.
13866 @item -mcmodel=large
13867 @opindex mcmodel=large
13868 Generate code for the large code model.  This makes no assumptions about
13869 addresses and sizes of sections.  Programs can be statically linked only.
13871 @item -mstrict-align
13872 @opindex mstrict-align
13873 Avoid generating memory accesses that may not be aligned on a natural object
13874 boundary as described in the architecture specification.
13876 @item -momit-leaf-frame-pointer
13877 @itemx -mno-omit-leaf-frame-pointer
13878 @opindex momit-leaf-frame-pointer
13879 @opindex mno-omit-leaf-frame-pointer
13880 Omit or keep the frame pointer in leaf functions.  The former behavior is the
13881 default.
13883 @item -mtls-dialect=desc
13884 @opindex mtls-dialect=desc
13885 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
13886 of TLS variables.  This is the default.
13888 @item -mtls-dialect=traditional
13889 @opindex mtls-dialect=traditional
13890 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
13891 of TLS variables.
13893 @item -mtls-size=@var{size}
13894 @opindex mtls-size
13895 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
13896 This option requires binutils 2.26 or newer.
13898 @item -mfix-cortex-a53-835769
13899 @itemx -mno-fix-cortex-a53-835769
13900 @opindex mfix-cortex-a53-835769
13901 @opindex mno-fix-cortex-a53-835769
13902 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
13903 This involves inserting a NOP instruction between memory instructions and
13904 64-bit integer multiply-accumulate instructions.
13906 @item -mfix-cortex-a53-843419
13907 @itemx -mno-fix-cortex-a53-843419
13908 @opindex mfix-cortex-a53-843419
13909 @opindex mno-fix-cortex-a53-843419
13910 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
13911 This erratum workaround is made at link time and this will only pass the
13912 corresponding flag to the linker.
13914 @item -mlow-precision-recip-sqrt
13915 @item -mno-low-precision-recip-sqrt
13916 @opindex mlow-precision-recip-sqrt
13917 @opindex mno-low-precision-recip-sqrt
13918 Enable or disable the reciprocal square root approximation.
13919 This option only has an effect if @option{-ffast-math} or
13920 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13921 precision of reciprocal square root results to about 16 bits for
13922 single precision and to 32 bits for double precision.
13924 @item -mlow-precision-sqrt
13925 @item -mno-low-precision-sqrt
13926 @opindex -mlow-precision-sqrt
13927 @opindex -mno-low-precision-sqrt
13928 Enable or disable the square root approximation.
13929 This option only has an effect if @option{-ffast-math} or
13930 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13931 precision of square root results to about 16 bits for
13932 single precision and to 32 bits for double precision.
13933 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
13935 @item -mlow-precision-div
13936 @item -mno-low-precision-div
13937 @opindex -mlow-precision-div
13938 @opindex -mno-low-precision-div
13939 Enable or disable the division approximation.
13940 This option only has an effect if @option{-ffast-math} or
13941 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13942 precision of division results to about 16 bits for
13943 single precision and to 32 bits for double precision.
13945 @item -march=@var{name}
13946 @opindex march
13947 Specify the name of the target architecture and, optionally, one or
13948 more feature modifiers.  This option has the form
13949 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
13951 The permissible values for @var{arch} are @samp{armv8-a},
13952 @samp{armv8.1-a}, @samp{armv8.2-a}, @samp{armv8.3-a} or @var{native}.
13954 The value @samp{armv8.3-a} implies @samp{armv8.2-a} and enables compiler
13955 support for the ARMv8.3-A architecture extensions.
13957 The value @samp{armv8.2-a} implies @samp{armv8.1-a} and enables compiler
13958 support for the ARMv8.2-A architecture extensions.
13960 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
13961 support for the ARMv8.1-A architecture extension.  In particular, it
13962 enables the @samp{+crc} and @samp{+lse} features.
13964 The value @samp{native} is available on native AArch64 GNU/Linux and
13965 causes the compiler to pick the architecture of the host system.  This
13966 option has no effect if the compiler is unable to recognize the
13967 architecture of the host system,
13969 The permissible values for @var{feature} are listed in the sub-section
13970 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13971 Feature Modifiers}.  Where conflicting feature modifiers are
13972 specified, the right-most feature is used.
13974 GCC uses @var{name} to determine what kind of instructions it can emit
13975 when generating assembly code.  If @option{-march} is specified
13976 without either of @option{-mtune} or @option{-mcpu} also being
13977 specified, the code is tuned to perform well across a range of target
13978 processors implementing the target architecture.
13980 @item -mtune=@var{name}
13981 @opindex mtune
13982 Specify the name of the target processor for which GCC should tune the
13983 performance of the code.  Permissible values for this option are:
13984 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
13985 @samp{cortex-a72}, @samp{cortex-a73}, @samp{exynos-m1}, @samp{falkor},
13986 @samp{qdf24xx}, @samp{xgene1}, @samp{vulcan}, @samp{thunderx},
13987 @samp{thunderxt88}, @samp{thunderxt88p1}, @samp{thunderxt81},
13988 @samp{thunderxt83}, @samp{thunderx2t99}, @samp{cortex-a57.cortex-a53},
13989 @samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35},
13990 @samp{cortex-a73.cortex-a53}, @samp{native}.
13992 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
13993 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53}
13994 specify that GCC should tune for a big.LITTLE system.
13996 Additionally on native AArch64 GNU/Linux systems the value
13997 @samp{native} tunes performance to the host system.  This option has no effect
13998 if the compiler is unable to recognize the processor of the host system.
14000 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
14001 are specified, the code is tuned to perform well across a range
14002 of target processors.
14004 This option cannot be suffixed by feature modifiers.
14006 @item -mcpu=@var{name}
14007 @opindex mcpu
14008 Specify the name of the target processor, optionally suffixed by one
14009 or more feature modifiers.  This option has the form
14010 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
14011 the permissible values for @var{cpu} are the same as those available
14012 for @option{-mtune}.  The permissible values for @var{feature} are
14013 documented in the sub-section on
14014 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
14015 Feature Modifiers}.  Where conflicting feature modifiers are
14016 specified, the right-most feature is used.
14018 GCC uses @var{name} to determine what kind of instructions it can emit when
14019 generating assembly code (as if by @option{-march}) and to determine
14020 the target processor for which to tune for performance (as if
14021 by @option{-mtune}).  Where this option is used in conjunction
14022 with @option{-march} or @option{-mtune}, those options take precedence
14023 over the appropriate part of this option.
14025 @item -moverride=@var{string}
14026 @opindex moverride
14027 Override tuning decisions made by the back-end in response to a
14028 @option{-mtune=} switch.  The syntax, semantics, and accepted values
14029 for @var{string} in this option are not guaranteed to be consistent
14030 across releases.
14032 This option is only intended to be useful when developing GCC.
14034 @item -mpc-relative-literal-loads
14035 @opindex mpc-relative-literal-loads
14036 Enable PC-relative literal loads.  With this option literal pools are
14037 accessed using a single instruction and emitted after each function.  This
14038 limits the maximum size of functions to 1MB.  This is enabled by default for
14039 @option{-mcmodel=tiny}.
14041 @item -msign-return-address=@var{scope}
14042 @opindex msign-return-address
14043 Select the function scope on which return address signing will be applied.
14044 Permissible values are @samp{none}, which disables return address signing,
14045 @samp{non-leaf}, which enables pointer signing for functions which are not leaf
14046 functions, and @samp{all}, which enables pointer signing for all functions.  The
14047 default value is @samp{none}.
14049 @end table
14051 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
14052 @anchor{aarch64-feature-modifiers}
14053 @cindex @option{-march} feature modifiers
14054 @cindex @option{-mcpu} feature modifiers
14055 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
14056 the following and their inverses @option{no@var{feature}}:
14058 @table @samp
14059 @item crc
14060 Enable CRC extension.  This is on by default for
14061 @option{-march=armv8.1-a}.
14062 @item crypto
14063 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
14064 instructions.
14065 @item fp
14066 Enable floating-point instructions.  This is on by default for all possible
14067 values for options @option{-march} and @option{-mcpu}.
14068 @item simd
14069 Enable Advanced SIMD instructions.  This also enables floating-point
14070 instructions.  This is on by default for all possible values for options
14071 @option{-march} and @option{-mcpu}.
14072 @item lse
14073 Enable Large System Extension instructions.  This is on by default for
14074 @option{-march=armv8.1-a}.
14075 @item fp16
14076 Enable FP16 extension.  This also enables floating-point instructions.
14078 @end table
14080 Feature @option{crypto} implies @option{simd}, which implies @option{fp}.
14081 Conversely, @option{nofp} implies @option{nosimd}, which implies
14082 @option{nocrypto}.
14084 @node Adapteva Epiphany Options
14085 @subsection Adapteva Epiphany Options
14087 These @samp{-m} options are defined for Adapteva Epiphany:
14089 @table @gcctabopt
14090 @item -mhalf-reg-file
14091 @opindex mhalf-reg-file
14092 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
14093 That allows code to run on hardware variants that lack these registers.
14095 @item -mprefer-short-insn-regs
14096 @opindex mprefer-short-insn-regs
14097 Preferentially allocate registers that allow short instruction generation.
14098 This can result in increased instruction count, so this may either reduce or
14099 increase overall code size.
14101 @item -mbranch-cost=@var{num}
14102 @opindex mbranch-cost
14103 Set the cost of branches to roughly @var{num} ``simple'' instructions.
14104 This cost is only a heuristic and is not guaranteed to produce
14105 consistent results across releases.
14107 @item -mcmove
14108 @opindex mcmove
14109 Enable the generation of conditional moves.
14111 @item -mnops=@var{num}
14112 @opindex mnops
14113 Emit @var{num} NOPs before every other generated instruction.
14115 @item -mno-soft-cmpsf
14116 @opindex mno-soft-cmpsf
14117 For single-precision floating-point comparisons, emit an @code{fsub} instruction
14118 and test the flags.  This is faster than a software comparison, but can
14119 get incorrect results in the presence of NaNs, or when two different small
14120 numbers are compared such that their difference is calculated as zero.
14121 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
14122 software comparisons.
14124 @item -mstack-offset=@var{num}
14125 @opindex mstack-offset
14126 Set the offset between the top of the stack and the stack pointer.
14127 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
14128 can be used by leaf functions without stack allocation.
14129 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
14130 Note also that this option changes the ABI; compiling a program with a
14131 different stack offset than the libraries have been compiled with
14132 generally does not work.
14133 This option can be useful if you want to evaluate if a different stack
14134 offset would give you better code, but to actually use a different stack
14135 offset to build working programs, it is recommended to configure the
14136 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
14138 @item -mno-round-nearest
14139 @opindex mno-round-nearest
14140 Make the scheduler assume that the rounding mode has been set to
14141 truncating.  The default is @option{-mround-nearest}.
14143 @item -mlong-calls
14144 @opindex mlong-calls
14145 If not otherwise specified by an attribute, assume all calls might be beyond
14146 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
14147 function address into a register before performing a (otherwise direct) call.
14148 This is the default.
14150 @item -mshort-calls
14151 @opindex short-calls
14152 If not otherwise specified by an attribute, assume all direct calls are
14153 in the range of the @code{b} / @code{bl} instructions, so use these instructions
14154 for direct calls.  The default is @option{-mlong-calls}.
14156 @item -msmall16
14157 @opindex msmall16
14158 Assume addresses can be loaded as 16-bit unsigned values.  This does not
14159 apply to function addresses for which @option{-mlong-calls} semantics
14160 are in effect.
14162 @item -mfp-mode=@var{mode}
14163 @opindex mfp-mode
14164 Set the prevailing mode of the floating-point unit.
14165 This determines the floating-point mode that is provided and expected
14166 at function call and return time.  Making this mode match the mode you
14167 predominantly need at function start can make your programs smaller and
14168 faster by avoiding unnecessary mode switches.
14170 @var{mode} can be set to one the following values:
14172 @table @samp
14173 @item caller
14174 Any mode at function entry is valid, and retained or restored when
14175 the function returns, and when it calls other functions.
14176 This mode is useful for compiling libraries or other compilation units
14177 you might want to incorporate into different programs with different
14178 prevailing FPU modes, and the convenience of being able to use a single
14179 object file outweighs the size and speed overhead for any extra
14180 mode switching that might be needed, compared with what would be needed
14181 with a more specific choice of prevailing FPU mode.
14183 @item truncate
14184 This is the mode used for floating-point calculations with
14185 truncating (i.e.@: round towards zero) rounding mode.  That includes
14186 conversion from floating point to integer.
14188 @item round-nearest
14189 This is the mode used for floating-point calculations with
14190 round-to-nearest-or-even rounding mode.
14192 @item int
14193 This is the mode used to perform integer calculations in the FPU, e.g.@:
14194 integer multiply, or integer multiply-and-accumulate.
14195 @end table
14197 The default is @option{-mfp-mode=caller}
14199 @item -mnosplit-lohi
14200 @itemx -mno-postinc
14201 @itemx -mno-postmodify
14202 @opindex mnosplit-lohi
14203 @opindex mno-postinc
14204 @opindex mno-postmodify
14205 Code generation tweaks that disable, respectively, splitting of 32-bit
14206 loads, generation of post-increment addresses, and generation of
14207 post-modify addresses.  The defaults are @option{msplit-lohi},
14208 @option{-mpost-inc}, and @option{-mpost-modify}.
14210 @item -mnovect-double
14211 @opindex mno-vect-double
14212 Change the preferred SIMD mode to SImode.  The default is
14213 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
14215 @item -max-vect-align=@var{num}
14216 @opindex max-vect-align
14217 The maximum alignment for SIMD vector mode types.
14218 @var{num} may be 4 or 8.  The default is 8.
14219 Note that this is an ABI change, even though many library function
14220 interfaces are unaffected if they don't use SIMD vector modes
14221 in places that affect size and/or alignment of relevant types.
14223 @item -msplit-vecmove-early
14224 @opindex msplit-vecmove-early
14225 Split vector moves into single word moves before reload.  In theory this
14226 can give better register allocation, but so far the reverse seems to be
14227 generally the case.
14229 @item -m1reg-@var{reg}
14230 @opindex m1reg-
14231 Specify a register to hold the constant @minus{}1, which makes loading small negative
14232 constants and certain bitmasks faster.
14233 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
14234 which specify use of that register as a fixed register,
14235 and @samp{none}, which means that no register is used for this
14236 purpose.  The default is @option{-m1reg-none}.
14238 @end table
14240 @node ARC Options
14241 @subsection ARC Options
14242 @cindex ARC options
14244 The following options control the architecture variant for which code
14245 is being compiled:
14247 @c architecture variants
14248 @table @gcctabopt
14250 @item -mbarrel-shifter
14251 @opindex mbarrel-shifter
14252 Generate instructions supported by barrel shifter.  This is the default
14253 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
14255 @item -mcpu=@var{cpu}
14256 @opindex mcpu
14257 Set architecture type, register usage, and instruction scheduling
14258 parameters for @var{cpu}.  There are also shortcut alias options
14259 available for backward compatibility and convenience.  Supported
14260 values for @var{cpu} are
14262 @table @samp
14263 @opindex mA6
14264 @opindex mARC600
14265 @item arc600
14266 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
14268 @item arc601
14269 @opindex mARC601
14270 Compile for ARC601.  Alias: @option{-mARC601}.
14272 @item arc700
14273 @opindex mA7
14274 @opindex mARC700
14275 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
14276 This is the default when configured with @option{--with-cpu=arc700}@.
14278 @item arcem
14279 Compile for ARC EM.
14281 @item archs
14282 Compile for ARC HS.
14284 @item em
14285 Compile for ARC EM CPU with no hardware extensions.
14287 @item em4
14288 Compile for ARC EM4 CPU.
14290 @item em4_dmips
14291 Compile for ARC EM4 DMIPS CPU.
14293 @item em4_fpus
14294 Compile for ARC EM4 DMIPS CPU with the single-precision floating-point
14295 extension.
14297 @item em4_fpuda
14298 Compile for ARC EM4 DMIPS CPU with single-precision floating-point and
14299 double assist instructions.
14301 @item hs
14302 Compile for ARC HS CPU with no hardware extensions except the atomic
14303 instructions.
14305 @item hs34
14306 Compile for ARC HS34 CPU.
14308 @item hs38
14309 Compile for ARC HS38 CPU.
14311 @item hs38_linux
14312 Compile for ARC HS38 CPU with all hardware extensions on.
14314 @item arc600_norm
14315 Compile for ARC 600 CPU with @code{norm} instructions enabled.
14317 @item arc600_mul32x16
14318 Compile for ARC 600 CPU with @code{norm} and 32x16-bit multiply 
14319 instructions enabled.
14321 @item arc600_mul64
14322 Compile for ARC 600 CPU with @code{norm} and @code{mul64}-family 
14323 instructions enabled.
14325 @item arc601_norm
14326 Compile for ARC 601 CPU with @code{norm} instructions enabled.
14328 @item arc601_mul32x16
14329 Compile for ARC 601 CPU with @code{norm} and 32x16-bit multiply
14330 instructions enabled.
14332 @item arc601_mul64
14333 Compile for ARC 601 CPU with @code{norm} and @code{mul64}-family
14334 instructions enabled.
14336 @item nps400
14337 Compile for ARC 700 on NPS400 chip.
14339 @end table
14341 @item -mdpfp
14342 @opindex mdpfp
14343 @itemx -mdpfp-compact
14344 @opindex mdpfp-compact
14345 Generate double-precision FPX instructions, tuned for the compact
14346 implementation.
14348 @item -mdpfp-fast
14349 @opindex mdpfp-fast
14350 Generate double-precision FPX instructions, tuned for the fast
14351 implementation.
14353 @item -mno-dpfp-lrsr
14354 @opindex mno-dpfp-lrsr
14355 Disable @code{lr} and @code{sr} instructions from using FPX extension
14356 aux registers.
14358 @item -mea
14359 @opindex mea
14360 Generate extended arithmetic instructions.  Currently only
14361 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
14362 supported.  This is always enabled for @option{-mcpu=ARC700}.
14364 @item -mno-mpy
14365 @opindex mno-mpy
14366 Do not generate @code{mpy}-family instructions for ARC700.  This option is
14367 deprecated.
14369 @item -mmul32x16
14370 @opindex mmul32x16
14371 Generate 32x16-bit multiply and multiply-accumulate instructions.
14373 @item -mmul64
14374 @opindex mmul64
14375 Generate @code{mul64} and @code{mulu64} instructions.  
14376 Only valid for @option{-mcpu=ARC600}.
14378 @item -mnorm
14379 @opindex mnorm
14380 Generate @code{norm} instructions.  This is the default if @option{-mcpu=ARC700}
14381 is in effect.
14383 @item -mspfp
14384 @opindex mspfp
14385 @itemx -mspfp-compact
14386 @opindex mspfp-compact
14387 Generate single-precision FPX instructions, tuned for the compact
14388 implementation.
14390 @item -mspfp-fast
14391 @opindex mspfp-fast
14392 Generate single-precision FPX instructions, tuned for the fast
14393 implementation.
14395 @item -msimd
14396 @opindex msimd
14397 Enable generation of ARC SIMD instructions via target-specific
14398 builtins.  Only valid for @option{-mcpu=ARC700}.
14400 @item -msoft-float
14401 @opindex msoft-float
14402 This option ignored; it is provided for compatibility purposes only.
14403 Software floating-point code is emitted by default, and this default
14404 can overridden by FPX options; @option{-mspfp}, @option{-mspfp-compact}, or
14405 @option{-mspfp-fast} for single precision, and @option{-mdpfp},
14406 @option{-mdpfp-compact}, or @option{-mdpfp-fast} for double precision.
14408 @item -mswap
14409 @opindex mswap
14410 Generate @code{swap} instructions.
14412 @item -matomic
14413 @opindex matomic
14414 This enables use of the locked load/store conditional extension to implement
14415 atomic memory built-in functions.  Not available for ARC 6xx or ARC
14416 EM cores.
14418 @item -mdiv-rem
14419 @opindex mdiv-rem
14420 Enable @code{div} and @code{rem} instructions for ARCv2 cores.
14422 @item -mcode-density
14423 @opindex mcode-density
14424 Enable code density instructions for ARC EM.  
14425 This option is on by default for ARC HS.
14427 @item -mll64
14428 @opindex mll64
14429 Enable double load/store operations for ARC HS cores.
14431 @item -mtp-regno=@var{regno}
14432 @opindex mtp-regno
14433 Specify thread pointer register number.
14435 @item -mmpy-option=@var{multo}
14436 @opindex mmpy-option
14437 Compile ARCv2 code with a multiplier design option.  You can specify 
14438 the option using either a string or numeric value for @var{multo}.  
14439 @samp{wlh1} is the default value.  The recognized values are:
14441 @table @samp
14442 @item 0
14443 @itemx none
14444 No multiplier available.
14446 @item 1
14447 @itemx w
14448 16x16 multiplier, fully pipelined.
14449 The following instructions are enabled: @code{mpyw} and @code{mpyuw}.
14451 @item 2
14452 @itemx wlh1
14453 32x32 multiplier, fully
14454 pipelined (1 stage).  The following instructions are additionally
14455 enabled: @code{mpy}, @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14457 @item 3
14458 @itemx wlh2
14459 32x32 multiplier, fully pipelined
14460 (2 stages).  The following instructions are additionally enabled: @code{mpy},
14461 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14463 @item 4
14464 @itemx wlh3
14465 Two 16x16 multipliers, blocking,
14466 sequential.  The following instructions are additionally enabled: @code{mpy},
14467 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14469 @item 5
14470 @itemx wlh4
14471 One 16x16 multiplier, blocking,
14472 sequential.  The following instructions are additionally enabled: @code{mpy},
14473 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14475 @item 6
14476 @itemx wlh5
14477 One 32x4 multiplier, blocking,
14478 sequential.  The following instructions are additionally enabled: @code{mpy},
14479 @code{mpyu}, @code{mpym}, @code{mpymu}, and @code{mpy_s}.
14481 @item 7
14482 @itemx plus_dmpy
14483 ARC HS SIMD support.
14485 @item 8
14486 @itemx plus_macd
14487 ARC HS SIMD support.
14489 @item 9
14490 @itemx plus_qmacw
14491 ARC HS SIMD support.
14493 @end table
14495 This option is only available for ARCv2 cores@.
14497 @item -mfpu=@var{fpu}
14498 @opindex mfpu
14499 Enables support for specific floating-point hardware extensions for ARCv2
14500 cores.  Supported values for @var{fpu} are:
14502 @table @samp
14504 @item fpus
14505 Enables support for single-precision floating-point hardware
14506 extensions@.
14508 @item fpud
14509 Enables support for double-precision floating-point hardware
14510 extensions.  The single-precision floating-point extension is also
14511 enabled.  Not available for ARC EM@.
14513 @item fpuda
14514 Enables support for double-precision floating-point hardware
14515 extensions using double-precision assist instructions.  The single-precision
14516 floating-point extension is also enabled.  This option is
14517 only available for ARC EM@.
14519 @item fpuda_div
14520 Enables support for double-precision floating-point hardware
14521 extensions using double-precision assist instructions.
14522 The single-precision floating-point, square-root, and divide 
14523 extensions are also enabled.  This option is
14524 only available for ARC EM@.
14526 @item fpuda_fma
14527 Enables support for double-precision floating-point hardware
14528 extensions using double-precision assist instructions.
14529 The single-precision floating-point and fused multiply and add 
14530 hardware extensions are also enabled.  This option is
14531 only available for ARC EM@.
14533 @item fpuda_all
14534 Enables support for double-precision floating-point hardware
14535 extensions using double-precision assist instructions.
14536 All single-precision floating-point hardware extensions are also
14537 enabled.  This option is only available for ARC EM@.
14539 @item fpus_div
14540 Enables support for single-precision floating-point, square-root and divide 
14541 hardware extensions@.
14543 @item fpud_div
14544 Enables support for double-precision floating-point, square-root and divide 
14545 hardware extensions.  This option
14546 includes option @samp{fpus_div}. Not available for ARC EM@.
14548 @item fpus_fma
14549 Enables support for single-precision floating-point and 
14550 fused multiply and add hardware extensions@.
14552 @item fpud_fma
14553 Enables support for double-precision floating-point and 
14554 fused multiply and add hardware extensions.  This option
14555 includes option @samp{fpus_fma}.  Not available for ARC EM@.
14557 @item fpus_all
14558 Enables support for all single-precision floating-point hardware
14559 extensions@.
14561 @item fpud_all
14562 Enables support for all single- and double-precision floating-point
14563 hardware extensions.  Not available for ARC EM@.
14565 @end table
14567 @end table
14569 The following options are passed through to the assembler, and also
14570 define preprocessor macro symbols.
14572 @c Flags used by the assembler, but for which we define preprocessor
14573 @c macro symbols as well.
14574 @table @gcctabopt
14575 @item -mdsp-packa
14576 @opindex mdsp-packa
14577 Passed down to the assembler to enable the DSP Pack A extensions.
14578 Also sets the preprocessor symbol @code{__Xdsp_packa}.  This option is
14579 deprecated.
14581 @item -mdvbf
14582 @opindex mdvbf
14583 Passed down to the assembler to enable the dual Viterbi butterfly
14584 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.  This
14585 option is deprecated.
14587 @c ARC700 4.10 extension instruction
14588 @item -mlock
14589 @opindex mlock
14590 Passed down to the assembler to enable the locked load/store
14591 conditional extension.  Also sets the preprocessor symbol
14592 @code{__Xlock}.
14594 @item -mmac-d16
14595 @opindex mmac-d16
14596 Passed down to the assembler.  Also sets the preprocessor symbol
14597 @code{__Xxmac_d16}.  This option is deprecated.
14599 @item -mmac-24
14600 @opindex mmac-24
14601 Passed down to the assembler.  Also sets the preprocessor symbol
14602 @code{__Xxmac_24}.  This option is deprecated.
14604 @c ARC700 4.10 extension instruction
14605 @item -mrtsc
14606 @opindex mrtsc
14607 Passed down to the assembler to enable the 64-bit time-stamp counter
14608 extension instruction.  Also sets the preprocessor symbol
14609 @code{__Xrtsc}.  This option is deprecated.
14611 @c ARC700 4.10 extension instruction
14612 @item -mswape
14613 @opindex mswape
14614 Passed down to the assembler to enable the swap byte ordering
14615 extension instruction.  Also sets the preprocessor symbol
14616 @code{__Xswape}.
14618 @item -mtelephony
14619 @opindex mtelephony
14620 Passed down to the assembler to enable dual- and single-operand
14621 instructions for telephony.  Also sets the preprocessor symbol
14622 @code{__Xtelephony}.  This option is deprecated.
14624 @item -mxy
14625 @opindex mxy
14626 Passed down to the assembler to enable the XY memory extension.  Also
14627 sets the preprocessor symbol @code{__Xxy}.
14629 @end table
14631 The following options control how the assembly code is annotated:
14633 @c Assembly annotation options
14634 @table @gcctabopt
14635 @item -misize
14636 @opindex misize
14637 Annotate assembler instructions with estimated addresses.
14639 @item -mannotate-align
14640 @opindex mannotate-align
14641 Explain what alignment considerations lead to the decision to make an
14642 instruction short or long.
14644 @end table
14646 The following options are passed through to the linker:
14648 @c options passed through to the linker
14649 @table @gcctabopt
14650 @item -marclinux
14651 @opindex marclinux
14652 Passed through to the linker, to specify use of the @code{arclinux} emulation.
14653 This option is enabled by default in tool chains built for
14654 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
14655 when profiling is not requested.
14657 @item -marclinux_prof
14658 @opindex marclinux_prof
14659 Passed through to the linker, to specify use of the
14660 @code{arclinux_prof} emulation.  This option is enabled by default in
14661 tool chains built for @w{@code{arc-linux-uclibc}} and
14662 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
14664 @end table
14666 The following options control the semantics of generated code:
14668 @c semantically relevant code generation options
14669 @table @gcctabopt
14670 @item -mlong-calls
14671 @opindex mlong-calls
14672 Generate calls as register indirect calls, thus providing access
14673 to the full 32-bit address range.
14675 @item -mmedium-calls
14676 @opindex mmedium-calls
14677 Don't use less than 25-bit addressing range for calls, which is the
14678 offset available for an unconditional branch-and-link
14679 instruction.  Conditional execution of function calls is suppressed, to
14680 allow use of the 25-bit range, rather than the 21-bit range with
14681 conditional branch-and-link.  This is the default for tool chains built
14682 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
14684 @item -mno-sdata
14685 @opindex mno-sdata
14686 Do not generate sdata references.  This is the default for tool chains
14687 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
14688 targets.
14690 @item -mvolatile-cache
14691 @opindex mvolatile-cache
14692 Use ordinarily cached memory accesses for volatile references.  This is the
14693 default.
14695 @item -mno-volatile-cache
14696 @opindex mno-volatile-cache
14697 Enable cache bypass for volatile references.
14699 @end table
14701 The following options fine tune code generation:
14702 @c code generation tuning options
14703 @table @gcctabopt
14704 @item -malign-call
14705 @opindex malign-call
14706 Do alignment optimizations for call instructions.
14708 @item -mauto-modify-reg
14709 @opindex mauto-modify-reg
14710 Enable the use of pre/post modify with register displacement.
14712 @item -mbbit-peephole
14713 @opindex mbbit-peephole
14714 Enable bbit peephole2.
14716 @item -mno-brcc
14717 @opindex mno-brcc
14718 This option disables a target-specific pass in @file{arc_reorg} to
14719 generate compare-and-branch (@code{br@var{cc}}) instructions.  
14720 It has no effect on
14721 generation of these instructions driven by the combiner pass.
14723 @item -mcase-vector-pcrel
14724 @opindex mcase-vector-pcrel
14725 Use PC-relative switch case tables to enable case table shortening.
14726 This is the default for @option{-Os}.
14728 @item -mcompact-casesi
14729 @opindex mcompact-casesi
14730 Enable compact @code{casesi} pattern.  This is the default for @option{-Os},
14731 and only available for ARCv1 cores.
14733 @item -mno-cond-exec
14734 @opindex mno-cond-exec
14735 Disable the ARCompact-specific pass to generate conditional 
14736 execution instructions.
14738 Due to delay slot scheduling and interactions between operand numbers,
14739 literal sizes, instruction lengths, and the support for conditional execution,
14740 the target-independent pass to generate conditional execution is often lacking,
14741 so the ARC port has kept a special pass around that tries to find more
14742 conditional execution generation opportunities after register allocation,
14743 branch shortening, and delay slot scheduling have been done.  This pass
14744 generally, but not always, improves performance and code size, at the cost of
14745 extra compilation time, which is why there is an option to switch it off.
14746 If you have a problem with call instructions exceeding their allowable
14747 offset range because they are conditionalized, you should consider using
14748 @option{-mmedium-calls} instead.
14750 @item -mearly-cbranchsi
14751 @opindex mearly-cbranchsi
14752 Enable pre-reload use of the @code{cbranchsi} pattern.
14754 @item -mexpand-adddi
14755 @opindex mexpand-adddi
14756 Expand @code{adddi3} and @code{subdi3} at RTL generation time into
14757 @code{add.f}, @code{adc} etc.
14759 @item -mindexed-loads
14760 @opindex mindexed-loads
14761 Enable the use of indexed loads.  This can be problematic because some
14762 optimizers then assume that indexed stores exist, which is not
14763 the case.
14765 @opindex mlra
14766 Enable Local Register Allocation.  This is still experimental for ARC,
14767 so by default the compiler uses standard reload
14768 (i.e. @option{-mno-lra}).
14770 @item -mlra-priority-none
14771 @opindex mlra-priority-none
14772 Don't indicate any priority for target registers.
14774 @item -mlra-priority-compact
14775 @opindex mlra-priority-compact
14776 Indicate target register priority for r0..r3 / r12..r15.
14778 @item -mlra-priority-noncompact
14779 @opindex mlra-priority-noncompact
14780 Reduce target register priority for r0..r3 / r12..r15.
14782 @item -mno-millicode
14783 @opindex mno-millicode
14784 When optimizing for size (using @option{-Os}), prologues and epilogues
14785 that have to save or restore a large number of registers are often
14786 shortened by using call to a special function in libgcc; this is
14787 referred to as a @emph{millicode} call.  As these calls can pose
14788 performance issues, and/or cause linking issues when linking in a
14789 nonstandard way, this option is provided to turn off millicode call
14790 generation.
14792 @item -mmixed-code
14793 @opindex mmixed-code
14794 Tweak register allocation to help 16-bit instruction generation.
14795 This generally has the effect of decreasing the average instruction size
14796 while increasing the instruction count.
14798 @item -mq-class
14799 @opindex mq-class
14800 Enable @samp{q} instruction alternatives.
14801 This is the default for @option{-Os}.
14803 @item -mRcq
14804 @opindex mRcq
14805 Enable @samp{Rcq} constraint handling.  
14806 Most short code generation depends on this.
14807 This is the default.
14809 @item -mRcw
14810 @opindex mRcw
14811 Enable @samp{Rcw} constraint handling.  
14812 Most ccfsm condexec mostly depends on this.
14813 This is the default.
14815 @item -msize-level=@var{level}
14816 @opindex msize-level
14817 Fine-tune size optimization with regards to instruction lengths and alignment.
14818 The recognized values for @var{level} are:
14819 @table @samp
14820 @item 0
14821 No size optimization.  This level is deprecated and treated like @samp{1}.
14823 @item 1
14824 Short instructions are used opportunistically.
14826 @item 2
14827 In addition, alignment of loops and of code after barriers are dropped.
14829 @item 3
14830 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
14832 @end table
14834 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
14835 the behavior when this is not set is equivalent to level @samp{1}.
14837 @item -mtune=@var{cpu}
14838 @opindex mtune
14839 Set instruction scheduling parameters for @var{cpu}, overriding any implied
14840 by @option{-mcpu=}.
14842 Supported values for @var{cpu} are
14844 @table @samp
14845 @item ARC600
14846 Tune for ARC600 CPU.
14848 @item ARC601
14849 Tune for ARC601 CPU.
14851 @item ARC700
14852 Tune for ARC700 CPU with standard multiplier block.
14854 @item ARC700-xmac
14855 Tune for ARC700 CPU with XMAC block.
14857 @item ARC725D
14858 Tune for ARC725D CPU.
14860 @item ARC750D
14861 Tune for ARC750D CPU.
14863 @end table
14865 @item -mmultcost=@var{num}
14866 @opindex mmultcost
14867 Cost to assume for a multiply instruction, with @samp{4} being equal to a
14868 normal instruction.
14870 @item -munalign-prob-threshold=@var{probability}
14871 @opindex munalign-prob-threshold
14872 Set probability threshold for unaligning branches.
14873 When tuning for @samp{ARC700} and optimizing for speed, branches without
14874 filled delay slot are preferably emitted unaligned and long, unless
14875 profiling indicates that the probability for the branch to be taken
14876 is below @var{probability}.  @xref{Cross-profiling}.
14877 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
14879 @end table
14881 The following options are maintained for backward compatibility, but
14882 are now deprecated and will be removed in a future release:
14884 @c Deprecated options
14885 @table @gcctabopt
14887 @item -margonaut
14888 @opindex margonaut
14889 Obsolete FPX.
14891 @item -mbig-endian
14892 @opindex mbig-endian
14893 @itemx -EB
14894 @opindex EB
14895 Compile code for big-endian targets.  Use of these options is now
14896 deprecated.  Big-endian code is supported by configuring GCC to build
14897 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets,
14898 for which big endian is the default.
14900 @item -mlittle-endian
14901 @opindex mlittle-endian
14902 @itemx -EL
14903 @opindex EL
14904 Compile code for little-endian targets.  Use of these options is now
14905 deprecated.  Little-endian code is supported by configuring GCC to build 
14906 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets,
14907 for which little endian is the default.
14909 @item -mbarrel_shifter
14910 @opindex mbarrel_shifter
14911 Replaced by @option{-mbarrel-shifter}.
14913 @item -mdpfp_compact
14914 @opindex mdpfp_compact
14915 Replaced by @option{-mdpfp-compact}.
14917 @item -mdpfp_fast
14918 @opindex mdpfp_fast
14919 Replaced by @option{-mdpfp-fast}.
14921 @item -mdsp_packa
14922 @opindex mdsp_packa
14923 Replaced by @option{-mdsp-packa}.
14925 @item -mEA
14926 @opindex mEA
14927 Replaced by @option{-mea}.
14929 @item -mmac_24
14930 @opindex mmac_24
14931 Replaced by @option{-mmac-24}.
14933 @item -mmac_d16
14934 @opindex mmac_d16
14935 Replaced by @option{-mmac-d16}.
14937 @item -mspfp_compact
14938 @opindex mspfp_compact
14939 Replaced by @option{-mspfp-compact}.
14941 @item -mspfp_fast
14942 @opindex mspfp_fast
14943 Replaced by @option{-mspfp-fast}.
14945 @item -mtune=@var{cpu}
14946 @opindex mtune
14947 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
14948 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
14949 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively.
14951 @item -multcost=@var{num}
14952 @opindex multcost
14953 Replaced by @option{-mmultcost}.
14955 @end table
14957 @node ARM Options
14958 @subsection ARM Options
14959 @cindex ARM options
14961 These @samp{-m} options are defined for the ARM port:
14963 @table @gcctabopt
14964 @item -mabi=@var{name}
14965 @opindex mabi
14966 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
14967 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
14969 @item -mapcs-frame
14970 @opindex mapcs-frame
14971 Generate a stack frame that is compliant with the ARM Procedure Call
14972 Standard for all functions, even if this is not strictly necessary for
14973 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
14974 with this option causes the stack frames not to be generated for
14975 leaf functions.  The default is @option{-mno-apcs-frame}.
14976 This option is deprecated.
14978 @item -mapcs
14979 @opindex mapcs
14980 This is a synonym for @option{-mapcs-frame} and is deprecated.
14982 @ignore
14983 @c not currently implemented
14984 @item -mapcs-stack-check
14985 @opindex mapcs-stack-check
14986 Generate code to check the amount of stack space available upon entry to
14987 every function (that actually uses some stack space).  If there is
14988 insufficient space available then either the function
14989 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
14990 called, depending upon the amount of stack space required.  The runtime
14991 system is required to provide these functions.  The default is
14992 @option{-mno-apcs-stack-check}, since this produces smaller code.
14994 @c not currently implemented
14995 @item -mapcs-reentrant
14996 @opindex mapcs-reentrant
14997 Generate reentrant, position-independent code.  The default is
14998 @option{-mno-apcs-reentrant}.
14999 @end ignore
15001 @item -mthumb-interwork
15002 @opindex mthumb-interwork
15003 Generate code that supports calling between the ARM and Thumb
15004 instruction sets.  Without this option, on pre-v5 architectures, the
15005 two instruction sets cannot be reliably used inside one program.  The
15006 default is @option{-mno-thumb-interwork}, since slightly larger code
15007 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
15008 configurations this option is meaningless.
15010 @item -mno-sched-prolog
15011 @opindex mno-sched-prolog
15012 Prevent the reordering of instructions in the function prologue, or the
15013 merging of those instruction with the instructions in the function's
15014 body.  This means that all functions start with a recognizable set
15015 of instructions (or in fact one of a choice from a small set of
15016 different function prologues), and this information can be used to
15017 locate the start of functions inside an executable piece of code.  The
15018 default is @option{-msched-prolog}.
15020 @item -mfloat-abi=@var{name}
15021 @opindex mfloat-abi
15022 Specifies which floating-point ABI to use.  Permissible values
15023 are: @samp{soft}, @samp{softfp} and @samp{hard}.
15025 Specifying @samp{soft} causes GCC to generate output containing
15026 library calls for floating-point operations.
15027 @samp{softfp} allows the generation of code using hardware floating-point
15028 instructions, but still uses the soft-float calling conventions.
15029 @samp{hard} allows generation of floating-point instructions
15030 and uses FPU-specific calling conventions.
15032 The default depends on the specific target configuration.  Note that
15033 the hard-float and soft-float ABIs are not link-compatible; you must
15034 compile your entire program with the same ABI, and link with a
15035 compatible set of libraries.
15037 @item -mlittle-endian
15038 @opindex mlittle-endian
15039 Generate code for a processor running in little-endian mode.  This is
15040 the default for all standard configurations.
15042 @item -mbig-endian
15043 @opindex mbig-endian
15044 Generate code for a processor running in big-endian mode; the default is
15045 to compile code for a little-endian processor.
15047 @item -march=@var{name}
15048 @opindex march
15049 This specifies the name of the target ARM architecture.  GCC uses this
15050 name to determine what kind of instructions it can emit when generating
15051 assembly code.  This option can be used in conjunction with or instead
15052 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
15053 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
15054 @samp{armv5}, @samp{armv5e}, @samp{armv5t}, @samp{armv5te},
15055 @samp{armv6}, @samp{armv6-m}, @samp{armv6j}, @samp{armv6k},
15056 @samp{armv6kz}, @samp{armv6s-m},
15057 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk},
15058 @samp{armv7}, @samp{armv7-a}, @samp{armv7-m}, @samp{armv7-r}, @samp{armv7e-m},
15059 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc}, @samp{armv8.1-a},
15060 @samp{armv8.1-a+crc}, @samp{armv8-m.base}, @samp{armv8-m.main},
15061 @samp{armv8-m.main+dsp}, @samp{iwmmxt}, @samp{iwmmxt2}.
15063 Architecture revisions older than @samp{armv4t} are deprecated.
15065 @option{-march=armv6s-m} is the @samp{armv6-m} architecture with support for
15066 the (now mandatory) SVC instruction.
15068 @option{-march=armv6zk} is an alias for @samp{armv6kz}, existing for backwards
15069 compatibility.
15071 @option{-march=armv7ve} is the @samp{armv7-a} architecture with virtualization
15072 extensions.
15074 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
15075 architecture together with the optional CRC32 extensions.
15077 @option{-march=armv8.1-a} enables compiler support for the ARMv8.1-A
15078 architecture.  This also enables the features provided by
15079 @option{-march=armv8-a+crc}.
15081 @option{-march=armv8.2-a} enables compiler support for the ARMv8.2-A
15082 architecture.  This also enables the features provided by
15083 @option{-march=armv8.1-a}.
15085 @option{-march=armv8.2-a+fp16} enables compiler support for the
15086 ARMv8.2-A architecture with the optional FP16 instructions extension.
15087 This also enables the features provided by @option{-march=armv8.1-a}
15088 and implies @option{-mfp16-format=ieee}.
15090 @option{-march=native} causes the compiler to auto-detect the architecture
15091 of the build computer.  At present, this feature is only supported on
15092 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15093 is unsuccessful the option has no effect.
15095 @item -mtune=@var{name}
15096 @opindex mtune
15097 This option specifies the name of the target ARM processor for
15098 which GCC should tune the performance of the code.
15099 For some ARM implementations better performance can be obtained by using
15100 this option.
15101 Permissible names are: @samp{arm2}, @samp{arm250},
15102 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
15103 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
15104 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
15105 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
15106 @samp{arm720},
15107 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
15108 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
15109 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
15110 @samp{strongarm1110},
15111 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
15112 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
15113 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
15114 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
15115 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
15116 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
15117 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
15118 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
15119 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
15120 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
15121 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-r4},
15122 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
15123 @samp{cortex-m33},
15124 @samp{cortex-m23},
15125 @samp{cortex-m7},
15126 @samp{cortex-m4},
15127 @samp{cortex-m3},
15128 @samp{cortex-m1},
15129 @samp{cortex-m0},
15130 @samp{cortex-m0plus},
15131 @samp{cortex-m1.small-multiply},
15132 @samp{cortex-m0.small-multiply},
15133 @samp{cortex-m0plus.small-multiply},
15134 @samp{exynos-m1},
15135 @samp{falkor},
15136 @samp{qdf24xx},
15137 @samp{marvell-pj4},
15138 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
15139 @samp{fa526}, @samp{fa626},
15140 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
15141 @samp{xgene1}.
15143 Additionally, this option can specify that GCC should tune the performance
15144 of the code for a big.LITTLE system.  Permissible names are:
15145 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
15146 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
15147 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53}.
15149 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
15150 performance for a blend of processors within architecture @var{arch}.
15151 The aim is to generate code that run well on the current most popular
15152 processors, balancing between optimizations that benefit some CPUs in the
15153 range, and avoiding performance pitfalls of other CPUs.  The effects of
15154 this option may change in future GCC versions as CPU models come and go.
15156 @option{-mtune=native} causes the compiler to auto-detect the CPU
15157 of the build computer.  At present, this feature is only supported on
15158 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
15159 unsuccessful the option has no effect.
15161 @item -mcpu=@var{name}
15162 @opindex mcpu
15163 This specifies the name of the target ARM processor.  GCC uses this name
15164 to derive the name of the target ARM architecture (as if specified
15165 by @option{-march}) and the ARM processor type for which to tune for
15166 performance (as if specified by @option{-mtune}).  Where this option
15167 is used in conjunction with @option{-march} or @option{-mtune},
15168 those options take precedence over the appropriate part of this option.
15170 Permissible names for this option are the same as those for
15171 @option{-mtune}.
15173 @option{-mcpu=generic-@var{arch}} is also permissible, and is
15174 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
15175 See @option{-mtune} for more information.
15177 @option{-mcpu=native} causes the compiler to auto-detect the CPU
15178 of the build computer.  At present, this feature is only supported on
15179 GNU/Linux, and not all architectures are recognized.  If the auto-detect
15180 is unsuccessful the option has no effect.
15182 @item -mfpu=@var{name}
15183 @opindex mfpu
15184 This specifies what floating-point hardware (or hardware emulation) is
15185 available on the target.  Permissible names are: @samp{vfpv2}, @samp{vfpv3},
15186 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
15187 @samp{vfpv3xd-fp16}, @samp{neon-vfpv3}, @samp{neon-fp16}, @samp{vfpv4},
15188 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
15189 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
15190 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
15191 Note that @samp{neon} is an alias for @samp{neon-vfpv3} and @samp{vfp}
15192 is an alias for @samp{vfpv2}.
15194 If @option{-msoft-float} is specified this specifies the format of
15195 floating-point values.
15197 If the selected floating-point hardware includes the NEON extension
15198 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
15199 operations are not generated by GCC's auto-vectorization pass unless
15200 @option{-funsafe-math-optimizations} is also specified.  This is
15201 because NEON hardware does not fully implement the IEEE 754 standard for
15202 floating-point arithmetic (in particular denormal values are treated as
15203 zero), so the use of NEON instructions may lead to a loss of precision.
15205 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}).
15207 @item -mfp16-format=@var{name}
15208 @opindex mfp16-format
15209 Specify the format of the @code{__fp16} half-precision floating-point type.
15210 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
15211 the default is @samp{none}, in which case the @code{__fp16} type is not
15212 defined.  @xref{Half-Precision}, for more information.
15214 @item -mstructure-size-boundary=@var{n}
15215 @opindex mstructure-size-boundary
15216 The sizes of all structures and unions are rounded up to a multiple
15217 of the number of bits set by this option.  Permissible values are 8, 32
15218 and 64.  The default value varies for different toolchains.  For the COFF
15219 targeted toolchain the default value is 8.  A value of 64 is only allowed
15220 if the underlying ABI supports it.
15222 Specifying a larger number can produce faster, more efficient code, but
15223 can also increase the size of the program.  Different values are potentially
15224 incompatible.  Code compiled with one value cannot necessarily expect to
15225 work with code or libraries compiled with another value, if they exchange
15226 information using structures or unions.
15228 @item -mabort-on-noreturn
15229 @opindex mabort-on-noreturn
15230 Generate a call to the function @code{abort} at the end of a
15231 @code{noreturn} function.  It is executed if the function tries to
15232 return.
15234 @item -mlong-calls
15235 @itemx -mno-long-calls
15236 @opindex mlong-calls
15237 @opindex mno-long-calls
15238 Tells the compiler to perform function calls by first loading the
15239 address of the function into a register and then performing a subroutine
15240 call on this register.  This switch is needed if the target function
15241 lies outside of the 64-megabyte addressing range of the offset-based
15242 version of subroutine call instruction.
15244 Even if this switch is enabled, not all function calls are turned
15245 into long calls.  The heuristic is that static functions, functions
15246 that have the @code{short_call} attribute, functions that are inside
15247 the scope of a @code{#pragma no_long_calls} directive, and functions whose
15248 definitions have already been compiled within the current compilation
15249 unit are not turned into long calls.  The exceptions to this rule are
15250 that weak function definitions, functions with the @code{long_call}
15251 attribute or the @code{section} attribute, and functions that are within
15252 the scope of a @code{#pragma long_calls} directive are always
15253 turned into long calls.
15255 This feature is not enabled by default.  Specifying
15256 @option{-mno-long-calls} restores the default behavior, as does
15257 placing the function calls within the scope of a @code{#pragma
15258 long_calls_off} directive.  Note these switches have no effect on how
15259 the compiler generates code to handle function calls via function
15260 pointers.
15262 @item -msingle-pic-base
15263 @opindex msingle-pic-base
15264 Treat the register used for PIC addressing as read-only, rather than
15265 loading it in the prologue for each function.  The runtime system is
15266 responsible for initializing this register with an appropriate value
15267 before execution begins.
15269 @item -mpic-register=@var{reg}
15270 @opindex mpic-register
15271 Specify the register to be used for PIC addressing.
15272 For standard PIC base case, the default is any suitable register
15273 determined by compiler.  For single PIC base case, the default is
15274 @samp{R9} if target is EABI based or stack-checking is enabled,
15275 otherwise the default is @samp{R10}.
15277 @item -mpic-data-is-text-relative
15278 @opindex mpic-data-is-text-relative
15279 Assume that the displacement between the text and data segments is fixed
15280 at static link time.  This permits using PC-relative addressing
15281 operations to access data known to be in the data segment.  For
15282 non-VxWorks RTP targets, this option is enabled by default.  When
15283 disabled on such targets, it will enable @option{-msingle-pic-base} by
15284 default.
15286 @item -mpoke-function-name
15287 @opindex mpoke-function-name
15288 Write the name of each function into the text section, directly
15289 preceding the function prologue.  The generated code is similar to this:
15291 @smallexample
15292      t0
15293          .ascii "arm_poke_function_name", 0
15294          .align
15295      t1
15296          .word 0xff000000 + (t1 - t0)
15297      arm_poke_function_name
15298          mov     ip, sp
15299          stmfd   sp!, @{fp, ip, lr, pc@}
15300          sub     fp, ip, #4
15301 @end smallexample
15303 When performing a stack backtrace, code can inspect the value of
15304 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
15305 location @code{pc - 12} and the top 8 bits are set, then we know that
15306 there is a function name embedded immediately preceding this location
15307 and has length @code{((pc[-3]) & 0xff000000)}.
15309 @item -mthumb
15310 @itemx -marm
15311 @opindex marm
15312 @opindex mthumb
15314 Select between generating code that executes in ARM and Thumb
15315 states.  The default for most configurations is to generate code
15316 that executes in ARM state, but the default can be changed by
15317 configuring GCC with the @option{--with-mode=}@var{state}
15318 configure option.
15320 You can also override the ARM and Thumb mode for each function
15321 by using the @code{target("thumb")} and @code{target("arm")} function attributes
15322 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
15324 @item -mtpcs-frame
15325 @opindex mtpcs-frame
15326 Generate a stack frame that is compliant with the Thumb Procedure Call
15327 Standard for all non-leaf functions.  (A leaf function is one that does
15328 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
15330 @item -mtpcs-leaf-frame
15331 @opindex mtpcs-leaf-frame
15332 Generate a stack frame that is compliant with the Thumb Procedure Call
15333 Standard for all leaf functions.  (A leaf function is one that does
15334 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
15336 @item -mcallee-super-interworking
15337 @opindex mcallee-super-interworking
15338 Gives all externally visible functions in the file being compiled an ARM
15339 instruction set header which switches to Thumb mode before executing the
15340 rest of the function.  This allows these functions to be called from
15341 non-interworking code.  This option is not valid in AAPCS configurations
15342 because interworking is enabled by default.
15344 @item -mcaller-super-interworking
15345 @opindex mcaller-super-interworking
15346 Allows calls via function pointers (including virtual functions) to
15347 execute correctly regardless of whether the target code has been
15348 compiled for interworking or not.  There is a small overhead in the cost
15349 of executing a function pointer if this option is enabled.  This option
15350 is not valid in AAPCS configurations because interworking is enabled
15351 by default.
15353 @item -mtp=@var{name}
15354 @opindex mtp
15355 Specify the access model for the thread local storage pointer.  The valid
15356 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
15357 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
15358 (supported in the arm6k architecture), and @samp{auto}, which uses the
15359 best available method for the selected processor.  The default setting is
15360 @samp{auto}.
15362 @item -mtls-dialect=@var{dialect}
15363 @opindex mtls-dialect
15364 Specify the dialect to use for accessing thread local storage.  Two
15365 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
15366 @samp{gnu} dialect selects the original GNU scheme for supporting
15367 local and global dynamic TLS models.  The @samp{gnu2} dialect
15368 selects the GNU descriptor scheme, which provides better performance
15369 for shared libraries.  The GNU descriptor scheme is compatible with
15370 the original scheme, but does require new assembler, linker and
15371 library support.  Initial and local exec TLS models are unaffected by
15372 this option and always use the original scheme.
15374 @item -mword-relocations
15375 @opindex mword-relocations
15376 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
15377 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
15378 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
15379 is specified.
15381 @item -mfix-cortex-m3-ldrd
15382 @opindex mfix-cortex-m3-ldrd
15383 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
15384 with overlapping destination and base registers are used.  This option avoids
15385 generating these instructions.  This option is enabled by default when
15386 @option{-mcpu=cortex-m3} is specified.
15388 @item -munaligned-access
15389 @itemx -mno-unaligned-access
15390 @opindex munaligned-access
15391 @opindex mno-unaligned-access
15392 Enables (or disables) reading and writing of 16- and 32- bit values
15393 from addresses that are not 16- or 32- bit aligned.  By default
15394 unaligned access is disabled for all pre-ARMv6, all ARMv6-M and for
15395 ARMv8-M Baseline architectures, and enabled for all other
15396 architectures.  If unaligned access is not enabled then words in packed
15397 data structures are accessed a byte at a time.
15399 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
15400 generated object file to either true or false, depending upon the
15401 setting of this option.  If unaligned access is enabled then the
15402 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
15403 defined.
15405 @item -mneon-for-64bits
15406 @opindex mneon-for-64bits
15407 Enables using Neon to handle scalar 64-bits operations. This is
15408 disabled by default since the cost of moving data from core registers
15409 to Neon is high.
15411 @item -mslow-flash-data
15412 @opindex mslow-flash-data
15413 Assume loading data from flash is slower than fetching instruction.
15414 Therefore literal load is minimized for better performance.
15415 This option is only supported when compiling for ARMv7 M-profile and
15416 off by default.
15418 @item -masm-syntax-unified
15419 @opindex masm-syntax-unified
15420 Assume inline assembler is using unified asm syntax.  The default is
15421 currently off which implies divided syntax.  This option has no impact
15422 on Thumb2. However, this may change in future releases of GCC.
15423 Divided syntax should be considered deprecated.
15425 @item -mrestrict-it
15426 @opindex mrestrict-it
15427 Restricts generation of IT blocks to conform to the rules of ARMv8.
15428 IT blocks can only contain a single 16-bit instruction from a select
15429 set of instructions. This option is on by default for ARMv8 Thumb mode.
15431 @item -mprint-tune-info
15432 @opindex mprint-tune-info
15433 Print CPU tuning information as comment in assembler file.  This is
15434 an option used only for regression testing of the compiler and not
15435 intended for ordinary use in compiling code.  This option is disabled
15436 by default.
15438 @item -mpure-code
15439 @opindex mpure-code
15440 Do not allow constant data to be placed in code sections.
15441 Additionally, when compiling for ELF object format give all text sections the
15442 ELF processor-specific section attribute @code{SHF_ARM_PURECODE}.  This option
15443 is only available when generating non-pic code for ARMv7-M targets.
15445 @item -mcmse
15446 @opindex mcmse
15447 Generate secure code as per the "ARMv8-M Security Extensions: Requirements on
15448 Development Tools Engineering Specification", which can be found on
15449 @url{http://infocenter.arm.com/help/topic/com.arm.doc.ecm0359818/ECM0359818_armv8m_security_extensions_reqs_on_dev_tools_1_0.pdf}.
15450 @end table
15452 @node AVR Options
15453 @subsection AVR Options
15454 @cindex AVR Options
15456 These options are defined for AVR implementations:
15458 @table @gcctabopt
15459 @item -mmcu=@var{mcu}
15460 @opindex mmcu
15461 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
15463 The default for this option is@tie{}@samp{avr2}.
15465 GCC supports the following AVR devices and ISAs:
15467 @include avr-mmcu.texi
15469 @item -mabsdata
15470 @opindex mabsdata
15472 Assume that all data in static storage can be accessed by LDS / STS
15473 instructions.  This option has only an effect on reduced Tiny devices like
15474 ATtiny40.  See also the @code{absdata}
15475 @ref{AVR Variable Attributes,variable attribute}.
15477 @item -maccumulate-args
15478 @opindex maccumulate-args
15479 Accumulate outgoing function arguments and acquire/release the needed
15480 stack space for outgoing function arguments once in function
15481 prologue/epilogue.  Without this option, outgoing arguments are pushed
15482 before calling a function and popped afterwards.
15484 Popping the arguments after the function call can be expensive on
15485 AVR so that accumulating the stack space might lead to smaller
15486 executables because arguments need not be removed from the
15487 stack after such a function call.
15489 This option can lead to reduced code size for functions that perform
15490 several calls to functions that get their arguments on the stack like
15491 calls to printf-like functions.
15493 @item -mbranch-cost=@var{cost}
15494 @opindex mbranch-cost
15495 Set the branch costs for conditional branch instructions to
15496 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
15497 integers. The default branch cost is 0.
15499 @item -mcall-prologues
15500 @opindex mcall-prologues
15501 Functions prologues/epilogues are expanded as calls to appropriate
15502 subroutines.  Code size is smaller.
15504 @item -mint8
15505 @opindex mint8
15506 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
15507 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
15508 and @code{long long} is 4 bytes.  Please note that this option does not
15509 conform to the C standards, but it results in smaller code
15510 size.
15512 @item -mn-flash=@var{num}
15513 @opindex mn-flash
15514 Assume that the flash memory has a size of 
15515 @var{num} times 64@tie{}KiB.
15517 @item -mno-interrupts
15518 @opindex mno-interrupts
15519 Generated code is not compatible with hardware interrupts.
15520 Code size is smaller.
15522 @item -mrelax
15523 @opindex mrelax
15524 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
15525 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
15526 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
15527 the assembler's command line and the @option{--relax} option to the
15528 linker's command line.
15530 Jump relaxing is performed by the linker because jump offsets are not
15531 known before code is located. Therefore, the assembler code generated by the
15532 compiler is the same, but the instructions in the executable may
15533 differ from instructions in the assembler code.
15535 Relaxing must be turned on if linker stubs are needed, see the
15536 section on @code{EIND} and linker stubs below.
15538 @item -mrmw
15539 @opindex mrmw
15540 Assume that the device supports the Read-Modify-Write
15541 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
15543 @item -msp8
15544 @opindex msp8
15545 Treat the stack pointer register as an 8-bit register,
15546 i.e.@: assume the high byte of the stack pointer is zero.
15547 In general, you don't need to set this option by hand.
15549 This option is used internally by the compiler to select and
15550 build multilibs for architectures @code{avr2} and @code{avr25}.
15551 These architectures mix devices with and without @code{SPH}.
15552 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
15553 the compiler driver adds or removes this option from the compiler
15554 proper's command line, because the compiler then knows if the device
15555 or architecture has an 8-bit stack pointer and thus no @code{SPH}
15556 register or not.
15558 @item -mstrict-X
15559 @opindex mstrict-X
15560 Use address register @code{X} in a way proposed by the hardware.  This means
15561 that @code{X} is only used in indirect, post-increment or
15562 pre-decrement addressing.
15564 Without this option, the @code{X} register may be used in the same way
15565 as @code{Y} or @code{Z} which then is emulated by additional
15566 instructions.  
15567 For example, loading a value with @code{X+const} addressing with a
15568 small non-negative @code{const < 64} to a register @var{Rn} is
15569 performed as
15571 @example
15572 adiw r26, const   ; X += const
15573 ld   @var{Rn}, X        ; @var{Rn} = *X
15574 sbiw r26, const   ; X -= const
15575 @end example
15577 @item -mtiny-stack
15578 @opindex mtiny-stack
15579 Only change the lower 8@tie{}bits of the stack pointer.
15581 @item -mfract-convert-truncate
15582 @opindex mfract-convert-truncate
15583 Allow to use truncation instead of rounding towards zero for fractional fixed-point types.
15585 @item -nodevicelib
15586 @opindex nodevicelib
15587 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
15589 @item -Waddr-space-convert
15590 @opindex Waddr-space-convert
15591 Warn about conversions between address spaces in the case where the
15592 resulting address space is not contained in the incoming address space.
15594 @item -Wmisspelled-isr
15595 @opindex Wmisspelled-isr
15596 Warn if the ISR is misspelled, i.e. without __vector prefix.
15597 Enabled by default.
15598 @end table
15600 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
15601 @cindex @code{EIND}
15602 Pointers in the implementation are 16@tie{}bits wide.
15603 The address of a function or label is represented as word address so
15604 that indirect jumps and calls can target any code address in the
15605 range of 64@tie{}Ki words.
15607 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
15608 bytes of program memory space, there is a special function register called
15609 @code{EIND} that serves as most significant part of the target address
15610 when @code{EICALL} or @code{EIJMP} instructions are used.
15612 Indirect jumps and calls on these devices are handled as follows by
15613 the compiler and are subject to some limitations:
15615 @itemize @bullet
15617 @item
15618 The compiler never sets @code{EIND}.
15620 @item
15621 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
15622 instructions or might read @code{EIND} directly in order to emulate an
15623 indirect call/jump by means of a @code{RET} instruction.
15625 @item
15626 The compiler assumes that @code{EIND} never changes during the startup
15627 code or during the application. In particular, @code{EIND} is not
15628 saved/restored in function or interrupt service routine
15629 prologue/epilogue.
15631 @item
15632 For indirect calls to functions and computed goto, the linker
15633 generates @emph{stubs}. Stubs are jump pads sometimes also called
15634 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
15635 The stub contains a direct jump to the desired address.
15637 @item
15638 Linker relaxation must be turned on so that the linker generates
15639 the stubs correctly in all situations. See the compiler option
15640 @option{-mrelax} and the linker option @option{--relax}.
15641 There are corner cases where the linker is supposed to generate stubs
15642 but aborts without relaxation and without a helpful error message.
15644 @item
15645 The default linker script is arranged for code with @code{EIND = 0}.
15646 If code is supposed to work for a setup with @code{EIND != 0}, a custom
15647 linker script has to be used in order to place the sections whose
15648 name start with @code{.trampolines} into the segment where @code{EIND}
15649 points to.
15651 @item
15652 The startup code from libgcc never sets @code{EIND}.
15653 Notice that startup code is a blend of code from libgcc and AVR-LibC.
15654 For the impact of AVR-LibC on @code{EIND}, see the
15655 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
15657 @item
15658 It is legitimate for user-specific startup code to set up @code{EIND}
15659 early, for example by means of initialization code located in
15660 section @code{.init3}. Such code runs prior to general startup code
15661 that initializes RAM and calls constructors, but after the bit
15662 of startup code from AVR-LibC that sets @code{EIND} to the segment
15663 where the vector table is located.
15664 @example
15665 #include <avr/io.h>
15667 static void
15668 __attribute__((section(".init3"),naked,used,no_instrument_function))
15669 init3_set_eind (void)
15671   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
15672                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
15674 @end example
15676 @noindent
15677 The @code{__trampolines_start} symbol is defined in the linker script.
15679 @item
15680 Stubs are generated automatically by the linker if
15681 the following two conditions are met:
15682 @itemize @minus
15684 @item The address of a label is taken by means of the @code{gs} modifier
15685 (short for @emph{generate stubs}) like so:
15686 @example
15687 LDI r24, lo8(gs(@var{func}))
15688 LDI r25, hi8(gs(@var{func}))
15689 @end example
15690 @item The final location of that label is in a code segment
15691 @emph{outside} the segment where the stubs are located.
15692 @end itemize
15694 @item
15695 The compiler emits such @code{gs} modifiers for code labels in the
15696 following situations:
15697 @itemize @minus
15698 @item Taking address of a function or code label.
15699 @item Computed goto.
15700 @item If prologue-save function is used, see @option{-mcall-prologues}
15701 command-line option.
15702 @item Switch/case dispatch tables. If you do not want such dispatch
15703 tables you can specify the @option{-fno-jump-tables} command-line option.
15704 @item C and C++ constructors/destructors called during startup/shutdown.
15705 @item If the tools hit a @code{gs()} modifier explained above.
15706 @end itemize
15708 @item
15709 Jumping to non-symbolic addresses like so is @emph{not} supported:
15711 @example
15712 int main (void)
15714     /* Call function at word address 0x2 */
15715     return ((int(*)(void)) 0x2)();
15717 @end example
15719 Instead, a stub has to be set up, i.e.@: the function has to be called
15720 through a symbol (@code{func_4} in the example):
15722 @example
15723 int main (void)
15725     extern int func_4 (void);
15727     /* Call function at byte address 0x4 */
15728     return func_4();
15730 @end example
15732 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
15733 Alternatively, @code{func_4} can be defined in the linker script.
15734 @end itemize
15736 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
15737 @cindex @code{RAMPD}
15738 @cindex @code{RAMPX}
15739 @cindex @code{RAMPY}
15740 @cindex @code{RAMPZ}
15741 Some AVR devices support memories larger than the 64@tie{}KiB range
15742 that can be accessed with 16-bit pointers.  To access memory locations
15743 outside this 64@tie{}KiB range, the content of a @code{RAMP}
15744 register is used as high part of the address:
15745 The @code{X}, @code{Y}, @code{Z} address register is concatenated
15746 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
15747 register, respectively, to get a wide address. Similarly,
15748 @code{RAMPD} is used together with direct addressing.
15750 @itemize
15751 @item
15752 The startup code initializes the @code{RAMP} special function
15753 registers with zero.
15755 @item
15756 If a @ref{AVR Named Address Spaces,named address space} other than
15757 generic or @code{__flash} is used, then @code{RAMPZ} is set
15758 as needed before the operation.
15760 @item
15761 If the device supports RAM larger than 64@tie{}KiB and the compiler
15762 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
15763 is reset to zero after the operation.
15765 @item
15766 If the device comes with a specific @code{RAMP} register, the ISR
15767 prologue/epilogue saves/restores that SFR and initializes it with
15768 zero in case the ISR code might (implicitly) use it.
15770 @item
15771 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
15772 If you use inline assembler to read from locations outside the
15773 16-bit address range and change one of the @code{RAMP} registers,
15774 you must reset it to zero after the access.
15776 @end itemize
15778 @subsubsection AVR Built-in Macros
15780 GCC defines several built-in macros so that the user code can test
15781 for the presence or absence of features.  Almost any of the following
15782 built-in macros are deduced from device capabilities and thus
15783 triggered by the @option{-mmcu=} command-line option.
15785 For even more AVR-specific built-in macros see
15786 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
15788 @table @code
15790 @item __AVR_ARCH__
15791 Build-in macro that resolves to a decimal number that identifies the
15792 architecture and depends on the @option{-mmcu=@var{mcu}} option.
15793 Possible values are:
15795 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
15796 @code{4}, @code{5}, @code{51}, @code{6}
15798 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
15799 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
15801 respectively and
15803 @code{100}, @code{102}, @code{104},
15804 @code{105}, @code{106}, @code{107}
15806 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
15807 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
15808 If @var{mcu} specifies a device, this built-in macro is set
15809 accordingly. For example, with @option{-mmcu=atmega8} the macro is
15810 defined to @code{4}.
15812 @item __AVR_@var{Device}__
15813 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
15814 the device's name. For example, @option{-mmcu=atmega8} defines the
15815 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
15816 @code{__AVR_ATtiny261A__}, etc.
15818 The built-in macros' names follow
15819 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
15820 the device name as from the AVR user manual. The difference between
15821 @var{Device} in the built-in macro and @var{device} in
15822 @option{-mmcu=@var{device}} is that the latter is always lowercase.
15824 If @var{device} is not a device but only a core architecture like
15825 @samp{avr51}, this macro is not defined.
15827 @item __AVR_DEVICE_NAME__
15828 Setting @option{-mmcu=@var{device}} defines this built-in macro to
15829 the device's name. For example, with @option{-mmcu=atmega8} the macro
15830 is defined to @code{atmega8}.
15832 If @var{device} is not a device but only a core architecture like
15833 @samp{avr51}, this macro is not defined.
15835 @item __AVR_XMEGA__
15836 The device / architecture belongs to the XMEGA family of devices.
15838 @item __AVR_HAVE_ELPM__
15839 The device has the @code{ELPM} instruction.
15841 @item __AVR_HAVE_ELPMX__
15842 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
15843 R@var{n},Z+} instructions.
15845 @item __AVR_HAVE_MOVW__
15846 The device has the @code{MOVW} instruction to perform 16-bit
15847 register-register moves.
15849 @item __AVR_HAVE_LPMX__
15850 The device has the @code{LPM R@var{n},Z} and
15851 @code{LPM R@var{n},Z+} instructions.
15853 @item __AVR_HAVE_MUL__
15854 The device has a hardware multiplier. 
15856 @item __AVR_HAVE_JMP_CALL__
15857 The device has the @code{JMP} and @code{CALL} instructions.
15858 This is the case for devices with at least 16@tie{}KiB of program
15859 memory.
15861 @item __AVR_HAVE_EIJMP_EICALL__
15862 @itemx __AVR_3_BYTE_PC__
15863 The device has the @code{EIJMP} and @code{EICALL} instructions.
15864 This is the case for devices with more than 128@tie{}KiB of program memory.
15865 This also means that the program counter
15866 (PC) is 3@tie{}bytes wide.
15868 @item __AVR_2_BYTE_PC__
15869 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
15870 with up to 128@tie{}KiB of program memory.
15872 @item __AVR_HAVE_8BIT_SP__
15873 @itemx __AVR_HAVE_16BIT_SP__
15874 The stack pointer (SP) register is treated as 8-bit respectively
15875 16-bit register by the compiler.
15876 The definition of these macros is affected by @option{-mtiny-stack}.
15878 @item __AVR_HAVE_SPH__
15879 @itemx __AVR_SP8__
15880 The device has the SPH (high part of stack pointer) special function
15881 register or has an 8-bit stack pointer, respectively.
15882 The definition of these macros is affected by @option{-mmcu=} and
15883 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
15884 by @option{-msp8}.
15886 @item __AVR_HAVE_RAMPD__
15887 @itemx __AVR_HAVE_RAMPX__
15888 @itemx __AVR_HAVE_RAMPY__
15889 @itemx __AVR_HAVE_RAMPZ__
15890 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
15891 @code{RAMPZ} special function register, respectively.
15893 @item __NO_INTERRUPTS__
15894 This macro reflects the @option{-mno-interrupts} command-line option.
15896 @item __AVR_ERRATA_SKIP__
15897 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
15898 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
15899 instructions because of a hardware erratum.  Skip instructions are
15900 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
15901 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
15902 set.
15904 @item __AVR_ISA_RMW__
15905 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
15907 @item __AVR_SFR_OFFSET__=@var{offset}
15908 Instructions that can address I/O special function registers directly
15909 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
15910 address as if addressed by an instruction to access RAM like @code{LD}
15911 or @code{STS}. This offset depends on the device architecture and has
15912 to be subtracted from the RAM address in order to get the
15913 respective I/O@tie{}address.
15915 @item __WITH_AVRLIBC__
15916 The compiler is configured to be used together with AVR-Libc.
15917 See the @option{--with-avrlibc} configure option.
15919 @end table
15921 @node Blackfin Options
15922 @subsection Blackfin Options
15923 @cindex Blackfin Options
15925 @table @gcctabopt
15926 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
15927 @opindex mcpu=
15928 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
15929 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
15930 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
15931 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
15932 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
15933 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
15934 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
15935 @samp{bf561}, @samp{bf592}.
15937 The optional @var{sirevision} specifies the silicon revision of the target
15938 Blackfin processor.  Any workarounds available for the targeted silicon revision
15939 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
15940 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
15941 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
15942 hexadecimal digits representing the major and minor numbers in the silicon
15943 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
15944 is not defined.  If @var{sirevision} is @samp{any}, the
15945 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
15946 If this optional @var{sirevision} is not used, GCC assumes the latest known
15947 silicon revision of the targeted Blackfin processor.
15949 GCC defines a preprocessor macro for the specified @var{cpu}.
15950 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
15951 provided by libgloss to be linked in if @option{-msim} is not given.
15953 Without this option, @samp{bf532} is used as the processor by default.
15955 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
15956 only the preprocessor macro is defined.
15958 @item -msim
15959 @opindex msim
15960 Specifies that the program will be run on the simulator.  This causes
15961 the simulator BSP provided by libgloss to be linked in.  This option
15962 has effect only for @samp{bfin-elf} toolchain.
15963 Certain other options, such as @option{-mid-shared-library} and
15964 @option{-mfdpic}, imply @option{-msim}.
15966 @item -momit-leaf-frame-pointer
15967 @opindex momit-leaf-frame-pointer
15968 Don't keep the frame pointer in a register for leaf functions.  This
15969 avoids the instructions to save, set up and restore frame pointers and
15970 makes an extra register available in leaf functions.  The option
15971 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
15972 which might make debugging harder.
15974 @item -mspecld-anomaly
15975 @opindex mspecld-anomaly
15976 When enabled, the compiler ensures that the generated code does not
15977 contain speculative loads after jump instructions. If this option is used,
15978 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
15980 @item -mno-specld-anomaly
15981 @opindex mno-specld-anomaly
15982 Don't generate extra code to prevent speculative loads from occurring.
15984 @item -mcsync-anomaly
15985 @opindex mcsync-anomaly
15986 When enabled, the compiler ensures that the generated code does not
15987 contain CSYNC or SSYNC instructions too soon after conditional branches.
15988 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
15990 @item -mno-csync-anomaly
15991 @opindex mno-csync-anomaly
15992 Don't generate extra code to prevent CSYNC or SSYNC instructions from
15993 occurring too soon after a conditional branch.
15995 @item -mlow-64k
15996 @opindex mlow-64k
15997 When enabled, the compiler is free to take advantage of the knowledge that
15998 the entire program fits into the low 64k of memory.
16000 @item -mno-low-64k
16001 @opindex mno-low-64k
16002 Assume that the program is arbitrarily large.  This is the default.
16004 @item -mstack-check-l1
16005 @opindex mstack-check-l1
16006 Do stack checking using information placed into L1 scratchpad memory by the
16007 uClinux kernel.
16009 @item -mid-shared-library
16010 @opindex mid-shared-library
16011 Generate code that supports shared libraries via the library ID method.
16012 This allows for execute in place and shared libraries in an environment
16013 without virtual memory management.  This option implies @option{-fPIC}.
16014 With a @samp{bfin-elf} target, this option implies @option{-msim}.
16016 @item -mno-id-shared-library
16017 @opindex mno-id-shared-library
16018 Generate code that doesn't assume ID-based shared libraries are being used.
16019 This is the default.
16021 @item -mleaf-id-shared-library
16022 @opindex mleaf-id-shared-library
16023 Generate code that supports shared libraries via the library ID method,
16024 but assumes that this library or executable won't link against any other
16025 ID shared libraries.  That allows the compiler to use faster code for jumps
16026 and calls.
16028 @item -mno-leaf-id-shared-library
16029 @opindex mno-leaf-id-shared-library
16030 Do not assume that the code being compiled won't link against any ID shared
16031 libraries.  Slower code is generated for jump and call insns.
16033 @item -mshared-library-id=n
16034 @opindex mshared-library-id
16035 Specifies the identification number of the ID-based shared library being
16036 compiled.  Specifying a value of 0 generates more compact code; specifying
16037 other values forces the allocation of that number to the current
16038 library but is no more space- or time-efficient than omitting this option.
16040 @item -msep-data
16041 @opindex msep-data
16042 Generate code that allows the data segment to be located in a different
16043 area of memory from the text segment.  This allows for execute in place in
16044 an environment without virtual memory management by eliminating relocations
16045 against the text section.
16047 @item -mno-sep-data
16048 @opindex mno-sep-data
16049 Generate code that assumes that the data segment follows the text segment.
16050 This is the default.
16052 @item -mlong-calls
16053 @itemx -mno-long-calls
16054 @opindex mlong-calls
16055 @opindex mno-long-calls
16056 Tells the compiler to perform function calls by first loading the
16057 address of the function into a register and then performing a subroutine
16058 call on this register.  This switch is needed if the target function
16059 lies outside of the 24-bit addressing range of the offset-based
16060 version of subroutine call instruction.
16062 This feature is not enabled by default.  Specifying
16063 @option{-mno-long-calls} restores the default behavior.  Note these
16064 switches have no effect on how the compiler generates code to handle
16065 function calls via function pointers.
16067 @item -mfast-fp
16068 @opindex mfast-fp
16069 Link with the fast floating-point library. This library relaxes some of
16070 the IEEE floating-point standard's rules for checking inputs against
16071 Not-a-Number (NAN), in the interest of performance.
16073 @item -minline-plt
16074 @opindex minline-plt
16075 Enable inlining of PLT entries in function calls to functions that are
16076 not known to bind locally.  It has no effect without @option{-mfdpic}.
16078 @item -mmulticore
16079 @opindex mmulticore
16080 Build a standalone application for multicore Blackfin processors. 
16081 This option causes proper start files and link scripts supporting 
16082 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
16083 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
16085 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
16086 selects the one-application-per-core programming model.  Without
16087 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
16088 programming model is used. In this model, the main function of Core B
16089 should be named as @code{coreb_main}.
16091 If this option is not used, the single-core application programming
16092 model is used.
16094 @item -mcorea
16095 @opindex mcorea
16096 Build a standalone application for Core A of BF561 when using
16097 the one-application-per-core programming model. Proper start files
16098 and link scripts are used to support Core A, and the macro
16099 @code{__BFIN_COREA} is defined.
16100 This option can only be used in conjunction with @option{-mmulticore}.
16102 @item -mcoreb
16103 @opindex mcoreb
16104 Build a standalone application for Core B of BF561 when using
16105 the one-application-per-core programming model. Proper start files
16106 and link scripts are used to support Core B, and the macro
16107 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
16108 should be used instead of @code{main}. 
16109 This option can only be used in conjunction with @option{-mmulticore}.
16111 @item -msdram
16112 @opindex msdram
16113 Build a standalone application for SDRAM. Proper start files and
16114 link scripts are used to put the application into SDRAM, and the macro
16115 @code{__BFIN_SDRAM} is defined.
16116 The loader should initialize SDRAM before loading the application.
16118 @item -micplb
16119 @opindex micplb
16120 Assume that ICPLBs are enabled at run time.  This has an effect on certain
16121 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
16122 are enabled; for standalone applications the default is off.
16123 @end table
16125 @node C6X Options
16126 @subsection C6X Options
16127 @cindex C6X Options
16129 @table @gcctabopt
16130 @item -march=@var{name}
16131 @opindex march
16132 This specifies the name of the target architecture.  GCC uses this
16133 name to determine what kind of instructions it can emit when generating
16134 assembly code.  Permissible names are: @samp{c62x},
16135 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
16137 @item -mbig-endian
16138 @opindex mbig-endian
16139 Generate code for a big-endian target.
16141 @item -mlittle-endian
16142 @opindex mlittle-endian
16143 Generate code for a little-endian target.  This is the default.
16145 @item -msim
16146 @opindex msim
16147 Choose startup files and linker script suitable for the simulator.
16149 @item -msdata=default
16150 @opindex msdata=default
16151 Put small global and static data in the @code{.neardata} section,
16152 which is pointed to by register @code{B14}.  Put small uninitialized
16153 global and static data in the @code{.bss} section, which is adjacent
16154 to the @code{.neardata} section.  Put small read-only data into the
16155 @code{.rodata} section.  The corresponding sections used for large
16156 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
16158 @item -msdata=all
16159 @opindex msdata=all
16160 Put all data, not just small objects, into the sections reserved for
16161 small data, and use addressing relative to the @code{B14} register to
16162 access them.
16164 @item -msdata=none
16165 @opindex msdata=none
16166 Make no use of the sections reserved for small data, and use absolute
16167 addresses to access all data.  Put all initialized global and static
16168 data in the @code{.fardata} section, and all uninitialized data in the
16169 @code{.far} section.  Put all constant data into the @code{.const}
16170 section.
16171 @end table
16173 @node CRIS Options
16174 @subsection CRIS Options
16175 @cindex CRIS Options
16177 These options are defined specifically for the CRIS ports.
16179 @table @gcctabopt
16180 @item -march=@var{architecture-type}
16181 @itemx -mcpu=@var{architecture-type}
16182 @opindex march
16183 @opindex mcpu
16184 Generate code for the specified architecture.  The choices for
16185 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
16186 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
16187 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
16188 @samp{v10}.
16190 @item -mtune=@var{architecture-type}
16191 @opindex mtune
16192 Tune to @var{architecture-type} everything applicable about the generated
16193 code, except for the ABI and the set of available instructions.  The
16194 choices for @var{architecture-type} are the same as for
16195 @option{-march=@var{architecture-type}}.
16197 @item -mmax-stack-frame=@var{n}
16198 @opindex mmax-stack-frame
16199 Warn when the stack frame of a function exceeds @var{n} bytes.
16201 @item -metrax4
16202 @itemx -metrax100
16203 @opindex metrax4
16204 @opindex metrax100
16205 The options @option{-metrax4} and @option{-metrax100} are synonyms for
16206 @option{-march=v3} and @option{-march=v8} respectively.
16208 @item -mmul-bug-workaround
16209 @itemx -mno-mul-bug-workaround
16210 @opindex mmul-bug-workaround
16211 @opindex mno-mul-bug-workaround
16212 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
16213 models where it applies.  This option is active by default.
16215 @item -mpdebug
16216 @opindex mpdebug
16217 Enable CRIS-specific verbose debug-related information in the assembly
16218 code.  This option also has the effect of turning off the @samp{#NO_APP}
16219 formatted-code indicator to the assembler at the beginning of the
16220 assembly file.
16222 @item -mcc-init
16223 @opindex mcc-init
16224 Do not use condition-code results from previous instruction; always emit
16225 compare and test instructions before use of condition codes.
16227 @item -mno-side-effects
16228 @opindex mno-side-effects
16229 Do not emit instructions with side effects in addressing modes other than
16230 post-increment.
16232 @item -mstack-align
16233 @itemx -mno-stack-align
16234 @itemx -mdata-align
16235 @itemx -mno-data-align
16236 @itemx -mconst-align
16237 @itemx -mno-const-align
16238 @opindex mstack-align
16239 @opindex mno-stack-align
16240 @opindex mdata-align
16241 @opindex mno-data-align
16242 @opindex mconst-align
16243 @opindex mno-const-align
16244 These options (@samp{no-} options) arrange (eliminate arrangements) for the
16245 stack frame, individual data and constants to be aligned for the maximum
16246 single data access size for the chosen CPU model.  The default is to
16247 arrange for 32-bit alignment.  ABI details such as structure layout are
16248 not affected by these options.
16250 @item -m32-bit
16251 @itemx -m16-bit
16252 @itemx -m8-bit
16253 @opindex m32-bit
16254 @opindex m16-bit
16255 @opindex m8-bit
16256 Similar to the stack- data- and const-align options above, these options
16257 arrange for stack frame, writable data and constants to all be 32-bit,
16258 16-bit or 8-bit aligned.  The default is 32-bit alignment.
16260 @item -mno-prologue-epilogue
16261 @itemx -mprologue-epilogue
16262 @opindex mno-prologue-epilogue
16263 @opindex mprologue-epilogue
16264 With @option{-mno-prologue-epilogue}, the normal function prologue and
16265 epilogue which set up the stack frame are omitted and no return
16266 instructions or return sequences are generated in the code.  Use this
16267 option only together with visual inspection of the compiled code: no
16268 warnings or errors are generated when call-saved registers must be saved,
16269 or storage for local variables needs to be allocated.
16271 @item -mno-gotplt
16272 @itemx -mgotplt
16273 @opindex mno-gotplt
16274 @opindex mgotplt
16275 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
16276 instruction sequences that load addresses for functions from the PLT part
16277 of the GOT rather than (traditional on other architectures) calls to the
16278 PLT@.  The default is @option{-mgotplt}.
16280 @item -melf
16281 @opindex melf
16282 Legacy no-op option only recognized with the cris-axis-elf and
16283 cris-axis-linux-gnu targets.
16285 @item -mlinux
16286 @opindex mlinux
16287 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
16289 @item -sim
16290 @opindex sim
16291 This option, recognized for the cris-axis-elf, arranges
16292 to link with input-output functions from a simulator library.  Code,
16293 initialized data and zero-initialized data are allocated consecutively.
16295 @item -sim2
16296 @opindex sim2
16297 Like @option{-sim}, but pass linker options to locate initialized data at
16298 0x40000000 and zero-initialized data at 0x80000000.
16299 @end table
16301 @node CR16 Options
16302 @subsection CR16 Options
16303 @cindex CR16 Options
16305 These options are defined specifically for the CR16 ports.
16307 @table @gcctabopt
16309 @item -mmac
16310 @opindex mmac
16311 Enable the use of multiply-accumulate instructions. Disabled by default.
16313 @item -mcr16cplus
16314 @itemx -mcr16c
16315 @opindex mcr16cplus
16316 @opindex mcr16c
16317 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
16318 is default.
16320 @item -msim
16321 @opindex msim
16322 Links the library libsim.a which is in compatible with simulator. Applicable
16323 to ELF compiler only.
16325 @item -mint32
16326 @opindex mint32
16327 Choose integer type as 32-bit wide.
16329 @item -mbit-ops
16330 @opindex mbit-ops
16331 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
16333 @item -mdata-model=@var{model}
16334 @opindex mdata-model
16335 Choose a data model. The choices for @var{model} are @samp{near},
16336 @samp{far} or @samp{medium}. @samp{medium} is default.
16337 However, @samp{far} is not valid with @option{-mcr16c}, as the
16338 CR16C architecture does not support the far data model.
16339 @end table
16341 @node Darwin Options
16342 @subsection Darwin Options
16343 @cindex Darwin options
16345 These options are defined for all architectures running the Darwin operating
16346 system.
16348 FSF GCC on Darwin does not create ``fat'' object files; it creates
16349 an object file for the single architecture that GCC was built to
16350 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
16351 @option{-arch} options are used; it does so by running the compiler or
16352 linker multiple times and joining the results together with
16353 @file{lipo}.
16355 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
16356 @samp{i686}) is determined by the flags that specify the ISA
16357 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
16358 @option{-force_cpusubtype_ALL} option can be used to override this.
16360 The Darwin tools vary in their behavior when presented with an ISA
16361 mismatch.  The assembler, @file{as}, only permits instructions to
16362 be used that are valid for the subtype of the file it is generating,
16363 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
16364 The linker for shared libraries, @file{/usr/bin/libtool}, fails
16365 and prints an error if asked to create a shared library with a less
16366 restrictive subtype than its input files (for instance, trying to put
16367 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
16368 for executables, @command{ld}, quietly gives the executable the most
16369 restrictive subtype of any of its input files.
16371 @table @gcctabopt
16372 @item -F@var{dir}
16373 @opindex F
16374 Add the framework directory @var{dir} to the head of the list of
16375 directories to be searched for header files.  These directories are
16376 interleaved with those specified by @option{-I} options and are
16377 scanned in a left-to-right order.
16379 A framework directory is a directory with frameworks in it.  A
16380 framework is a directory with a @file{Headers} and/or
16381 @file{PrivateHeaders} directory contained directly in it that ends
16382 in @file{.framework}.  The name of a framework is the name of this
16383 directory excluding the @file{.framework}.  Headers associated with
16384 the framework are found in one of those two directories, with
16385 @file{Headers} being searched first.  A subframework is a framework
16386 directory that is in a framework's @file{Frameworks} directory.
16387 Includes of subframework headers can only appear in a header of a
16388 framework that contains the subframework, or in a sibling subframework
16389 header.  Two subframeworks are siblings if they occur in the same
16390 framework.  A subframework should not have the same name as a
16391 framework; a warning is issued if this is violated.  Currently a
16392 subframework cannot have subframeworks; in the future, the mechanism
16393 may be extended to support this.  The standard frameworks can be found
16394 in @file{/System/Library/Frameworks} and
16395 @file{/Library/Frameworks}.  An example include looks like
16396 @code{#include <Framework/header.h>}, where @file{Framework} denotes
16397 the name of the framework and @file{header.h} is found in the
16398 @file{PrivateHeaders} or @file{Headers} directory.
16400 @item -iframework@var{dir}
16401 @opindex iframework
16402 Like @option{-F} except the directory is a treated as a system
16403 directory.  The main difference between this @option{-iframework} and
16404 @option{-F} is that with @option{-iframework} the compiler does not
16405 warn about constructs contained within header files found via
16406 @var{dir}.  This option is valid only for the C family of languages.
16408 @item -gused
16409 @opindex gused
16410 Emit debugging information for symbols that are used.  For stabs
16411 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
16412 This is by default ON@.
16414 @item -gfull
16415 @opindex gfull
16416 Emit debugging information for all symbols and types.
16418 @item -mmacosx-version-min=@var{version}
16419 The earliest version of MacOS X that this executable will run on
16420 is @var{version}.  Typical values of @var{version} include @code{10.1},
16421 @code{10.2}, and @code{10.3.9}.
16423 If the compiler was built to use the system's headers by default,
16424 then the default for this option is the system version on which the
16425 compiler is running, otherwise the default is to make choices that
16426 are compatible with as many systems and code bases as possible.
16428 @item -mkernel
16429 @opindex mkernel
16430 Enable kernel development mode.  The @option{-mkernel} option sets
16431 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
16432 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
16433 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
16434 applicable.  This mode also sets @option{-mno-altivec},
16435 @option{-msoft-float}, @option{-fno-builtin} and
16436 @option{-mlong-branch} for PowerPC targets.
16438 @item -mone-byte-bool
16439 @opindex mone-byte-bool
16440 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
16441 By default @code{sizeof(bool)} is @code{4} when compiling for
16442 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
16443 option has no effect on x86.
16445 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
16446 to generate code that is not binary compatible with code generated
16447 without that switch.  Using this switch may require recompiling all
16448 other modules in a program, including system libraries.  Use this
16449 switch to conform to a non-default data model.
16451 @item -mfix-and-continue
16452 @itemx -ffix-and-continue
16453 @itemx -findirect-data
16454 @opindex mfix-and-continue
16455 @opindex ffix-and-continue
16456 @opindex findirect-data
16457 Generate code suitable for fast turnaround development, such as to
16458 allow GDB to dynamically load @file{.o} files into already-running
16459 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
16460 are provided for backwards compatibility.
16462 @item -all_load
16463 @opindex all_load
16464 Loads all members of static archive libraries.
16465 See man ld(1) for more information.
16467 @item -arch_errors_fatal
16468 @opindex arch_errors_fatal
16469 Cause the errors having to do with files that have the wrong architecture
16470 to be fatal.
16472 @item -bind_at_load
16473 @opindex bind_at_load
16474 Causes the output file to be marked such that the dynamic linker will
16475 bind all undefined references when the file is loaded or launched.
16477 @item -bundle
16478 @opindex bundle
16479 Produce a Mach-o bundle format file.
16480 See man ld(1) for more information.
16482 @item -bundle_loader @var{executable}
16483 @opindex bundle_loader
16484 This option specifies the @var{executable} that will load the build
16485 output file being linked.  See man ld(1) for more information.
16487 @item -dynamiclib
16488 @opindex dynamiclib
16489 When passed this option, GCC produces a dynamic library instead of
16490 an executable when linking, using the Darwin @file{libtool} command.
16492 @item -force_cpusubtype_ALL
16493 @opindex force_cpusubtype_ALL
16494 This causes GCC's output file to have the @samp{ALL} subtype, instead of
16495 one controlled by the @option{-mcpu} or @option{-march} option.
16497 @item -allowable_client  @var{client_name}
16498 @itemx -client_name
16499 @itemx -compatibility_version
16500 @itemx -current_version
16501 @itemx -dead_strip
16502 @itemx -dependency-file
16503 @itemx -dylib_file
16504 @itemx -dylinker_install_name
16505 @itemx -dynamic
16506 @itemx -exported_symbols_list
16507 @itemx -filelist
16508 @need 800
16509 @itemx -flat_namespace
16510 @itemx -force_flat_namespace
16511 @itemx -headerpad_max_install_names
16512 @itemx -image_base
16513 @itemx -init
16514 @itemx -install_name
16515 @itemx -keep_private_externs
16516 @itemx -multi_module
16517 @itemx -multiply_defined
16518 @itemx -multiply_defined_unused
16519 @need 800
16520 @itemx -noall_load
16521 @itemx -no_dead_strip_inits_and_terms
16522 @itemx -nofixprebinding
16523 @itemx -nomultidefs
16524 @itemx -noprebind
16525 @itemx -noseglinkedit
16526 @itemx -pagezero_size
16527 @itemx -prebind
16528 @itemx -prebind_all_twolevel_modules
16529 @itemx -private_bundle
16530 @need 800
16531 @itemx -read_only_relocs
16532 @itemx -sectalign
16533 @itemx -sectobjectsymbols
16534 @itemx -whyload
16535 @itemx -seg1addr
16536 @itemx -sectcreate
16537 @itemx -sectobjectsymbols
16538 @itemx -sectorder
16539 @itemx -segaddr
16540 @itemx -segs_read_only_addr
16541 @need 800
16542 @itemx -segs_read_write_addr
16543 @itemx -seg_addr_table
16544 @itemx -seg_addr_table_filename
16545 @itemx -seglinkedit
16546 @itemx -segprot
16547 @itemx -segs_read_only_addr
16548 @itemx -segs_read_write_addr
16549 @itemx -single_module
16550 @itemx -static
16551 @itemx -sub_library
16552 @need 800
16553 @itemx -sub_umbrella
16554 @itemx -twolevel_namespace
16555 @itemx -umbrella
16556 @itemx -undefined
16557 @itemx -unexported_symbols_list
16558 @itemx -weak_reference_mismatches
16559 @itemx -whatsloaded
16560 @opindex allowable_client
16561 @opindex client_name
16562 @opindex compatibility_version
16563 @opindex current_version
16564 @opindex dead_strip
16565 @opindex dependency-file
16566 @opindex dylib_file
16567 @opindex dylinker_install_name
16568 @opindex dynamic
16569 @opindex exported_symbols_list
16570 @opindex filelist
16571 @opindex flat_namespace
16572 @opindex force_flat_namespace
16573 @opindex headerpad_max_install_names
16574 @opindex image_base
16575 @opindex init
16576 @opindex install_name
16577 @opindex keep_private_externs
16578 @opindex multi_module
16579 @opindex multiply_defined
16580 @opindex multiply_defined_unused
16581 @opindex noall_load
16582 @opindex no_dead_strip_inits_and_terms
16583 @opindex nofixprebinding
16584 @opindex nomultidefs
16585 @opindex noprebind
16586 @opindex noseglinkedit
16587 @opindex pagezero_size
16588 @opindex prebind
16589 @opindex prebind_all_twolevel_modules
16590 @opindex private_bundle
16591 @opindex read_only_relocs
16592 @opindex sectalign
16593 @opindex sectobjectsymbols
16594 @opindex whyload
16595 @opindex seg1addr
16596 @opindex sectcreate
16597 @opindex sectobjectsymbols
16598 @opindex sectorder
16599 @opindex segaddr
16600 @opindex segs_read_only_addr
16601 @opindex segs_read_write_addr
16602 @opindex seg_addr_table
16603 @opindex seg_addr_table_filename
16604 @opindex seglinkedit
16605 @opindex segprot
16606 @opindex segs_read_only_addr
16607 @opindex segs_read_write_addr
16608 @opindex single_module
16609 @opindex static
16610 @opindex sub_library
16611 @opindex sub_umbrella
16612 @opindex twolevel_namespace
16613 @opindex umbrella
16614 @opindex undefined
16615 @opindex unexported_symbols_list
16616 @opindex weak_reference_mismatches
16617 @opindex whatsloaded
16618 These options are passed to the Darwin linker.  The Darwin linker man page
16619 describes them in detail.
16620 @end table
16622 @node DEC Alpha Options
16623 @subsection DEC Alpha Options
16625 These @samp{-m} options are defined for the DEC Alpha implementations:
16627 @table @gcctabopt
16628 @item -mno-soft-float
16629 @itemx -msoft-float
16630 @opindex mno-soft-float
16631 @opindex msoft-float
16632 Use (do not use) the hardware floating-point instructions for
16633 floating-point operations.  When @option{-msoft-float} is specified,
16634 functions in @file{libgcc.a} are used to perform floating-point
16635 operations.  Unless they are replaced by routines that emulate the
16636 floating-point operations, or compiled in such a way as to call such
16637 emulations routines, these routines issue floating-point
16638 operations.   If you are compiling for an Alpha without floating-point
16639 operations, you must ensure that the library is built so as not to call
16640 them.
16642 Note that Alpha implementations without floating-point operations are
16643 required to have floating-point registers.
16645 @item -mfp-reg
16646 @itemx -mno-fp-regs
16647 @opindex mfp-reg
16648 @opindex mno-fp-regs
16649 Generate code that uses (does not use) the floating-point register set.
16650 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
16651 register set is not used, floating-point operands are passed in integer
16652 registers as if they were integers and floating-point results are passed
16653 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
16654 so any function with a floating-point argument or return value called by code
16655 compiled with @option{-mno-fp-regs} must also be compiled with that
16656 option.
16658 A typical use of this option is building a kernel that does not use,
16659 and hence need not save and restore, any floating-point registers.
16661 @item -mieee
16662 @opindex mieee
16663 The Alpha architecture implements floating-point hardware optimized for
16664 maximum performance.  It is mostly compliant with the IEEE floating-point
16665 standard.  However, for full compliance, software assistance is
16666 required.  This option generates code fully IEEE-compliant code
16667 @emph{except} that the @var{inexact-flag} is not maintained (see below).
16668 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
16669 defined during compilation.  The resulting code is less efficient but is
16670 able to correctly support denormalized numbers and exceptional IEEE
16671 values such as not-a-number and plus/minus infinity.  Other Alpha
16672 compilers call this option @option{-ieee_with_no_inexact}.
16674 @item -mieee-with-inexact
16675 @opindex mieee-with-inexact
16676 This is like @option{-mieee} except the generated code also maintains
16677 the IEEE @var{inexact-flag}.  Turning on this option causes the
16678 generated code to implement fully-compliant IEEE math.  In addition to
16679 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
16680 macro.  On some Alpha implementations the resulting code may execute
16681 significantly slower than the code generated by default.  Since there is
16682 very little code that depends on the @var{inexact-flag}, you should
16683 normally not specify this option.  Other Alpha compilers call this
16684 option @option{-ieee_with_inexact}.
16686 @item -mfp-trap-mode=@var{trap-mode}
16687 @opindex mfp-trap-mode
16688 This option controls what floating-point related traps are enabled.
16689 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
16690 The trap mode can be set to one of four values:
16692 @table @samp
16693 @item n
16694 This is the default (normal) setting.  The only traps that are enabled
16695 are the ones that cannot be disabled in software (e.g., division by zero
16696 trap).
16698 @item u
16699 In addition to the traps enabled by @samp{n}, underflow traps are enabled
16700 as well.
16702 @item su
16703 Like @samp{u}, but the instructions are marked to be safe for software
16704 completion (see Alpha architecture manual for details).
16706 @item sui
16707 Like @samp{su}, but inexact traps are enabled as well.
16708 @end table
16710 @item -mfp-rounding-mode=@var{rounding-mode}
16711 @opindex mfp-rounding-mode
16712 Selects the IEEE rounding mode.  Other Alpha compilers call this option
16713 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
16716 @table @samp
16717 @item n
16718 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
16719 the nearest machine number or towards the even machine number in case
16720 of a tie.
16722 @item m
16723 Round towards minus infinity.
16725 @item c
16726 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
16728 @item d
16729 Dynamic rounding mode.  A field in the floating-point control register
16730 (@var{fpcr}, see Alpha architecture reference manual) controls the
16731 rounding mode in effect.  The C library initializes this register for
16732 rounding towards plus infinity.  Thus, unless your program modifies the
16733 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
16734 @end table
16736 @item -mtrap-precision=@var{trap-precision}
16737 @opindex mtrap-precision
16738 In the Alpha architecture, floating-point traps are imprecise.  This
16739 means without software assistance it is impossible to recover from a
16740 floating trap and program execution normally needs to be terminated.
16741 GCC can generate code that can assist operating system trap handlers
16742 in determining the exact location that caused a floating-point trap.
16743 Depending on the requirements of an application, different levels of
16744 precisions can be selected:
16746 @table @samp
16747 @item p
16748 Program precision.  This option is the default and means a trap handler
16749 can only identify which program caused a floating-point exception.
16751 @item f
16752 Function precision.  The trap handler can determine the function that
16753 caused a floating-point exception.
16755 @item i
16756 Instruction precision.  The trap handler can determine the exact
16757 instruction that caused a floating-point exception.
16758 @end table
16760 Other Alpha compilers provide the equivalent options called
16761 @option{-scope_safe} and @option{-resumption_safe}.
16763 @item -mieee-conformant
16764 @opindex mieee-conformant
16765 This option marks the generated code as IEEE conformant.  You must not
16766 use this option unless you also specify @option{-mtrap-precision=i} and either
16767 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
16768 is to emit the line @samp{.eflag 48} in the function prologue of the
16769 generated assembly file.
16771 @item -mbuild-constants
16772 @opindex mbuild-constants
16773 Normally GCC examines a 32- or 64-bit integer constant to
16774 see if it can construct it from smaller constants in two or three
16775 instructions.  If it cannot, it outputs the constant as a literal and
16776 generates code to load it from the data segment at run time.
16778 Use this option to require GCC to construct @emph{all} integer constants
16779 using code, even if it takes more instructions (the maximum is six).
16781 You typically use this option to build a shared library dynamic
16782 loader.  Itself a shared library, it must relocate itself in memory
16783 before it can find the variables and constants in its own data segment.
16785 @item -mbwx
16786 @itemx -mno-bwx
16787 @itemx -mcix
16788 @itemx -mno-cix
16789 @itemx -mfix
16790 @itemx -mno-fix
16791 @itemx -mmax
16792 @itemx -mno-max
16793 @opindex mbwx
16794 @opindex mno-bwx
16795 @opindex mcix
16796 @opindex mno-cix
16797 @opindex mfix
16798 @opindex mno-fix
16799 @opindex mmax
16800 @opindex mno-max
16801 Indicate whether GCC should generate code to use the optional BWX,
16802 CIX, FIX and MAX instruction sets.  The default is to use the instruction
16803 sets supported by the CPU type specified via @option{-mcpu=} option or that
16804 of the CPU on which GCC was built if none is specified.
16806 @item -mfloat-vax
16807 @itemx -mfloat-ieee
16808 @opindex mfloat-vax
16809 @opindex mfloat-ieee
16810 Generate code that uses (does not use) VAX F and G floating-point
16811 arithmetic instead of IEEE single and double precision.
16813 @item -mexplicit-relocs
16814 @itemx -mno-explicit-relocs
16815 @opindex mexplicit-relocs
16816 @opindex mno-explicit-relocs
16817 Older Alpha assemblers provided no way to generate symbol relocations
16818 except via assembler macros.  Use of these macros does not allow
16819 optimal instruction scheduling.  GNU binutils as of version 2.12
16820 supports a new syntax that allows the compiler to explicitly mark
16821 which relocations should apply to which instructions.  This option
16822 is mostly useful for debugging, as GCC detects the capabilities of
16823 the assembler when it is built and sets the default accordingly.
16825 @item -msmall-data
16826 @itemx -mlarge-data
16827 @opindex msmall-data
16828 @opindex mlarge-data
16829 When @option{-mexplicit-relocs} is in effect, static data is
16830 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
16831 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
16832 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
16833 16-bit relocations off of the @code{$gp} register.  This limits the
16834 size of the small data area to 64KB, but allows the variables to be
16835 directly accessed via a single instruction.
16837 The default is @option{-mlarge-data}.  With this option the data area
16838 is limited to just below 2GB@.  Programs that require more than 2GB of
16839 data must use @code{malloc} or @code{mmap} to allocate the data in the
16840 heap instead of in the program's data segment.
16842 When generating code for shared libraries, @option{-fpic} implies
16843 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
16845 @item -msmall-text
16846 @itemx -mlarge-text
16847 @opindex msmall-text
16848 @opindex mlarge-text
16849 When @option{-msmall-text} is used, the compiler assumes that the
16850 code of the entire program (or shared library) fits in 4MB, and is
16851 thus reachable with a branch instruction.  When @option{-msmall-data}
16852 is used, the compiler can assume that all local symbols share the
16853 same @code{$gp} value, and thus reduce the number of instructions
16854 required for a function call from 4 to 1.
16856 The default is @option{-mlarge-text}.
16858 @item -mcpu=@var{cpu_type}
16859 @opindex mcpu
16860 Set the instruction set and instruction scheduling parameters for
16861 machine type @var{cpu_type}.  You can specify either the @samp{EV}
16862 style name or the corresponding chip number.  GCC supports scheduling
16863 parameters for the EV4, EV5 and EV6 family of processors and
16864 chooses the default values for the instruction set from the processor
16865 you specify.  If you do not specify a processor type, GCC defaults
16866 to the processor on which the compiler was built.
16868 Supported values for @var{cpu_type} are
16870 @table @samp
16871 @item ev4
16872 @itemx ev45
16873 @itemx 21064
16874 Schedules as an EV4 and has no instruction set extensions.
16876 @item ev5
16877 @itemx 21164
16878 Schedules as an EV5 and has no instruction set extensions.
16880 @item ev56
16881 @itemx 21164a
16882 Schedules as an EV5 and supports the BWX extension.
16884 @item pca56
16885 @itemx 21164pc
16886 @itemx 21164PC
16887 Schedules as an EV5 and supports the BWX and MAX extensions.
16889 @item ev6
16890 @itemx 21264
16891 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
16893 @item ev67
16894 @itemx 21264a
16895 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
16896 @end table
16898 Native toolchains also support the value @samp{native},
16899 which selects the best architecture option for the host processor.
16900 @option{-mcpu=native} has no effect if GCC does not recognize
16901 the processor.
16903 @item -mtune=@var{cpu_type}
16904 @opindex mtune
16905 Set only the instruction scheduling parameters for machine type
16906 @var{cpu_type}.  The instruction set is not changed.
16908 Native toolchains also support the value @samp{native},
16909 which selects the best architecture option for the host processor.
16910 @option{-mtune=native} has no effect if GCC does not recognize
16911 the processor.
16913 @item -mmemory-latency=@var{time}
16914 @opindex mmemory-latency
16915 Sets the latency the scheduler should assume for typical memory
16916 references as seen by the application.  This number is highly
16917 dependent on the memory access patterns used by the application
16918 and the size of the external cache on the machine.
16920 Valid options for @var{time} are
16922 @table @samp
16923 @item @var{number}
16924 A decimal number representing clock cycles.
16926 @item L1
16927 @itemx L2
16928 @itemx L3
16929 @itemx main
16930 The compiler contains estimates of the number of clock cycles for
16931 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
16932 (also called Dcache, Scache, and Bcache), as well as to main memory.
16933 Note that L3 is only valid for EV5.
16935 @end table
16936 @end table
16938 @node FR30 Options
16939 @subsection FR30 Options
16940 @cindex FR30 Options
16942 These options are defined specifically for the FR30 port.
16944 @table @gcctabopt
16946 @item -msmall-model
16947 @opindex msmall-model
16948 Use the small address space model.  This can produce smaller code, but
16949 it does assume that all symbolic values and addresses fit into a
16950 20-bit range.
16952 @item -mno-lsim
16953 @opindex mno-lsim
16954 Assume that runtime support has been provided and so there is no need
16955 to include the simulator library (@file{libsim.a}) on the linker
16956 command line.
16958 @end table
16960 @node FT32 Options
16961 @subsection FT32 Options
16962 @cindex FT32 Options
16964 These options are defined specifically for the FT32 port.
16966 @table @gcctabopt
16968 @item -msim
16969 @opindex msim
16970 Specifies that the program will be run on the simulator.  This causes
16971 an alternate runtime startup and library to be linked.
16972 You must not use this option when generating programs that will run on
16973 real hardware; you must provide your own runtime library for whatever
16974 I/O functions are needed.
16976 @item -mlra
16977 @opindex mlra
16978 Enable Local Register Allocation.  This is still experimental for FT32,
16979 so by default the compiler uses standard reload.
16981 @item -mnodiv
16982 @opindex mnodiv
16983 Do not use div and mod instructions.
16985 @end table
16987 @node FRV Options
16988 @subsection FRV Options
16989 @cindex FRV Options
16991 @table @gcctabopt
16992 @item -mgpr-32
16993 @opindex mgpr-32
16995 Only use the first 32 general-purpose registers.
16997 @item -mgpr-64
16998 @opindex mgpr-64
17000 Use all 64 general-purpose registers.
17002 @item -mfpr-32
17003 @opindex mfpr-32
17005 Use only the first 32 floating-point registers.
17007 @item -mfpr-64
17008 @opindex mfpr-64
17010 Use all 64 floating-point registers.
17012 @item -mhard-float
17013 @opindex mhard-float
17015 Use hardware instructions for floating-point operations.
17017 @item -msoft-float
17018 @opindex msoft-float
17020 Use library routines for floating-point operations.
17022 @item -malloc-cc
17023 @opindex malloc-cc
17025 Dynamically allocate condition code registers.
17027 @item -mfixed-cc
17028 @opindex mfixed-cc
17030 Do not try to dynamically allocate condition code registers, only
17031 use @code{icc0} and @code{fcc0}.
17033 @item -mdword
17034 @opindex mdword
17036 Change ABI to use double word insns.
17038 @item -mno-dword
17039 @opindex mno-dword
17041 Do not use double word instructions.
17043 @item -mdouble
17044 @opindex mdouble
17046 Use floating-point double instructions.
17048 @item -mno-double
17049 @opindex mno-double
17051 Do not use floating-point double instructions.
17053 @item -mmedia
17054 @opindex mmedia
17056 Use media instructions.
17058 @item -mno-media
17059 @opindex mno-media
17061 Do not use media instructions.
17063 @item -mmuladd
17064 @opindex mmuladd
17066 Use multiply and add/subtract instructions.
17068 @item -mno-muladd
17069 @opindex mno-muladd
17071 Do not use multiply and add/subtract instructions.
17073 @item -mfdpic
17074 @opindex mfdpic
17076 Select the FDPIC ABI, which uses function descriptors to represent
17077 pointers to functions.  Without any PIC/PIE-related options, it
17078 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
17079 assumes GOT entries and small data are within a 12-bit range from the
17080 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
17081 are computed with 32 bits.
17082 With a @samp{bfin-elf} target, this option implies @option{-msim}.
17084 @item -minline-plt
17085 @opindex minline-plt
17087 Enable inlining of PLT entries in function calls to functions that are
17088 not known to bind locally.  It has no effect without @option{-mfdpic}.
17089 It's enabled by default if optimizing for speed and compiling for
17090 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
17091 optimization option such as @option{-O3} or above is present in the
17092 command line.
17094 @item -mTLS
17095 @opindex mTLS
17097 Assume a large TLS segment when generating thread-local code.
17099 @item -mtls
17100 @opindex mtls
17102 Do not assume a large TLS segment when generating thread-local code.
17104 @item -mgprel-ro
17105 @opindex mgprel-ro
17107 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
17108 that is known to be in read-only sections.  It's enabled by default,
17109 except for @option{-fpic} or @option{-fpie}: even though it may help
17110 make the global offset table smaller, it trades 1 instruction for 4.
17111 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
17112 one of which may be shared by multiple symbols, and it avoids the need
17113 for a GOT entry for the referenced symbol, so it's more likely to be a
17114 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
17116 @item -multilib-library-pic
17117 @opindex multilib-library-pic
17119 Link with the (library, not FD) pic libraries.  It's implied by
17120 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
17121 @option{-fpic} without @option{-mfdpic}.  You should never have to use
17122 it explicitly.
17124 @item -mlinked-fp
17125 @opindex mlinked-fp
17127 Follow the EABI requirement of always creating a frame pointer whenever
17128 a stack frame is allocated.  This option is enabled by default and can
17129 be disabled with @option{-mno-linked-fp}.
17131 @item -mlong-calls
17132 @opindex mlong-calls
17134 Use indirect addressing to call functions outside the current
17135 compilation unit.  This allows the functions to be placed anywhere
17136 within the 32-bit address space.
17138 @item -malign-labels
17139 @opindex malign-labels
17141 Try to align labels to an 8-byte boundary by inserting NOPs into the
17142 previous packet.  This option only has an effect when VLIW packing
17143 is enabled.  It doesn't create new packets; it merely adds NOPs to
17144 existing ones.
17146 @item -mlibrary-pic
17147 @opindex mlibrary-pic
17149 Generate position-independent EABI code.
17151 @item -macc-4
17152 @opindex macc-4
17154 Use only the first four media accumulator registers.
17156 @item -macc-8
17157 @opindex macc-8
17159 Use all eight media accumulator registers.
17161 @item -mpack
17162 @opindex mpack
17164 Pack VLIW instructions.
17166 @item -mno-pack
17167 @opindex mno-pack
17169 Do not pack VLIW instructions.
17171 @item -mno-eflags
17172 @opindex mno-eflags
17174 Do not mark ABI switches in e_flags.
17176 @item -mcond-move
17177 @opindex mcond-move
17179 Enable the use of conditional-move instructions (default).
17181 This switch is mainly for debugging the compiler and will likely be removed
17182 in a future version.
17184 @item -mno-cond-move
17185 @opindex mno-cond-move
17187 Disable the use of conditional-move instructions.
17189 This switch is mainly for debugging the compiler and will likely be removed
17190 in a future version.
17192 @item -mscc
17193 @opindex mscc
17195 Enable the use of conditional set instructions (default).
17197 This switch is mainly for debugging the compiler and will likely be removed
17198 in a future version.
17200 @item -mno-scc
17201 @opindex mno-scc
17203 Disable the use of conditional set instructions.
17205 This switch is mainly for debugging the compiler and will likely be removed
17206 in a future version.
17208 @item -mcond-exec
17209 @opindex mcond-exec
17211 Enable the use of conditional execution (default).
17213 This switch is mainly for debugging the compiler and will likely be removed
17214 in a future version.
17216 @item -mno-cond-exec
17217 @opindex mno-cond-exec
17219 Disable the use of conditional execution.
17221 This switch is mainly for debugging the compiler and will likely be removed
17222 in a future version.
17224 @item -mvliw-branch
17225 @opindex mvliw-branch
17227 Run a pass to pack branches into VLIW instructions (default).
17229 This switch is mainly for debugging the compiler and will likely be removed
17230 in a future version.
17232 @item -mno-vliw-branch
17233 @opindex mno-vliw-branch
17235 Do not run a pass to pack branches into VLIW instructions.
17237 This switch is mainly for debugging the compiler and will likely be removed
17238 in a future version.
17240 @item -mmulti-cond-exec
17241 @opindex mmulti-cond-exec
17243 Enable optimization of @code{&&} and @code{||} in conditional execution
17244 (default).
17246 This switch is mainly for debugging the compiler and will likely be removed
17247 in a future version.
17249 @item -mno-multi-cond-exec
17250 @opindex mno-multi-cond-exec
17252 Disable optimization of @code{&&} and @code{||} in conditional execution.
17254 This switch is mainly for debugging the compiler and will likely be removed
17255 in a future version.
17257 @item -mnested-cond-exec
17258 @opindex mnested-cond-exec
17260 Enable nested conditional execution optimizations (default).
17262 This switch is mainly for debugging the compiler and will likely be removed
17263 in a future version.
17265 @item -mno-nested-cond-exec
17266 @opindex mno-nested-cond-exec
17268 Disable nested conditional execution optimizations.
17270 This switch is mainly for debugging the compiler and will likely be removed
17271 in a future version.
17273 @item -moptimize-membar
17274 @opindex moptimize-membar
17276 This switch removes redundant @code{membar} instructions from the
17277 compiler-generated code.  It is enabled by default.
17279 @item -mno-optimize-membar
17280 @opindex mno-optimize-membar
17282 This switch disables the automatic removal of redundant @code{membar}
17283 instructions from the generated code.
17285 @item -mtomcat-stats
17286 @opindex mtomcat-stats
17288 Cause gas to print out tomcat statistics.
17290 @item -mcpu=@var{cpu}
17291 @opindex mcpu
17293 Select the processor type for which to generate code.  Possible values are
17294 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
17295 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
17297 @end table
17299 @node GNU/Linux Options
17300 @subsection GNU/Linux Options
17302 These @samp{-m} options are defined for GNU/Linux targets:
17304 @table @gcctabopt
17305 @item -mglibc
17306 @opindex mglibc
17307 Use the GNU C library.  This is the default except
17308 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
17309 @samp{*-*-linux-*android*} targets.
17311 @item -muclibc
17312 @opindex muclibc
17313 Use uClibc C library.  This is the default on
17314 @samp{*-*-linux-*uclibc*} targets.
17316 @item -mmusl
17317 @opindex mmusl
17318 Use the musl C library.  This is the default on
17319 @samp{*-*-linux-*musl*} targets.
17321 @item -mbionic
17322 @opindex mbionic
17323 Use Bionic C library.  This is the default on
17324 @samp{*-*-linux-*android*} targets.
17326 @item -mandroid
17327 @opindex mandroid
17328 Compile code compatible with Android platform.  This is the default on
17329 @samp{*-*-linux-*android*} targets.
17331 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
17332 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
17333 this option makes the GCC driver pass Android-specific options to the linker.
17334 Finally, this option causes the preprocessor macro @code{__ANDROID__}
17335 to be defined.
17337 @item -tno-android-cc
17338 @opindex tno-android-cc
17339 Disable compilation effects of @option{-mandroid}, i.e., do not enable
17340 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
17341 @option{-fno-rtti} by default.
17343 @item -tno-android-ld
17344 @opindex tno-android-ld
17345 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
17346 linking options to the linker.
17348 @end table
17350 @node H8/300 Options
17351 @subsection H8/300 Options
17353 These @samp{-m} options are defined for the H8/300 implementations:
17355 @table @gcctabopt
17356 @item -mrelax
17357 @opindex mrelax
17358 Shorten some address references at link time, when possible; uses the
17359 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
17360 ld, Using ld}, for a fuller description.
17362 @item -mh
17363 @opindex mh
17364 Generate code for the H8/300H@.
17366 @item -ms
17367 @opindex ms
17368 Generate code for the H8S@.
17370 @item -mn
17371 @opindex mn
17372 Generate code for the H8S and H8/300H in the normal mode.  This switch
17373 must be used either with @option{-mh} or @option{-ms}.
17375 @item -ms2600
17376 @opindex ms2600
17377 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
17379 @item -mexr
17380 @opindex mexr
17381 Extended registers are stored on stack before execution of function
17382 with monitor attribute. Default option is @option{-mexr}.
17383 This option is valid only for H8S targets.
17385 @item -mno-exr
17386 @opindex mno-exr
17387 Extended registers are not stored on stack before execution of function 
17388 with monitor attribute. Default option is @option{-mno-exr}. 
17389 This option is valid only for H8S targets.
17391 @item -mint32
17392 @opindex mint32
17393 Make @code{int} data 32 bits by default.
17395 @item -malign-300
17396 @opindex malign-300
17397 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
17398 The default for the H8/300H and H8S is to align longs and floats on
17399 4-byte boundaries.
17400 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
17401 This option has no effect on the H8/300.
17402 @end table
17404 @node HPPA Options
17405 @subsection HPPA Options
17406 @cindex HPPA Options
17408 These @samp{-m} options are defined for the HPPA family of computers:
17410 @table @gcctabopt
17411 @item -march=@var{architecture-type}
17412 @opindex march
17413 Generate code for the specified architecture.  The choices for
17414 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
17415 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
17416 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
17417 architecture option for your machine.  Code compiled for lower numbered
17418 architectures runs on higher numbered architectures, but not the
17419 other way around.
17421 @item -mpa-risc-1-0
17422 @itemx -mpa-risc-1-1
17423 @itemx -mpa-risc-2-0
17424 @opindex mpa-risc-1-0
17425 @opindex mpa-risc-1-1
17426 @opindex mpa-risc-2-0
17427 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
17429 @item -mcaller-copies
17430 @opindex mcaller-copies
17431 The caller copies function arguments passed by hidden reference.  This
17432 option should be used with care as it is not compatible with the default
17433 32-bit runtime.  However, only aggregates larger than eight bytes are
17434 passed by hidden reference and the option provides better compatibility
17435 with OpenMP.
17437 @item -mjump-in-delay
17438 @opindex mjump-in-delay
17439 This option is ignored and provided for compatibility purposes only.
17441 @item -mdisable-fpregs
17442 @opindex mdisable-fpregs
17443 Prevent floating-point registers from being used in any manner.  This is
17444 necessary for compiling kernels that perform lazy context switching of
17445 floating-point registers.  If you use this option and attempt to perform
17446 floating-point operations, the compiler aborts.
17448 @item -mdisable-indexing
17449 @opindex mdisable-indexing
17450 Prevent the compiler from using indexing address modes.  This avoids some
17451 rather obscure problems when compiling MIG generated code under MACH@.
17453 @item -mno-space-regs
17454 @opindex mno-space-regs
17455 Generate code that assumes the target has no space registers.  This allows
17456 GCC to generate faster indirect calls and use unscaled index address modes.
17458 Such code is suitable for level 0 PA systems and kernels.
17460 @item -mfast-indirect-calls
17461 @opindex mfast-indirect-calls
17462 Generate code that assumes calls never cross space boundaries.  This
17463 allows GCC to emit code that performs faster indirect calls.
17465 This option does not work in the presence of shared libraries or nested
17466 functions.
17468 @item -mfixed-range=@var{register-range}
17469 @opindex mfixed-range
17470 Generate code treating the given register range as fixed registers.
17471 A fixed register is one that the register allocator cannot use.  This is
17472 useful when compiling kernel code.  A register range is specified as
17473 two registers separated by a dash.  Multiple register ranges can be
17474 specified separated by a comma.
17476 @item -mlong-load-store
17477 @opindex mlong-load-store
17478 Generate 3-instruction load and store sequences as sometimes required by
17479 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
17480 the HP compilers.
17482 @item -mportable-runtime
17483 @opindex mportable-runtime
17484 Use the portable calling conventions proposed by HP for ELF systems.
17486 @item -mgas
17487 @opindex mgas
17488 Enable the use of assembler directives only GAS understands.
17490 @item -mschedule=@var{cpu-type}
17491 @opindex mschedule
17492 Schedule code according to the constraints for the machine type
17493 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
17494 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
17495 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
17496 proper scheduling option for your machine.  The default scheduling is
17497 @samp{8000}.
17499 @item -mlinker-opt
17500 @opindex mlinker-opt
17501 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
17502 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
17503 linkers in which they give bogus error messages when linking some programs.
17505 @item -msoft-float
17506 @opindex msoft-float
17507 Generate output containing library calls for floating point.
17508 @strong{Warning:} the requisite libraries are not available for all HPPA
17509 targets.  Normally the facilities of the machine's usual C compiler are
17510 used, but this cannot be done directly in cross-compilation.  You must make
17511 your own arrangements to provide suitable library functions for
17512 cross-compilation.
17514 @option{-msoft-float} changes the calling convention in the output file;
17515 therefore, it is only useful if you compile @emph{all} of a program with
17516 this option.  In particular, you need to compile @file{libgcc.a}, the
17517 library that comes with GCC, with @option{-msoft-float} in order for
17518 this to work.
17520 @item -msio
17521 @opindex msio
17522 Generate the predefine, @code{_SIO}, for server IO@.  The default is
17523 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
17524 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
17525 options are available under HP-UX and HI-UX@.
17527 @item -mgnu-ld
17528 @opindex mgnu-ld
17529 Use options specific to GNU @command{ld}.
17530 This passes @option{-shared} to @command{ld} when
17531 building a shared library.  It is the default when GCC is configured,
17532 explicitly or implicitly, with the GNU linker.  This option does not
17533 affect which @command{ld} is called; it only changes what parameters
17534 are passed to that @command{ld}.
17535 The @command{ld} that is called is determined by the
17536 @option{--with-ld} configure option, GCC's program search path, and
17537 finally by the user's @env{PATH}.  The linker used by GCC can be printed
17538 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
17539 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
17541 @item -mhp-ld
17542 @opindex mhp-ld
17543 Use options specific to HP @command{ld}.
17544 This passes @option{-b} to @command{ld} when building
17545 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
17546 links.  It is the default when GCC is configured, explicitly or
17547 implicitly, with the HP linker.  This option does not affect
17548 which @command{ld} is called; it only changes what parameters are passed to that
17549 @command{ld}.
17550 The @command{ld} that is called is determined by the @option{--with-ld}
17551 configure option, GCC's program search path, and finally by the user's
17552 @env{PATH}.  The linker used by GCC can be printed using @samp{which
17553 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
17554 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
17556 @item -mlong-calls
17557 @opindex mno-long-calls
17558 Generate code that uses long call sequences.  This ensures that a call
17559 is always able to reach linker generated stubs.  The default is to generate
17560 long calls only when the distance from the call site to the beginning
17561 of the function or translation unit, as the case may be, exceeds a
17562 predefined limit set by the branch type being used.  The limits for
17563 normal calls are 7,600,000 and 240,000 bytes, respectively for the
17564 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
17565 240,000 bytes.
17567 Distances are measured from the beginning of functions when using the
17568 @option{-ffunction-sections} option, or when using the @option{-mgas}
17569 and @option{-mno-portable-runtime} options together under HP-UX with
17570 the SOM linker.
17572 It is normally not desirable to use this option as it degrades
17573 performance.  However, it may be useful in large applications,
17574 particularly when partial linking is used to build the application.
17576 The types of long calls used depends on the capabilities of the
17577 assembler and linker, and the type of code being generated.  The
17578 impact on systems that support long absolute calls, and long pic
17579 symbol-difference or pc-relative calls should be relatively small.
17580 However, an indirect call is used on 32-bit ELF systems in pic code
17581 and it is quite long.
17583 @item -munix=@var{unix-std}
17584 @opindex march
17585 Generate compiler predefines and select a startfile for the specified
17586 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
17587 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
17588 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
17589 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
17590 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
17591 and later.
17593 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
17594 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
17595 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
17596 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
17597 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
17598 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
17600 It is @emph{important} to note that this option changes the interfaces
17601 for various library routines.  It also affects the operational behavior
17602 of the C library.  Thus, @emph{extreme} care is needed in using this
17603 option.
17605 Library code that is intended to operate with more than one UNIX
17606 standard must test, set and restore the variable @code{__xpg4_extended_mask}
17607 as appropriate.  Most GNU software doesn't provide this capability.
17609 @item -nolibdld
17610 @opindex nolibdld
17611 Suppress the generation of link options to search libdld.sl when the
17612 @option{-static} option is specified on HP-UX 10 and later.
17614 @item -static
17615 @opindex static
17616 The HP-UX implementation of setlocale in libc has a dependency on
17617 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
17618 when the @option{-static} option is specified, special link options
17619 are needed to resolve this dependency.
17621 On HP-UX 10 and later, the GCC driver adds the necessary options to
17622 link with libdld.sl when the @option{-static} option is specified.
17623 This causes the resulting binary to be dynamic.  On the 64-bit port,
17624 the linkers generate dynamic binaries by default in any case.  The
17625 @option{-nolibdld} option can be used to prevent the GCC driver from
17626 adding these link options.
17628 @item -threads
17629 @opindex threads
17630 Add support for multithreading with the @dfn{dce thread} library
17631 under HP-UX@.  This option sets flags for both the preprocessor and
17632 linker.
17633 @end table
17635 @node IA-64 Options
17636 @subsection IA-64 Options
17637 @cindex IA-64 Options
17639 These are the @samp{-m} options defined for the Intel IA-64 architecture.
17641 @table @gcctabopt
17642 @item -mbig-endian
17643 @opindex mbig-endian
17644 Generate code for a big-endian target.  This is the default for HP-UX@.
17646 @item -mlittle-endian
17647 @opindex mlittle-endian
17648 Generate code for a little-endian target.  This is the default for AIX5
17649 and GNU/Linux.
17651 @item -mgnu-as
17652 @itemx -mno-gnu-as
17653 @opindex mgnu-as
17654 @opindex mno-gnu-as
17655 Generate (or don't) code for the GNU assembler.  This is the default.
17656 @c Also, this is the default if the configure option @option{--with-gnu-as}
17657 @c is used.
17659 @item -mgnu-ld
17660 @itemx -mno-gnu-ld
17661 @opindex mgnu-ld
17662 @opindex mno-gnu-ld
17663 Generate (or don't) code for the GNU linker.  This is the default.
17664 @c Also, this is the default if the configure option @option{--with-gnu-ld}
17665 @c is used.
17667 @item -mno-pic
17668 @opindex mno-pic
17669 Generate code that does not use a global pointer register.  The result
17670 is not position independent code, and violates the IA-64 ABI@.
17672 @item -mvolatile-asm-stop
17673 @itemx -mno-volatile-asm-stop
17674 @opindex mvolatile-asm-stop
17675 @opindex mno-volatile-asm-stop
17676 Generate (or don't) a stop bit immediately before and after volatile asm
17677 statements.
17679 @item -mregister-names
17680 @itemx -mno-register-names
17681 @opindex mregister-names
17682 @opindex mno-register-names
17683 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
17684 the stacked registers.  This may make assembler output more readable.
17686 @item -mno-sdata
17687 @itemx -msdata
17688 @opindex mno-sdata
17689 @opindex msdata
17690 Disable (or enable) optimizations that use the small data section.  This may
17691 be useful for working around optimizer bugs.
17693 @item -mconstant-gp
17694 @opindex mconstant-gp
17695 Generate code that uses a single constant global pointer value.  This is
17696 useful when compiling kernel code.
17698 @item -mauto-pic
17699 @opindex mauto-pic
17700 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
17701 This is useful when compiling firmware code.
17703 @item -minline-float-divide-min-latency
17704 @opindex minline-float-divide-min-latency
17705 Generate code for inline divides of floating-point values
17706 using the minimum latency algorithm.
17708 @item -minline-float-divide-max-throughput
17709 @opindex minline-float-divide-max-throughput
17710 Generate code for inline divides of floating-point values
17711 using the maximum throughput algorithm.
17713 @item -mno-inline-float-divide
17714 @opindex mno-inline-float-divide
17715 Do not generate inline code for divides of floating-point values.
17717 @item -minline-int-divide-min-latency
17718 @opindex minline-int-divide-min-latency
17719 Generate code for inline divides of integer values
17720 using the minimum latency algorithm.
17722 @item -minline-int-divide-max-throughput
17723 @opindex minline-int-divide-max-throughput
17724 Generate code for inline divides of integer values
17725 using the maximum throughput algorithm.
17727 @item -mno-inline-int-divide
17728 @opindex mno-inline-int-divide
17729 Do not generate inline code for divides of integer values.
17731 @item -minline-sqrt-min-latency
17732 @opindex minline-sqrt-min-latency
17733 Generate code for inline square roots
17734 using the minimum latency algorithm.
17736 @item -minline-sqrt-max-throughput
17737 @opindex minline-sqrt-max-throughput
17738 Generate code for inline square roots
17739 using the maximum throughput algorithm.
17741 @item -mno-inline-sqrt
17742 @opindex mno-inline-sqrt
17743 Do not generate inline code for @code{sqrt}.
17745 @item -mfused-madd
17746 @itemx -mno-fused-madd
17747 @opindex mfused-madd
17748 @opindex mno-fused-madd
17749 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
17750 instructions.  The default is to use these instructions.
17752 @item -mno-dwarf2-asm
17753 @itemx -mdwarf2-asm
17754 @opindex mno-dwarf2-asm
17755 @opindex mdwarf2-asm
17756 Don't (or do) generate assembler code for the DWARF line number debugging
17757 info.  This may be useful when not using the GNU assembler.
17759 @item -mearly-stop-bits
17760 @itemx -mno-early-stop-bits
17761 @opindex mearly-stop-bits
17762 @opindex mno-early-stop-bits
17763 Allow stop bits to be placed earlier than immediately preceding the
17764 instruction that triggered the stop bit.  This can improve instruction
17765 scheduling, but does not always do so.
17767 @item -mfixed-range=@var{register-range}
17768 @opindex mfixed-range
17769 Generate code treating the given register range as fixed registers.
17770 A fixed register is one that the register allocator cannot use.  This is
17771 useful when compiling kernel code.  A register range is specified as
17772 two registers separated by a dash.  Multiple register ranges can be
17773 specified separated by a comma.
17775 @item -mtls-size=@var{tls-size}
17776 @opindex mtls-size
17777 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
17780 @item -mtune=@var{cpu-type}
17781 @opindex mtune
17782 Tune the instruction scheduling for a particular CPU, Valid values are
17783 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
17784 and @samp{mckinley}.
17786 @item -milp32
17787 @itemx -mlp64
17788 @opindex milp32
17789 @opindex mlp64
17790 Generate code for a 32-bit or 64-bit environment.
17791 The 32-bit environment sets int, long and pointer to 32 bits.
17792 The 64-bit environment sets int to 32 bits and long and pointer
17793 to 64 bits.  These are HP-UX specific flags.
17795 @item -mno-sched-br-data-spec
17796 @itemx -msched-br-data-spec
17797 @opindex mno-sched-br-data-spec
17798 @opindex msched-br-data-spec
17799 (Dis/En)able data speculative scheduling before reload.
17800 This results in generation of @code{ld.a} instructions and
17801 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
17802 The default setting is disabled.
17804 @item -msched-ar-data-spec
17805 @itemx -mno-sched-ar-data-spec
17806 @opindex msched-ar-data-spec
17807 @opindex mno-sched-ar-data-spec
17808 (En/Dis)able data speculative scheduling after reload.
17809 This results in generation of @code{ld.a} instructions and
17810 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
17811 The default setting is enabled.
17813 @item -mno-sched-control-spec
17814 @itemx -msched-control-spec
17815 @opindex mno-sched-control-spec
17816 @opindex msched-control-spec
17817 (Dis/En)able control speculative scheduling.  This feature is
17818 available only during region scheduling (i.e.@: before reload).
17819 This results in generation of the @code{ld.s} instructions and
17820 the corresponding check instructions @code{chk.s}.
17821 The default setting is disabled.
17823 @item -msched-br-in-data-spec
17824 @itemx -mno-sched-br-in-data-spec
17825 @opindex msched-br-in-data-spec
17826 @opindex mno-sched-br-in-data-spec
17827 (En/Dis)able speculative scheduling of the instructions that
17828 are dependent on the data speculative loads before reload.
17829 This is effective only with @option{-msched-br-data-spec} enabled.
17830 The default setting is enabled.
17832 @item -msched-ar-in-data-spec
17833 @itemx -mno-sched-ar-in-data-spec
17834 @opindex msched-ar-in-data-spec
17835 @opindex mno-sched-ar-in-data-spec
17836 (En/Dis)able speculative scheduling of the instructions that
17837 are dependent on the data speculative loads after reload.
17838 This is effective only with @option{-msched-ar-data-spec} enabled.
17839 The default setting is enabled.
17841 @item -msched-in-control-spec
17842 @itemx -mno-sched-in-control-spec
17843 @opindex msched-in-control-spec
17844 @opindex mno-sched-in-control-spec
17845 (En/Dis)able speculative scheduling of the instructions that
17846 are dependent on the control speculative loads.
17847 This is effective only with @option{-msched-control-spec} enabled.
17848 The default setting is enabled.
17850 @item -mno-sched-prefer-non-data-spec-insns
17851 @itemx -msched-prefer-non-data-spec-insns
17852 @opindex mno-sched-prefer-non-data-spec-insns
17853 @opindex msched-prefer-non-data-spec-insns
17854 If enabled, data-speculative instructions are chosen for schedule
17855 only if there are no other choices at the moment.  This makes
17856 the use of the data speculation much more conservative.
17857 The default setting is disabled.
17859 @item -mno-sched-prefer-non-control-spec-insns
17860 @itemx -msched-prefer-non-control-spec-insns
17861 @opindex mno-sched-prefer-non-control-spec-insns
17862 @opindex msched-prefer-non-control-spec-insns
17863 If enabled, control-speculative instructions are chosen for schedule
17864 only if there are no other choices at the moment.  This makes
17865 the use of the control speculation much more conservative.
17866 The default setting is disabled.
17868 @item -mno-sched-count-spec-in-critical-path
17869 @itemx -msched-count-spec-in-critical-path
17870 @opindex mno-sched-count-spec-in-critical-path
17871 @opindex msched-count-spec-in-critical-path
17872 If enabled, speculative dependencies are considered during
17873 computation of the instructions priorities.  This makes the use of the
17874 speculation a bit more conservative.
17875 The default setting is disabled.
17877 @item -msched-spec-ldc
17878 @opindex msched-spec-ldc
17879 Use a simple data speculation check.  This option is on by default.
17881 @item -msched-control-spec-ldc
17882 @opindex msched-spec-ldc
17883 Use a simple check for control speculation.  This option is on by default.
17885 @item -msched-stop-bits-after-every-cycle
17886 @opindex msched-stop-bits-after-every-cycle
17887 Place a stop bit after every cycle when scheduling.  This option is on
17888 by default.
17890 @item -msched-fp-mem-deps-zero-cost
17891 @opindex msched-fp-mem-deps-zero-cost
17892 Assume that floating-point stores and loads are not likely to cause a conflict
17893 when placed into the same instruction group.  This option is disabled by
17894 default.
17896 @item -msel-sched-dont-check-control-spec
17897 @opindex msel-sched-dont-check-control-spec
17898 Generate checks for control speculation in selective scheduling.
17899 This flag is disabled by default.
17901 @item -msched-max-memory-insns=@var{max-insns}
17902 @opindex msched-max-memory-insns
17903 Limit on the number of memory insns per instruction group, giving lower
17904 priority to subsequent memory insns attempting to schedule in the same
17905 instruction group. Frequently useful to prevent cache bank conflicts.
17906 The default value is 1.
17908 @item -msched-max-memory-insns-hard-limit
17909 @opindex msched-max-memory-insns-hard-limit
17910 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
17911 disallowing more than that number in an instruction group.
17912 Otherwise, the limit is ``soft'', meaning that non-memory operations
17913 are preferred when the limit is reached, but memory operations may still
17914 be scheduled.
17916 @end table
17918 @node LM32 Options
17919 @subsection LM32 Options
17920 @cindex LM32 options
17922 These @option{-m} options are defined for the LatticeMico32 architecture:
17924 @table @gcctabopt
17925 @item -mbarrel-shift-enabled
17926 @opindex mbarrel-shift-enabled
17927 Enable barrel-shift instructions.
17929 @item -mdivide-enabled
17930 @opindex mdivide-enabled
17931 Enable divide and modulus instructions.
17933 @item -mmultiply-enabled
17934 @opindex multiply-enabled
17935 Enable multiply instructions.
17937 @item -msign-extend-enabled
17938 @opindex msign-extend-enabled
17939 Enable sign extend instructions.
17941 @item -muser-enabled
17942 @opindex muser-enabled
17943 Enable user-defined instructions.
17945 @end table
17947 @node M32C Options
17948 @subsection M32C Options
17949 @cindex M32C options
17951 @table @gcctabopt
17952 @item -mcpu=@var{name}
17953 @opindex mcpu=
17954 Select the CPU for which code is generated.  @var{name} may be one of
17955 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
17956 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
17957 the M32C/80 series.
17959 @item -msim
17960 @opindex msim
17961 Specifies that the program will be run on the simulator.  This causes
17962 an alternate runtime library to be linked in which supports, for
17963 example, file I/O@.  You must not use this option when generating
17964 programs that will run on real hardware; you must provide your own
17965 runtime library for whatever I/O functions are needed.
17967 @item -memregs=@var{number}
17968 @opindex memregs=
17969 Specifies the number of memory-based pseudo-registers GCC uses
17970 during code generation.  These pseudo-registers are used like real
17971 registers, so there is a tradeoff between GCC's ability to fit the
17972 code into available registers, and the performance penalty of using
17973 memory instead of registers.  Note that all modules in a program must
17974 be compiled with the same value for this option.  Because of that, you
17975 must not use this option with GCC's default runtime libraries.
17977 @end table
17979 @node M32R/D Options
17980 @subsection M32R/D Options
17981 @cindex M32R/D options
17983 These @option{-m} options are defined for Renesas M32R/D architectures:
17985 @table @gcctabopt
17986 @item -m32r2
17987 @opindex m32r2
17988 Generate code for the M32R/2@.
17990 @item -m32rx
17991 @opindex m32rx
17992 Generate code for the M32R/X@.
17994 @item -m32r
17995 @opindex m32r
17996 Generate code for the M32R@.  This is the default.
17998 @item -mmodel=small
17999 @opindex mmodel=small
18000 Assume all objects live in the lower 16MB of memory (so that their addresses
18001 can be loaded with the @code{ld24} instruction), and assume all subroutines
18002 are reachable with the @code{bl} instruction.
18003 This is the default.
18005 The addressability of a particular object can be set with the
18006 @code{model} attribute.
18008 @item -mmodel=medium
18009 @opindex mmodel=medium
18010 Assume objects may be anywhere in the 32-bit address space (the compiler
18011 generates @code{seth/add3} instructions to load their addresses), and
18012 assume all subroutines are reachable with the @code{bl} instruction.
18014 @item -mmodel=large
18015 @opindex mmodel=large
18016 Assume objects may be anywhere in the 32-bit address space (the compiler
18017 generates @code{seth/add3} instructions to load their addresses), and
18018 assume subroutines may not be reachable with the @code{bl} instruction
18019 (the compiler generates the much slower @code{seth/add3/jl}
18020 instruction sequence).
18022 @item -msdata=none
18023 @opindex msdata=none
18024 Disable use of the small data area.  Variables are put into
18025 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
18026 @code{section} attribute has been specified).
18027 This is the default.
18029 The small data area consists of sections @code{.sdata} and @code{.sbss}.
18030 Objects may be explicitly put in the small data area with the
18031 @code{section} attribute using one of these sections.
18033 @item -msdata=sdata
18034 @opindex msdata=sdata
18035 Put small global and static data in the small data area, but do not
18036 generate special code to reference them.
18038 @item -msdata=use
18039 @opindex msdata=use
18040 Put small global and static data in the small data area, and generate
18041 special instructions to reference them.
18043 @item -G @var{num}
18044 @opindex G
18045 @cindex smaller data references
18046 Put global and static objects less than or equal to @var{num} bytes
18047 into the small data or BSS sections instead of the normal data or BSS
18048 sections.  The default value of @var{num} is 8.
18049 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
18050 for this option to have any effect.
18052 All modules should be compiled with the same @option{-G @var{num}} value.
18053 Compiling with different values of @var{num} may or may not work; if it
18054 doesn't the linker gives an error message---incorrect code is not
18055 generated.
18057 @item -mdebug
18058 @opindex mdebug
18059 Makes the M32R-specific code in the compiler display some statistics
18060 that might help in debugging programs.
18062 @item -malign-loops
18063 @opindex malign-loops
18064 Align all loops to a 32-byte boundary.
18066 @item -mno-align-loops
18067 @opindex mno-align-loops
18068 Do not enforce a 32-byte alignment for loops.  This is the default.
18070 @item -missue-rate=@var{number}
18071 @opindex missue-rate=@var{number}
18072 Issue @var{number} instructions per cycle.  @var{number} can only be 1
18073 or 2.
18075 @item -mbranch-cost=@var{number}
18076 @opindex mbranch-cost=@var{number}
18077 @var{number} can only be 1 or 2.  If it is 1 then branches are
18078 preferred over conditional code, if it is 2, then the opposite applies.
18080 @item -mflush-trap=@var{number}
18081 @opindex mflush-trap=@var{number}
18082 Specifies the trap number to use to flush the cache.  The default is
18083 12.  Valid numbers are between 0 and 15 inclusive.
18085 @item -mno-flush-trap
18086 @opindex mno-flush-trap
18087 Specifies that the cache cannot be flushed by using a trap.
18089 @item -mflush-func=@var{name}
18090 @opindex mflush-func=@var{name}
18091 Specifies the name of the operating system function to call to flush
18092 the cache.  The default is @samp{_flush_cache}, but a function call
18093 is only used if a trap is not available.
18095 @item -mno-flush-func
18096 @opindex mno-flush-func
18097 Indicates that there is no OS function for flushing the cache.
18099 @end table
18101 @node M680x0 Options
18102 @subsection M680x0 Options
18103 @cindex M680x0 options
18105 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
18106 The default settings depend on which architecture was selected when
18107 the compiler was configured; the defaults for the most common choices
18108 are given below.
18110 @table @gcctabopt
18111 @item -march=@var{arch}
18112 @opindex march
18113 Generate code for a specific M680x0 or ColdFire instruction set
18114 architecture.  Permissible values of @var{arch} for M680x0
18115 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
18116 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
18117 architectures are selected according to Freescale's ISA classification
18118 and the permissible values are: @samp{isaa}, @samp{isaaplus},
18119 @samp{isab} and @samp{isac}.
18121 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
18122 code for a ColdFire target.  The @var{arch} in this macro is one of the
18123 @option{-march} arguments given above.
18125 When used together, @option{-march} and @option{-mtune} select code
18126 that runs on a family of similar processors but that is optimized
18127 for a particular microarchitecture.
18129 @item -mcpu=@var{cpu}
18130 @opindex mcpu
18131 Generate code for a specific M680x0 or ColdFire processor.
18132 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
18133 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
18134 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
18135 below, which also classifies the CPUs into families:
18137 @multitable @columnfractions 0.20 0.80
18138 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
18139 @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}
18140 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
18141 @item @samp{5206e} @tab @samp{5206e}
18142 @item @samp{5208} @tab @samp{5207} @samp{5208}
18143 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
18144 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
18145 @item @samp{5216} @tab @samp{5214} @samp{5216}
18146 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
18147 @item @samp{5225} @tab @samp{5224} @samp{5225}
18148 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
18149 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
18150 @item @samp{5249} @tab @samp{5249}
18151 @item @samp{5250} @tab @samp{5250}
18152 @item @samp{5271} @tab @samp{5270} @samp{5271}
18153 @item @samp{5272} @tab @samp{5272}
18154 @item @samp{5275} @tab @samp{5274} @samp{5275}
18155 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
18156 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
18157 @item @samp{5307} @tab @samp{5307}
18158 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
18159 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
18160 @item @samp{5407} @tab @samp{5407}
18161 @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}
18162 @end multitable
18164 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
18165 @var{arch} is compatible with @var{cpu}.  Other combinations of
18166 @option{-mcpu} and @option{-march} are rejected.
18168 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
18169 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
18170 where the value of @var{family} is given by the table above.
18172 @item -mtune=@var{tune}
18173 @opindex mtune
18174 Tune the code for a particular microarchitecture within the
18175 constraints set by @option{-march} and @option{-mcpu}.
18176 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
18177 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
18178 and @samp{cpu32}.  The ColdFire microarchitectures
18179 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
18181 You can also use @option{-mtune=68020-40} for code that needs
18182 to run relatively well on 68020, 68030 and 68040 targets.
18183 @option{-mtune=68020-60} is similar but includes 68060 targets
18184 as well.  These two options select the same tuning decisions as
18185 @option{-m68020-40} and @option{-m68020-60} respectively.
18187 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
18188 when tuning for 680x0 architecture @var{arch}.  It also defines
18189 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
18190 option is used.  If GCC is tuning for a range of architectures,
18191 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
18192 it defines the macros for every architecture in the range.
18194 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
18195 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
18196 of the arguments given above.
18198 @item -m68000
18199 @itemx -mc68000
18200 @opindex m68000
18201 @opindex mc68000
18202 Generate output for a 68000.  This is the default
18203 when the compiler is configured for 68000-based systems.
18204 It is equivalent to @option{-march=68000}.
18206 Use this option for microcontrollers with a 68000 or EC000 core,
18207 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
18209 @item -m68010
18210 @opindex m68010
18211 Generate output for a 68010.  This is the default
18212 when the compiler is configured for 68010-based systems.
18213 It is equivalent to @option{-march=68010}.
18215 @item -m68020
18216 @itemx -mc68020
18217 @opindex m68020
18218 @opindex mc68020
18219 Generate output for a 68020.  This is the default
18220 when the compiler is configured for 68020-based systems.
18221 It is equivalent to @option{-march=68020}.
18223 @item -m68030
18224 @opindex m68030
18225 Generate output for a 68030.  This is the default when the compiler is
18226 configured for 68030-based systems.  It is equivalent to
18227 @option{-march=68030}.
18229 @item -m68040
18230 @opindex m68040
18231 Generate output for a 68040.  This is the default when the compiler is
18232 configured for 68040-based systems.  It is equivalent to
18233 @option{-march=68040}.
18235 This option inhibits the use of 68881/68882 instructions that have to be
18236 emulated by software on the 68040.  Use this option if your 68040 does not
18237 have code to emulate those instructions.
18239 @item -m68060
18240 @opindex m68060
18241 Generate output for a 68060.  This is the default when the compiler is
18242 configured for 68060-based systems.  It is equivalent to
18243 @option{-march=68060}.
18245 This option inhibits the use of 68020 and 68881/68882 instructions that
18246 have to be emulated by software on the 68060.  Use this option if your 68060
18247 does not have code to emulate those instructions.
18249 @item -mcpu32
18250 @opindex mcpu32
18251 Generate output for a CPU32.  This is the default
18252 when the compiler is configured for CPU32-based systems.
18253 It is equivalent to @option{-march=cpu32}.
18255 Use this option for microcontrollers with a
18256 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
18257 68336, 68340, 68341, 68349 and 68360.
18259 @item -m5200
18260 @opindex m5200
18261 Generate output for a 520X ColdFire CPU@.  This is the default
18262 when the compiler is configured for 520X-based systems.
18263 It is equivalent to @option{-mcpu=5206}, and is now deprecated
18264 in favor of that option.
18266 Use this option for microcontroller with a 5200 core, including
18267 the MCF5202, MCF5203, MCF5204 and MCF5206.
18269 @item -m5206e
18270 @opindex m5206e
18271 Generate output for a 5206e ColdFire CPU@.  The option is now
18272 deprecated in favor of the equivalent @option{-mcpu=5206e}.
18274 @item -m528x
18275 @opindex m528x
18276 Generate output for a member of the ColdFire 528X family.
18277 The option is now deprecated in favor of the equivalent
18278 @option{-mcpu=528x}.
18280 @item -m5307
18281 @opindex m5307
18282 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
18283 in favor of the equivalent @option{-mcpu=5307}.
18285 @item -m5407
18286 @opindex m5407
18287 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
18288 in favor of the equivalent @option{-mcpu=5407}.
18290 @item -mcfv4e
18291 @opindex mcfv4e
18292 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
18293 This includes use of hardware floating-point instructions.
18294 The option is equivalent to @option{-mcpu=547x}, and is now
18295 deprecated in favor of that option.
18297 @item -m68020-40
18298 @opindex m68020-40
18299 Generate output for a 68040, without using any of the new instructions.
18300 This results in code that can run relatively efficiently on either a
18301 68020/68881 or a 68030 or a 68040.  The generated code does use the
18302 68881 instructions that are emulated on the 68040.
18304 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
18306 @item -m68020-60
18307 @opindex m68020-60
18308 Generate output for a 68060, without using any of the new instructions.
18309 This results in code that can run relatively efficiently on either a
18310 68020/68881 or a 68030 or a 68040.  The generated code does use the
18311 68881 instructions that are emulated on the 68060.
18313 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
18315 @item -mhard-float
18316 @itemx -m68881
18317 @opindex mhard-float
18318 @opindex m68881
18319 Generate floating-point instructions.  This is the default for 68020
18320 and above, and for ColdFire devices that have an FPU@.  It defines the
18321 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
18322 on ColdFire targets.
18324 @item -msoft-float
18325 @opindex msoft-float
18326 Do not generate floating-point instructions; use library calls instead.
18327 This is the default for 68000, 68010, and 68832 targets.  It is also
18328 the default for ColdFire devices that have no FPU.
18330 @item -mdiv
18331 @itemx -mno-div
18332 @opindex mdiv
18333 @opindex mno-div
18334 Generate (do not generate) ColdFire hardware divide and remainder
18335 instructions.  If @option{-march} is used without @option{-mcpu},
18336 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
18337 architectures.  Otherwise, the default is taken from the target CPU
18338 (either the default CPU, or the one specified by @option{-mcpu}).  For
18339 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
18340 @option{-mcpu=5206e}.
18342 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
18344 @item -mshort
18345 @opindex mshort
18346 Consider type @code{int} to be 16 bits wide, like @code{short int}.
18347 Additionally, parameters passed on the stack are also aligned to a
18348 16-bit boundary even on targets whose API mandates promotion to 32-bit.
18350 @item -mno-short
18351 @opindex mno-short
18352 Do not consider type @code{int} to be 16 bits wide.  This is the default.
18354 @item -mnobitfield
18355 @itemx -mno-bitfield
18356 @opindex mnobitfield
18357 @opindex mno-bitfield
18358 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
18359 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
18361 @item -mbitfield
18362 @opindex mbitfield
18363 Do use the bit-field instructions.  The @option{-m68020} option implies
18364 @option{-mbitfield}.  This is the default if you use a configuration
18365 designed for a 68020.
18367 @item -mrtd
18368 @opindex mrtd
18369 Use a different function-calling convention, in which functions
18370 that take a fixed number of arguments return with the @code{rtd}
18371 instruction, which pops their arguments while returning.  This
18372 saves one instruction in the caller since there is no need to pop
18373 the arguments there.
18375 This calling convention is incompatible with the one normally
18376 used on Unix, so you cannot use it if you need to call libraries
18377 compiled with the Unix compiler.
18379 Also, you must provide function prototypes for all functions that
18380 take variable numbers of arguments (including @code{printf});
18381 otherwise incorrect code is generated for calls to those
18382 functions.
18384 In addition, seriously incorrect code results if you call a
18385 function with too many arguments.  (Normally, extra arguments are
18386 harmlessly ignored.)
18388 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
18389 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
18391 @item -mno-rtd
18392 @opindex mno-rtd
18393 Do not use the calling conventions selected by @option{-mrtd}.
18394 This is the default.
18396 @item -malign-int
18397 @itemx -mno-align-int
18398 @opindex malign-int
18399 @opindex mno-align-int
18400 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
18401 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
18402 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
18403 Aligning variables on 32-bit boundaries produces code that runs somewhat
18404 faster on processors with 32-bit busses at the expense of more memory.
18406 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
18407 aligns structures containing the above types differently than
18408 most published application binary interface specifications for the m68k.
18410 @item -mpcrel
18411 @opindex mpcrel
18412 Use the pc-relative addressing mode of the 68000 directly, instead of
18413 using a global offset table.  At present, this option implies @option{-fpic},
18414 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
18415 not presently supported with @option{-mpcrel}, though this could be supported for
18416 68020 and higher processors.
18418 @item -mno-strict-align
18419 @itemx -mstrict-align
18420 @opindex mno-strict-align
18421 @opindex mstrict-align
18422 Do not (do) assume that unaligned memory references are handled by
18423 the system.
18425 @item -msep-data
18426 Generate code that allows the data segment to be located in a different
18427 area of memory from the text segment.  This allows for execute-in-place in
18428 an environment without virtual memory management.  This option implies
18429 @option{-fPIC}.
18431 @item -mno-sep-data
18432 Generate code that assumes that the data segment follows the text segment.
18433 This is the default.
18435 @item -mid-shared-library
18436 Generate code that supports shared libraries via the library ID method.
18437 This allows for execute-in-place and shared libraries in an environment
18438 without virtual memory management.  This option implies @option{-fPIC}.
18440 @item -mno-id-shared-library
18441 Generate code that doesn't assume ID-based shared libraries are being used.
18442 This is the default.
18444 @item -mshared-library-id=n
18445 Specifies the identification number of the ID-based shared library being
18446 compiled.  Specifying a value of 0 generates more compact code; specifying
18447 other values forces the allocation of that number to the current
18448 library, but is no more space- or time-efficient than omitting this option.
18450 @item -mxgot
18451 @itemx -mno-xgot
18452 @opindex mxgot
18453 @opindex mno-xgot
18454 When generating position-independent code for ColdFire, generate code
18455 that works if the GOT has more than 8192 entries.  This code is
18456 larger and slower than code generated without this option.  On M680x0
18457 processors, this option is not needed; @option{-fPIC} suffices.
18459 GCC normally uses a single instruction to load values from the GOT@.
18460 While this is relatively efficient, it only works if the GOT
18461 is smaller than about 64k.  Anything larger causes the linker
18462 to report an error such as:
18464 @cindex relocation truncated to fit (ColdFire)
18465 @smallexample
18466 relocation truncated to fit: R_68K_GOT16O foobar
18467 @end smallexample
18469 If this happens, you should recompile your code with @option{-mxgot}.
18470 It should then work with very large GOTs.  However, code generated with
18471 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
18472 the value of a global symbol.
18474 Note that some linkers, including newer versions of the GNU linker,
18475 can create multiple GOTs and sort GOT entries.  If you have such a linker,
18476 you should only need to use @option{-mxgot} when compiling a single
18477 object file that accesses more than 8192 GOT entries.  Very few do.
18479 These options have no effect unless GCC is generating
18480 position-independent code.
18482 @item -mlong-jump-table-offsets
18483 @opindex mlong-jump-table-offsets
18484 Use 32-bit offsets in @code{switch} tables.  The default is to use
18485 16-bit offsets.
18487 @end table
18489 @node MCore Options
18490 @subsection MCore Options
18491 @cindex MCore options
18493 These are the @samp{-m} options defined for the Motorola M*Core
18494 processors.
18496 @table @gcctabopt
18498 @item -mhardlit
18499 @itemx -mno-hardlit
18500 @opindex mhardlit
18501 @opindex mno-hardlit
18502 Inline constants into the code stream if it can be done in two
18503 instructions or less.
18505 @item -mdiv
18506 @itemx -mno-div
18507 @opindex mdiv
18508 @opindex mno-div
18509 Use the divide instruction.  (Enabled by default).
18511 @item -mrelax-immediate
18512 @itemx -mno-relax-immediate
18513 @opindex mrelax-immediate
18514 @opindex mno-relax-immediate
18515 Allow arbitrary-sized immediates in bit operations.
18517 @item -mwide-bitfields
18518 @itemx -mno-wide-bitfields
18519 @opindex mwide-bitfields
18520 @opindex mno-wide-bitfields
18521 Always treat bit-fields as @code{int}-sized.
18523 @item -m4byte-functions
18524 @itemx -mno-4byte-functions
18525 @opindex m4byte-functions
18526 @opindex mno-4byte-functions
18527 Force all functions to be aligned to a 4-byte boundary.
18529 @item -mcallgraph-data
18530 @itemx -mno-callgraph-data
18531 @opindex mcallgraph-data
18532 @opindex mno-callgraph-data
18533 Emit callgraph information.
18535 @item -mslow-bytes
18536 @itemx -mno-slow-bytes
18537 @opindex mslow-bytes
18538 @opindex mno-slow-bytes
18539 Prefer word access when reading byte quantities.
18541 @item -mlittle-endian
18542 @itemx -mbig-endian
18543 @opindex mlittle-endian
18544 @opindex mbig-endian
18545 Generate code for a little-endian target.
18547 @item -m210
18548 @itemx -m340
18549 @opindex m210
18550 @opindex m340
18551 Generate code for the 210 processor.
18553 @item -mno-lsim
18554 @opindex mno-lsim
18555 Assume that runtime support has been provided and so omit the
18556 simulator library (@file{libsim.a)} from the linker command line.
18558 @item -mstack-increment=@var{size}
18559 @opindex mstack-increment
18560 Set the maximum amount for a single stack increment operation.  Large
18561 values can increase the speed of programs that contain functions
18562 that need a large amount of stack space, but they can also trigger a
18563 segmentation fault if the stack is extended too much.  The default
18564 value is 0x1000.
18566 @end table
18568 @node MeP Options
18569 @subsection MeP Options
18570 @cindex MeP options
18572 @table @gcctabopt
18574 @item -mabsdiff
18575 @opindex mabsdiff
18576 Enables the @code{abs} instruction, which is the absolute difference
18577 between two registers.
18579 @item -mall-opts
18580 @opindex mall-opts
18581 Enables all the optional instructions---average, multiply, divide, bit
18582 operations, leading zero, absolute difference, min/max, clip, and
18583 saturation.
18586 @item -maverage
18587 @opindex maverage
18588 Enables the @code{ave} instruction, which computes the average of two
18589 registers.
18591 @item -mbased=@var{n}
18592 @opindex mbased=
18593 Variables of size @var{n} bytes or smaller are placed in the
18594 @code{.based} section by default.  Based variables use the @code{$tp}
18595 register as a base register, and there is a 128-byte limit to the
18596 @code{.based} section.
18598 @item -mbitops
18599 @opindex mbitops
18600 Enables the bit operation instructions---bit test (@code{btstm}), set
18601 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
18602 test-and-set (@code{tas}).
18604 @item -mc=@var{name}
18605 @opindex mc=
18606 Selects which section constant data is placed in.  @var{name} may
18607 be @samp{tiny}, @samp{near}, or @samp{far}.
18609 @item -mclip
18610 @opindex mclip
18611 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
18612 useful unless you also provide @option{-mminmax}.
18614 @item -mconfig=@var{name}
18615 @opindex mconfig=
18616 Selects one of the built-in core configurations.  Each MeP chip has
18617 one or more modules in it; each module has a core CPU and a variety of
18618 coprocessors, optional instructions, and peripherals.  The
18619 @code{MeP-Integrator} tool, not part of GCC, provides these
18620 configurations through this option; using this option is the same as
18621 using all the corresponding command-line options.  The default
18622 configuration is @samp{default}.
18624 @item -mcop
18625 @opindex mcop
18626 Enables the coprocessor instructions.  By default, this is a 32-bit
18627 coprocessor.  Note that the coprocessor is normally enabled via the
18628 @option{-mconfig=} option.
18630 @item -mcop32
18631 @opindex mcop32
18632 Enables the 32-bit coprocessor's instructions.
18634 @item -mcop64
18635 @opindex mcop64
18636 Enables the 64-bit coprocessor's instructions.
18638 @item -mivc2
18639 @opindex mivc2
18640 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
18642 @item -mdc
18643 @opindex mdc
18644 Causes constant variables to be placed in the @code{.near} section.
18646 @item -mdiv
18647 @opindex mdiv
18648 Enables the @code{div} and @code{divu} instructions.
18650 @item -meb
18651 @opindex meb
18652 Generate big-endian code.
18654 @item -mel
18655 @opindex mel
18656 Generate little-endian code.
18658 @item -mio-volatile
18659 @opindex mio-volatile
18660 Tells the compiler that any variable marked with the @code{io}
18661 attribute is to be considered volatile.
18663 @item -ml
18664 @opindex ml
18665 Causes variables to be assigned to the @code{.far} section by default.
18667 @item -mleadz
18668 @opindex mleadz
18669 Enables the @code{leadz} (leading zero) instruction.
18671 @item -mm
18672 @opindex mm
18673 Causes variables to be assigned to the @code{.near} section by default.
18675 @item -mminmax
18676 @opindex mminmax
18677 Enables the @code{min} and @code{max} instructions.
18679 @item -mmult
18680 @opindex mmult
18681 Enables the multiplication and multiply-accumulate instructions.
18683 @item -mno-opts
18684 @opindex mno-opts
18685 Disables all the optional instructions enabled by @option{-mall-opts}.
18687 @item -mrepeat
18688 @opindex mrepeat
18689 Enables the @code{repeat} and @code{erepeat} instructions, used for
18690 low-overhead looping.
18692 @item -ms
18693 @opindex ms
18694 Causes all variables to default to the @code{.tiny} section.  Note
18695 that there is a 65536-byte limit to this section.  Accesses to these
18696 variables use the @code{%gp} base register.
18698 @item -msatur
18699 @opindex msatur
18700 Enables the saturation instructions.  Note that the compiler does not
18701 currently generate these itself, but this option is included for
18702 compatibility with other tools, like @code{as}.
18704 @item -msdram
18705 @opindex msdram
18706 Link the SDRAM-based runtime instead of the default ROM-based runtime.
18708 @item -msim
18709 @opindex msim
18710 Link the simulator run-time libraries.
18712 @item -msimnovec
18713 @opindex msimnovec
18714 Link the simulator runtime libraries, excluding built-in support
18715 for reset and exception vectors and tables.
18717 @item -mtf
18718 @opindex mtf
18719 Causes all functions to default to the @code{.far} section.  Without
18720 this option, functions default to the @code{.near} section.
18722 @item -mtiny=@var{n}
18723 @opindex mtiny=
18724 Variables that are @var{n} bytes or smaller are allocated to the
18725 @code{.tiny} section.  These variables use the @code{$gp} base
18726 register.  The default for this option is 4, but note that there's a
18727 65536-byte limit to the @code{.tiny} section.
18729 @end table
18731 @node MicroBlaze Options
18732 @subsection MicroBlaze Options
18733 @cindex MicroBlaze Options
18735 @table @gcctabopt
18737 @item -msoft-float
18738 @opindex msoft-float
18739 Use software emulation for floating point (default).
18741 @item -mhard-float
18742 @opindex mhard-float
18743 Use hardware floating-point instructions.
18745 @item -mmemcpy
18746 @opindex mmemcpy
18747 Do not optimize block moves, use @code{memcpy}.
18749 @item -mno-clearbss
18750 @opindex mno-clearbss
18751 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
18753 @item -mcpu=@var{cpu-type}
18754 @opindex mcpu=
18755 Use features of, and schedule code for, the given CPU.
18756 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
18757 where @var{X} is a major version, @var{YY} is the minor version, and
18758 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
18759 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
18761 @item -mxl-soft-mul
18762 @opindex mxl-soft-mul
18763 Use software multiply emulation (default).
18765 @item -mxl-soft-div
18766 @opindex mxl-soft-div
18767 Use software emulation for divides (default).
18769 @item -mxl-barrel-shift
18770 @opindex mxl-barrel-shift
18771 Use the hardware barrel shifter.
18773 @item -mxl-pattern-compare
18774 @opindex mxl-pattern-compare
18775 Use pattern compare instructions.
18777 @item -msmall-divides
18778 @opindex msmall-divides
18779 Use table lookup optimization for small signed integer divisions.
18781 @item -mxl-stack-check
18782 @opindex mxl-stack-check
18783 This option is deprecated.  Use @option{-fstack-check} instead.
18785 @item -mxl-gp-opt
18786 @opindex mxl-gp-opt
18787 Use GP-relative @code{.sdata}/@code{.sbss} sections.
18789 @item -mxl-multiply-high
18790 @opindex mxl-multiply-high
18791 Use multiply high instructions for high part of 32x32 multiply.
18793 @item -mxl-float-convert
18794 @opindex mxl-float-convert
18795 Use hardware floating-point conversion instructions.
18797 @item -mxl-float-sqrt
18798 @opindex mxl-float-sqrt
18799 Use hardware floating-point square root instruction.
18801 @item -mbig-endian
18802 @opindex mbig-endian
18803 Generate code for a big-endian target.
18805 @item -mlittle-endian
18806 @opindex mlittle-endian
18807 Generate code for a little-endian target.
18809 @item -mxl-reorder
18810 @opindex mxl-reorder
18811 Use reorder instructions (swap and byte reversed load/store).
18813 @item -mxl-mode-@var{app-model}
18814 Select application model @var{app-model}.  Valid models are
18815 @table @samp
18816 @item executable
18817 normal executable (default), uses startup code @file{crt0.o}.
18819 @item xmdstub
18820 for use with Xilinx Microprocessor Debugger (XMD) based
18821 software intrusive debug agent called xmdstub. This uses startup file
18822 @file{crt1.o} and sets the start address of the program to 0x800.
18824 @item bootstrap
18825 for applications that are loaded using a bootloader.
18826 This model uses startup file @file{crt2.o} which does not contain a processor
18827 reset vector handler. This is suitable for transferring control on a
18828 processor reset to the bootloader rather than the application.
18830 @item novectors
18831 for applications that do not require any of the
18832 MicroBlaze vectors. This option may be useful for applications running
18833 within a monitoring application. This model uses @file{crt3.o} as a startup file.
18834 @end table
18836 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
18837 @option{-mxl-mode-@var{app-model}}.
18839 @end table
18841 @node MIPS Options
18842 @subsection MIPS Options
18843 @cindex MIPS options
18845 @table @gcctabopt
18847 @item -EB
18848 @opindex EB
18849 Generate big-endian code.
18851 @item -EL
18852 @opindex EL
18853 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
18854 configurations.
18856 @item -march=@var{arch}
18857 @opindex march
18858 Generate code that runs on @var{arch}, which can be the name of a
18859 generic MIPS ISA, or the name of a particular processor.
18860 The ISA names are:
18861 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
18862 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
18863 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
18864 @samp{mips64r5} and @samp{mips64r6}.
18865 The processor names are:
18866 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
18867 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
18868 @samp{5kc}, @samp{5kf},
18869 @samp{20kc},
18870 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
18871 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
18872 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
18873 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
18874 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
18875 @samp{i6400},
18876 @samp{interaptiv},
18877 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
18878 @samp{m4k},
18879 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
18880 @samp{m5100}, @samp{m5101},
18881 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
18882 @samp{orion},
18883 @samp{p5600},
18884 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
18885 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
18886 @samp{rm7000}, @samp{rm9000},
18887 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
18888 @samp{sb1},
18889 @samp{sr71000},
18890 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
18891 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
18892 @samp{xlr} and @samp{xlp}.
18893 The special value @samp{from-abi} selects the
18894 most compatible architecture for the selected ABI (that is,
18895 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
18897 The native Linux/GNU toolchain also supports the value @samp{native},
18898 which selects the best architecture option for the host processor.
18899 @option{-march=native} has no effect if GCC does not recognize
18900 the processor.
18902 In processor names, a final @samp{000} can be abbreviated as @samp{k}
18903 (for example, @option{-march=r2k}).  Prefixes are optional, and
18904 @samp{vr} may be written @samp{r}.
18906 Names of the form @samp{@var{n}f2_1} refer to processors with
18907 FPUs clocked at half the rate of the core, names of the form
18908 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
18909 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
18910 processors with FPUs clocked a ratio of 3:2 with respect to the core.
18911 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
18912 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
18913 accepted as synonyms for @samp{@var{n}f1_1}.
18915 GCC defines two macros based on the value of this option.  The first
18916 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
18917 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
18918 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
18919 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
18920 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
18922 Note that the @code{_MIPS_ARCH} macro uses the processor names given
18923 above.  In other words, it has the full prefix and does not
18924 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
18925 the macro names the resolved architecture (either @code{"mips1"} or
18926 @code{"mips3"}).  It names the default architecture when no
18927 @option{-march} option is given.
18929 @item -mtune=@var{arch}
18930 @opindex mtune
18931 Optimize for @var{arch}.  Among other things, this option controls
18932 the way instructions are scheduled, and the perceived cost of arithmetic
18933 operations.  The list of @var{arch} values is the same as for
18934 @option{-march}.
18936 When this option is not used, GCC optimizes for the processor
18937 specified by @option{-march}.  By using @option{-march} and
18938 @option{-mtune} together, it is possible to generate code that
18939 runs on a family of processors, but optimize the code for one
18940 particular member of that family.
18942 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
18943 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
18944 @option{-march} ones described above.
18946 @item -mips1
18947 @opindex mips1
18948 Equivalent to @option{-march=mips1}.
18950 @item -mips2
18951 @opindex mips2
18952 Equivalent to @option{-march=mips2}.
18954 @item -mips3
18955 @opindex mips3
18956 Equivalent to @option{-march=mips3}.
18958 @item -mips4
18959 @opindex mips4
18960 Equivalent to @option{-march=mips4}.
18962 @item -mips32
18963 @opindex mips32
18964 Equivalent to @option{-march=mips32}.
18966 @item -mips32r3
18967 @opindex mips32r3
18968 Equivalent to @option{-march=mips32r3}.
18970 @item -mips32r5
18971 @opindex mips32r5
18972 Equivalent to @option{-march=mips32r5}.
18974 @item -mips32r6
18975 @opindex mips32r6
18976 Equivalent to @option{-march=mips32r6}.
18978 @item -mips64
18979 @opindex mips64
18980 Equivalent to @option{-march=mips64}.
18982 @item -mips64r2
18983 @opindex mips64r2
18984 Equivalent to @option{-march=mips64r2}.
18986 @item -mips64r3
18987 @opindex mips64r3
18988 Equivalent to @option{-march=mips64r3}.
18990 @item -mips64r5
18991 @opindex mips64r5
18992 Equivalent to @option{-march=mips64r5}.
18994 @item -mips64r6
18995 @opindex mips64r6
18996 Equivalent to @option{-march=mips64r6}.
18998 @item -mips16
18999 @itemx -mno-mips16
19000 @opindex mips16
19001 @opindex mno-mips16
19002 Generate (do not generate) MIPS16 code.  If GCC is targeting a
19003 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
19005 MIPS16 code generation can also be controlled on a per-function basis
19006 by means of @code{mips16} and @code{nomips16} attributes.
19007 @xref{Function Attributes}, for more information.
19009 @item -mflip-mips16
19010 @opindex mflip-mips16
19011 Generate MIPS16 code on alternating functions.  This option is provided
19012 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
19013 not intended for ordinary use in compiling user code.
19015 @item -minterlink-compressed
19016 @item -mno-interlink-compressed
19017 @opindex minterlink-compressed
19018 @opindex mno-interlink-compressed
19019 Require (do not require) that code using the standard (uncompressed) MIPS ISA
19020 be link-compatible with MIPS16 and microMIPS code, and vice versa.
19022 For example, code using the standard ISA encoding cannot jump directly
19023 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
19024 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
19025 knows that the target of the jump is not compressed.
19027 @item -minterlink-mips16
19028 @itemx -mno-interlink-mips16
19029 @opindex minterlink-mips16
19030 @opindex mno-interlink-mips16
19031 Aliases of @option{-minterlink-compressed} and
19032 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
19033 and are retained for backwards compatibility.
19035 @item -mabi=32
19036 @itemx -mabi=o64
19037 @itemx -mabi=n32
19038 @itemx -mabi=64
19039 @itemx -mabi=eabi
19040 @opindex mabi=32
19041 @opindex mabi=o64
19042 @opindex mabi=n32
19043 @opindex mabi=64
19044 @opindex mabi=eabi
19045 Generate code for the given ABI@.
19047 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
19048 generates 64-bit code when you select a 64-bit architecture, but you
19049 can use @option{-mgp32} to get 32-bit code instead.
19051 For information about the O64 ABI, see
19052 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
19054 GCC supports a variant of the o32 ABI in which floating-point registers
19055 are 64 rather than 32 bits wide.  You can select this combination with
19056 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
19057 and @code{mfhc1} instructions and is therefore only supported for
19058 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
19060 The register assignments for arguments and return values remain the
19061 same, but each scalar value is passed in a single 64-bit register
19062 rather than a pair of 32-bit registers.  For example, scalar
19063 floating-point values are returned in @samp{$f0} only, not a
19064 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
19065 remains the same in that the even-numbered double-precision registers
19066 are saved.
19068 Two additional variants of the o32 ABI are supported to enable
19069 a transition from 32-bit to 64-bit registers.  These are FPXX
19070 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
19071 The FPXX extension mandates that all code must execute correctly
19072 when run using 32-bit or 64-bit registers.  The code can be interlinked
19073 with either FP32 or FP64, but not both.
19074 The FP64A extension is similar to the FP64 extension but forbids the
19075 use of odd-numbered single-precision registers.  This can be used
19076 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
19077 processors and allows both FP32 and FP64A code to interlink and
19078 run in the same process without changing FPU modes.
19080 @item -mabicalls
19081 @itemx -mno-abicalls
19082 @opindex mabicalls
19083 @opindex mno-abicalls
19084 Generate (do not generate) code that is suitable for SVR4-style
19085 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
19086 systems.
19088 @item -mshared
19089 @itemx -mno-shared
19090 Generate (do not generate) code that is fully position-independent,
19091 and that can therefore be linked into shared libraries.  This option
19092 only affects @option{-mabicalls}.
19094 All @option{-mabicalls} code has traditionally been position-independent,
19095 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
19096 as an extension, the GNU toolchain allows executables to use absolute
19097 accesses for locally-binding symbols.  It can also use shorter GP
19098 initialization sequences and generate direct calls to locally-defined
19099 functions.  This mode is selected by @option{-mno-shared}.
19101 @option{-mno-shared} depends on binutils 2.16 or higher and generates
19102 objects that can only be linked by the GNU linker.  However, the option
19103 does not affect the ABI of the final executable; it only affects the ABI
19104 of relocatable objects.  Using @option{-mno-shared} generally makes
19105 executables both smaller and quicker.
19107 @option{-mshared} is the default.
19109 @item -mplt
19110 @itemx -mno-plt
19111 @opindex mplt
19112 @opindex mno-plt
19113 Assume (do not assume) that the static and dynamic linkers
19114 support PLTs and copy relocations.  This option only affects
19115 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
19116 has no effect without @option{-msym32}.
19118 You can make @option{-mplt} the default by configuring
19119 GCC with @option{--with-mips-plt}.  The default is
19120 @option{-mno-plt} otherwise.
19122 @item -mxgot
19123 @itemx -mno-xgot
19124 @opindex mxgot
19125 @opindex mno-xgot
19126 Lift (do not lift) the usual restrictions on the size of the global
19127 offset table.
19129 GCC normally uses a single instruction to load values from the GOT@.
19130 While this is relatively efficient, it only works if the GOT
19131 is smaller than about 64k.  Anything larger causes the linker
19132 to report an error such as:
19134 @cindex relocation truncated to fit (MIPS)
19135 @smallexample
19136 relocation truncated to fit: R_MIPS_GOT16 foobar
19137 @end smallexample
19139 If this happens, you should recompile your code with @option{-mxgot}.
19140 This works with very large GOTs, although the code is also
19141 less efficient, since it takes three instructions to fetch the
19142 value of a global symbol.
19144 Note that some linkers can create multiple GOTs.  If you have such a
19145 linker, you should only need to use @option{-mxgot} when a single object
19146 file accesses more than 64k's worth of GOT entries.  Very few do.
19148 These options have no effect unless GCC is generating position
19149 independent code.
19151 @item -mgp32
19152 @opindex mgp32
19153 Assume that general-purpose registers are 32 bits wide.
19155 @item -mgp64
19156 @opindex mgp64
19157 Assume that general-purpose registers are 64 bits wide.
19159 @item -mfp32
19160 @opindex mfp32
19161 Assume that floating-point registers are 32 bits wide.
19163 @item -mfp64
19164 @opindex mfp64
19165 Assume that floating-point registers are 64 bits wide.
19167 @item -mfpxx
19168 @opindex mfpxx
19169 Do not assume the width of floating-point registers.
19171 @item -mhard-float
19172 @opindex mhard-float
19173 Use floating-point coprocessor instructions.
19175 @item -msoft-float
19176 @opindex msoft-float
19177 Do not use floating-point coprocessor instructions.  Implement
19178 floating-point calculations using library calls instead.
19180 @item -mno-float
19181 @opindex mno-float
19182 Equivalent to @option{-msoft-float}, but additionally asserts that the
19183 program being compiled does not perform any floating-point operations.
19184 This option is presently supported only by some bare-metal MIPS
19185 configurations, where it may select a special set of libraries
19186 that lack all floating-point support (including, for example, the
19187 floating-point @code{printf} formats).  
19188 If code compiled with @option{-mno-float} accidentally contains
19189 floating-point operations, it is likely to suffer a link-time
19190 or run-time failure.
19192 @item -msingle-float
19193 @opindex msingle-float
19194 Assume that the floating-point coprocessor only supports single-precision
19195 operations.
19197 @item -mdouble-float
19198 @opindex mdouble-float
19199 Assume that the floating-point coprocessor supports double-precision
19200 operations.  This is the default.
19202 @item -modd-spreg
19203 @itemx -mno-odd-spreg
19204 @opindex modd-spreg
19205 @opindex mno-odd-spreg
19206 Enable the use of odd-numbered single-precision floating-point registers
19207 for the o32 ABI.  This is the default for processors that are known to
19208 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
19209 is set by default.
19211 @item -mabs=2008
19212 @itemx -mabs=legacy
19213 @opindex mabs=2008
19214 @opindex mabs=legacy
19215 These options control the treatment of the special not-a-number (NaN)
19216 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
19217 @code{neg.@i{fmt}} machine instructions.
19219 By default or when @option{-mabs=legacy} is used the legacy
19220 treatment is selected.  In this case these instructions are considered
19221 arithmetic and avoided where correct operation is required and the
19222 input operand might be a NaN.  A longer sequence of instructions that
19223 manipulate the sign bit of floating-point datum manually is used
19224 instead unless the @option{-ffinite-math-only} option has also been
19225 specified.
19227 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
19228 this case these instructions are considered non-arithmetic and therefore
19229 operating correctly in all cases, including in particular where the
19230 input operand is a NaN.  These instructions are therefore always used
19231 for the respective operations.
19233 @item -mnan=2008
19234 @itemx -mnan=legacy
19235 @opindex mnan=2008
19236 @opindex mnan=legacy
19237 These options control the encoding of the special not-a-number (NaN)
19238 IEEE 754 floating-point data.
19240 The @option{-mnan=legacy} option selects the legacy encoding.  In this
19241 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
19242 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
19243 by the first bit of their trailing significand field being 1.
19245 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
19246 this case qNaNs are denoted by the first bit of their trailing
19247 significand field being 1, whereas sNaNs are denoted by the first bit of
19248 their trailing significand field being 0.
19250 The default is @option{-mnan=legacy} unless GCC has been configured with
19251 @option{--with-nan=2008}.
19253 @item -mllsc
19254 @itemx -mno-llsc
19255 @opindex mllsc
19256 @opindex mno-llsc
19257 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
19258 implement atomic memory built-in functions.  When neither option is
19259 specified, GCC uses the instructions if the target architecture
19260 supports them.
19262 @option{-mllsc} is useful if the runtime environment can emulate the
19263 instructions and @option{-mno-llsc} can be useful when compiling for
19264 nonstandard ISAs.  You can make either option the default by
19265 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
19266 respectively.  @option{--with-llsc} is the default for some
19267 configurations; see the installation documentation for details.
19269 @item -mdsp
19270 @itemx -mno-dsp
19271 @opindex mdsp
19272 @opindex mno-dsp
19273 Use (do not use) revision 1 of the MIPS DSP ASE@.
19274 @xref{MIPS DSP Built-in Functions}.  This option defines the
19275 preprocessor macro @code{__mips_dsp}.  It also defines
19276 @code{__mips_dsp_rev} to 1.
19278 @item -mdspr2
19279 @itemx -mno-dspr2
19280 @opindex mdspr2
19281 @opindex mno-dspr2
19282 Use (do not use) revision 2 of the MIPS DSP ASE@.
19283 @xref{MIPS DSP Built-in Functions}.  This option defines the
19284 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
19285 It also defines @code{__mips_dsp_rev} to 2.
19287 @item -msmartmips
19288 @itemx -mno-smartmips
19289 @opindex msmartmips
19290 @opindex mno-smartmips
19291 Use (do not use) the MIPS SmartMIPS ASE.
19293 @item -mpaired-single
19294 @itemx -mno-paired-single
19295 @opindex mpaired-single
19296 @opindex mno-paired-single
19297 Use (do not use) paired-single floating-point instructions.
19298 @xref{MIPS Paired-Single Support}.  This option requires
19299 hardware floating-point support to be enabled.
19301 @item -mdmx
19302 @itemx -mno-mdmx
19303 @opindex mdmx
19304 @opindex mno-mdmx
19305 Use (do not use) MIPS Digital Media Extension instructions.
19306 This option can only be used when generating 64-bit code and requires
19307 hardware floating-point support to be enabled.
19309 @item -mips3d
19310 @itemx -mno-mips3d
19311 @opindex mips3d
19312 @opindex mno-mips3d
19313 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
19314 The option @option{-mips3d} implies @option{-mpaired-single}.
19316 @item -mmicromips
19317 @itemx -mno-micromips
19318 @opindex mmicromips
19319 @opindex mno-mmicromips
19320 Generate (do not generate) microMIPS code.
19322 MicroMIPS code generation can also be controlled on a per-function basis
19323 by means of @code{micromips} and @code{nomicromips} attributes.
19324 @xref{Function Attributes}, for more information.
19326 @item -mmt
19327 @itemx -mno-mt
19328 @opindex mmt
19329 @opindex mno-mt
19330 Use (do not use) MT Multithreading instructions.
19332 @item -mmcu
19333 @itemx -mno-mcu
19334 @opindex mmcu
19335 @opindex mno-mcu
19336 Use (do not use) the MIPS MCU ASE instructions.
19338 @item -meva
19339 @itemx -mno-eva
19340 @opindex meva
19341 @opindex mno-eva
19342 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
19344 @item -mvirt
19345 @itemx -mno-virt
19346 @opindex mvirt
19347 @opindex mno-virt
19348 Use (do not use) the MIPS Virtualization (VZ) instructions.
19350 @item -mxpa
19351 @itemx -mno-xpa
19352 @opindex mxpa
19353 @opindex mno-xpa
19354 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
19356 @item -mlong64
19357 @opindex mlong64
19358 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
19359 an explanation of the default and the way that the pointer size is
19360 determined.
19362 @item -mlong32
19363 @opindex mlong32
19364 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
19366 The default size of @code{int}s, @code{long}s and pointers depends on
19367 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
19368 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
19369 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
19370 or the same size as integer registers, whichever is smaller.
19372 @item -msym32
19373 @itemx -mno-sym32
19374 @opindex msym32
19375 @opindex mno-sym32
19376 Assume (do not assume) that all symbols have 32-bit values, regardless
19377 of the selected ABI@.  This option is useful in combination with
19378 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
19379 to generate shorter and faster references to symbolic addresses.
19381 @item -G @var{num}
19382 @opindex G
19383 Put definitions of externally-visible data in a small data section
19384 if that data is no bigger than @var{num} bytes.  GCC can then generate
19385 more efficient accesses to the data; see @option{-mgpopt} for details.
19387 The default @option{-G} option depends on the configuration.
19389 @item -mlocal-sdata
19390 @itemx -mno-local-sdata
19391 @opindex mlocal-sdata
19392 @opindex mno-local-sdata
19393 Extend (do not extend) the @option{-G} behavior to local data too,
19394 such as to static variables in C@.  @option{-mlocal-sdata} is the
19395 default for all configurations.
19397 If the linker complains that an application is using too much small data,
19398 you might want to try rebuilding the less performance-critical parts with
19399 @option{-mno-local-sdata}.  You might also want to build large
19400 libraries with @option{-mno-local-sdata}, so that the libraries leave
19401 more room for the main program.
19403 @item -mextern-sdata
19404 @itemx -mno-extern-sdata
19405 @opindex mextern-sdata
19406 @opindex mno-extern-sdata
19407 Assume (do not assume) that externally-defined data is in
19408 a small data section if the size of that data is within the @option{-G} limit.
19409 @option{-mextern-sdata} is the default for all configurations.
19411 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
19412 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
19413 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
19414 is placed in a small data section.  If @var{Var} is defined by another
19415 module, you must either compile that module with a high-enough
19416 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
19417 definition.  If @var{Var} is common, you must link the application
19418 with a high-enough @option{-G} setting.
19420 The easiest way of satisfying these restrictions is to compile
19421 and link every module with the same @option{-G} option.  However,
19422 you may wish to build a library that supports several different
19423 small data limits.  You can do this by compiling the library with
19424 the highest supported @option{-G} setting and additionally using
19425 @option{-mno-extern-sdata} to stop the library from making assumptions
19426 about externally-defined data.
19428 @item -mgpopt
19429 @itemx -mno-gpopt
19430 @opindex mgpopt
19431 @opindex mno-gpopt
19432 Use (do not use) GP-relative accesses for symbols that are known to be
19433 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
19434 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
19435 configurations.
19437 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
19438 might not hold the value of @code{_gp}.  For example, if the code is
19439 part of a library that might be used in a boot monitor, programs that
19440 call boot monitor routines pass an unknown value in @code{$gp}.
19441 (In such situations, the boot monitor itself is usually compiled
19442 with @option{-G0}.)
19444 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
19445 @option{-mno-extern-sdata}.
19447 @item -membedded-data
19448 @itemx -mno-embedded-data
19449 @opindex membedded-data
19450 @opindex mno-embedded-data
19451 Allocate variables to the read-only data section first if possible, then
19452 next in the small data section if possible, otherwise in data.  This gives
19453 slightly slower code than the default, but reduces the amount of RAM required
19454 when executing, and thus may be preferred for some embedded systems.
19456 @item -muninit-const-in-rodata
19457 @itemx -mno-uninit-const-in-rodata
19458 @opindex muninit-const-in-rodata
19459 @opindex mno-uninit-const-in-rodata
19460 Put uninitialized @code{const} variables in the read-only data section.
19461 This option is only meaningful in conjunction with @option{-membedded-data}.
19463 @item -mcode-readable=@var{setting}
19464 @opindex mcode-readable
19465 Specify whether GCC may generate code that reads from executable sections.
19466 There are three possible settings:
19468 @table @gcctabopt
19469 @item -mcode-readable=yes
19470 Instructions may freely access executable sections.  This is the
19471 default setting.
19473 @item -mcode-readable=pcrel
19474 MIPS16 PC-relative load instructions can access executable sections,
19475 but other instructions must not do so.  This option is useful on 4KSc
19476 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
19477 It is also useful on processors that can be configured to have a dual
19478 instruction/data SRAM interface and that, like the M4K, automatically
19479 redirect PC-relative loads to the instruction RAM.
19481 @item -mcode-readable=no
19482 Instructions must not access executable sections.  This option can be
19483 useful on targets that are configured to have a dual instruction/data
19484 SRAM interface but that (unlike the M4K) do not automatically redirect
19485 PC-relative loads to the instruction RAM.
19486 @end table
19488 @item -msplit-addresses
19489 @itemx -mno-split-addresses
19490 @opindex msplit-addresses
19491 @opindex mno-split-addresses
19492 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
19493 relocation operators.  This option has been superseded by
19494 @option{-mexplicit-relocs} but is retained for backwards compatibility.
19496 @item -mexplicit-relocs
19497 @itemx -mno-explicit-relocs
19498 @opindex mexplicit-relocs
19499 @opindex mno-explicit-relocs
19500 Use (do not use) assembler relocation operators when dealing with symbolic
19501 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
19502 is to use assembler macros instead.
19504 @option{-mexplicit-relocs} is the default if GCC was configured
19505 to use an assembler that supports relocation operators.
19507 @item -mcheck-zero-division
19508 @itemx -mno-check-zero-division
19509 @opindex mcheck-zero-division
19510 @opindex mno-check-zero-division
19511 Trap (do not trap) on integer division by zero.
19513 The default is @option{-mcheck-zero-division}.
19515 @item -mdivide-traps
19516 @itemx -mdivide-breaks
19517 @opindex mdivide-traps
19518 @opindex mdivide-breaks
19519 MIPS systems check for division by zero by generating either a
19520 conditional trap or a break instruction.  Using traps results in
19521 smaller code, but is only supported on MIPS II and later.  Also, some
19522 versions of the Linux kernel have a bug that prevents trap from
19523 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
19524 allow conditional traps on architectures that support them and
19525 @option{-mdivide-breaks} to force the use of breaks.
19527 The default is usually @option{-mdivide-traps}, but this can be
19528 overridden at configure time using @option{--with-divide=breaks}.
19529 Divide-by-zero checks can be completely disabled using
19530 @option{-mno-check-zero-division}.
19532 @item -mload-store-pairs
19533 @itemx -mno-load-store-pairs
19534 @opindex mload-store-pairs
19535 @opindex mno-load-store-pairs
19536 Enable (disable) an optimization that pairs consecutive load or store
19537 instructions to enable load/store bonding.  This option is enabled by
19538 default but only takes effect when the selected architecture is known
19539 to support bonding.
19541 @item -mmemcpy
19542 @itemx -mno-memcpy
19543 @opindex mmemcpy
19544 @opindex mno-memcpy
19545 Force (do not force) the use of @code{memcpy} for non-trivial block
19546 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
19547 most constant-sized copies.
19549 @item -mlong-calls
19550 @itemx -mno-long-calls
19551 @opindex mlong-calls
19552 @opindex mno-long-calls
19553 Disable (do not disable) use of the @code{jal} instruction.  Calling
19554 functions using @code{jal} is more efficient but requires the caller
19555 and callee to be in the same 256 megabyte segment.
19557 This option has no effect on abicalls code.  The default is
19558 @option{-mno-long-calls}.
19560 @item -mmad
19561 @itemx -mno-mad
19562 @opindex mmad
19563 @opindex mno-mad
19564 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
19565 instructions, as provided by the R4650 ISA@.
19567 @item -mimadd
19568 @itemx -mno-imadd
19569 @opindex mimadd
19570 @opindex mno-imadd
19571 Enable (disable) use of the @code{madd} and @code{msub} integer
19572 instructions.  The default is @option{-mimadd} on architectures
19573 that support @code{madd} and @code{msub} except for the 74k 
19574 architecture where it was found to generate slower code.
19576 @item -mfused-madd
19577 @itemx -mno-fused-madd
19578 @opindex mfused-madd
19579 @opindex mno-fused-madd
19580 Enable (disable) use of the floating-point multiply-accumulate
19581 instructions, when they are available.  The default is
19582 @option{-mfused-madd}.
19584 On the R8000 CPU when multiply-accumulate instructions are used,
19585 the intermediate product is calculated to infinite precision
19586 and is not subject to the FCSR Flush to Zero bit.  This may be
19587 undesirable in some circumstances.  On other processors the result
19588 is numerically identical to the equivalent computation using
19589 separate multiply, add, subtract and negate instructions.
19591 @item -nocpp
19592 @opindex nocpp
19593 Tell the MIPS assembler to not run its preprocessor over user
19594 assembler files (with a @samp{.s} suffix) when assembling them.
19596 @item -mfix-24k
19597 @item -mno-fix-24k
19598 @opindex mfix-24k
19599 @opindex mno-fix-24k
19600 Work around the 24K E48 (lost data on stores during refill) errata.
19601 The workarounds are implemented by the assembler rather than by GCC@.
19603 @item -mfix-r4000
19604 @itemx -mno-fix-r4000
19605 @opindex mfix-r4000
19606 @opindex mno-fix-r4000
19607 Work around certain R4000 CPU errata:
19608 @itemize @minus
19609 @item
19610 A double-word or a variable shift may give an incorrect result if executed
19611 immediately after starting an integer division.
19612 @item
19613 A double-word or a variable shift may give an incorrect result if executed
19614 while an integer multiplication is in progress.
19615 @item
19616 An integer division may give an incorrect result if started in a delay slot
19617 of a taken branch or a jump.
19618 @end itemize
19620 @item -mfix-r4400
19621 @itemx -mno-fix-r4400
19622 @opindex mfix-r4400
19623 @opindex mno-fix-r4400
19624 Work around certain R4400 CPU errata:
19625 @itemize @minus
19626 @item
19627 A double-word or a variable shift may give an incorrect result if executed
19628 immediately after starting an integer division.
19629 @end itemize
19631 @item -mfix-r10000
19632 @itemx -mno-fix-r10000
19633 @opindex mfix-r10000
19634 @opindex mno-fix-r10000
19635 Work around certain R10000 errata:
19636 @itemize @minus
19637 @item
19638 @code{ll}/@code{sc} sequences may not behave atomically on revisions
19639 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
19640 @end itemize
19642 This option can only be used if the target architecture supports
19643 branch-likely instructions.  @option{-mfix-r10000} is the default when
19644 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
19645 otherwise.
19647 @item -mfix-rm7000
19648 @itemx -mno-fix-rm7000
19649 @opindex mfix-rm7000
19650 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
19651 workarounds are implemented by the assembler rather than by GCC@.
19653 @item -mfix-vr4120
19654 @itemx -mno-fix-vr4120
19655 @opindex mfix-vr4120
19656 Work around certain VR4120 errata:
19657 @itemize @minus
19658 @item
19659 @code{dmultu} does not always produce the correct result.
19660 @item
19661 @code{div} and @code{ddiv} do not always produce the correct result if one
19662 of the operands is negative.
19663 @end itemize
19664 The workarounds for the division errata rely on special functions in
19665 @file{libgcc.a}.  At present, these functions are only provided by
19666 the @code{mips64vr*-elf} configurations.
19668 Other VR4120 errata require a NOP to be inserted between certain pairs of
19669 instructions.  These errata are handled by the assembler, not by GCC itself.
19671 @item -mfix-vr4130
19672 @opindex mfix-vr4130
19673 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
19674 workarounds are implemented by the assembler rather than by GCC,
19675 although GCC avoids using @code{mflo} and @code{mfhi} if the
19676 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
19677 instructions are available instead.
19679 @item -mfix-sb1
19680 @itemx -mno-fix-sb1
19681 @opindex mfix-sb1
19682 Work around certain SB-1 CPU core errata.
19683 (This flag currently works around the SB-1 revision 2
19684 ``F1'' and ``F2'' floating-point errata.)
19686 @item -mr10k-cache-barrier=@var{setting}
19687 @opindex mr10k-cache-barrier
19688 Specify whether GCC should insert cache barriers to avoid the
19689 side-effects of speculation on R10K processors.
19691 In common with many processors, the R10K tries to predict the outcome
19692 of a conditional branch and speculatively executes instructions from
19693 the ``taken'' branch.  It later aborts these instructions if the
19694 predicted outcome is wrong.  However, on the R10K, even aborted
19695 instructions can have side effects.
19697 This problem only affects kernel stores and, depending on the system,
19698 kernel loads.  As an example, a speculatively-executed store may load
19699 the target memory into cache and mark the cache line as dirty, even if
19700 the store itself is later aborted.  If a DMA operation writes to the
19701 same area of memory before the ``dirty'' line is flushed, the cached
19702 data overwrites the DMA-ed data.  See the R10K processor manual
19703 for a full description, including other potential problems.
19705 One workaround is to insert cache barrier instructions before every memory
19706 access that might be speculatively executed and that might have side
19707 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
19708 controls GCC's implementation of this workaround.  It assumes that
19709 aborted accesses to any byte in the following regions does not have
19710 side effects:
19712 @enumerate
19713 @item
19714 the memory occupied by the current function's stack frame;
19716 @item
19717 the memory occupied by an incoming stack argument;
19719 @item
19720 the memory occupied by an object with a link-time-constant address.
19721 @end enumerate
19723 It is the kernel's responsibility to ensure that speculative
19724 accesses to these regions are indeed safe.
19726 If the input program contains a function declaration such as:
19728 @smallexample
19729 void foo (void);
19730 @end smallexample
19732 then the implementation of @code{foo} must allow @code{j foo} and
19733 @code{jal foo} to be executed speculatively.  GCC honors this
19734 restriction for functions it compiles itself.  It expects non-GCC
19735 functions (such as hand-written assembly code) to do the same.
19737 The option has three forms:
19739 @table @gcctabopt
19740 @item -mr10k-cache-barrier=load-store
19741 Insert a cache barrier before a load or store that might be
19742 speculatively executed and that might have side effects even
19743 if aborted.
19745 @item -mr10k-cache-barrier=store
19746 Insert a cache barrier before a store that might be speculatively
19747 executed and that might have side effects even if aborted.
19749 @item -mr10k-cache-barrier=none
19750 Disable the insertion of cache barriers.  This is the default setting.
19751 @end table
19753 @item -mflush-func=@var{func}
19754 @itemx -mno-flush-func
19755 @opindex mflush-func
19756 Specifies the function to call to flush the I and D caches, or to not
19757 call any such function.  If called, the function must take the same
19758 arguments as the common @code{_flush_func}, that is, the address of the
19759 memory range for which the cache is being flushed, the size of the
19760 memory range, and the number 3 (to flush both caches).  The default
19761 depends on the target GCC was configured for, but commonly is either
19762 @code{_flush_func} or @code{__cpu_flush}.
19764 @item mbranch-cost=@var{num}
19765 @opindex mbranch-cost
19766 Set the cost of branches to roughly @var{num} ``simple'' instructions.
19767 This cost is only a heuristic and is not guaranteed to produce
19768 consistent results across releases.  A zero cost redundantly selects
19769 the default, which is based on the @option{-mtune} setting.
19771 @item -mbranch-likely
19772 @itemx -mno-branch-likely
19773 @opindex mbranch-likely
19774 @opindex mno-branch-likely
19775 Enable or disable use of Branch Likely instructions, regardless of the
19776 default for the selected architecture.  By default, Branch Likely
19777 instructions may be generated if they are supported by the selected
19778 architecture.  An exception is for the MIPS32 and MIPS64 architectures
19779 and processors that implement those architectures; for those, Branch
19780 Likely instructions are not be generated by default because the MIPS32
19781 and MIPS64 architectures specifically deprecate their use.
19783 @item -mcompact-branches=never
19784 @itemx -mcompact-branches=optimal
19785 @itemx -mcompact-branches=always
19786 @opindex mcompact-branches=never
19787 @opindex mcompact-branches=optimal
19788 @opindex mcompact-branches=always
19789 These options control which form of branches will be generated.  The
19790 default is @option{-mcompact-branches=optimal}.
19792 The @option{-mcompact-branches=never} option ensures that compact branch
19793 instructions will never be generated.
19795 The @option{-mcompact-branches=always} option ensures that a compact
19796 branch instruction will be generated if available.  If a compact branch
19797 instruction is not available, a delay slot form of the branch will be
19798 used instead.
19800 This option is supported from MIPS Release 6 onwards.
19802 The @option{-mcompact-branches=optimal} option will cause a delay slot
19803 branch to be used if one is available in the current ISA and the delay
19804 slot is successfully filled.  If the delay slot is not filled, a compact
19805 branch will be chosen if one is available.
19807 @item -mfp-exceptions
19808 @itemx -mno-fp-exceptions
19809 @opindex mfp-exceptions
19810 Specifies whether FP exceptions are enabled.  This affects how
19811 FP instructions are scheduled for some processors.
19812 The default is that FP exceptions are
19813 enabled.
19815 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
19816 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
19817 FP pipe.
19819 @item -mvr4130-align
19820 @itemx -mno-vr4130-align
19821 @opindex mvr4130-align
19822 The VR4130 pipeline is two-way superscalar, but can only issue two
19823 instructions together if the first one is 8-byte aligned.  When this
19824 option is enabled, GCC aligns pairs of instructions that it
19825 thinks should execute in parallel.
19827 This option only has an effect when optimizing for the VR4130.
19828 It normally makes code faster, but at the expense of making it bigger.
19829 It is enabled by default at optimization level @option{-O3}.
19831 @item -msynci
19832 @itemx -mno-synci
19833 @opindex msynci
19834 Enable (disable) generation of @code{synci} instructions on
19835 architectures that support it.  The @code{synci} instructions (if
19836 enabled) are generated when @code{__builtin___clear_cache} is
19837 compiled.
19839 This option defaults to @option{-mno-synci}, but the default can be
19840 overridden by configuring GCC with @option{--with-synci}.
19842 When compiling code for single processor systems, it is generally safe
19843 to use @code{synci}.  However, on many multi-core (SMP) systems, it
19844 does not invalidate the instruction caches on all cores and may lead
19845 to undefined behavior.
19847 @item -mrelax-pic-calls
19848 @itemx -mno-relax-pic-calls
19849 @opindex mrelax-pic-calls
19850 Try to turn PIC calls that are normally dispatched via register
19851 @code{$25} into direct calls.  This is only possible if the linker can
19852 resolve the destination at link time and if the destination is within
19853 range for a direct call.
19855 @option{-mrelax-pic-calls} is the default if GCC was configured to use
19856 an assembler and a linker that support the @code{.reloc} assembly
19857 directive and @option{-mexplicit-relocs} is in effect.  With
19858 @option{-mno-explicit-relocs}, this optimization can be performed by the
19859 assembler and the linker alone without help from the compiler.
19861 @item -mmcount-ra-address
19862 @itemx -mno-mcount-ra-address
19863 @opindex mmcount-ra-address
19864 @opindex mno-mcount-ra-address
19865 Emit (do not emit) code that allows @code{_mcount} to modify the
19866 calling function's return address.  When enabled, this option extends
19867 the usual @code{_mcount} interface with a new @var{ra-address}
19868 parameter, which has type @code{intptr_t *} and is passed in register
19869 @code{$12}.  @code{_mcount} can then modify the return address by
19870 doing both of the following:
19871 @itemize
19872 @item
19873 Returning the new address in register @code{$31}.
19874 @item
19875 Storing the new address in @code{*@var{ra-address}},
19876 if @var{ra-address} is nonnull.
19877 @end itemize
19879 The default is @option{-mno-mcount-ra-address}.
19881 @item -mframe-header-opt
19882 @itemx -mno-frame-header-opt
19883 @opindex mframe-header-opt
19884 Enable (disable) frame header optimization in the o32 ABI.  When using the
19885 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
19886 function to write out register arguments.  When enabled, this optimization
19887 will suppress the allocation of the frame header if it can be determined that
19888 it is unused.
19890 This optimization is off by default at all optimization levels.
19892 @item -mlxc1-sxc1
19893 @itemx -mno-lxc1-sxc1
19894 @opindex mlxc1-sxc1
19895 When applicable, enable (disable) the generation of @code{lwxc1},
19896 @code{swxc1}, @code{ldxc1}, @code{sdxc1} instructions.  Enabled by default.
19898 @item -mmadd4
19899 @itemx -mno-madd4
19900 @opindex mmadd4
19901 When applicable, enable (disable) the generation of 4-operand @code{madd.s},
19902 @code{madd.d} and related instructions.  Enabled by default.
19904 @end table
19906 @node MMIX Options
19907 @subsection MMIX Options
19908 @cindex MMIX Options
19910 These options are defined for the MMIX:
19912 @table @gcctabopt
19913 @item -mlibfuncs
19914 @itemx -mno-libfuncs
19915 @opindex mlibfuncs
19916 @opindex mno-libfuncs
19917 Specify that intrinsic library functions are being compiled, passing all
19918 values in registers, no matter the size.
19920 @item -mepsilon
19921 @itemx -mno-epsilon
19922 @opindex mepsilon
19923 @opindex mno-epsilon
19924 Generate floating-point comparison instructions that compare with respect
19925 to the @code{rE} epsilon register.
19927 @item -mabi=mmixware
19928 @itemx -mabi=gnu
19929 @opindex mabi=mmixware
19930 @opindex mabi=gnu
19931 Generate code that passes function parameters and return values that (in
19932 the called function) are seen as registers @code{$0} and up, as opposed to
19933 the GNU ABI which uses global registers @code{$231} and up.
19935 @item -mzero-extend
19936 @itemx -mno-zero-extend
19937 @opindex mzero-extend
19938 @opindex mno-zero-extend
19939 When reading data from memory in sizes shorter than 64 bits, use (do not
19940 use) zero-extending load instructions by default, rather than
19941 sign-extending ones.
19943 @item -mknuthdiv
19944 @itemx -mno-knuthdiv
19945 @opindex mknuthdiv
19946 @opindex mno-knuthdiv
19947 Make the result of a division yielding a remainder have the same sign as
19948 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
19949 remainder follows the sign of the dividend.  Both methods are
19950 arithmetically valid, the latter being almost exclusively used.
19952 @item -mtoplevel-symbols
19953 @itemx -mno-toplevel-symbols
19954 @opindex mtoplevel-symbols
19955 @opindex mno-toplevel-symbols
19956 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
19957 code can be used with the @code{PREFIX} assembly directive.
19959 @item -melf
19960 @opindex melf
19961 Generate an executable in the ELF format, rather than the default
19962 @samp{mmo} format used by the @command{mmix} simulator.
19964 @item -mbranch-predict
19965 @itemx -mno-branch-predict
19966 @opindex mbranch-predict
19967 @opindex mno-branch-predict
19968 Use (do not use) the probable-branch instructions, when static branch
19969 prediction indicates a probable branch.
19971 @item -mbase-addresses
19972 @itemx -mno-base-addresses
19973 @opindex mbase-addresses
19974 @opindex mno-base-addresses
19975 Generate (do not generate) code that uses @emph{base addresses}.  Using a
19976 base address automatically generates a request (handled by the assembler
19977 and the linker) for a constant to be set up in a global register.  The
19978 register is used for one or more base address requests within the range 0
19979 to 255 from the value held in the register.  The generally leads to short
19980 and fast code, but the number of different data items that can be
19981 addressed is limited.  This means that a program that uses lots of static
19982 data may require @option{-mno-base-addresses}.
19984 @item -msingle-exit
19985 @itemx -mno-single-exit
19986 @opindex msingle-exit
19987 @opindex mno-single-exit
19988 Force (do not force) generated code to have a single exit point in each
19989 function.
19990 @end table
19992 @node MN10300 Options
19993 @subsection MN10300 Options
19994 @cindex MN10300 options
19996 These @option{-m} options are defined for Matsushita MN10300 architectures:
19998 @table @gcctabopt
19999 @item -mmult-bug
20000 @opindex mmult-bug
20001 Generate code to avoid bugs in the multiply instructions for the MN10300
20002 processors.  This is the default.
20004 @item -mno-mult-bug
20005 @opindex mno-mult-bug
20006 Do not generate code to avoid bugs in the multiply instructions for the
20007 MN10300 processors.
20009 @item -mam33
20010 @opindex mam33
20011 Generate code using features specific to the AM33 processor.
20013 @item -mno-am33
20014 @opindex mno-am33
20015 Do not generate code using features specific to the AM33 processor.  This
20016 is the default.
20018 @item -mam33-2
20019 @opindex mam33-2
20020 Generate code using features specific to the AM33/2.0 processor.
20022 @item -mam34
20023 @opindex mam34
20024 Generate code using features specific to the AM34 processor.
20026 @item -mtune=@var{cpu-type}
20027 @opindex mtune
20028 Use the timing characteristics of the indicated CPU type when
20029 scheduling instructions.  This does not change the targeted processor
20030 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
20031 @samp{am33-2} or @samp{am34}.
20033 @item -mreturn-pointer-on-d0
20034 @opindex mreturn-pointer-on-d0
20035 When generating a function that returns a pointer, return the pointer
20036 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
20037 only in @code{a0}, and attempts to call such functions without a prototype
20038 result in errors.  Note that this option is on by default; use
20039 @option{-mno-return-pointer-on-d0} to disable it.
20041 @item -mno-crt0
20042 @opindex mno-crt0
20043 Do not link in the C run-time initialization object file.
20045 @item -mrelax
20046 @opindex mrelax
20047 Indicate to the linker that it should perform a relaxation optimization pass
20048 to shorten branches, calls and absolute memory addresses.  This option only
20049 has an effect when used on the command line for the final link step.
20051 This option makes symbolic debugging impossible.
20053 @item -mliw
20054 @opindex mliw
20055 Allow the compiler to generate @emph{Long Instruction Word}
20056 instructions if the target is the @samp{AM33} or later.  This is the
20057 default.  This option defines the preprocessor macro @code{__LIW__}.
20059 @item -mnoliw
20060 @opindex mnoliw
20061 Do not allow the compiler to generate @emph{Long Instruction Word}
20062 instructions.  This option defines the preprocessor macro
20063 @code{__NO_LIW__}.
20065 @item -msetlb
20066 @opindex msetlb
20067 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
20068 instructions if the target is the @samp{AM33} or later.  This is the
20069 default.  This option defines the preprocessor macro @code{__SETLB__}.
20071 @item -mnosetlb
20072 @opindex mnosetlb
20073 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
20074 instructions.  This option defines the preprocessor macro
20075 @code{__NO_SETLB__}.
20077 @end table
20079 @node Moxie Options
20080 @subsection Moxie Options
20081 @cindex Moxie Options
20083 @table @gcctabopt
20085 @item -meb
20086 @opindex meb
20087 Generate big-endian code.  This is the default for @samp{moxie-*-*}
20088 configurations.
20090 @item -mel
20091 @opindex mel
20092 Generate little-endian code.
20094 @item -mmul.x
20095 @opindex mmul.x
20096 Generate mul.x and umul.x instructions.  This is the default for
20097 @samp{moxiebox-*-*} configurations.
20099 @item -mno-crt0
20100 @opindex mno-crt0
20101 Do not link in the C run-time initialization object file.
20103 @end table
20105 @node MSP430 Options
20106 @subsection MSP430 Options
20107 @cindex MSP430 Options
20109 These options are defined for the MSP430:
20111 @table @gcctabopt
20113 @item -masm-hex
20114 @opindex masm-hex
20115 Force assembly output to always use hex constants.  Normally such
20116 constants are signed decimals, but this option is available for
20117 testsuite and/or aesthetic purposes.
20119 @item -mmcu=
20120 @opindex mmcu=
20121 Select the MCU to target.  This is used to create a C preprocessor
20122 symbol based upon the MCU name, converted to upper case and pre- and
20123 post-fixed with @samp{__}.  This in turn is used by the
20124 @file{msp430.h} header file to select an MCU-specific supplementary
20125 header file.
20127 The option also sets the ISA to use.  If the MCU name is one that is
20128 known to only support the 430 ISA then that is selected, otherwise the
20129 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
20130 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
20131 name selects the 430X ISA.
20133 In addition an MCU-specific linker script is added to the linker
20134 command line.  The script's name is the name of the MCU with
20135 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
20136 command line defines the C preprocessor symbol @code{__XXX__} and
20137 cause the linker to search for a script called @file{xxx.ld}.
20139 This option is also passed on to the assembler.
20141 @item -mwarn-mcu
20142 @itemx -mno-warn-mcu
20143 @opindex mwarn-mcu
20144 @opindex mno-warn-mcu
20145 This option enables or disables warnings about conflicts between the
20146 MCU name specified by the @option{-mmcu} option and the ISA set by the
20147 @option{-mcpu} option and/or the hardware multiply support set by the
20148 @option{-mhwmult} option.  It also toggles warnings about unrecognized
20149 MCU names.  This option is on by default.
20151 @item -mcpu=
20152 @opindex mcpu=
20153 Specifies the ISA to use.  Accepted values are @samp{msp430},
20154 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
20155 @option{-mmcu=} option should be used to select the ISA.
20157 @item -msim
20158 @opindex msim
20159 Link to the simulator runtime libraries and linker script.  Overrides
20160 any scripts that would be selected by the @option{-mmcu=} option.
20162 @item -mlarge
20163 @opindex mlarge
20164 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
20166 @item -msmall
20167 @opindex msmall
20168 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
20170 @item -mrelax
20171 @opindex mrelax
20172 This option is passed to the assembler and linker, and allows the
20173 linker to perform certain optimizations that cannot be done until
20174 the final link.
20176 @item mhwmult=
20177 @opindex mhwmult=
20178 Describes the type of hardware multiply supported by the target.
20179 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
20180 for the original 16-bit-only multiply supported by early MCUs.
20181 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
20182 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
20183 A value of @samp{auto} can also be given.  This tells GCC to deduce
20184 the hardware multiply support based upon the MCU name provided by the
20185 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
20186 the MCU name is not recognized then no hardware multiply support is
20187 assumed.  @code{auto} is the default setting.
20189 Hardware multiplies are normally performed by calling a library
20190 routine.  This saves space in the generated code.  When compiling at
20191 @option{-O3} or higher however the hardware multiplier is invoked
20192 inline.  This makes for bigger, but faster code.
20194 The hardware multiply routines disable interrupts whilst running and
20195 restore the previous interrupt state when they finish.  This makes
20196 them safe to use inside interrupt handlers as well as in normal code.
20198 @item -minrt
20199 @opindex minrt
20200 Enable the use of a minimum runtime environment - no static
20201 initializers or constructors.  This is intended for memory-constrained
20202 devices.  The compiler includes special symbols in some objects
20203 that tell the linker and runtime which code fragments are required.
20205 @item -mcode-region=
20206 @itemx -mdata-region=
20207 @opindex mcode-region
20208 @opindex mdata-region
20209 These options tell the compiler where to place functions and data that
20210 do not have one of the @code{lower}, @code{upper}, @code{either} or
20211 @code{section} attributes.  Possible values are @code{lower},
20212 @code{upper}, @code{either} or @code{any}.  The first three behave
20213 like the corresponding attribute.  The fourth possible value -
20214 @code{any} - is the default.  It leaves placement entirely up to the
20215 linker script and how it assigns the standard sections
20216 (@code{.text}, @code{.data}, etc) to the memory regions.
20218 @item -msilicon-errata=
20219 @opindex msilicon-errata
20220 This option passes on a request to assembler to enable the fixes for
20221 the named silicon errata.
20223 @item -msilicon-errata-warn=
20224 @opindex msilicon-errata-warn
20225 This option passes on a request to the assembler to enable warning
20226 messages when a silicon errata might need to be applied.
20228 @end table
20230 @node NDS32 Options
20231 @subsection NDS32 Options
20232 @cindex NDS32 Options
20234 These options are defined for NDS32 implementations:
20236 @table @gcctabopt
20238 @item -mbig-endian
20239 @opindex mbig-endian
20240 Generate code in big-endian mode.
20242 @item -mlittle-endian
20243 @opindex mlittle-endian
20244 Generate code in little-endian mode.
20246 @item -mreduced-regs
20247 @opindex mreduced-regs
20248 Use reduced-set registers for register allocation.
20250 @item -mfull-regs
20251 @opindex mfull-regs
20252 Use full-set registers for register allocation.
20254 @item -mcmov
20255 @opindex mcmov
20256 Generate conditional move instructions.
20258 @item -mno-cmov
20259 @opindex mno-cmov
20260 Do not generate conditional move instructions.
20262 @item -mperf-ext
20263 @opindex mperf-ext
20264 Generate performance extension instructions.
20266 @item -mno-perf-ext
20267 @opindex mno-perf-ext
20268 Do not generate performance extension instructions.
20270 @item -mv3push
20271 @opindex mv3push
20272 Generate v3 push25/pop25 instructions.
20274 @item -mno-v3push
20275 @opindex mno-v3push
20276 Do not generate v3 push25/pop25 instructions.
20278 @item -m16-bit
20279 @opindex m16-bit
20280 Generate 16-bit instructions.
20282 @item -mno-16-bit
20283 @opindex mno-16-bit
20284 Do not generate 16-bit instructions.
20286 @item -misr-vector-size=@var{num}
20287 @opindex misr-vector-size
20288 Specify the size of each interrupt vector, which must be 4 or 16.
20290 @item -mcache-block-size=@var{num}
20291 @opindex mcache-block-size
20292 Specify the size of each cache block,
20293 which must be a power of 2 between 4 and 512.
20295 @item -march=@var{arch}
20296 @opindex march
20297 Specify the name of the target architecture.
20299 @item -mcmodel=@var{code-model}
20300 @opindex mcmodel
20301 Set the code model to one of
20302 @table @asis
20303 @item @samp{small}
20304 All the data and read-only data segments must be within 512KB addressing space.
20305 The text segment must be within 16MB addressing space.
20306 @item @samp{medium}
20307 The data segment must be within 512KB while the read-only data segment can be
20308 within 4GB addressing space.  The text segment should be still within 16MB
20309 addressing space.
20310 @item @samp{large}
20311 All the text and data segments can be within 4GB addressing space.
20312 @end table
20314 @item -mctor-dtor
20315 @opindex mctor-dtor
20316 Enable constructor/destructor feature.
20318 @item -mrelax
20319 @opindex mrelax
20320 Guide linker to relax instructions.
20322 @end table
20324 @node Nios II Options
20325 @subsection Nios II Options
20326 @cindex Nios II options
20327 @cindex Altera Nios II options
20329 These are the options defined for the Altera Nios II processor.
20331 @table @gcctabopt
20333 @item -G @var{num}
20334 @opindex G
20335 @cindex smaller data references
20336 Put global and static objects less than or equal to @var{num} bytes
20337 into the small data or BSS sections instead of the normal data or BSS
20338 sections.  The default value of @var{num} is 8.
20340 @item -mgpopt=@var{option}
20341 @item -mgpopt
20342 @itemx -mno-gpopt
20343 @opindex mgpopt
20344 @opindex mno-gpopt
20345 Generate (do not generate) GP-relative accesses.  The following 
20346 @var{option} names are recognized:
20348 @table @samp
20350 @item none
20351 Do not generate GP-relative accesses.
20353 @item local
20354 Generate GP-relative accesses for small data objects that are not 
20355 external, weak, or uninitialized common symbols.  
20356 Also use GP-relative addressing for objects that
20357 have been explicitly placed in a small data section via a @code{section}
20358 attribute.
20360 @item global
20361 As for @samp{local}, but also generate GP-relative accesses for
20362 small data objects that are external, weak, or common.  If you use this option,
20363 you must ensure that all parts of your program (including libraries) are
20364 compiled with the same @option{-G} setting.
20366 @item data
20367 Generate GP-relative accesses for all data objects in the program.  If you
20368 use this option, the entire data and BSS segments
20369 of your program must fit in 64K of memory and you must use an appropriate
20370 linker script to allocate them within the addressable range of the
20371 global pointer.
20373 @item all
20374 Generate GP-relative addresses for function pointers as well as data
20375 pointers.  If you use this option, the entire text, data, and BSS segments
20376 of your program must fit in 64K of memory and you must use an appropriate
20377 linker script to allocate them within the addressable range of the
20378 global pointer.
20380 @end table
20382 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
20383 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
20385 The default is @option{-mgpopt} except when @option{-fpic} or
20386 @option{-fPIC} is specified to generate position-independent code.
20387 Note that the Nios II ABI does not permit GP-relative accesses from
20388 shared libraries.
20390 You may need to specify @option{-mno-gpopt} explicitly when building
20391 programs that include large amounts of small data, including large
20392 GOT data sections.  In this case, the 16-bit offset for GP-relative
20393 addressing may not be large enough to allow access to the entire 
20394 small data section.
20396 @item -mel
20397 @itemx -meb
20398 @opindex mel
20399 @opindex meb
20400 Generate little-endian (default) or big-endian (experimental) code,
20401 respectively.
20403 @item -march=@var{arch}
20404 @opindex march
20405 This specifies the name of the target Nios II architecture.  GCC uses this
20406 name to determine what kind of instructions it can emit when generating
20407 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
20409 The preprocessor macro @code{__nios2_arch__} is available to programs,
20410 with value 1 or 2, indicating the targeted ISA level.
20412 @item -mbypass-cache
20413 @itemx -mno-bypass-cache
20414 @opindex mno-bypass-cache
20415 @opindex mbypass-cache
20416 Force all load and store instructions to always bypass cache by 
20417 using I/O variants of the instructions. The default is not to
20418 bypass the cache.
20420 @item -mno-cache-volatile 
20421 @itemx -mcache-volatile       
20422 @opindex mcache-volatile 
20423 @opindex mno-cache-volatile
20424 Volatile memory access bypass the cache using the I/O variants of 
20425 the load and store instructions. The default is not to bypass the cache.
20427 @item -mno-fast-sw-div
20428 @itemx -mfast-sw-div
20429 @opindex mno-fast-sw-div
20430 @opindex mfast-sw-div
20431 Do not use table-based fast divide for small numbers. The default 
20432 is to use the fast divide at @option{-O3} and above.
20434 @item -mno-hw-mul
20435 @itemx -mhw-mul
20436 @itemx -mno-hw-mulx
20437 @itemx -mhw-mulx
20438 @itemx -mno-hw-div
20439 @itemx -mhw-div
20440 @opindex mno-hw-mul
20441 @opindex mhw-mul
20442 @opindex mno-hw-mulx
20443 @opindex mhw-mulx
20444 @opindex mno-hw-div
20445 @opindex mhw-div
20446 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
20447 instructions by the compiler. The default is to emit @code{mul}
20448 and not emit @code{div} and @code{mulx}.
20450 @item -mbmx
20451 @itemx -mno-bmx
20452 @itemx -mcdx
20453 @itemx -mno-cdx
20454 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
20455 CDX (code density) instructions.  Enabling these instructions also
20456 requires @option{-march=r2}.  Since these instructions are optional
20457 extensions to the R2 architecture, the default is not to emit them.
20459 @item -mcustom-@var{insn}=@var{N}
20460 @itemx -mno-custom-@var{insn}
20461 @opindex mcustom-@var{insn}
20462 @opindex mno-custom-@var{insn}
20463 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
20464 custom instruction with encoding @var{N} when generating code that uses 
20465 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
20466 instruction 253 for single-precision floating-point add operations instead
20467 of the default behavior of using a library call.
20469 The following values of @var{insn} are supported.  Except as otherwise
20470 noted, floating-point operations are expected to be implemented with
20471 normal IEEE 754 semantics and correspond directly to the C operators or the
20472 equivalent GCC built-in functions (@pxref{Other Builtins}).
20474 Single-precision floating point:
20475 @table @asis
20477 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
20478 Binary arithmetic operations.
20480 @item @samp{fnegs}
20481 Unary negation.
20483 @item @samp{fabss}
20484 Unary absolute value.
20486 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
20487 Comparison operations.
20489 @item @samp{fmins}, @samp{fmaxs}
20490 Floating-point minimum and maximum.  These instructions are only
20491 generated if @option{-ffinite-math-only} is specified.
20493 @item @samp{fsqrts}
20494 Unary square root operation.
20496 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
20497 Floating-point trigonometric and exponential functions.  These instructions
20498 are only generated if @option{-funsafe-math-optimizations} is also specified.
20500 @end table
20502 Double-precision floating point:
20503 @table @asis
20505 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
20506 Binary arithmetic operations.
20508 @item @samp{fnegd}
20509 Unary negation.
20511 @item @samp{fabsd}
20512 Unary absolute value.
20514 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
20515 Comparison operations.
20517 @item @samp{fmind}, @samp{fmaxd}
20518 Double-precision minimum and maximum.  These instructions are only
20519 generated if @option{-ffinite-math-only} is specified.
20521 @item @samp{fsqrtd}
20522 Unary square root operation.
20524 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
20525 Double-precision trigonometric and exponential functions.  These instructions
20526 are only generated if @option{-funsafe-math-optimizations} is also specified.
20528 @end table
20530 Conversions:
20531 @table @asis
20532 @item @samp{fextsd}
20533 Conversion from single precision to double precision.
20535 @item @samp{ftruncds}
20536 Conversion from double precision to single precision.
20538 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
20539 Conversion from floating point to signed or unsigned integer types, with
20540 truncation towards zero.
20542 @item @samp{round}
20543 Conversion from single-precision floating point to signed integer,
20544 rounding to the nearest integer and ties away from zero.
20545 This corresponds to the @code{__builtin_lroundf} function when
20546 @option{-fno-math-errno} is used.
20548 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
20549 Conversion from signed or unsigned integer types to floating-point types.
20551 @end table
20553 In addition, all of the following transfer instructions for internal
20554 registers X and Y must be provided to use any of the double-precision
20555 floating-point instructions.  Custom instructions taking two
20556 double-precision source operands expect the first operand in the
20557 64-bit register X.  The other operand (or only operand of a unary
20558 operation) is given to the custom arithmetic instruction with the
20559 least significant half in source register @var{src1} and the most
20560 significant half in @var{src2}.  A custom instruction that returns a
20561 double-precision result returns the most significant 32 bits in the
20562 destination register and the other half in 32-bit register Y.  
20563 GCC automatically generates the necessary code sequences to write
20564 register X and/or read register Y when double-precision floating-point
20565 instructions are used.
20567 @table @asis
20569 @item @samp{fwrx}
20570 Write @var{src1} into the least significant half of X and @var{src2} into
20571 the most significant half of X.
20573 @item @samp{fwry}
20574 Write @var{src1} into Y.
20576 @item @samp{frdxhi}, @samp{frdxlo}
20577 Read the most or least (respectively) significant half of X and store it in
20578 @var{dest}.
20580 @item @samp{frdy}
20581 Read the value of Y and store it into @var{dest}.
20582 @end table
20584 Note that you can gain more local control over generation of Nios II custom
20585 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
20586 and @code{target("no-custom-@var{insn}")} function attributes
20587 (@pxref{Function Attributes})
20588 or pragmas (@pxref{Function Specific Option Pragmas}).
20590 @item -mcustom-fpu-cfg=@var{name}
20591 @opindex mcustom-fpu-cfg
20593 This option enables a predefined, named set of custom instruction encodings
20594 (see @option{-mcustom-@var{insn}} above).  
20595 Currently, the following sets are defined:
20597 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
20598 @gccoptlist{-mcustom-fmuls=252 @gol
20599 -mcustom-fadds=253 @gol
20600 -mcustom-fsubs=254 @gol
20601 -fsingle-precision-constant}
20603 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
20604 @gccoptlist{-mcustom-fmuls=252 @gol
20605 -mcustom-fadds=253 @gol
20606 -mcustom-fsubs=254 @gol
20607 -mcustom-fdivs=255 @gol
20608 -fsingle-precision-constant}
20610 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
20611 @gccoptlist{-mcustom-floatus=243 @gol
20612 -mcustom-fixsi=244 @gol
20613 -mcustom-floatis=245 @gol
20614 -mcustom-fcmpgts=246 @gol
20615 -mcustom-fcmples=249 @gol
20616 -mcustom-fcmpeqs=250 @gol
20617 -mcustom-fcmpnes=251 @gol
20618 -mcustom-fmuls=252 @gol
20619 -mcustom-fadds=253 @gol
20620 -mcustom-fsubs=254 @gol
20621 -mcustom-fdivs=255 @gol
20622 -fsingle-precision-constant}
20624 Custom instruction assignments given by individual
20625 @option{-mcustom-@var{insn}=} options override those given by
20626 @option{-mcustom-fpu-cfg=}, regardless of the
20627 order of the options on the command line.
20629 Note that you can gain more local control over selection of a FPU
20630 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
20631 function attribute (@pxref{Function Attributes})
20632 or pragma (@pxref{Function Specific Option Pragmas}).
20634 @end table
20636 These additional @samp{-m} options are available for the Altera Nios II
20637 ELF (bare-metal) target:
20639 @table @gcctabopt
20641 @item -mhal
20642 @opindex mhal
20643 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
20644 startup and termination code, and is typically used in conjunction with
20645 @option{-msys-crt0=} to specify the location of the alternate startup code
20646 provided by the HAL BSP.
20648 @item -msmallc
20649 @opindex msmallc
20650 Link with a limited version of the C library, @option{-lsmallc}, rather than
20651 Newlib.
20653 @item -msys-crt0=@var{startfile}
20654 @opindex msys-crt0
20655 @var{startfile} is the file name of the startfile (crt0) to use 
20656 when linking.  This option is only useful in conjunction with @option{-mhal}.
20658 @item -msys-lib=@var{systemlib}
20659 @opindex msys-lib
20660 @var{systemlib} is the library name of the library that provides
20661 low-level system calls required by the C library,
20662 e.g. @code{read} and @code{write}.
20663 This option is typically used to link with a library provided by a HAL BSP.
20665 @end table
20667 @node Nvidia PTX Options
20668 @subsection Nvidia PTX Options
20669 @cindex Nvidia PTX options
20670 @cindex nvptx options
20672 These options are defined for Nvidia PTX:
20674 @table @gcctabopt
20676 @item -m32
20677 @itemx -m64
20678 @opindex m32
20679 @opindex m64
20680 Generate code for 32-bit or 64-bit ABI.
20682 @item -mmainkernel
20683 @opindex mmainkernel
20684 Link in code for a __main kernel.  This is for stand-alone instead of
20685 offloading execution.
20687 @item -moptimize
20688 @opindex moptimize
20689 Apply partitioned execution optimizations.  This is the default when any
20690 level of optimization is selected.
20692 @item -msoft-stack
20693 @opindex msoft-stack
20694 Generate code that does not use @code{.local} memory
20695 directly for stack storage. Instead, a per-warp stack pointer is
20696 maintained explicitly. This enables variable-length stack allocation (with
20697 variable-length arrays or @code{alloca}), and when global memory is used for
20698 underlying storage, makes it possible to access automatic variables from other
20699 threads, or with atomic instructions. This code generation variant is used
20700 for OpenMP offloading, but the option is exposed on its own for the purpose
20701 of testing the compiler; to generate code suitable for linking into programs
20702 using OpenMP offloading, use option @option{-mgomp}.
20704 @item -muniform-simt
20705 @opindex muniform-simt
20706 Switch to code generation variant that allows to execute all threads in each
20707 warp, while maintaining memory state and side effects as if only one thread
20708 in each warp was active outside of OpenMP SIMD regions.  All atomic operations
20709 and calls to runtime (malloc, free, vprintf) are conditionally executed (iff
20710 current lane index equals the master lane index), and the register being
20711 assigned is copied via a shuffle instruction from the master lane.  Outside of
20712 SIMD regions lane 0 is the master; inside, each thread sees itself as the
20713 master.  Shared memory array @code{int __nvptx_uni[]} stores all-zeros or
20714 all-ones bitmasks for each warp, indicating current mode (0 outside of SIMD
20715 regions).  Each thread can bitwise-and the bitmask at position @code{tid.y}
20716 with current lane index to compute the master lane index.
20718 @item -mgomp
20719 @opindex mgomp
20720 Generate code for use in OpenMP offloading: enables @option{-msoft-stack} and
20721 @option{-muniform-simt} options, and selects corresponding multilib variant.
20723 @end table
20725 @node PDP-11 Options
20726 @subsection PDP-11 Options
20727 @cindex PDP-11 Options
20729 These options are defined for the PDP-11:
20731 @table @gcctabopt
20732 @item -mfpu
20733 @opindex mfpu
20734 Use hardware FPP floating point.  This is the default.  (FIS floating
20735 point on the PDP-11/40 is not supported.)
20737 @item -msoft-float
20738 @opindex msoft-float
20739 Do not use hardware floating point.
20741 @item -mac0
20742 @opindex mac0
20743 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
20745 @item -mno-ac0
20746 @opindex mno-ac0
20747 Return floating-point results in memory.  This is the default.
20749 @item -m40
20750 @opindex m40
20751 Generate code for a PDP-11/40.
20753 @item -m45
20754 @opindex m45
20755 Generate code for a PDP-11/45.  This is the default.
20757 @item -m10
20758 @opindex m10
20759 Generate code for a PDP-11/10.
20761 @item -mbcopy-builtin
20762 @opindex mbcopy-builtin
20763 Use inline @code{movmemhi} patterns for copying memory.  This is the
20764 default.
20766 @item -mbcopy
20767 @opindex mbcopy
20768 Do not use inline @code{movmemhi} patterns for copying memory.
20770 @item -mint16
20771 @itemx -mno-int32
20772 @opindex mint16
20773 @opindex mno-int32
20774 Use 16-bit @code{int}.  This is the default.
20776 @item -mint32
20777 @itemx -mno-int16
20778 @opindex mint32
20779 @opindex mno-int16
20780 Use 32-bit @code{int}.
20782 @item -mfloat64
20783 @itemx -mno-float32
20784 @opindex mfloat64
20785 @opindex mno-float32
20786 Use 64-bit @code{float}.  This is the default.
20788 @item -mfloat32
20789 @itemx -mno-float64
20790 @opindex mfloat32
20791 @opindex mno-float64
20792 Use 32-bit @code{float}.
20794 @item -mabshi
20795 @opindex mabshi
20796 Use @code{abshi2} pattern.  This is the default.
20798 @item -mno-abshi
20799 @opindex mno-abshi
20800 Do not use @code{abshi2} pattern.
20802 @item -mbranch-expensive
20803 @opindex mbranch-expensive
20804 Pretend that branches are expensive.  This is for experimenting with
20805 code generation only.
20807 @item -mbranch-cheap
20808 @opindex mbranch-cheap
20809 Do not pretend that branches are expensive.  This is the default.
20811 @item -munix-asm
20812 @opindex munix-asm
20813 Use Unix assembler syntax.  This is the default when configured for
20814 @samp{pdp11-*-bsd}.
20816 @item -mdec-asm
20817 @opindex mdec-asm
20818 Use DEC assembler syntax.  This is the default when configured for any
20819 PDP-11 target other than @samp{pdp11-*-bsd}.
20820 @end table
20822 @node picoChip Options
20823 @subsection picoChip Options
20824 @cindex picoChip options
20826 These @samp{-m} options are defined for picoChip implementations:
20828 @table @gcctabopt
20830 @item -mae=@var{ae_type}
20831 @opindex mcpu
20832 Set the instruction set, register set, and instruction scheduling
20833 parameters for array element type @var{ae_type}.  Supported values
20834 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
20836 @option{-mae=ANY} selects a completely generic AE type.  Code
20837 generated with this option runs on any of the other AE types.  The
20838 code is not as efficient as it would be if compiled for a specific
20839 AE type, and some types of operation (e.g., multiplication) do not
20840 work properly on all types of AE.
20842 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
20843 for compiled code, and is the default.
20845 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
20846 option may suffer from poor performance of byte (char) manipulation,
20847 since the DSP AE does not provide hardware support for byte load/stores.
20849 @item -msymbol-as-address
20850 Enable the compiler to directly use a symbol name as an address in a
20851 load/store instruction, without first loading it into a
20852 register.  Typically, the use of this option generates larger
20853 programs, which run faster than when the option isn't used.  However, the
20854 results vary from program to program, so it is left as a user option,
20855 rather than being permanently enabled.
20857 @item -mno-inefficient-warnings
20858 Disables warnings about the generation of inefficient code.  These
20859 warnings can be generated, for example, when compiling code that
20860 performs byte-level memory operations on the MAC AE type.  The MAC AE has
20861 no hardware support for byte-level memory operations, so all byte
20862 load/stores must be synthesized from word load/store operations.  This is
20863 inefficient and a warning is generated to indicate
20864 that you should rewrite the code to avoid byte operations, or to target
20865 an AE type that has the necessary hardware support.  This option disables
20866 these warnings.
20868 @end table
20870 @node PowerPC Options
20871 @subsection PowerPC Options
20872 @cindex PowerPC options
20874 These are listed under @xref{RS/6000 and PowerPC Options}.
20876 @node RISC-V Options
20877 @subsection RISC-V Options
20878 @cindex RISC-V Options
20880 These command-line options are defined for RISC-V targets:
20882 @table @gcctabopt
20883 @item -mbranch-cost=@var{n}
20884 @opindex mbranch-cost
20885 Set the cost of branches to roughly @var{n} instructions.
20887 @item -mmemcpy
20888 @itemx -mno-memcpy
20889 @opindex mmemcpy
20890 Don't optimize block moves.
20892 @item -mplt
20893 @itemx -mno-plt
20894 @opindex plt
20895 When generating PIC code, allow the use of PLTs. Ignored for non-PIC.
20897 @item -mabi=@var{ABI-string}
20898 @opindex mabi
20899 Specify integer and floating-point calling convention.  This defaults to the
20900 natural calling convention: e.g.@ LP64 for RV64I, ILP32 for RV32I, LP64D for
20901 RV64G.
20903 @item -mfdiv
20904 @itemx -mno-fdiv
20905 @opindex mfdiv
20906 Use hardware floating-point divide and square root instructions.  This requires
20907 the F or D extensions for floating-point registers.
20909 @item -mdiv
20910 @itemx -mno-div
20911 @opindex mdiv
20912 Use hardware instructions for integer division.  This requires the M extension.
20914 @item -march=@var{ISA-string}
20915 @opindex march
20916 Generate code for given RISC-V ISA (e.g.@ @samp{rv64im}).  ISA strings must be
20917 lower-case.  Examples include @samp{rv64i}, @samp{rv32g}, and @samp{rv32imaf}.
20919 @item -mtune=@var{processor-string}
20920 @opindex mtune
20921 Optimize the output for the given processor, specified by microarchitecture
20922 name.
20924 @item -msmall-data-limit=@var{n}
20925 @opindex msmall-data-limit
20926 Put global and static data smaller than @var{n} bytes into a special section
20927 (on some targets).
20929 @item -msave-restore
20930 @itemx -mno-save-restore
20931 @opindex msave-restore
20932 Use smaller but slower prologue and epilogue code.
20934 @item -mcmodel=@var{code-model}
20935 @opindex mcmodel
20936 Specify the code model.
20938 @end table
20940 @node RL78 Options
20941 @subsection RL78 Options
20942 @cindex RL78 Options
20944 @table @gcctabopt
20946 @item -msim
20947 @opindex msim
20948 Links in additional target libraries to support operation within a
20949 simulator.
20951 @item -mmul=none
20952 @itemx -mmul=g10
20953 @itemx -mmul=g13
20954 @itemx -mmul=g14
20955 @itemx -mmul=rl78
20956 @opindex mmul
20957 Specifies the type of hardware multiplication and division support to
20958 be used.  The simplest is @code{none}, which uses software for both
20959 multiplication and division.  This is the default.  The @code{g13}
20960 value is for the hardware multiply/divide peripheral found on the
20961 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
20962 the multiplication and division instructions supported by the RL78/G14
20963 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
20964 the value @code{mg10} is an alias for @code{none}.
20966 In addition a C preprocessor macro is defined, based upon the setting
20967 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
20968 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
20970 @item -mcpu=g10
20971 @itemx -mcpu=g13
20972 @itemx -mcpu=g14
20973 @itemx -mcpu=rl78
20974 @opindex mcpu
20975 Specifies the RL78 core to target.  The default is the G14 core, also
20976 known as an S3 core or just RL78.  The G13 or S2 core does not have
20977 multiply or divide instructions, instead it uses a hardware peripheral
20978 for these operations.  The G10 or S1 core does not have register
20979 banks, so it uses a different calling convention.
20981 If this option is set it also selects the type of hardware multiply
20982 support to use, unless this is overridden by an explicit
20983 @option{-mmul=none} option on the command line.  Thus specifying
20984 @option{-mcpu=g13} enables the use of the G13 hardware multiply
20985 peripheral and specifying @option{-mcpu=g10} disables the use of
20986 hardware multiplications altogether.
20988 Note, although the RL78/G14 core is the default target, specifying
20989 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
20990 change the behavior of the toolchain since it also enables G14
20991 hardware multiply support.  If these options are not specified on the
20992 command line then software multiplication routines will be used even
20993 though the code targets the RL78 core.  This is for backwards
20994 compatibility with older toolchains which did not have hardware
20995 multiply and divide support.
20997 In addition a C preprocessor macro is defined, based upon the setting
20998 of this option.  Possible values are: @code{__RL78_G10__},
20999 @code{__RL78_G13__} or @code{__RL78_G14__}.
21001 @item -mg10
21002 @itemx -mg13
21003 @itemx -mg14
21004 @itemx -mrl78
21005 @opindex mg10
21006 @opindex mg13
21007 @opindex mg14
21008 @opindex mrl78
21009 These are aliases for the corresponding @option{-mcpu=} option.  They
21010 are provided for backwards compatibility.
21012 @item -mallregs
21013 @opindex mallregs
21014 Allow the compiler to use all of the available registers.  By default
21015 registers @code{r24..r31} are reserved for use in interrupt handlers.
21016 With this option enabled these registers can be used in ordinary
21017 functions as well.
21019 @item -m64bit-doubles
21020 @itemx -m32bit-doubles
21021 @opindex m64bit-doubles
21022 @opindex m32bit-doubles
21023 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
21024 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
21025 @option{-m32bit-doubles}.
21027 @item -msave-mduc-in-interrupts
21028 @item -mno-save-mduc-in-interrupts
21029 @opindex msave-mduc-in-interrupts
21030 @opindex mno-save-mduc-in-interrupts
21031 Specifies that interrupt handler functions should preserve the
21032 MDUC registers.  This is only necessary if normal code might use
21033 the MDUC registers, for example because it performs multiplication
21034 and division operations.  The default is to ignore the MDUC registers
21035 as this makes the interrupt handlers faster.  The target option -mg13
21036 needs to be passed for this to work as this feature is only available
21037 on the G13 target (S2 core).  The MDUC registers will only be saved
21038 if the interrupt handler performs a multiplication or division
21039 operation or it calls another function.
21041 @end table
21043 @node RS/6000 and PowerPC Options
21044 @subsection IBM RS/6000 and PowerPC Options
21045 @cindex RS/6000 and PowerPC Options
21046 @cindex IBM RS/6000 and PowerPC Options
21048 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
21049 @table @gcctabopt
21050 @item -mpowerpc-gpopt
21051 @itemx -mno-powerpc-gpopt
21052 @itemx -mpowerpc-gfxopt
21053 @itemx -mno-powerpc-gfxopt
21054 @need 800
21055 @itemx -mpowerpc64
21056 @itemx -mno-powerpc64
21057 @itemx -mmfcrf
21058 @itemx -mno-mfcrf
21059 @itemx -mpopcntb
21060 @itemx -mno-popcntb
21061 @itemx -mpopcntd
21062 @itemx -mno-popcntd
21063 @itemx -mfprnd
21064 @itemx -mno-fprnd
21065 @need 800
21066 @itemx -mcmpb
21067 @itemx -mno-cmpb
21068 @itemx -mmfpgpr
21069 @itemx -mno-mfpgpr
21070 @itemx -mhard-dfp
21071 @itemx -mno-hard-dfp
21072 @opindex mpowerpc-gpopt
21073 @opindex mno-powerpc-gpopt
21074 @opindex mpowerpc-gfxopt
21075 @opindex mno-powerpc-gfxopt
21076 @opindex mpowerpc64
21077 @opindex mno-powerpc64
21078 @opindex mmfcrf
21079 @opindex mno-mfcrf
21080 @opindex mpopcntb
21081 @opindex mno-popcntb
21082 @opindex mpopcntd
21083 @opindex mno-popcntd
21084 @opindex mfprnd
21085 @opindex mno-fprnd
21086 @opindex mcmpb
21087 @opindex mno-cmpb
21088 @opindex mmfpgpr
21089 @opindex mno-mfpgpr
21090 @opindex mhard-dfp
21091 @opindex mno-hard-dfp
21092 You use these options to specify which instructions are available on the
21093 processor you are using.  The default value of these options is
21094 determined when configuring GCC@.  Specifying the
21095 @option{-mcpu=@var{cpu_type}} overrides the specification of these
21096 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
21097 rather than the options listed above.
21099 Specifying @option{-mpowerpc-gpopt} allows
21100 GCC to use the optional PowerPC architecture instructions in the
21101 General Purpose group, including floating-point square root.  Specifying
21102 @option{-mpowerpc-gfxopt} allows GCC to
21103 use the optional PowerPC architecture instructions in the Graphics
21104 group, including floating-point select.
21106 The @option{-mmfcrf} option allows GCC to generate the move from
21107 condition register field instruction implemented on the POWER4
21108 processor and other processors that support the PowerPC V2.01
21109 architecture.
21110 The @option{-mpopcntb} option allows GCC to generate the popcount and
21111 double-precision FP reciprocal estimate instruction implemented on the
21112 POWER5 processor and other processors that support the PowerPC V2.02
21113 architecture.
21114 The @option{-mpopcntd} option allows GCC to generate the popcount
21115 instruction implemented on the POWER7 processor and other processors
21116 that support the PowerPC V2.06 architecture.
21117 The @option{-mfprnd} option allows GCC to generate the FP round to
21118 integer instructions implemented on the POWER5+ processor and other
21119 processors that support the PowerPC V2.03 architecture.
21120 The @option{-mcmpb} option allows GCC to generate the compare bytes
21121 instruction implemented on the POWER6 processor and other processors
21122 that support the PowerPC V2.05 architecture.
21123 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
21124 general-purpose register instructions implemented on the POWER6X
21125 processor and other processors that support the extended PowerPC V2.05
21126 architecture.
21127 The @option{-mhard-dfp} option allows GCC to generate the decimal
21128 floating-point instructions implemented on some POWER processors.
21130 The @option{-mpowerpc64} option allows GCC to generate the additional
21131 64-bit instructions that are found in the full PowerPC64 architecture
21132 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
21133 @option{-mno-powerpc64}.
21135 @item -mcpu=@var{cpu_type}
21136 @opindex mcpu
21137 Set architecture type, register usage, and
21138 instruction scheduling parameters for machine type @var{cpu_type}.
21139 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
21140 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
21141 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
21142 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
21143 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
21144 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
21145 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
21146 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
21147 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
21148 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
21149 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
21150 and @samp{rs64}.
21152 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
21153 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
21154 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
21155 architecture machine types, with an appropriate, generic processor
21156 model assumed for scheduling purposes.
21158 The other options specify a specific processor.  Code generated under
21159 those options runs best on that processor, and may not run at all on
21160 others.
21162 The @option{-mcpu} options automatically enable or disable the
21163 following options:
21165 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
21166 -mpopcntb -mpopcntd  -mpowerpc64 @gol
21167 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
21168 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
21169 -mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
21170 -mquad-memory -mquad-memory-atomic -mfloat128 -mfloat128-hardware}
21172 The particular options set for any particular CPU varies between
21173 compiler versions, depending on what setting seems to produce optimal
21174 code for that CPU; it doesn't necessarily reflect the actual hardware's
21175 capabilities.  If you wish to set an individual option to a particular
21176 value, you may specify it after the @option{-mcpu} option, like
21177 @option{-mcpu=970 -mno-altivec}.
21179 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
21180 not enabled or disabled by the @option{-mcpu} option at present because
21181 AIX does not have full support for these options.  You may still
21182 enable or disable them individually if you're sure it'll work in your
21183 environment.
21185 @item -mtune=@var{cpu_type}
21186 @opindex mtune
21187 Set the instruction scheduling parameters for machine type
21188 @var{cpu_type}, but do not set the architecture type or register usage,
21189 as @option{-mcpu=@var{cpu_type}} does.  The same
21190 values for @var{cpu_type} are used for @option{-mtune} as for
21191 @option{-mcpu}.  If both are specified, the code generated uses the
21192 architecture and registers set by @option{-mcpu}, but the
21193 scheduling parameters set by @option{-mtune}.
21195 @item -mcmodel=small
21196 @opindex mcmodel=small
21197 Generate PowerPC64 code for the small model: The TOC is limited to
21198 64k.
21200 @item -mcmodel=medium
21201 @opindex mcmodel=medium
21202 Generate PowerPC64 code for the medium model: The TOC and other static
21203 data may be up to a total of 4G in size.  This is the default for 64-bit
21204 Linux.
21206 @item -mcmodel=large
21207 @opindex mcmodel=large
21208 Generate PowerPC64 code for the large model: The TOC may be up to 4G
21209 in size.  Other data and code is only limited by the 64-bit address
21210 space.
21212 @item -maltivec
21213 @itemx -mno-altivec
21214 @opindex maltivec
21215 @opindex mno-altivec
21216 Generate code that uses (does not use) AltiVec instructions, and also
21217 enable the use of built-in functions that allow more direct access to
21218 the AltiVec instruction set.  You may also need to set
21219 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
21220 enhancements.
21222 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
21223 @option{-maltivec=be}, the element order for AltiVec intrinsics such
21224 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
21225 match array element order corresponding to the endianness of the
21226 target.  That is, element zero identifies the leftmost element in a
21227 vector register when targeting a big-endian platform, and identifies
21228 the rightmost element in a vector register when targeting a
21229 little-endian platform.
21231 @item -maltivec=be
21232 @opindex maltivec=be
21233 Generate AltiVec instructions using big-endian element order,
21234 regardless of whether the target is big- or little-endian.  This is
21235 the default when targeting a big-endian platform.
21237 The element order is used to interpret element numbers in AltiVec
21238 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21239 @code{vec_insert}.  By default, these match array element order
21240 corresponding to the endianness for the target.
21242 @item -maltivec=le
21243 @opindex maltivec=le
21244 Generate AltiVec instructions using little-endian element order,
21245 regardless of whether the target is big- or little-endian.  This is
21246 the default when targeting a little-endian platform.  This option is
21247 currently ignored when targeting a big-endian platform.
21249 The element order is used to interpret element numbers in AltiVec
21250 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
21251 @code{vec_insert}.  By default, these match array element order
21252 corresponding to the endianness for the target.
21254 @item -mvrsave
21255 @itemx -mno-vrsave
21256 @opindex mvrsave
21257 @opindex mno-vrsave
21258 Generate VRSAVE instructions when generating AltiVec code.
21260 @item -mgen-cell-microcode
21261 @opindex mgen-cell-microcode
21262 Generate Cell microcode instructions.
21264 @item -mwarn-cell-microcode
21265 @opindex mwarn-cell-microcode
21266 Warn when a Cell microcode instruction is emitted.  An example
21267 of a Cell microcode instruction is a variable shift.
21269 @item -msecure-plt
21270 @opindex msecure-plt
21271 Generate code that allows @command{ld} and @command{ld.so}
21272 to build executables and shared
21273 libraries with non-executable @code{.plt} and @code{.got} sections.
21274 This is a PowerPC
21275 32-bit SYSV ABI option.
21277 @item -mbss-plt
21278 @opindex mbss-plt
21279 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
21280 fills in, and
21281 requires @code{.plt} and @code{.got}
21282 sections that are both writable and executable.
21283 This is a PowerPC 32-bit SYSV ABI option.
21285 @item -misel
21286 @itemx -mno-isel
21287 @opindex misel
21288 @opindex mno-isel
21289 This switch enables or disables the generation of ISEL instructions.
21291 @item -misel=@var{yes/no}
21292 This switch has been deprecated.  Use @option{-misel} and
21293 @option{-mno-isel} instead.
21295 @item -mlra
21296 @opindex mlra
21297 Enable Local Register Allocation. By default the port uses LRA.
21298 (i.e. @option{-mno-lra}).
21300 @item -mspe
21301 @itemx -mno-spe
21302 @opindex mspe
21303 @opindex mno-spe
21304 This switch enables or disables the generation of SPE simd
21305 instructions.
21307 @item -mpaired
21308 @itemx -mno-paired
21309 @opindex mpaired
21310 @opindex mno-paired
21311 This switch enables or disables the generation of PAIRED simd
21312 instructions.
21314 @item -mspe=@var{yes/no}
21315 This option has been deprecated.  Use @option{-mspe} and
21316 @option{-mno-spe} instead.
21318 @item -mvsx
21319 @itemx -mno-vsx
21320 @opindex mvsx
21321 @opindex mno-vsx
21322 Generate code that uses (does not use) vector/scalar (VSX)
21323 instructions, and also enable the use of built-in functions that allow
21324 more direct access to the VSX instruction set.
21326 @item -mcrypto
21327 @itemx -mno-crypto
21328 @opindex mcrypto
21329 @opindex mno-crypto
21330 Enable the use (disable) of the built-in functions that allow direct
21331 access to the cryptographic instructions that were added in version
21332 2.07 of the PowerPC ISA.
21334 @item -mdirect-move
21335 @itemx -mno-direct-move
21336 @opindex mdirect-move
21337 @opindex mno-direct-move
21338 Generate code that uses (does not use) the instructions to move data
21339 between the general purpose registers and the vector/scalar (VSX)
21340 registers that were added in version 2.07 of the PowerPC ISA.
21342 @item -mhtm
21343 @itemx -mno-htm
21344 @opindex mhtm
21345 @opindex mno-htm
21346 Enable (disable) the use of the built-in functions that allow direct
21347 access to the Hardware Transactional Memory (HTM) instructions that
21348 were added in version 2.07 of the PowerPC ISA.
21350 @item -mpower8-fusion
21351 @itemx -mno-power8-fusion
21352 @opindex mpower8-fusion
21353 @opindex mno-power8-fusion
21354 Generate code that keeps (does not keeps) some integer operations
21355 adjacent so that the instructions can be fused together on power8 and
21356 later processors.
21358 @item -mpower8-vector
21359 @itemx -mno-power8-vector
21360 @opindex mpower8-vector
21361 @opindex mno-power8-vector
21362 Generate code that uses (does not use) the vector and scalar
21363 instructions that were added in version 2.07 of the PowerPC ISA.  Also
21364 enable the use of built-in functions that allow more direct access to
21365 the vector instructions.
21367 @item -mquad-memory
21368 @itemx -mno-quad-memory
21369 @opindex mquad-memory
21370 @opindex mno-quad-memory
21371 Generate code that uses (does not use) the non-atomic quad word memory
21372 instructions.  The @option{-mquad-memory} option requires use of
21373 64-bit mode.
21375 @item -mquad-memory-atomic
21376 @itemx -mno-quad-memory-atomic
21377 @opindex mquad-memory-atomic
21378 @opindex mno-quad-memory-atomic
21379 Generate code that uses (does not use) the atomic quad word memory
21380 instructions.  The @option{-mquad-memory-atomic} option requires use of
21381 64-bit mode.
21383 @item -mupper-regs-di
21384 @itemx -mno-upper-regs-di
21385 @opindex mupper-regs-di
21386 @opindex mno-upper-regs-di
21387 Generate code that uses (does not use) the scalar instructions that
21388 target all 64 registers in the vector/scalar floating point register
21389 set that were added in version 2.06 of the PowerPC ISA when processing
21390 integers.  @option{-mupper-regs-di} is turned on by default if you use
21391 any of the @option{-mcpu=power7}, @option{-mcpu=power8},
21392 @option{-mcpu=power9}, or @option{-mvsx} options.
21394 @item -mupper-regs-df
21395 @itemx -mno-upper-regs-df
21396 @opindex mupper-regs-df
21397 @opindex mno-upper-regs-df
21398 Generate code that uses (does not use) the scalar double precision
21399 instructions that target all 64 registers in the vector/scalar
21400 floating point register set that were added in version 2.06 of the
21401 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
21402 use any of the @option{-mcpu=power7}, @option{-mcpu=power8},
21403 @option{-mcpu=power9}, or @option{-mvsx} options.
21405 @item -mupper-regs-sf
21406 @itemx -mno-upper-regs-sf
21407 @opindex mupper-regs-sf
21408 @opindex mno-upper-regs-sf
21409 Generate code that uses (does not use) the scalar single precision
21410 instructions that target all 64 registers in the vector/scalar
21411 floating point register set that were added in version 2.07 of the
21412 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
21413 use either of the @option{-mcpu=power8}, @option{-mpower8-vector}, or
21414 @option{-mcpu=power9} options.
21416 @item -mupper-regs
21417 @itemx -mno-upper-regs
21418 @opindex mupper-regs
21419 @opindex mno-upper-regs
21420 Generate code that uses (does not use) the scalar
21421 instructions that target all 64 registers in the vector/scalar
21422 floating point register set, depending on the model of the machine.
21424 If the @option{-mno-upper-regs} option is used, it turns off both
21425 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
21427 @item -mfloat128
21428 @itemx -mno-float128
21429 @opindex mfloat128
21430 @opindex mno-float128
21431 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
21432 and use either software emulation for IEEE 128-bit floating point or
21433 hardware instructions.
21435 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
21436 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
21437 option.  The @option{-mfloat128} option only works on PowerPC 64-bit
21438 Linux systems.
21440 If you use the ISA 3.0 instruction set (@option{-mcpu=power9}), the
21441 @option{-mfloat128} option will also enable the generation of ISA 3.0
21442 IEEE 128-bit floating point instructions.  Otherwise, IEEE 128-bit
21443 floating point will be done with software emulation.
21445 @item -mfloat128-hardware
21446 @itemx -mno-float128-hardware
21447 @opindex mfloat128-hardware
21448 @opindex mno-float128-hardware
21449 Enable/disable using ISA 3.0 hardware instructions to support the
21450 @var{__float128} data type.
21452 If you use @option{-mfloat128-hardware}, it will enable the option
21453 @option{-mfloat128} as well.
21455 If you select ISA 3.0 instructions with @option{-mcpu=power9}, but do
21456 not use either @option{-mfloat128} or @option{-mfloat128-hardware},
21457 the IEEE 128-bit floating point support will not be enabled.
21459 @item -mfloat-gprs=@var{yes/single/double/no}
21460 @itemx -mfloat-gprs
21461 @opindex mfloat-gprs
21462 This switch enables or disables the generation of floating-point
21463 operations on the general-purpose registers for architectures that
21464 support it.
21466 The argument @samp{yes} or @samp{single} enables the use of
21467 single-precision floating-point operations.
21469 The argument @samp{double} enables the use of single and
21470 double-precision floating-point operations.
21472 The argument @samp{no} disables floating-point operations on the
21473 general-purpose registers.
21475 This option is currently only available on the MPC854x.
21477 @item -m32
21478 @itemx -m64
21479 @opindex m32
21480 @opindex m64
21481 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
21482 targets (including GNU/Linux).  The 32-bit environment sets int, long
21483 and pointer to 32 bits and generates code that runs on any PowerPC
21484 variant.  The 64-bit environment sets int to 32 bits and long and
21485 pointer to 64 bits, and generates code for PowerPC64, as for
21486 @option{-mpowerpc64}.
21488 @item -mfull-toc
21489 @itemx -mno-fp-in-toc
21490 @itemx -mno-sum-in-toc
21491 @itemx -mminimal-toc
21492 @opindex mfull-toc
21493 @opindex mno-fp-in-toc
21494 @opindex mno-sum-in-toc
21495 @opindex mminimal-toc
21496 Modify generation of the TOC (Table Of Contents), which is created for
21497 every executable file.  The @option{-mfull-toc} option is selected by
21498 default.  In that case, GCC allocates at least one TOC entry for
21499 each unique non-automatic variable reference in your program.  GCC
21500 also places floating-point constants in the TOC@.  However, only
21501 16,384 entries are available in the TOC@.
21503 If you receive a linker error message that saying you have overflowed
21504 the available TOC space, you can reduce the amount of TOC space used
21505 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
21506 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
21507 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
21508 generate code to calculate the sum of an address and a constant at
21509 run time instead of putting that sum into the TOC@.  You may specify one
21510 or both of these options.  Each causes GCC to produce very slightly
21511 slower and larger code at the expense of conserving TOC space.
21513 If you still run out of space in the TOC even when you specify both of
21514 these options, specify @option{-mminimal-toc} instead.  This option causes
21515 GCC to make only one TOC entry for every file.  When you specify this
21516 option, GCC produces code that is slower and larger but which
21517 uses extremely little TOC space.  You may wish to use this option
21518 only on files that contain less frequently-executed code.
21520 @item -maix64
21521 @itemx -maix32
21522 @opindex maix64
21523 @opindex maix32
21524 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
21525 @code{long} type, and the infrastructure needed to support them.
21526 Specifying @option{-maix64} implies @option{-mpowerpc64},
21527 while @option{-maix32} disables the 64-bit ABI and
21528 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
21530 @item -mxl-compat
21531 @itemx -mno-xl-compat
21532 @opindex mxl-compat
21533 @opindex mno-xl-compat
21534 Produce code that conforms more closely to IBM XL compiler semantics
21535 when using AIX-compatible ABI@.  Pass floating-point arguments to
21536 prototyped functions beyond the register save area (RSA) on the stack
21537 in addition to argument FPRs.  Do not assume that most significant
21538 double in 128-bit long double value is properly rounded when comparing
21539 values and converting to double.  Use XL symbol names for long double
21540 support routines.
21542 The AIX calling convention was extended but not initially documented to
21543 handle an obscure K&R C case of calling a function that takes the
21544 address of its arguments with fewer arguments than declared.  IBM XL
21545 compilers access floating-point arguments that do not fit in the
21546 RSA from the stack when a subroutine is compiled without
21547 optimization.  Because always storing floating-point arguments on the
21548 stack is inefficient and rarely needed, this option is not enabled by
21549 default and only is necessary when calling subroutines compiled by IBM
21550 XL compilers without optimization.
21552 @item -mpe
21553 @opindex mpe
21554 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
21555 application written to use message passing with special startup code to
21556 enable the application to run.  The system must have PE installed in the
21557 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
21558 must be overridden with the @option{-specs=} option to specify the
21559 appropriate directory location.  The Parallel Environment does not
21560 support threads, so the @option{-mpe} option and the @option{-pthread}
21561 option are incompatible.
21563 @item -malign-natural
21564 @itemx -malign-power
21565 @opindex malign-natural
21566 @opindex malign-power
21567 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
21568 @option{-malign-natural} overrides the ABI-defined alignment of larger
21569 types, such as floating-point doubles, on their natural size-based boundary.
21570 The option @option{-malign-power} instructs GCC to follow the ABI-specified
21571 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
21573 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
21574 is not supported.
21576 @item -msoft-float
21577 @itemx -mhard-float
21578 @opindex msoft-float
21579 @opindex mhard-float
21580 Generate code that does not use (uses) the floating-point register set.
21581 Software floating-point emulation is provided if you use the
21582 @option{-msoft-float} option, and pass the option to GCC when linking.
21584 @item -msingle-float
21585 @itemx -mdouble-float
21586 @opindex msingle-float
21587 @opindex mdouble-float
21588 Generate code for single- or double-precision floating-point operations.
21589 @option{-mdouble-float} implies @option{-msingle-float}.
21591 @item -msimple-fpu
21592 @opindex msimple-fpu
21593 Do not generate @code{sqrt} and @code{div} instructions for hardware
21594 floating-point unit.
21596 @item -mfpu=@var{name}
21597 @opindex mfpu
21598 Specify type of floating-point unit.  Valid values for @var{name} are
21599 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
21600 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
21601 @samp{sp_full} (equivalent to @option{-msingle-float}),
21602 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
21604 @item -mxilinx-fpu
21605 @opindex mxilinx-fpu
21606 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
21608 @item -mmultiple
21609 @itemx -mno-multiple
21610 @opindex mmultiple
21611 @opindex mno-multiple
21612 Generate code that uses (does not use) the load multiple word
21613 instructions and the store multiple word instructions.  These
21614 instructions are generated by default on POWER systems, and not
21615 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
21616 PowerPC systems, since those instructions do not work when the
21617 processor is in little-endian mode.  The exceptions are PPC740 and
21618 PPC750 which permit these instructions in little-endian mode.
21620 @item -mstring
21621 @itemx -mno-string
21622 @opindex mstring
21623 @opindex mno-string
21624 Generate code that uses (does not use) the load string instructions
21625 and the store string word instructions to save multiple registers and
21626 do small block moves.  These instructions are generated by default on
21627 POWER systems, and not generated on PowerPC systems.  Do not use
21628 @option{-mstring} on little-endian PowerPC systems, since those
21629 instructions do not work when the processor is in little-endian mode.
21630 The exceptions are PPC740 and PPC750 which permit these instructions
21631 in little-endian mode.
21633 @item -mupdate
21634 @itemx -mno-update
21635 @opindex mupdate
21636 @opindex mno-update
21637 Generate code that uses (does not use) the load or store instructions
21638 that update the base register to the address of the calculated memory
21639 location.  These instructions are generated by default.  If you use
21640 @option{-mno-update}, there is a small window between the time that the
21641 stack pointer is updated and the address of the previous frame is
21642 stored, which means code that walks the stack frame across interrupts or
21643 signals may get corrupted data.
21645 @item -mavoid-indexed-addresses
21646 @itemx -mno-avoid-indexed-addresses
21647 @opindex mavoid-indexed-addresses
21648 @opindex mno-avoid-indexed-addresses
21649 Generate code that tries to avoid (not avoid) the use of indexed load
21650 or store instructions. These instructions can incur a performance
21651 penalty on Power6 processors in certain situations, such as when
21652 stepping through large arrays that cross a 16M boundary.  This option
21653 is enabled by default when targeting Power6 and disabled otherwise.
21655 @item -mfused-madd
21656 @itemx -mno-fused-madd
21657 @opindex mfused-madd
21658 @opindex mno-fused-madd
21659 Generate code that uses (does not use) the floating-point multiply and
21660 accumulate instructions.  These instructions are generated by default
21661 if hardware floating point is used.  The machine-dependent
21662 @option{-mfused-madd} option is now mapped to the machine-independent
21663 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21664 mapped to @option{-ffp-contract=off}.
21666 @item -mmulhw
21667 @itemx -mno-mulhw
21668 @opindex mmulhw
21669 @opindex mno-mulhw
21670 Generate code that uses (does not use) the half-word multiply and
21671 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
21672 These instructions are generated by default when targeting those
21673 processors.
21675 @item -mdlmzb
21676 @itemx -mno-dlmzb
21677 @opindex mdlmzb
21678 @opindex mno-dlmzb
21679 Generate code that uses (does not use) the string-search @samp{dlmzb}
21680 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
21681 generated by default when targeting those processors.
21683 @item -mno-bit-align
21684 @itemx -mbit-align
21685 @opindex mno-bit-align
21686 @opindex mbit-align
21687 On System V.4 and embedded PowerPC systems do not (do) force structures
21688 and unions that contain bit-fields to be aligned to the base type of the
21689 bit-field.
21691 For example, by default a structure containing nothing but 8
21692 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
21693 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
21694 the structure is aligned to a 1-byte boundary and is 1 byte in
21695 size.
21697 @item -mno-strict-align
21698 @itemx -mstrict-align
21699 @opindex mno-strict-align
21700 @opindex mstrict-align
21701 On System V.4 and embedded PowerPC systems do not (do) assume that
21702 unaligned memory references are handled by the system.
21704 @item -mrelocatable
21705 @itemx -mno-relocatable
21706 @opindex mrelocatable
21707 @opindex mno-relocatable
21708 Generate code that allows (does not allow) a static executable to be
21709 relocated to a different address at run time.  A simple embedded
21710 PowerPC system loader should relocate the entire contents of
21711 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
21712 a table of 32-bit addresses generated by this option.  For this to
21713 work, all objects linked together must be compiled with
21714 @option{-mrelocatable} or @option{-mrelocatable-lib}.
21715 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
21717 @item -mrelocatable-lib
21718 @itemx -mno-relocatable-lib
21719 @opindex mrelocatable-lib
21720 @opindex mno-relocatable-lib
21721 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
21722 @code{.fixup} section to allow static executables to be relocated at
21723 run time, but @option{-mrelocatable-lib} does not use the smaller stack
21724 alignment of @option{-mrelocatable}.  Objects compiled with
21725 @option{-mrelocatable-lib} may be linked with objects compiled with
21726 any combination of the @option{-mrelocatable} options.
21728 @item -mno-toc
21729 @itemx -mtoc
21730 @opindex mno-toc
21731 @opindex mtoc
21732 On System V.4 and embedded PowerPC systems do not (do) assume that
21733 register 2 contains a pointer to a global area pointing to the addresses
21734 used in the program.
21736 @item -mlittle
21737 @itemx -mlittle-endian
21738 @opindex mlittle
21739 @opindex mlittle-endian
21740 On System V.4 and embedded PowerPC systems compile code for the
21741 processor in little-endian mode.  The @option{-mlittle-endian} option is
21742 the same as @option{-mlittle}.
21744 @item -mbig
21745 @itemx -mbig-endian
21746 @opindex mbig
21747 @opindex mbig-endian
21748 On System V.4 and embedded PowerPC systems compile code for the
21749 processor in big-endian mode.  The @option{-mbig-endian} option is
21750 the same as @option{-mbig}.
21752 @item -mdynamic-no-pic
21753 @opindex mdynamic-no-pic
21754 On Darwin and Mac OS X systems, compile code so that it is not
21755 relocatable, but that its external references are relocatable.  The
21756 resulting code is suitable for applications, but not shared
21757 libraries.
21759 @item -msingle-pic-base
21760 @opindex msingle-pic-base
21761 Treat the register used for PIC addressing as read-only, rather than
21762 loading it in the prologue for each function.  The runtime system is
21763 responsible for initializing this register with an appropriate value
21764 before execution begins.
21766 @item -mprioritize-restricted-insns=@var{priority}
21767 @opindex mprioritize-restricted-insns
21768 This option controls the priority that is assigned to
21769 dispatch-slot restricted instructions during the second scheduling
21770 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
21771 or @samp{2} to assign no, highest, or second-highest (respectively) 
21772 priority to dispatch-slot restricted
21773 instructions.
21775 @item -msched-costly-dep=@var{dependence_type}
21776 @opindex msched-costly-dep
21777 This option controls which dependences are considered costly
21778 by the target during instruction scheduling.  The argument
21779 @var{dependence_type} takes one of the following values:
21781 @table @asis
21782 @item @samp{no}
21783 No dependence is costly.
21785 @item @samp{all}
21786 All dependences are costly.
21788 @item @samp{true_store_to_load}
21789 A true dependence from store to load is costly.
21791 @item @samp{store_to_load}
21792 Any dependence from store to load is costly.
21794 @item @var{number}
21795 Any dependence for which the latency is greater than or equal to 
21796 @var{number} is costly.
21797 @end table
21799 @item -minsert-sched-nops=@var{scheme}
21800 @opindex minsert-sched-nops
21801 This option controls which NOP insertion scheme is used during
21802 the second scheduling pass.  The argument @var{scheme} takes one of the
21803 following values:
21805 @table @asis
21806 @item @samp{no}
21807 Don't insert NOPs.
21809 @item @samp{pad}
21810 Pad with NOPs any dispatch group that has vacant issue slots,
21811 according to the scheduler's grouping.
21813 @item @samp{regroup_exact}
21814 Insert NOPs to force costly dependent insns into
21815 separate groups.  Insert exactly as many NOPs as needed to force an insn
21816 to a new group, according to the estimated processor grouping.
21818 @item @var{number}
21819 Insert NOPs to force costly dependent insns into
21820 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
21821 @end table
21823 @item -mcall-sysv
21824 @opindex mcall-sysv
21825 On System V.4 and embedded PowerPC systems compile code using calling
21826 conventions that adhere to the March 1995 draft of the System V
21827 Application Binary Interface, PowerPC processor supplement.  This is the
21828 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
21830 @item -mcall-sysv-eabi
21831 @itemx -mcall-eabi
21832 @opindex mcall-sysv-eabi
21833 @opindex mcall-eabi
21834 Specify both @option{-mcall-sysv} and @option{-meabi} options.
21836 @item -mcall-sysv-noeabi
21837 @opindex mcall-sysv-noeabi
21838 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
21840 @item -mcall-aixdesc
21841 @opindex m
21842 On System V.4 and embedded PowerPC systems compile code for the AIX
21843 operating system.
21845 @item -mcall-linux
21846 @opindex mcall-linux
21847 On System V.4 and embedded PowerPC systems compile code for the
21848 Linux-based GNU system.
21850 @item -mcall-freebsd
21851 @opindex mcall-freebsd
21852 On System V.4 and embedded PowerPC systems compile code for the
21853 FreeBSD operating system.
21855 @item -mcall-netbsd
21856 @opindex mcall-netbsd
21857 On System V.4 and embedded PowerPC systems compile code for the
21858 NetBSD operating system.
21860 @item -mcall-openbsd
21861 @opindex mcall-netbsd
21862 On System V.4 and embedded PowerPC systems compile code for the
21863 OpenBSD operating system.
21865 @item -maix-struct-return
21866 @opindex maix-struct-return
21867 Return all structures in memory (as specified by the AIX ABI)@.
21869 @item -msvr4-struct-return
21870 @opindex msvr4-struct-return
21871 Return structures smaller than 8 bytes in registers (as specified by the
21872 SVR4 ABI)@.
21874 @item -mabi=@var{abi-type}
21875 @opindex mabi
21876 Extend the current ABI with a particular extension, or remove such extension.
21877 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
21878 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
21879 @samp{elfv1}, @samp{elfv2}@.
21881 @item -mabi=spe
21882 @opindex mabi=spe
21883 Extend the current ABI with SPE ABI extensions.  This does not change
21884 the default ABI, instead it adds the SPE ABI extensions to the current
21885 ABI@.
21887 @item -mabi=no-spe
21888 @opindex mabi=no-spe
21889 Disable Book-E SPE ABI extensions for the current ABI@.
21891 @item -mabi=ibmlongdouble
21892 @opindex mabi=ibmlongdouble
21893 Change the current ABI to use IBM extended-precision long double.
21894 This is a PowerPC 32-bit SYSV ABI option.
21896 @item -mabi=ieeelongdouble
21897 @opindex mabi=ieeelongdouble
21898 Change the current ABI to use IEEE extended-precision long double.
21899 This is a PowerPC 32-bit Linux ABI option.
21901 @item -mabi=elfv1
21902 @opindex mabi=elfv1
21903 Change the current ABI to use the ELFv1 ABI.
21904 This is the default ABI for big-endian PowerPC 64-bit Linux.
21905 Overriding the default ABI requires special system support and is
21906 likely to fail in spectacular ways.
21908 @item -mabi=elfv2
21909 @opindex mabi=elfv2
21910 Change the current ABI to use the ELFv2 ABI.
21911 This is the default ABI for little-endian PowerPC 64-bit Linux.
21912 Overriding the default ABI requires special system support and is
21913 likely to fail in spectacular ways.
21915 @item -mgnu-attribute
21916 @itemx -mno-gnu-attribute
21917 @opindex mgnu-attribute
21918 @opindex mno-gnu-attribute
21919 Emit .gnu_attribute assembly directives to set tag/value pairs in a
21920 .gnu.attributes section that specify ABI variations in function
21921 parameters or return values.
21923 @item -mprototype
21924 @itemx -mno-prototype
21925 @opindex mprototype
21926 @opindex mno-prototype
21927 On System V.4 and embedded PowerPC systems assume that all calls to
21928 variable argument functions are properly prototyped.  Otherwise, the
21929 compiler must insert an instruction before every non-prototyped call to
21930 set or clear bit 6 of the condition code register (@code{CR}) to
21931 indicate whether floating-point values are passed in the floating-point
21932 registers in case the function takes variable arguments.  With
21933 @option{-mprototype}, only calls to prototyped variable argument functions
21934 set or clear the bit.
21936 @item -msim
21937 @opindex msim
21938 On embedded PowerPC systems, assume that the startup module is called
21939 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
21940 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
21941 configurations.
21943 @item -mmvme
21944 @opindex mmvme
21945 On embedded PowerPC systems, assume that the startup module is called
21946 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
21947 @file{libc.a}.
21949 @item -mads
21950 @opindex mads
21951 On embedded PowerPC systems, assume that the startup module is called
21952 @file{crt0.o} and the standard C libraries are @file{libads.a} and
21953 @file{libc.a}.
21955 @item -myellowknife
21956 @opindex myellowknife
21957 On embedded PowerPC systems, assume that the startup module is called
21958 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
21959 @file{libc.a}.
21961 @item -mvxworks
21962 @opindex mvxworks
21963 On System V.4 and embedded PowerPC systems, specify that you are
21964 compiling for a VxWorks system.
21966 @item -memb
21967 @opindex memb
21968 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
21969 header to indicate that @samp{eabi} extended relocations are used.
21971 @item -meabi
21972 @itemx -mno-eabi
21973 @opindex meabi
21974 @opindex mno-eabi
21975 On System V.4 and embedded PowerPC systems do (do not) adhere to the
21976 Embedded Applications Binary Interface (EABI), which is a set of
21977 modifications to the System V.4 specifications.  Selecting @option{-meabi}
21978 means that the stack is aligned to an 8-byte boundary, a function
21979 @code{__eabi} is called from @code{main} to set up the EABI
21980 environment, and the @option{-msdata} option can use both @code{r2} and
21981 @code{r13} to point to two separate small data areas.  Selecting
21982 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
21983 no EABI initialization function is called from @code{main}, and the
21984 @option{-msdata} option only uses @code{r13} to point to a single
21985 small data area.  The @option{-meabi} option is on by default if you
21986 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
21988 @item -msdata=eabi
21989 @opindex msdata=eabi
21990 On System V.4 and embedded PowerPC systems, put small initialized
21991 @code{const} global and static data in the @code{.sdata2} section, which
21992 is pointed to by register @code{r2}.  Put small initialized
21993 non-@code{const} global and static data in the @code{.sdata} section,
21994 which is pointed to by register @code{r13}.  Put small uninitialized
21995 global and static data in the @code{.sbss} section, which is adjacent to
21996 the @code{.sdata} section.  The @option{-msdata=eabi} option is
21997 incompatible with the @option{-mrelocatable} option.  The
21998 @option{-msdata=eabi} option also sets the @option{-memb} option.
22000 @item -msdata=sysv
22001 @opindex msdata=sysv
22002 On System V.4 and embedded PowerPC systems, put small global and static
22003 data in the @code{.sdata} section, which is pointed to by register
22004 @code{r13}.  Put small uninitialized global and static data in the
22005 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
22006 The @option{-msdata=sysv} option is incompatible with the
22007 @option{-mrelocatable} option.
22009 @item -msdata=default
22010 @itemx -msdata
22011 @opindex msdata=default
22012 @opindex msdata
22013 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
22014 compile code the same as @option{-msdata=eabi}, otherwise compile code the
22015 same as @option{-msdata=sysv}.
22017 @item -msdata=data
22018 @opindex msdata=data
22019 On System V.4 and embedded PowerPC systems, put small global
22020 data in the @code{.sdata} section.  Put small uninitialized global
22021 data in the @code{.sbss} section.  Do not use register @code{r13}
22022 to address small data however.  This is the default behavior unless
22023 other @option{-msdata} options are used.
22025 @item -msdata=none
22026 @itemx -mno-sdata
22027 @opindex msdata=none
22028 @opindex mno-sdata
22029 On embedded PowerPC systems, put all initialized global and static data
22030 in the @code{.data} section, and all uninitialized data in the
22031 @code{.bss} section.
22033 @item -mblock-move-inline-limit=@var{num}
22034 @opindex mblock-move-inline-limit
22035 Inline all block moves (such as calls to @code{memcpy} or structure
22036 copies) less than or equal to @var{num} bytes.  The minimum value for
22037 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
22038 targets.  The default value is target-specific.
22040 @item -G @var{num}
22041 @opindex G
22042 @cindex smaller data references (PowerPC)
22043 @cindex .sdata/.sdata2 references (PowerPC)
22044 On embedded PowerPC systems, put global and static items less than or
22045 equal to @var{num} bytes into the small data or BSS sections instead of
22046 the normal data or BSS section.  By default, @var{num} is 8.  The
22047 @option{-G @var{num}} switch is also passed to the linker.
22048 All modules should be compiled with the same @option{-G @var{num}} value.
22050 @item -mregnames
22051 @itemx -mno-regnames
22052 @opindex mregnames
22053 @opindex mno-regnames
22054 On System V.4 and embedded PowerPC systems do (do not) emit register
22055 names in the assembly language output using symbolic forms.
22057 @item -mlongcall
22058 @itemx -mno-longcall
22059 @opindex mlongcall
22060 @opindex mno-longcall
22061 By default assume that all calls are far away so that a longer and more
22062 expensive calling sequence is required.  This is required for calls
22063 farther than 32 megabytes (33,554,432 bytes) from the current location.
22064 A short call is generated if the compiler knows
22065 the call cannot be that far away.  This setting can be overridden by
22066 the @code{shortcall} function attribute, or by @code{#pragma
22067 longcall(0)}.
22069 Some linkers are capable of detecting out-of-range calls and generating
22070 glue code on the fly.  On these systems, long calls are unnecessary and
22071 generate slower code.  As of this writing, the AIX linker can do this,
22072 as can the GNU linker for PowerPC/64.  It is planned to add this feature
22073 to the GNU linker for 32-bit PowerPC systems as well.
22075 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
22076 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
22077 addresses represent the callee and the branch island.  The
22078 Darwin/PPC linker prefers the first address and generates a @code{bl
22079 callee} if the PPC @code{bl} instruction reaches the callee directly;
22080 otherwise, the linker generates @code{bl L42} to call the branch
22081 island.  The branch island is appended to the body of the
22082 calling function; it computes the full 32-bit address of the callee
22083 and jumps to it.
22085 On Mach-O (Darwin) systems, this option directs the compiler emit to
22086 the glue for every direct call, and the Darwin linker decides whether
22087 to use or discard it.
22089 In the future, GCC may ignore all longcall specifications
22090 when the linker is known to generate glue.
22092 @item -mtls-markers
22093 @itemx -mno-tls-markers
22094 @opindex mtls-markers
22095 @opindex mno-tls-markers
22096 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
22097 specifying the function argument.  The relocation allows the linker to
22098 reliably associate function call with argument setup instructions for
22099 TLS optimization, which in turn allows GCC to better schedule the
22100 sequence.
22102 @item -mrecip
22103 @itemx -mno-recip
22104 @opindex mrecip
22105 This option enables use of the reciprocal estimate and
22106 reciprocal square root estimate instructions with additional
22107 Newton-Raphson steps to increase precision instead of doing a divide or
22108 square root and divide for floating-point arguments.  You should use
22109 the @option{-ffast-math} option when using @option{-mrecip} (or at
22110 least @option{-funsafe-math-optimizations},
22111 @option{-ffinite-math-only}, @option{-freciprocal-math} and
22112 @option{-fno-trapping-math}).  Note that while the throughput of the
22113 sequence is generally higher than the throughput of the non-reciprocal
22114 instruction, the precision of the sequence can be decreased by up to 2
22115 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
22116 roots.
22118 @item -mrecip=@var{opt}
22119 @opindex mrecip=opt
22120 This option controls which reciprocal estimate instructions
22121 may be used.  @var{opt} is a comma-separated list of options, which may
22122 be preceded by a @code{!} to invert the option:
22124 @table @samp
22126 @item all
22127 Enable all estimate instructions.
22129 @item default 
22130 Enable the default instructions, equivalent to @option{-mrecip}.
22132 @item none 
22133 Disable all estimate instructions, equivalent to @option{-mno-recip}.
22135 @item div 
22136 Enable the reciprocal approximation instructions for both 
22137 single and double precision.
22139 @item divf 
22140 Enable the single-precision reciprocal approximation instructions.
22142 @item divd 
22143 Enable the double-precision reciprocal approximation instructions.
22145 @item rsqrt 
22146 Enable the reciprocal square root approximation instructions for both
22147 single and double precision.
22149 @item rsqrtf 
22150 Enable the single-precision reciprocal square root approximation instructions.
22152 @item rsqrtd 
22153 Enable the double-precision reciprocal square root approximation instructions.
22155 @end table
22157 So, for example, @option{-mrecip=all,!rsqrtd} enables
22158 all of the reciprocal estimate instructions, except for the
22159 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
22160 which handle the double-precision reciprocal square root calculations.
22162 @item -mrecip-precision
22163 @itemx -mno-recip-precision
22164 @opindex mrecip-precision
22165 Assume (do not assume) that the reciprocal estimate instructions
22166 provide higher-precision estimates than is mandated by the PowerPC
22167 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
22168 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
22169 The double-precision square root estimate instructions are not generated by
22170 default on low-precision machines, since they do not provide an
22171 estimate that converges after three steps.
22173 @item -mveclibabi=@var{type}
22174 @opindex mveclibabi
22175 Specifies the ABI type to use for vectorizing intrinsics using an
22176 external library.  The only type supported at present is @samp{mass},
22177 which specifies to use IBM's Mathematical Acceleration Subsystem
22178 (MASS) libraries for vectorizing intrinsics using external libraries.
22179 GCC currently emits calls to @code{acosd2}, @code{acosf4},
22180 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
22181 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
22182 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
22183 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
22184 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
22185 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
22186 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
22187 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
22188 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
22189 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
22190 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
22191 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
22192 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
22193 for power7.  Both @option{-ftree-vectorize} and
22194 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
22195 libraries must be specified at link time.
22197 @item -mfriz
22198 @itemx -mno-friz
22199 @opindex mfriz
22200 Generate (do not generate) the @code{friz} instruction when the
22201 @option{-funsafe-math-optimizations} option is used to optimize
22202 rounding of floating-point values to 64-bit integer and back to floating
22203 point.  The @code{friz} instruction does not return the same value if
22204 the floating-point number is too large to fit in an integer.
22206 @item -mpointers-to-nested-functions
22207 @itemx -mno-pointers-to-nested-functions
22208 @opindex mpointers-to-nested-functions
22209 Generate (do not generate) code to load up the static chain register
22210 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
22211 systems where a function pointer points to a 3-word descriptor giving
22212 the function address, TOC value to be loaded in register @code{r2}, and
22213 static chain value to be loaded in register @code{r11}.  The
22214 @option{-mpointers-to-nested-functions} is on by default.  You cannot
22215 call through pointers to nested functions or pointers
22216 to functions compiled in other languages that use the static chain if
22217 you use @option{-mno-pointers-to-nested-functions}.
22219 @item -msave-toc-indirect
22220 @itemx -mno-save-toc-indirect
22221 @opindex msave-toc-indirect
22222 Generate (do not generate) code to save the TOC value in the reserved
22223 stack location in the function prologue if the function calls through
22224 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
22225 saved in the prologue, it is saved just before the call through the
22226 pointer.  The @option{-mno-save-toc-indirect} option is the default.
22228 @item -mcompat-align-parm
22229 @itemx -mno-compat-align-parm
22230 @opindex mcompat-align-parm
22231 Generate (do not generate) code to pass structure parameters with a
22232 maximum alignment of 64 bits, for compatibility with older versions
22233 of GCC.
22235 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
22236 structure parameter on a 128-bit boundary when that structure contained
22237 a member requiring 128-bit alignment.  This is corrected in more
22238 recent versions of GCC.  This option may be used to generate code
22239 that is compatible with functions compiled with older versions of
22240 GCC.
22242 The @option{-mno-compat-align-parm} option is the default.
22244 @item -mstack-protector-guard=@var{guard}
22245 @itemx -mstack-protector-guard-reg=@var{reg}
22246 @itemx -mstack-protector-guard-offset=@var{offset}
22247 @opindex mstack-protector-guard
22248 @opindex mstack-protector-guard-reg
22249 @opindex mstack-protector-guard-offset
22250 Generate stack protection code using canary at @var{guard}.  Supported
22251 locations are @samp{global} for global canary or @samp{tls} for per-thread
22252 canary in the TLS block (the default with GNU libc version 2.4 or later).
22254 With the latter choice the options
22255 @option{-mstack-protector-guard-reg=@var{reg}} and
22256 @option{-mstack-protector-guard-offset=@var{offset}} furthermore specify
22257 which register to use as base register for reading the canary, and from what
22258 offset from that base register. The default for those is as specified in the
22259 relevant ABI.
22260 @end table
22262 @node RX Options
22263 @subsection RX Options
22264 @cindex RX Options
22266 These command-line options are defined for RX targets:
22268 @table @gcctabopt
22269 @item -m64bit-doubles
22270 @itemx -m32bit-doubles
22271 @opindex m64bit-doubles
22272 @opindex m32bit-doubles
22273 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
22274 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
22275 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
22276 works on 32-bit values, which is why the default is
22277 @option{-m32bit-doubles}.
22279 @item -fpu
22280 @itemx -nofpu
22281 @opindex fpu
22282 @opindex nofpu
22283 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
22284 floating-point hardware.  The default is enabled for the RX600
22285 series and disabled for the RX200 series.
22287 Floating-point instructions are only generated for 32-bit floating-point 
22288 values, however, so the FPU hardware is not used for doubles if the
22289 @option{-m64bit-doubles} option is used.
22291 @emph{Note} If the @option{-fpu} option is enabled then
22292 @option{-funsafe-math-optimizations} is also enabled automatically.
22293 This is because the RX FPU instructions are themselves unsafe.
22295 @item -mcpu=@var{name}
22296 @opindex mcpu
22297 Selects the type of RX CPU to be targeted.  Currently three types are
22298 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
22299 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
22301 The only difference between @samp{RX600} and @samp{RX610} is that the
22302 @samp{RX610} does not support the @code{MVTIPL} instruction.
22304 The @samp{RX200} series does not have a hardware floating-point unit
22305 and so @option{-nofpu} is enabled by default when this type is
22306 selected.
22308 @item -mbig-endian-data
22309 @itemx -mlittle-endian-data
22310 @opindex mbig-endian-data
22311 @opindex mlittle-endian-data
22312 Store data (but not code) in the big-endian format.  The default is
22313 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
22314 format.
22316 @item -msmall-data-limit=@var{N}
22317 @opindex msmall-data-limit
22318 Specifies the maximum size in bytes of global and static variables
22319 which can be placed into the small data area.  Using the small data
22320 area can lead to smaller and faster code, but the size of area is
22321 limited and it is up to the programmer to ensure that the area does
22322 not overflow.  Also when the small data area is used one of the RX's
22323 registers (usually @code{r13}) is reserved for use pointing to this
22324 area, so it is no longer available for use by the compiler.  This
22325 could result in slower and/or larger code if variables are pushed onto
22326 the stack instead of being held in this register.
22328 Note, common variables (variables that have not been initialized) and
22329 constants are not placed into the small data area as they are assigned
22330 to other sections in the output executable.
22332 The default value is zero, which disables this feature.  Note, this
22333 feature is not enabled by default with higher optimization levels
22334 (@option{-O2} etc) because of the potentially detrimental effects of
22335 reserving a register.  It is up to the programmer to experiment and
22336 discover whether this feature is of benefit to their program.  See the
22337 description of the @option{-mpid} option for a description of how the
22338 actual register to hold the small data area pointer is chosen.
22340 @item -msim
22341 @itemx -mno-sim
22342 @opindex msim
22343 @opindex mno-sim
22344 Use the simulator runtime.  The default is to use the libgloss
22345 board-specific runtime.
22347 @item -mas100-syntax
22348 @itemx -mno-as100-syntax
22349 @opindex mas100-syntax
22350 @opindex mno-as100-syntax
22351 When generating assembler output use a syntax that is compatible with
22352 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
22353 assembler, but it has some restrictions so it is not generated by default.
22355 @item -mmax-constant-size=@var{N}
22356 @opindex mmax-constant-size
22357 Specifies the maximum size, in bytes, of a constant that can be used as
22358 an operand in a RX instruction.  Although the RX instruction set does
22359 allow constants of up to 4 bytes in length to be used in instructions,
22360 a longer value equates to a longer instruction.  Thus in some
22361 circumstances it can be beneficial to restrict the size of constants
22362 that are used in instructions.  Constants that are too big are instead
22363 placed into a constant pool and referenced via register indirection.
22365 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
22366 or 4 means that constants of any size are allowed.
22368 @item -mrelax
22369 @opindex mrelax
22370 Enable linker relaxation.  Linker relaxation is a process whereby the
22371 linker attempts to reduce the size of a program by finding shorter
22372 versions of various instructions.  Disabled by default.
22374 @item -mint-register=@var{N}
22375 @opindex mint-register
22376 Specify the number of registers to reserve for fast interrupt handler
22377 functions.  The value @var{N} can be between 0 and 4.  A value of 1
22378 means that register @code{r13} is reserved for the exclusive use
22379 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
22380 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
22381 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
22382 A value of 0, the default, does not reserve any registers.
22384 @item -msave-acc-in-interrupts
22385 @opindex msave-acc-in-interrupts
22386 Specifies that interrupt handler functions should preserve the
22387 accumulator register.  This is only necessary if normal code might use
22388 the accumulator register, for example because it performs 64-bit
22389 multiplications.  The default is to ignore the accumulator as this
22390 makes the interrupt handlers faster.
22392 @item -mpid
22393 @itemx -mno-pid
22394 @opindex mpid
22395 @opindex mno-pid
22396 Enables the generation of position independent data.  When enabled any
22397 access to constant data is done via an offset from a base address
22398 held in a register.  This allows the location of constant data to be
22399 determined at run time without requiring the executable to be
22400 relocated, which is a benefit to embedded applications with tight
22401 memory constraints.  Data that can be modified is not affected by this
22402 option.
22404 Note, using this feature reserves a register, usually @code{r13}, for
22405 the constant data base address.  This can result in slower and/or
22406 larger code, especially in complicated functions.
22408 The actual register chosen to hold the constant data base address
22409 depends upon whether the @option{-msmall-data-limit} and/or the
22410 @option{-mint-register} command-line options are enabled.  Starting
22411 with register @code{r13} and proceeding downwards, registers are
22412 allocated first to satisfy the requirements of @option{-mint-register},
22413 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
22414 is possible for the small data area register to be @code{r8} if both
22415 @option{-mint-register=4} and @option{-mpid} are specified on the
22416 command line.
22418 By default this feature is not enabled.  The default can be restored
22419 via the @option{-mno-pid} command-line option.
22421 @item -mno-warn-multiple-fast-interrupts
22422 @itemx -mwarn-multiple-fast-interrupts
22423 @opindex mno-warn-multiple-fast-interrupts
22424 @opindex mwarn-multiple-fast-interrupts
22425 Prevents GCC from issuing a warning message if it finds more than one
22426 fast interrupt handler when it is compiling a file.  The default is to
22427 issue a warning for each extra fast interrupt handler found, as the RX
22428 only supports one such interrupt.
22430 @item -mallow-string-insns
22431 @itemx -mno-allow-string-insns
22432 @opindex mallow-string-insns
22433 @opindex mno-allow-string-insns
22434 Enables or disables the use of the string manipulation instructions
22435 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
22436 @code{SWHILE} and also the @code{RMPA} instruction.  These
22437 instructions may prefetch data, which is not safe to do if accessing
22438 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
22439 for more information).
22441 The default is to allow these instructions, but it is not possible for
22442 GCC to reliably detect all circumstances where a string instruction
22443 might be used to access an I/O register, so their use cannot be
22444 disabled automatically.  Instead it is reliant upon the programmer to
22445 use the @option{-mno-allow-string-insns} option if their program
22446 accesses I/O space.
22448 When the instructions are enabled GCC defines the C preprocessor
22449 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
22450 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
22452 @item -mjsr
22453 @itemx -mno-jsr
22454 @opindex mjsr
22455 @opindex mno-jsr
22456 Use only (or not only) @code{JSR} instructions to access functions.
22457 This option can be used when code size exceeds the range of @code{BSR}
22458 instructions.  Note that @option{-mno-jsr} does not mean to not use
22459 @code{JSR} but instead means that any type of branch may be used.
22460 @end table
22462 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
22463 has special significance to the RX port when used with the
22464 @code{interrupt} function attribute.  This attribute indicates a
22465 function intended to process fast interrupts.  GCC ensures
22466 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
22467 and/or @code{r13} and only provided that the normal use of the
22468 corresponding registers have been restricted via the
22469 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
22470 options.
22472 @node S/390 and zSeries Options
22473 @subsection S/390 and zSeries Options
22474 @cindex S/390 and zSeries Options
22476 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
22478 @table @gcctabopt
22479 @item -mhard-float
22480 @itemx -msoft-float
22481 @opindex mhard-float
22482 @opindex msoft-float
22483 Use (do not use) the hardware floating-point instructions and registers
22484 for floating-point operations.  When @option{-msoft-float} is specified,
22485 functions in @file{libgcc.a} are used to perform floating-point
22486 operations.  When @option{-mhard-float} is specified, the compiler
22487 generates IEEE floating-point instructions.  This is the default.
22489 @item -mhard-dfp
22490 @itemx -mno-hard-dfp
22491 @opindex mhard-dfp
22492 @opindex mno-hard-dfp
22493 Use (do not use) the hardware decimal-floating-point instructions for
22494 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
22495 specified, functions in @file{libgcc.a} are used to perform
22496 decimal-floating-point operations.  When @option{-mhard-dfp} is
22497 specified, the compiler generates decimal-floating-point hardware
22498 instructions.  This is the default for @option{-march=z9-ec} or higher.
22500 @item -mlong-double-64
22501 @itemx -mlong-double-128
22502 @opindex mlong-double-64
22503 @opindex mlong-double-128
22504 These switches control the size of @code{long double} type. A size
22505 of 64 bits makes the @code{long double} type equivalent to the @code{double}
22506 type. This is the default.
22508 @item -mbackchain
22509 @itemx -mno-backchain
22510 @opindex mbackchain
22511 @opindex mno-backchain
22512 Store (do not store) the address of the caller's frame as backchain pointer
22513 into the callee's stack frame.
22514 A backchain may be needed to allow debugging using tools that do not understand
22515 DWARF call frame information.
22516 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
22517 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
22518 the backchain is placed into the topmost word of the 96/160 byte register
22519 save area.
22521 In general, code compiled with @option{-mbackchain} is call-compatible with
22522 code compiled with @option{-mmo-backchain}; however, use of the backchain
22523 for debugging purposes usually requires that the whole binary is built with
22524 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
22525 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
22526 to build a linux kernel use @option{-msoft-float}.
22528 The default is to not maintain the backchain.
22530 @item -mpacked-stack
22531 @itemx -mno-packed-stack
22532 @opindex mpacked-stack
22533 @opindex mno-packed-stack
22534 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
22535 specified, the compiler uses the all fields of the 96/160 byte register save
22536 area only for their default purpose; unused fields still take up stack space.
22537 When @option{-mpacked-stack} is specified, register save slots are densely
22538 packed at the top of the register save area; unused space is reused for other
22539 purposes, allowing for more efficient use of the available stack space.
22540 However, when @option{-mbackchain} is also in effect, the topmost word of
22541 the save area is always used to store the backchain, and the return address
22542 register is always saved two words below the backchain.
22544 As long as the stack frame backchain is not used, code generated with
22545 @option{-mpacked-stack} is call-compatible with code generated with
22546 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
22547 S/390 or zSeries generated code that uses the stack frame backchain at run
22548 time, not just for debugging purposes.  Such code is not call-compatible
22549 with code compiled with @option{-mpacked-stack}.  Also, note that the
22550 combination of @option{-mbackchain},
22551 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
22552 to build a linux kernel use @option{-msoft-float}.
22554 The default is to not use the packed stack layout.
22556 @item -msmall-exec
22557 @itemx -mno-small-exec
22558 @opindex msmall-exec
22559 @opindex mno-small-exec
22560 Generate (or do not generate) code using the @code{bras} instruction
22561 to do subroutine calls.
22562 This only works reliably if the total executable size does not
22563 exceed 64k.  The default is to use the @code{basr} instruction instead,
22564 which does not have this limitation.
22566 @item -m64
22567 @itemx -m31
22568 @opindex m64
22569 @opindex m31
22570 When @option{-m31} is specified, generate code compliant to the
22571 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
22572 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
22573 particular to generate 64-bit instructions.  For the @samp{s390}
22574 targets, the default is @option{-m31}, while the @samp{s390x}
22575 targets default to @option{-m64}.
22577 @item -mzarch
22578 @itemx -mesa
22579 @opindex mzarch
22580 @opindex mesa
22581 When @option{-mzarch} is specified, generate code using the
22582 instructions available on z/Architecture.
22583 When @option{-mesa} is specified, generate code using the
22584 instructions available on ESA/390.  Note that @option{-mesa} is
22585 not possible with @option{-m64}.
22586 When generating code compliant to the GNU/Linux for S/390 ABI,
22587 the default is @option{-mesa}.  When generating code compliant
22588 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
22590 @item -mhtm
22591 @itemx -mno-htm
22592 @opindex mhtm
22593 @opindex mno-htm
22594 The @option{-mhtm} option enables a set of builtins making use of
22595 instructions available with the transactional execution facility
22596 introduced with the IBM zEnterprise EC12 machine generation
22597 @ref{S/390 System z Built-in Functions}.
22598 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
22600 @item -mvx
22601 @itemx -mno-vx
22602 @opindex mvx
22603 @opindex mno-vx
22604 When @option{-mvx} is specified, generate code using the instructions
22605 available with the vector extension facility introduced with the IBM
22606 z13 machine generation.
22607 This option changes the ABI for some vector type values with regard to
22608 alignment and calling conventions.  In case vector type values are
22609 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
22610 command will be added to mark the resulting binary with the ABI used.
22611 @option{-mvx} is enabled by default when using @option{-march=z13}.
22613 @item -mzvector
22614 @itemx -mno-zvector
22615 @opindex mzvector
22616 @opindex mno-zvector
22617 The @option{-mzvector} option enables vector language extensions and
22618 builtins using instructions available with the vector extension
22619 facility introduced with the IBM z13 machine generation.
22620 This option adds support for @samp{vector} to be used as a keyword to
22621 define vector type variables and arguments.  @samp{vector} is only
22622 available when GNU extensions are enabled.  It will not be expanded
22623 when requesting strict standard compliance e.g. with @option{-std=c99}.
22624 In addition to the GCC low-level builtins @option{-mzvector} enables
22625 a set of builtins added for compatibility with AltiVec-style
22626 implementations like Power and Cell.  In order to make use of these
22627 builtins the header file @file{vecintrin.h} needs to be included.
22628 @option{-mzvector} is disabled by default.
22630 @item -mmvcle
22631 @itemx -mno-mvcle
22632 @opindex mmvcle
22633 @opindex mno-mvcle
22634 Generate (or do not generate) code using the @code{mvcle} instruction
22635 to perform block moves.  When @option{-mno-mvcle} is specified,
22636 use a @code{mvc} loop instead.  This is the default unless optimizing for
22637 size.
22639 @item -mdebug
22640 @itemx -mno-debug
22641 @opindex mdebug
22642 @opindex mno-debug
22643 Print (or do not print) additional debug information when compiling.
22644 The default is to not print debug information.
22646 @item -march=@var{cpu-type}
22647 @opindex march
22648 Generate code that runs on @var{cpu-type}, which is the name of a
22649 system representing a certain processor type.  Possible values for
22650 @var{cpu-type} are @samp{z900}/@samp{arch5}, @samp{z990}/@samp{arch6},
22651 @samp{z9-109}, @samp{z9-ec}/@samp{arch7}, @samp{z10}/@samp{arch8},
22652 @samp{z196}/@samp{arch9}, @samp{zEC12}, @samp{z13}/@samp{arch11}, and
22653 @samp{native}.
22655 The default is @option{-march=z900}.  @samp{g5}/@samp{arch3} and
22656 @samp{g6} are deprecated and will be removed with future releases.
22658 Specifying @samp{native} as cpu type can be used to select the best
22659 architecture option for the host processor.
22660 @option{-march=native} has no effect if GCC does not recognize the
22661 processor.
22663 @item -mtune=@var{cpu-type}
22664 @opindex mtune
22665 Tune to @var{cpu-type} everything applicable about the generated code,
22666 except for the ABI and the set of available instructions.
22667 The list of @var{cpu-type} values is the same as for @option{-march}.
22668 The default is the value used for @option{-march}.
22670 @item -mtpf-trace
22671 @itemx -mno-tpf-trace
22672 @opindex mtpf-trace
22673 @opindex mno-tpf-trace
22674 Generate code that adds (does not add) in TPF OS specific branches to trace
22675 routines in the operating system.  This option is off by default, even
22676 when compiling for the TPF OS@.
22678 @item -mfused-madd
22679 @itemx -mno-fused-madd
22680 @opindex mfused-madd
22681 @opindex mno-fused-madd
22682 Generate code that uses (does not use) the floating-point multiply and
22683 accumulate instructions.  These instructions are generated by default if
22684 hardware floating point is used.
22686 @item -mwarn-framesize=@var{framesize}
22687 @opindex mwarn-framesize
22688 Emit a warning if the current function exceeds the given frame size.  Because
22689 this is a compile-time check it doesn't need to be a real problem when the program
22690 runs.  It is intended to identify functions that most probably cause
22691 a stack overflow.  It is useful to be used in an environment with limited stack
22692 size e.g.@: the linux kernel.
22694 @item -mwarn-dynamicstack
22695 @opindex mwarn-dynamicstack
22696 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
22697 arrays.  This is generally a bad idea with a limited stack size.
22699 @item -mstack-guard=@var{stack-guard}
22700 @itemx -mstack-size=@var{stack-size}
22701 @opindex mstack-guard
22702 @opindex mstack-size
22703 If these options are provided the S/390 back end emits additional instructions in
22704 the function prologue that trigger a trap if the stack size is @var{stack-guard}
22705 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
22706 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
22707 the frame size of the compiled function is chosen.
22708 These options are intended to be used to help debugging stack overflow problems.
22709 The additionally emitted code causes only little overhead and hence can also be
22710 used in production-like systems without greater performance degradation.  The given
22711 values have to be exact powers of 2 and @var{stack-size} has to be greater than
22712 @var{stack-guard} without exceeding 64k.
22713 In order to be efficient the extra code makes the assumption that the stack starts
22714 at an address aligned to the value given by @var{stack-size}.
22715 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
22717 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
22718 @opindex mhotpatch
22719 If the hotpatch option is enabled, a ``hot-patching'' function
22720 prologue is generated for all functions in the compilation unit.
22721 The funtion label is prepended with the given number of two-byte
22722 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
22723 the label, 2 * @var{post-halfwords} bytes are appended, using the
22724 largest NOP like instructions the architecture allows (maximum
22725 1000000).
22727 If both arguments are zero, hotpatching is disabled.
22729 This option can be overridden for individual functions with the
22730 @code{hotpatch} attribute.
22731 @end table
22733 @node Score Options
22734 @subsection Score Options
22735 @cindex Score Options
22737 These options are defined for Score implementations:
22739 @table @gcctabopt
22740 @item -meb
22741 @opindex meb
22742 Compile code for big-endian mode.  This is the default.
22744 @item -mel
22745 @opindex mel
22746 Compile code for little-endian mode.
22748 @item -mnhwloop
22749 @opindex mnhwloop
22750 Disable generation of @code{bcnz} instructions.
22752 @item -muls
22753 @opindex muls
22754 Enable generation of unaligned load and store instructions.
22756 @item -mmac
22757 @opindex mmac
22758 Enable the use of multiply-accumulate instructions. Disabled by default.
22760 @item -mscore5
22761 @opindex mscore5
22762 Specify the SCORE5 as the target architecture.
22764 @item -mscore5u
22765 @opindex mscore5u
22766 Specify the SCORE5U of the target architecture.
22768 @item -mscore7
22769 @opindex mscore7
22770 Specify the SCORE7 as the target architecture. This is the default.
22772 @item -mscore7d
22773 @opindex mscore7d
22774 Specify the SCORE7D as the target architecture.
22775 @end table
22777 @node SH Options
22778 @subsection SH Options
22780 These @samp{-m} options are defined for the SH implementations:
22782 @table @gcctabopt
22783 @item -m1
22784 @opindex m1
22785 Generate code for the SH1.
22787 @item -m2
22788 @opindex m2
22789 Generate code for the SH2.
22791 @item -m2e
22792 Generate code for the SH2e.
22794 @item -m2a-nofpu
22795 @opindex m2a-nofpu
22796 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
22797 that the floating-point unit is not used.
22799 @item -m2a-single-only
22800 @opindex m2a-single-only
22801 Generate code for the SH2a-FPU, in such a way that no double-precision
22802 floating-point operations are used.
22804 @item -m2a-single
22805 @opindex m2a-single
22806 Generate code for the SH2a-FPU assuming the floating-point unit is in
22807 single-precision mode by default.
22809 @item -m2a
22810 @opindex m2a
22811 Generate code for the SH2a-FPU assuming the floating-point unit is in
22812 double-precision mode by default.
22814 @item -m3
22815 @opindex m3
22816 Generate code for the SH3.
22818 @item -m3e
22819 @opindex m3e
22820 Generate code for the SH3e.
22822 @item -m4-nofpu
22823 @opindex m4-nofpu
22824 Generate code for the SH4 without a floating-point unit.
22826 @item -m4-single-only
22827 @opindex m4-single-only
22828 Generate code for the SH4 with a floating-point unit that only
22829 supports single-precision arithmetic.
22831 @item -m4-single
22832 @opindex m4-single
22833 Generate code for the SH4 assuming the floating-point unit is in
22834 single-precision mode by default.
22836 @item -m4
22837 @opindex m4
22838 Generate code for the SH4.
22840 @item -m4-100
22841 @opindex m4-100
22842 Generate code for SH4-100.
22844 @item -m4-100-nofpu
22845 @opindex m4-100-nofpu
22846 Generate code for SH4-100 in such a way that the
22847 floating-point unit is not used.
22849 @item -m4-100-single
22850 @opindex m4-100-single
22851 Generate code for SH4-100 assuming the floating-point unit is in
22852 single-precision mode by default.
22854 @item -m4-100-single-only
22855 @opindex m4-100-single-only
22856 Generate code for SH4-100 in such a way that no double-precision
22857 floating-point operations are used.
22859 @item -m4-200
22860 @opindex m4-200
22861 Generate code for SH4-200.
22863 @item -m4-200-nofpu
22864 @opindex m4-200-nofpu
22865 Generate code for SH4-200 without in such a way that the
22866 floating-point unit is not used.
22868 @item -m4-200-single
22869 @opindex m4-200-single
22870 Generate code for SH4-200 assuming the floating-point unit is in
22871 single-precision mode by default.
22873 @item -m4-200-single-only
22874 @opindex m4-200-single-only
22875 Generate code for SH4-200 in such a way that no double-precision
22876 floating-point operations are used.
22878 @item -m4-300
22879 @opindex m4-300
22880 Generate code for SH4-300.
22882 @item -m4-300-nofpu
22883 @opindex m4-300-nofpu
22884 Generate code for SH4-300 without in such a way that the
22885 floating-point unit is not used.
22887 @item -m4-300-single
22888 @opindex m4-300-single
22889 Generate code for SH4-300 in such a way that no double-precision
22890 floating-point operations are used.
22892 @item -m4-300-single-only
22893 @opindex m4-300-single-only
22894 Generate code for SH4-300 in such a way that no double-precision
22895 floating-point operations are used.
22897 @item -m4-340
22898 @opindex m4-340
22899 Generate code for SH4-340 (no MMU, no FPU).
22901 @item -m4-500
22902 @opindex m4-500
22903 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
22904 assembler.
22906 @item -m4a-nofpu
22907 @opindex m4a-nofpu
22908 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
22909 floating-point unit is not used.
22911 @item -m4a-single-only
22912 @opindex m4a-single-only
22913 Generate code for the SH4a, in such a way that no double-precision
22914 floating-point operations are used.
22916 @item -m4a-single
22917 @opindex m4a-single
22918 Generate code for the SH4a assuming the floating-point unit is in
22919 single-precision mode by default.
22921 @item -m4a
22922 @opindex m4a
22923 Generate code for the SH4a.
22925 @item -m4al
22926 @opindex m4al
22927 Same as @option{-m4a-nofpu}, except that it implicitly passes
22928 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
22929 instructions at the moment.
22931 @item -mb
22932 @opindex mb
22933 Compile code for the processor in big-endian mode.
22935 @item -ml
22936 @opindex ml
22937 Compile code for the processor in little-endian mode.
22939 @item -mdalign
22940 @opindex mdalign
22941 Align doubles at 64-bit boundaries.  Note that this changes the calling
22942 conventions, and thus some functions from the standard C library do
22943 not work unless you recompile it first with @option{-mdalign}.
22945 @item -mrelax
22946 @opindex mrelax
22947 Shorten some address references at link time, when possible; uses the
22948 linker option @option{-relax}.
22950 @item -mbigtable
22951 @opindex mbigtable
22952 Use 32-bit offsets in @code{switch} tables.  The default is to use
22953 16-bit offsets.
22955 @item -mbitops
22956 @opindex mbitops
22957 Enable the use of bit manipulation instructions on SH2A.
22959 @item -mfmovd
22960 @opindex mfmovd
22961 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
22962 alignment constraints.
22964 @item -mrenesas
22965 @opindex mrenesas
22966 Comply with the calling conventions defined by Renesas.
22968 @item -mno-renesas
22969 @opindex mno-renesas
22970 Comply with the calling conventions defined for GCC before the Renesas
22971 conventions were available.  This option is the default for all
22972 targets of the SH toolchain.
22974 @item -mnomacsave
22975 @opindex mnomacsave
22976 Mark the @code{MAC} register as call-clobbered, even if
22977 @option{-mrenesas} is given.
22979 @item -mieee
22980 @itemx -mno-ieee
22981 @opindex mieee
22982 @opindex mno-ieee
22983 Control the IEEE compliance of floating-point comparisons, which affects the
22984 handling of cases where the result of a comparison is unordered.  By default
22985 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
22986 enabled @option{-mno-ieee} is implicitly set, which results in faster
22987 floating-point greater-equal and less-equal comparisons.  The implicit settings
22988 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
22990 @item -minline-ic_invalidate
22991 @opindex minline-ic_invalidate
22992 Inline code to invalidate instruction cache entries after setting up
22993 nested function trampolines.
22994 This option has no effect if @option{-musermode} is in effect and the selected
22995 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
22996 instruction.
22997 If the selected code generation option does not allow the use of the @code{icbi}
22998 instruction, and @option{-musermode} is not in effect, the inlined code
22999 manipulates the instruction cache address array directly with an associative
23000 write.  This not only requires privileged mode at run time, but it also
23001 fails if the cache line had been mapped via the TLB and has become unmapped.
23003 @item -misize
23004 @opindex misize
23005 Dump instruction size and location in the assembly code.
23007 @item -mpadstruct
23008 @opindex mpadstruct
23009 This option is deprecated.  It pads structures to multiple of 4 bytes,
23010 which is incompatible with the SH ABI@.
23012 @item -matomic-model=@var{model}
23013 @opindex matomic-model=@var{model}
23014 Sets the model of atomic operations and additional parameters as a comma
23015 separated list.  For details on the atomic built-in functions see
23016 @ref{__atomic Builtins}.  The following models and parameters are supported:
23018 @table @samp
23020 @item none
23021 Disable compiler generated atomic sequences and emit library calls for atomic
23022 operations.  This is the default if the target is not @code{sh*-*-linux*}.
23024 @item soft-gusa
23025 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
23026 built-in functions.  The generated atomic sequences require additional support
23027 from the interrupt/exception handling code of the system and are only suitable
23028 for SH3* and SH4* single-core systems.  This option is enabled by default when
23029 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
23030 this option also partially utilizes the hardware atomic instructions
23031 @code{movli.l} and @code{movco.l} to create more efficient code, unless
23032 @samp{strict} is specified.  
23034 @item soft-tcb
23035 Generate software atomic sequences that use a variable in the thread control
23036 block.  This is a variation of the gUSA sequences which can also be used on
23037 SH1* and SH2* targets.  The generated atomic sequences require additional
23038 support from the interrupt/exception handling code of the system and are only
23039 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
23040 parameter has to be specified as well.
23042 @item soft-imask
23043 Generate software atomic sequences that temporarily disable interrupts by
23044 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
23045 in privileged mode and is only suitable for single-core systems.  Additional
23046 support from the interrupt/exception handling code of the system is not
23047 required.  This model is enabled by default when the target is
23048 @code{sh*-*-linux*} and SH1* or SH2*.
23050 @item hard-llcs
23051 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
23052 instructions only.  This is only available on SH4A and is suitable for
23053 multi-core systems.  Since the hardware instructions support only 32 bit atomic
23054 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
23055 Code compiled with this option is also compatible with other software
23056 atomic model interrupt/exception handling systems if executed on an SH4A
23057 system.  Additional support from the interrupt/exception handling code of the
23058 system is not required for this model.
23060 @item gbr-offset=
23061 This parameter specifies the offset in bytes of the variable in the thread
23062 control block structure that should be used by the generated atomic sequences
23063 when the @samp{soft-tcb} model has been selected.  For other models this
23064 parameter is ignored.  The specified value must be an integer multiple of four
23065 and in the range 0-1020.
23067 @item strict
23068 This parameter prevents mixed usage of multiple atomic models, even if they
23069 are compatible, and makes the compiler generate atomic sequences of the
23070 specified model only.
23072 @end table
23074 @item -mtas
23075 @opindex mtas
23076 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
23077 Notice that depending on the particular hardware and software configuration
23078 this can degrade overall performance due to the operand cache line flushes
23079 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
23080 processors the @code{tas.b} instruction must be used with caution since it
23081 can result in data corruption for certain cache configurations.
23083 @item -mprefergot
23084 @opindex mprefergot
23085 When generating position-independent code, emit function calls using
23086 the Global Offset Table instead of the Procedure Linkage Table.
23088 @item -musermode
23089 @itemx -mno-usermode
23090 @opindex musermode
23091 @opindex mno-usermode
23092 Don't allow (allow) the compiler generating privileged mode code.  Specifying
23093 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
23094 inlined code would not work in user mode.  @option{-musermode} is the default
23095 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
23096 @option{-musermode} has no effect, since there is no user mode.
23098 @item -multcost=@var{number}
23099 @opindex multcost=@var{number}
23100 Set the cost to assume for a multiply insn.
23102 @item -mdiv=@var{strategy}
23103 @opindex mdiv=@var{strategy}
23104 Set the division strategy to be used for integer division operations.
23105 @var{strategy} can be one of: 
23107 @table @samp
23109 @item call-div1
23110 Calls a library function that uses the single-step division instruction
23111 @code{div1} to perform the operation.  Division by zero calculates an
23112 unspecified result and does not trap.  This is the default except for SH4,
23113 SH2A and SHcompact.
23115 @item call-fp
23116 Calls a library function that performs the operation in double precision
23117 floating point.  Division by zero causes a floating-point exception.  This is
23118 the default for SHcompact with FPU.  Specifying this for targets that do not
23119 have a double precision FPU defaults to @code{call-div1}.
23121 @item call-table
23122 Calls a library function that uses a lookup table for small divisors and
23123 the @code{div1} instruction with case distinction for larger divisors.  Division
23124 by zero calculates an unspecified result and does not trap.  This is the default
23125 for SH4.  Specifying this for targets that do not have dynamic shift
23126 instructions defaults to @code{call-div1}.
23128 @end table
23130 When a division strategy has not been specified the default strategy is
23131 selected based on the current target.  For SH2A the default strategy is to
23132 use the @code{divs} and @code{divu} instructions instead of library function
23133 calls.
23135 @item -maccumulate-outgoing-args
23136 @opindex maccumulate-outgoing-args
23137 Reserve space once for outgoing arguments in the function prologue rather
23138 than around each call.  Generally beneficial for performance and size.  Also
23139 needed for unwinding to avoid changing the stack frame around conditional code.
23141 @item -mdivsi3_libfunc=@var{name}
23142 @opindex mdivsi3_libfunc=@var{name}
23143 Set the name of the library function used for 32-bit signed division to
23144 @var{name}.
23145 This only affects the name used in the @samp{call} division strategies, and
23146 the compiler still expects the same sets of input/output/clobbered registers as
23147 if this option were not present.
23149 @item -mfixed-range=@var{register-range}
23150 @opindex mfixed-range
23151 Generate code treating the given register range as fixed registers.
23152 A fixed register is one that the register allocator can not use.  This is
23153 useful when compiling kernel code.  A register range is specified as
23154 two registers separated by a dash.  Multiple register ranges can be
23155 specified separated by a comma.
23157 @item -mbranch-cost=@var{num}
23158 @opindex mbranch-cost=@var{num}
23159 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
23160 make the compiler try to generate more branch-free code if possible.  
23161 If not specified the value is selected depending on the processor type that
23162 is being compiled for.
23164 @item -mzdcbranch
23165 @itemx -mno-zdcbranch
23166 @opindex mzdcbranch
23167 @opindex mno-zdcbranch
23168 Assume (do not assume) that zero displacement conditional branch instructions
23169 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
23170 compiler prefers zero displacement branch code sequences.  This is
23171 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
23172 disabled by specifying @option{-mno-zdcbranch}.
23174 @item -mcbranch-force-delay-slot
23175 @opindex mcbranch-force-delay-slot
23176 Force the usage of delay slots for conditional branches, which stuffs the delay
23177 slot with a @code{nop} if a suitable instruction cannot be found.  By default
23178 this option is disabled.  It can be enabled to work around hardware bugs as
23179 found in the original SH7055.
23181 @item -mfused-madd
23182 @itemx -mno-fused-madd
23183 @opindex mfused-madd
23184 @opindex mno-fused-madd
23185 Generate code that uses (does not use) the floating-point multiply and
23186 accumulate instructions.  These instructions are generated by default
23187 if hardware floating point is used.  The machine-dependent
23188 @option{-mfused-madd} option is now mapped to the machine-independent
23189 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
23190 mapped to @option{-ffp-contract=off}.
23192 @item -mfsca
23193 @itemx -mno-fsca
23194 @opindex mfsca
23195 @opindex mno-fsca
23196 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
23197 and cosine approximations.  The option @option{-mfsca} must be used in
23198 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
23199 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
23200 approximations even if @option{-funsafe-math-optimizations} is in effect.
23202 @item -mfsrra
23203 @itemx -mno-fsrra
23204 @opindex mfsrra
23205 @opindex mno-fsrra
23206 Allow or disallow the compiler to emit the @code{fsrra} instruction for
23207 reciprocal square root approximations.  The option @option{-mfsrra} must be used
23208 in combination with @option{-funsafe-math-optimizations} and
23209 @option{-ffinite-math-only}.  It is enabled by default when generating code for
23210 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
23211 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
23212 in effect.
23214 @item -mpretend-cmove
23215 @opindex mpretend-cmove
23216 Prefer zero-displacement conditional branches for conditional move instruction
23217 patterns.  This can result in faster code on the SH4 processor.
23219 @item -mfdpic
23220 @opindex fdpic
23221 Generate code using the FDPIC ABI.
23223 @end table
23225 @node Solaris 2 Options
23226 @subsection Solaris 2 Options
23227 @cindex Solaris 2 options
23229 These @samp{-m} options are supported on Solaris 2:
23231 @table @gcctabopt
23232 @item -mclear-hwcap
23233 @opindex mclear-hwcap
23234 @option{-mclear-hwcap} tells the compiler to remove the hardware
23235 capabilities generated by the Solaris assembler.  This is only necessary
23236 when object files use ISA extensions not supported by the current
23237 machine, but check at runtime whether or not to use them.
23239 @item -mimpure-text
23240 @opindex mimpure-text
23241 @option{-mimpure-text}, used in addition to @option{-shared}, tells
23242 the compiler to not pass @option{-z text} to the linker when linking a
23243 shared object.  Using this option, you can link position-dependent
23244 code into a shared object.
23246 @option{-mimpure-text} suppresses the ``relocations remain against
23247 allocatable but non-writable sections'' linker error message.
23248 However, the necessary relocations trigger copy-on-write, and the
23249 shared object is not actually shared across processes.  Instead of
23250 using @option{-mimpure-text}, you should compile all source code with
23251 @option{-fpic} or @option{-fPIC}.
23253 @end table
23255 These switches are supported in addition to the above on Solaris 2:
23257 @table @gcctabopt
23258 @item -pthreads
23259 @opindex pthreads
23260 This is a synonym for @option{-pthread}.
23261 @end table
23263 @node SPARC Options
23264 @subsection SPARC Options
23265 @cindex SPARC options
23267 These @samp{-m} options are supported on the SPARC:
23269 @table @gcctabopt
23270 @item -mno-app-regs
23271 @itemx -mapp-regs
23272 @opindex mno-app-regs
23273 @opindex mapp-regs
23274 Specify @option{-mapp-regs} to generate output using the global registers
23275 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
23276 global register 1, each global register 2 through 4 is then treated as an
23277 allocable register that is clobbered by function calls.  This is the default.
23279 To be fully SVR4 ABI-compliant at the cost of some performance loss,
23280 specify @option{-mno-app-regs}.  You should compile libraries and system
23281 software with this option.
23283 @item -mflat
23284 @itemx -mno-flat
23285 @opindex mflat
23286 @opindex mno-flat
23287 With @option{-mflat}, the compiler does not generate save/restore instructions
23288 and uses a ``flat'' or single register window model.  This model is compatible
23289 with the regular register window model.  The local registers and the input
23290 registers (0--5) are still treated as ``call-saved'' registers and are
23291 saved on the stack as needed.
23293 With @option{-mno-flat} (the default), the compiler generates save/restore
23294 instructions (except for leaf functions).  This is the normal operating mode.
23296 @item -mfpu
23297 @itemx -mhard-float
23298 @opindex mfpu
23299 @opindex mhard-float
23300 Generate output containing floating-point instructions.  This is the
23301 default.
23303 @item -mno-fpu
23304 @itemx -msoft-float
23305 @opindex mno-fpu
23306 @opindex msoft-float
23307 Generate output containing library calls for floating point.
23308 @strong{Warning:} the requisite libraries are not available for all SPARC
23309 targets.  Normally the facilities of the machine's usual C compiler are
23310 used, but this cannot be done directly in cross-compilation.  You must make
23311 your own arrangements to provide suitable library functions for
23312 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
23313 @samp{sparclite-*-*} do provide software floating-point support.
23315 @option{-msoft-float} changes the calling convention in the output file;
23316 therefore, it is only useful if you compile @emph{all} of a program with
23317 this option.  In particular, you need to compile @file{libgcc.a}, the
23318 library that comes with GCC, with @option{-msoft-float} in order for
23319 this to work.
23321 @item -mhard-quad-float
23322 @opindex mhard-quad-float
23323 Generate output containing quad-word (long double) floating-point
23324 instructions.
23326 @item -msoft-quad-float
23327 @opindex msoft-quad-float
23328 Generate output containing library calls for quad-word (long double)
23329 floating-point instructions.  The functions called are those specified
23330 in the SPARC ABI@.  This is the default.
23332 As of this writing, there are no SPARC implementations that have hardware
23333 support for the quad-word floating-point instructions.  They all invoke
23334 a trap handler for one of these instructions, and then the trap handler
23335 emulates the effect of the instruction.  Because of the trap handler overhead,
23336 this is much slower than calling the ABI library routines.  Thus the
23337 @option{-msoft-quad-float} option is the default.
23339 @item -mno-unaligned-doubles
23340 @itemx -munaligned-doubles
23341 @opindex mno-unaligned-doubles
23342 @opindex munaligned-doubles
23343 Assume that doubles have 8-byte alignment.  This is the default.
23345 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
23346 alignment only if they are contained in another type, or if they have an
23347 absolute address.  Otherwise, it assumes they have 4-byte alignment.
23348 Specifying this option avoids some rare compatibility problems with code
23349 generated by other compilers.  It is not the default because it results
23350 in a performance loss, especially for floating-point code.
23352 @item -muser-mode
23353 @itemx -mno-user-mode
23354 @opindex muser-mode
23355 @opindex mno-user-mode
23356 Do not generate code that can only run in supervisor mode.  This is relevant
23357 only for the @code{casa} instruction emitted for the LEON3 processor.  This
23358 is the default.
23360 @item -mfaster-structs
23361 @itemx -mno-faster-structs
23362 @opindex mfaster-structs
23363 @opindex mno-faster-structs
23364 With @option{-mfaster-structs}, the compiler assumes that structures
23365 should have 8-byte alignment.  This enables the use of pairs of
23366 @code{ldd} and @code{std} instructions for copies in structure
23367 assignment, in place of twice as many @code{ld} and @code{st} pairs.
23368 However, the use of this changed alignment directly violates the SPARC
23369 ABI@.  Thus, it's intended only for use on targets where the developer
23370 acknowledges that their resulting code is not directly in line with
23371 the rules of the ABI@.
23373 @item -mstd-struct-return
23374 @itemx -mno-std-struct-return
23375 @opindex mstd-struct-return
23376 @opindex mno-std-struct-return
23377 With @option{-mstd-struct-return}, the compiler generates checking code
23378 in functions returning structures or unions to detect size mismatches
23379 between the two sides of function calls, as per the 32-bit ABI@.
23381 The default is @option{-mno-std-struct-return}.  This option has no effect
23382 in 64-bit mode.
23384 @item -mlra
23385 @itemx -mno-lra
23386 @opindex mlra
23387 @opindex mno-lra
23388 Enable Local Register Allocation.  This is the default for SPARC since GCC 7
23389 so @option{-mno-lra} needs to be passed to get old Reload.
23391 @item -mcpu=@var{cpu_type}
23392 @opindex mcpu
23393 Set the instruction set, register set, and instruction scheduling parameters
23394 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
23395 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
23396 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
23397 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
23398 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
23399 @samp{niagara3}, @samp{niagara4} and @samp{niagara7}.
23401 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
23402 which selects the best architecture option for the host processor.
23403 @option{-mcpu=native} has no effect if GCC does not recognize
23404 the processor.
23406 Default instruction scheduling parameters are used for values that select
23407 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
23408 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
23410 Here is a list of each supported architecture and their supported
23411 implementations.
23413 @table @asis
23414 @item v7
23415 cypress, leon3v7
23417 @item v8
23418 supersparc, hypersparc, leon, leon3
23420 @item sparclite
23421 f930, f934, sparclite86x
23423 @item sparclet
23424 tsc701
23426 @item v9
23427 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4, niagara7
23428 @end table
23430 By default (unless configured otherwise), GCC generates code for the V7
23431 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
23432 additionally optimizes it for the Cypress CY7C602 chip, as used in the
23433 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
23434 SPARCStation 1, 2, IPX etc.
23436 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
23437 architecture.  The only difference from V7 code is that the compiler emits
23438 the integer multiply and integer divide instructions which exist in SPARC-V8
23439 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
23440 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
23441 2000 series.
23443 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
23444 the SPARC architecture.  This adds the integer multiply, integer divide step
23445 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
23446 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
23447 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
23448 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
23449 MB86934 chip, which is the more recent SPARClite with FPU@.
23451 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
23452 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
23453 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
23454 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
23455 optimizes it for the TEMIC SPARClet chip.
23457 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
23458 architecture.  This adds 64-bit integer and floating-point move instructions,
23459 3 additional floating-point condition code registers and conditional move
23460 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
23461 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
23462 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
23463 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
23464 @option{-mcpu=niagara}, the compiler additionally optimizes it for
23465 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
23466 additionally optimizes it for Sun UltraSPARC T2 chips. With
23467 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
23468 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
23469 additionally optimizes it for Sun UltraSPARC T4 chips.  With
23470 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
23471 Oracle SPARC M7 chips.
23473 @item -mtune=@var{cpu_type}
23474 @opindex mtune
23475 Set the instruction scheduling parameters for machine type
23476 @var{cpu_type}, but do not set the instruction set or register set that the
23477 option @option{-mcpu=@var{cpu_type}} does.
23479 The same values for @option{-mcpu=@var{cpu_type}} can be used for
23480 @option{-mtune=@var{cpu_type}}, but the only useful values are those
23481 that select a particular CPU implementation.  Those are
23482 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
23483 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
23484 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
23485 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
23486 @samp{niagara4} and @samp{niagara7}.  With native Solaris and
23487 GNU/Linux toolchains, @samp{native} can also be used.
23489 @item -mv8plus
23490 @itemx -mno-v8plus
23491 @opindex mv8plus
23492 @opindex mno-v8plus
23493 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
23494 difference from the V8 ABI is that the global and out registers are
23495 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
23496 mode for all SPARC-V9 processors.
23498 @item -mvis
23499 @itemx -mno-vis
23500 @opindex mvis
23501 @opindex mno-vis
23502 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
23503 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
23505 @item -mvis2
23506 @itemx -mno-vis2
23507 @opindex mvis2
23508 @opindex mno-vis2
23509 With @option{-mvis2}, GCC generates code that takes advantage of
23510 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
23511 default is @option{-mvis2} when targeting a cpu that supports such
23512 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
23513 also sets @option{-mvis}.
23515 @item -mvis3
23516 @itemx -mno-vis3
23517 @opindex mvis3
23518 @opindex mno-vis3
23519 With @option{-mvis3}, GCC generates code that takes advantage of
23520 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
23521 default is @option{-mvis3} when targeting a cpu that supports such
23522 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
23523 also sets @option{-mvis2} and @option{-mvis}.
23525 @item -mvis4
23526 @itemx -mno-vis4
23527 @opindex mvis4
23528 @opindex mno-vis4
23529 With @option{-mvis4}, GCC generates code that takes advantage of
23530 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
23531 default is @option{-mvis4} when targeting a cpu that supports such
23532 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
23533 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
23535 @item -mcbcond
23536 @itemx -mno-cbcond
23537 @opindex mcbcond
23538 @opindex mno-cbcond
23539 With @option{-mcbcond}, GCC generates code that takes advantage of the UltraSPARC
23540 Compare-and-Branch-on-Condition instructions.  The default is @option{-mcbcond}
23541 when targeting a CPU that supports such instructions, such as Niagara-4 and
23542 later.
23544 @item -mfmaf
23545 @itemx -mno-fmaf
23546 @opindex mfmaf
23547 @opindex mno-fmaf
23548 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
23549 Fused Multiply-Add Floating-point instructions.  The default is @option{-mfmaf}
23550 when targeting a CPU that supports such instructions, such as Niagara-3 and
23551 later.
23553 @item -mpopc
23554 @itemx -mno-popc
23555 @opindex mpopc
23556 @opindex mno-popc
23557 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
23558 Population Count instruction.  The default is @option{-mpopc}
23559 when targeting a CPU that supports such an instruction, such as Niagara-2 and
23560 later.
23562 @item -msubxc
23563 @itemx -mno-subxc
23564 @opindex msubxc
23565 @opindex mno-subxc
23566 With @option{-msubxc}, GCC generates code that takes advantage of the UltraSPARC
23567 Subtract-Extended-with-Carry instruction.  The default is @option{-msubxc}
23568 when targeting a CPU that supports such an instruction, such as Niagara-7 and
23569 later.
23571 @item -mfix-at697f
23572 @opindex mfix-at697f
23573 Enable the documented workaround for the single erratum of the Atmel AT697F
23574 processor (which corresponds to erratum #13 of the AT697E processor).
23576 @item -mfix-ut699
23577 @opindex mfix-ut699
23578 Enable the documented workarounds for the floating-point errata and the data
23579 cache nullify errata of the UT699 processor.
23580 @end table
23582 These @samp{-m} options are supported in addition to the above
23583 on SPARC-V9 processors in 64-bit environments:
23585 @table @gcctabopt
23586 @item -m32
23587 @itemx -m64
23588 @opindex m32
23589 @opindex m64
23590 Generate code for a 32-bit or 64-bit environment.
23591 The 32-bit environment sets int, long and pointer to 32 bits.
23592 The 64-bit environment sets int to 32 bits and long and pointer
23593 to 64 bits.
23595 @item -mcmodel=@var{which}
23596 @opindex mcmodel
23597 Set the code model to one of
23599 @table @samp
23600 @item medlow
23601 The Medium/Low code model: 64-bit addresses, programs
23602 must be linked in the low 32 bits of memory.  Programs can be statically
23603 or dynamically linked.
23605 @item medmid
23606 The Medium/Middle code model: 64-bit addresses, programs
23607 must be linked in the low 44 bits of memory, the text and data segments must
23608 be less than 2GB in size and the data segment must be located within 2GB of
23609 the text segment.
23611 @item medany
23612 The Medium/Anywhere code model: 64-bit addresses, programs
23613 may be linked anywhere in memory, the text and data segments must be less
23614 than 2GB in size and the data segment must be located within 2GB of the
23615 text segment.
23617 @item embmedany
23618 The Medium/Anywhere code model for embedded systems:
23619 64-bit addresses, the text and data segments must be less than 2GB in
23620 size, both starting anywhere in memory (determined at link time).  The
23621 global register %g4 points to the base of the data segment.  Programs
23622 are statically linked and PIC is not supported.
23623 @end table
23625 @item -mmemory-model=@var{mem-model}
23626 @opindex mmemory-model
23627 Set the memory model in force on the processor to one of
23629 @table @samp
23630 @item default
23631 The default memory model for the processor and operating system.
23633 @item rmo
23634 Relaxed Memory Order
23636 @item pso
23637 Partial Store Order
23639 @item tso
23640 Total Store Order
23642 @item sc
23643 Sequential Consistency
23644 @end table
23646 These memory models are formally defined in Appendix D of the SPARC-V9
23647 architecture manual, as set in the processor's @code{PSTATE.MM} field.
23649 @item -mstack-bias
23650 @itemx -mno-stack-bias
23651 @opindex mstack-bias
23652 @opindex mno-stack-bias
23653 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
23654 frame pointer if present, are offset by @minus{}2047 which must be added back
23655 when making stack frame references.  This is the default in 64-bit mode.
23656 Otherwise, assume no such offset is present.
23657 @end table
23659 @node SPU Options
23660 @subsection SPU Options
23661 @cindex SPU options
23663 These @samp{-m} options are supported on the SPU:
23665 @table @gcctabopt
23666 @item -mwarn-reloc
23667 @itemx -merror-reloc
23668 @opindex mwarn-reloc
23669 @opindex merror-reloc
23671 The loader for SPU does not handle dynamic relocations.  By default, GCC
23672 gives an error when it generates code that requires a dynamic
23673 relocation.  @option{-mno-error-reloc} disables the error,
23674 @option{-mwarn-reloc} generates a warning instead.
23676 @item -msafe-dma
23677 @itemx -munsafe-dma
23678 @opindex msafe-dma
23679 @opindex munsafe-dma
23681 Instructions that initiate or test completion of DMA must not be
23682 reordered with respect to loads and stores of the memory that is being
23683 accessed.
23684 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
23685 memory accesses, but that can lead to inefficient code in places where the
23686 memory is known to not change.  Rather than mark the memory as volatile,
23687 you can use @option{-msafe-dma} to tell the compiler to treat
23688 the DMA instructions as potentially affecting all memory.  
23690 @item -mbranch-hints
23691 @opindex mbranch-hints
23693 By default, GCC generates a branch hint instruction to avoid
23694 pipeline stalls for always-taken or probably-taken branches.  A hint
23695 is not generated closer than 8 instructions away from its branch.
23696 There is little reason to disable them, except for debugging purposes,
23697 or to make an object a little bit smaller.
23699 @item -msmall-mem
23700 @itemx -mlarge-mem
23701 @opindex msmall-mem
23702 @opindex mlarge-mem
23704 By default, GCC generates code assuming that addresses are never larger
23705 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
23706 a full 32-bit address.
23708 @item -mstdmain
23709 @opindex mstdmain
23711 By default, GCC links against startup code that assumes the SPU-style
23712 main function interface (which has an unconventional parameter list).
23713 With @option{-mstdmain}, GCC links your program against startup
23714 code that assumes a C99-style interface to @code{main}, including a
23715 local copy of @code{argv} strings.
23717 @item -mfixed-range=@var{register-range}
23718 @opindex mfixed-range
23719 Generate code treating the given register range as fixed registers.
23720 A fixed register is one that the register allocator cannot use.  This is
23721 useful when compiling kernel code.  A register range is specified as
23722 two registers separated by a dash.  Multiple register ranges can be
23723 specified separated by a comma.
23725 @item -mea32
23726 @itemx -mea64
23727 @opindex mea32
23728 @opindex mea64
23729 Compile code assuming that pointers to the PPU address space accessed
23730 via the @code{__ea} named address space qualifier are either 32 or 64
23731 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
23732 all object code in an executable must be compiled with the same setting.
23734 @item -maddress-space-conversion
23735 @itemx -mno-address-space-conversion
23736 @opindex maddress-space-conversion
23737 @opindex mno-address-space-conversion
23738 Allow/disallow treating the @code{__ea} address space as superset
23739 of the generic address space.  This enables explicit type casts
23740 between @code{__ea} and generic pointer as well as implicit
23741 conversions of generic pointers to @code{__ea} pointers.  The
23742 default is to allow address space pointer conversions.
23744 @item -mcache-size=@var{cache-size}
23745 @opindex mcache-size
23746 This option controls the version of libgcc that the compiler links to an
23747 executable and selects a software-managed cache for accessing variables
23748 in the @code{__ea} address space with a particular cache size.  Possible
23749 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
23750 and @samp{128}.  The default cache size is 64KB.
23752 @item -matomic-updates
23753 @itemx -mno-atomic-updates
23754 @opindex matomic-updates
23755 @opindex mno-atomic-updates
23756 This option controls the version of libgcc that the compiler links to an
23757 executable and selects whether atomic updates to the software-managed
23758 cache of PPU-side variables are used.  If you use atomic updates, changes
23759 to a PPU variable from SPU code using the @code{__ea} named address space
23760 qualifier do not interfere with changes to other PPU variables residing
23761 in the same cache line from PPU code.  If you do not use atomic updates,
23762 such interference may occur; however, writing back cache lines is
23763 more efficient.  The default behavior is to use atomic updates.
23765 @item -mdual-nops
23766 @itemx -mdual-nops=@var{n}
23767 @opindex mdual-nops
23768 By default, GCC inserts NOPs to increase dual issue when it expects
23769 it to increase performance.  @var{n} can be a value from 0 to 10.  A
23770 smaller @var{n} inserts fewer NOPs.  10 is the default, 0 is the
23771 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
23773 @item -mhint-max-nops=@var{n}
23774 @opindex mhint-max-nops
23775 Maximum number of NOPs to insert for a branch hint.  A branch hint must
23776 be at least 8 instructions away from the branch it is affecting.  GCC
23777 inserts up to @var{n} NOPs to enforce this, otherwise it does not
23778 generate the branch hint.
23780 @item -mhint-max-distance=@var{n}
23781 @opindex mhint-max-distance
23782 The encoding of the branch hint instruction limits the hint to be within
23783 256 instructions of the branch it is affecting.  By default, GCC makes
23784 sure it is within 125.
23786 @item -msafe-hints
23787 @opindex msafe-hints
23788 Work around a hardware bug that causes the SPU to stall indefinitely.
23789 By default, GCC inserts the @code{hbrp} instruction to make sure
23790 this stall won't happen.
23792 @end table
23794 @node System V Options
23795 @subsection Options for System V
23797 These additional options are available on System V Release 4 for
23798 compatibility with other compilers on those systems:
23800 @table @gcctabopt
23801 @item -G
23802 @opindex G
23803 Create a shared object.
23804 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
23806 @item -Qy
23807 @opindex Qy
23808 Identify the versions of each tool used by the compiler, in a
23809 @code{.ident} assembler directive in the output.
23811 @item -Qn
23812 @opindex Qn
23813 Refrain from adding @code{.ident} directives to the output file (this is
23814 the default).
23816 @item -YP,@var{dirs}
23817 @opindex YP
23818 Search the directories @var{dirs}, and no others, for libraries
23819 specified with @option{-l}.
23821 @item -Ym,@var{dir}
23822 @opindex Ym
23823 Look in the directory @var{dir} to find the M4 preprocessor.
23824 The assembler uses this option.
23825 @c This is supposed to go with a -Yd for predefined M4 macro files, but
23826 @c the generic assembler that comes with Solaris takes just -Ym.
23827 @end table
23829 @node TILE-Gx Options
23830 @subsection TILE-Gx Options
23831 @cindex TILE-Gx options
23833 These @samp{-m} options are supported on the TILE-Gx:
23835 @table @gcctabopt
23836 @item -mcmodel=small
23837 @opindex mcmodel=small
23838 Generate code for the small model.  The distance for direct calls is
23839 limited to 500M in either direction.  PC-relative addresses are 32
23840 bits.  Absolute addresses support the full address range.
23842 @item -mcmodel=large
23843 @opindex mcmodel=large
23844 Generate code for the large model.  There is no limitation on call
23845 distance, pc-relative addresses, or absolute addresses.
23847 @item -mcpu=@var{name}
23848 @opindex mcpu
23849 Selects the type of CPU to be targeted.  Currently the only supported
23850 type is @samp{tilegx}.
23852 @item -m32
23853 @itemx -m64
23854 @opindex m32
23855 @opindex m64
23856 Generate code for a 32-bit or 64-bit environment.  The 32-bit
23857 environment sets int, long, and pointer to 32 bits.  The 64-bit
23858 environment sets int to 32 bits and long and pointer to 64 bits.
23860 @item -mbig-endian
23861 @itemx -mlittle-endian
23862 @opindex mbig-endian
23863 @opindex mlittle-endian
23864 Generate code in big/little endian mode, respectively.
23865 @end table
23867 @node TILEPro Options
23868 @subsection TILEPro Options
23869 @cindex TILEPro options
23871 These @samp{-m} options are supported on the TILEPro:
23873 @table @gcctabopt
23874 @item -mcpu=@var{name}
23875 @opindex mcpu
23876 Selects the type of CPU to be targeted.  Currently the only supported
23877 type is @samp{tilepro}.
23879 @item -m32
23880 @opindex m32
23881 Generate code for a 32-bit environment, which sets int, long, and
23882 pointer to 32 bits.  This is the only supported behavior so the flag
23883 is essentially ignored.
23884 @end table
23886 @node V850 Options
23887 @subsection V850 Options
23888 @cindex V850 Options
23890 These @samp{-m} options are defined for V850 implementations:
23892 @table @gcctabopt
23893 @item -mlong-calls
23894 @itemx -mno-long-calls
23895 @opindex mlong-calls
23896 @opindex mno-long-calls
23897 Treat all calls as being far away (near).  If calls are assumed to be
23898 far away, the compiler always loads the function's address into a
23899 register, and calls indirect through the pointer.
23901 @item -mno-ep
23902 @itemx -mep
23903 @opindex mno-ep
23904 @opindex mep
23905 Do not optimize (do optimize) basic blocks that use the same index
23906 pointer 4 or more times to copy pointer into the @code{ep} register, and
23907 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
23908 option is on by default if you optimize.
23910 @item -mno-prolog-function
23911 @itemx -mprolog-function
23912 @opindex mno-prolog-function
23913 @opindex mprolog-function
23914 Do not use (do use) external functions to save and restore registers
23915 at the prologue and epilogue of a function.  The external functions
23916 are slower, but use less code space if more than one function saves
23917 the same number of registers.  The @option{-mprolog-function} option
23918 is on by default if you optimize.
23920 @item -mspace
23921 @opindex mspace
23922 Try to make the code as small as possible.  At present, this just turns
23923 on the @option{-mep} and @option{-mprolog-function} options.
23925 @item -mtda=@var{n}
23926 @opindex mtda
23927 Put static or global variables whose size is @var{n} bytes or less into
23928 the tiny data area that register @code{ep} points to.  The tiny data
23929 area can hold up to 256 bytes in total (128 bytes for byte references).
23931 @item -msda=@var{n}
23932 @opindex msda
23933 Put static or global variables whose size is @var{n} bytes or less into
23934 the small data area that register @code{gp} points to.  The small data
23935 area can hold up to 64 kilobytes.
23937 @item -mzda=@var{n}
23938 @opindex mzda
23939 Put static or global variables whose size is @var{n} bytes or less into
23940 the first 32 kilobytes of memory.
23942 @item -mv850
23943 @opindex mv850
23944 Specify that the target processor is the V850.
23946 @item -mv850e3v5
23947 @opindex mv850e3v5
23948 Specify that the target processor is the V850E3V5.  The preprocessor
23949 constant @code{__v850e3v5__} is defined if this option is used.
23951 @item -mv850e2v4
23952 @opindex mv850e2v4
23953 Specify that the target processor is the V850E3V5.  This is an alias for
23954 the @option{-mv850e3v5} option.
23956 @item -mv850e2v3
23957 @opindex mv850e2v3
23958 Specify that the target processor is the V850E2V3.  The preprocessor
23959 constant @code{__v850e2v3__} is defined if this option is used.
23961 @item -mv850e2
23962 @opindex mv850e2
23963 Specify that the target processor is the V850E2.  The preprocessor
23964 constant @code{__v850e2__} is defined if this option is used.
23966 @item -mv850e1
23967 @opindex mv850e1
23968 Specify that the target processor is the V850E1.  The preprocessor
23969 constants @code{__v850e1__} and @code{__v850e__} are defined if
23970 this option is used.
23972 @item -mv850es
23973 @opindex mv850es
23974 Specify that the target processor is the V850ES.  This is an alias for
23975 the @option{-mv850e1} option.
23977 @item -mv850e
23978 @opindex mv850e
23979 Specify that the target processor is the V850E@.  The preprocessor
23980 constant @code{__v850e__} is defined if this option is used.
23982 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
23983 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
23984 are defined then a default target processor is chosen and the
23985 relevant @samp{__v850*__} preprocessor constant is defined.
23987 The preprocessor constants @code{__v850} and @code{__v851__} are always
23988 defined, regardless of which processor variant is the target.
23990 @item -mdisable-callt
23991 @itemx -mno-disable-callt
23992 @opindex mdisable-callt
23993 @opindex mno-disable-callt
23994 This option suppresses generation of the @code{CALLT} instruction for the
23995 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
23996 architecture.
23998 This option is enabled by default when the RH850 ABI is
23999 in use (see @option{-mrh850-abi}), and disabled by default when the
24000 GCC ABI is in use.  If @code{CALLT} instructions are being generated
24001 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
24003 @item -mrelax
24004 @itemx -mno-relax
24005 @opindex mrelax
24006 @opindex mno-relax
24007 Pass on (or do not pass on) the @option{-mrelax} command-line option
24008 to the assembler.
24010 @item -mlong-jumps
24011 @itemx -mno-long-jumps
24012 @opindex mlong-jumps
24013 @opindex mno-long-jumps
24014 Disable (or re-enable) the generation of PC-relative jump instructions.
24016 @item -msoft-float
24017 @itemx -mhard-float
24018 @opindex msoft-float
24019 @opindex mhard-float
24020 Disable (or re-enable) the generation of hardware floating point
24021 instructions.  This option is only significant when the target
24022 architecture is @samp{V850E2V3} or higher.  If hardware floating point
24023 instructions are being generated then the C preprocessor symbol
24024 @code{__FPU_OK__} is defined, otherwise the symbol
24025 @code{__NO_FPU__} is defined.
24027 @item -mloop
24028 @opindex mloop
24029 Enables the use of the e3v5 LOOP instruction.  The use of this
24030 instruction is not enabled by default when the e3v5 architecture is
24031 selected because its use is still experimental.
24033 @item -mrh850-abi
24034 @itemx -mghs
24035 @opindex mrh850-abi
24036 @opindex mghs
24037 Enables support for the RH850 version of the V850 ABI.  This is the
24038 default.  With this version of the ABI the following rules apply:
24040 @itemize
24041 @item
24042 Integer sized structures and unions are returned via a memory pointer
24043 rather than a register.
24045 @item
24046 Large structures and unions (more than 8 bytes in size) are passed by
24047 value.
24049 @item
24050 Functions are aligned to 16-bit boundaries.
24052 @item
24053 The @option{-m8byte-align} command-line option is supported.
24055 @item
24056 The @option{-mdisable-callt} command-line option is enabled by
24057 default.  The @option{-mno-disable-callt} command-line option is not
24058 supported.
24059 @end itemize
24061 When this version of the ABI is enabled the C preprocessor symbol
24062 @code{__V850_RH850_ABI__} is defined.
24064 @item -mgcc-abi
24065 @opindex mgcc-abi
24066 Enables support for the old GCC version of the V850 ABI.  With this
24067 version of the ABI the following rules apply:
24069 @itemize
24070 @item
24071 Integer sized structures and unions are returned in register @code{r10}.
24073 @item
24074 Large structures and unions (more than 8 bytes in size) are passed by
24075 reference.
24077 @item
24078 Functions are aligned to 32-bit boundaries, unless optimizing for
24079 size.
24081 @item
24082 The @option{-m8byte-align} command-line option is not supported.
24084 @item
24085 The @option{-mdisable-callt} command-line option is supported but not
24086 enabled by default.
24087 @end itemize
24089 When this version of the ABI is enabled the C preprocessor symbol
24090 @code{__V850_GCC_ABI__} is defined.
24092 @item -m8byte-align
24093 @itemx -mno-8byte-align
24094 @opindex m8byte-align
24095 @opindex mno-8byte-align
24096 Enables support for @code{double} and @code{long long} types to be
24097 aligned on 8-byte boundaries.  The default is to restrict the
24098 alignment of all objects to at most 4-bytes.  When
24099 @option{-m8byte-align} is in effect the C preprocessor symbol
24100 @code{__V850_8BYTE_ALIGN__} is defined.
24102 @item -mbig-switch
24103 @opindex mbig-switch
24104 Generate code suitable for big switch tables.  Use this option only if
24105 the assembler/linker complain about out of range branches within a switch
24106 table.
24108 @item -mapp-regs
24109 @opindex mapp-regs
24110 This option causes r2 and r5 to be used in the code generated by
24111 the compiler.  This setting is the default.
24113 @item -mno-app-regs
24114 @opindex mno-app-regs
24115 This option causes r2 and r5 to be treated as fixed registers.
24117 @end table
24119 @node VAX Options
24120 @subsection VAX Options
24121 @cindex VAX options
24123 These @samp{-m} options are defined for the VAX:
24125 @table @gcctabopt
24126 @item -munix
24127 @opindex munix
24128 Do not output certain jump instructions (@code{aobleq} and so on)
24129 that the Unix assembler for the VAX cannot handle across long
24130 ranges.
24132 @item -mgnu
24133 @opindex mgnu
24134 Do output those jump instructions, on the assumption that the
24135 GNU assembler is being used.
24137 @item -mg
24138 @opindex mg
24139 Output code for G-format floating-point numbers instead of D-format.
24140 @end table
24142 @node Visium Options
24143 @subsection Visium Options
24144 @cindex Visium options
24146 @table @gcctabopt
24148 @item -mdebug
24149 @opindex mdebug
24150 A program which performs file I/O and is destined to run on an MCM target
24151 should be linked with this option.  It causes the libraries libc.a and
24152 libdebug.a to be linked.  The program should be run on the target under
24153 the control of the GDB remote debugging stub.
24155 @item -msim
24156 @opindex msim
24157 A program which performs file I/O and is destined to run on the simulator
24158 should be linked with option.  This causes libraries libc.a and libsim.a to
24159 be linked.
24161 @item -mfpu
24162 @itemx -mhard-float
24163 @opindex mfpu
24164 @opindex mhard-float
24165 Generate code containing floating-point instructions.  This is the
24166 default.
24168 @item -mno-fpu
24169 @itemx -msoft-float
24170 @opindex mno-fpu
24171 @opindex msoft-float
24172 Generate code containing library calls for floating-point.
24174 @option{-msoft-float} changes the calling convention in the output file;
24175 therefore, it is only useful if you compile @emph{all} of a program with
24176 this option.  In particular, you need to compile @file{libgcc.a}, the
24177 library that comes with GCC, with @option{-msoft-float} in order for
24178 this to work.
24180 @item -mcpu=@var{cpu_type}
24181 @opindex mcpu
24182 Set the instruction set, register set, and instruction scheduling parameters
24183 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
24184 @samp{mcm}, @samp{gr5} and @samp{gr6}.
24186 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
24188 By default (unless configured otherwise), GCC generates code for the GR5
24189 variant of the Visium architecture.  
24191 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
24192 architecture.  The only difference from GR5 code is that the compiler will
24193 generate block move instructions.
24195 @item -mtune=@var{cpu_type}
24196 @opindex mtune
24197 Set the instruction scheduling parameters for machine type @var{cpu_type},
24198 but do not set the instruction set or register set that the option
24199 @option{-mcpu=@var{cpu_type}} would.
24201 @item -msv-mode
24202 @opindex msv-mode
24203 Generate code for the supervisor mode, where there are no restrictions on
24204 the access to general registers.  This is the default.
24206 @item -muser-mode
24207 @opindex muser-mode
24208 Generate code for the user mode, where the access to some general registers
24209 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
24210 mode; on the GR6, only registers r29 to r31 are affected.
24211 @end table
24213 @node VMS Options
24214 @subsection VMS Options
24216 These @samp{-m} options are defined for the VMS implementations:
24218 @table @gcctabopt
24219 @item -mvms-return-codes
24220 @opindex mvms-return-codes
24221 Return VMS condition codes from @code{main}. The default is to return POSIX-style
24222 condition (e.g.@ error) codes.
24224 @item -mdebug-main=@var{prefix}
24225 @opindex mdebug-main=@var{prefix}
24226 Flag the first routine whose name starts with @var{prefix} as the main
24227 routine for the debugger.
24229 @item -mmalloc64
24230 @opindex mmalloc64
24231 Default to 64-bit memory allocation routines.
24233 @item -mpointer-size=@var{size}
24234 @opindex mpointer-size=@var{size}
24235 Set the default size of pointers. Possible options for @var{size} are
24236 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
24237 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
24238 The later option disables @code{pragma pointer_size}.
24239 @end table
24241 @node VxWorks Options
24242 @subsection VxWorks Options
24243 @cindex VxWorks Options
24245 The options in this section are defined for all VxWorks targets.
24246 Options specific to the target hardware are listed with the other
24247 options for that target.
24249 @table @gcctabopt
24250 @item -mrtp
24251 @opindex mrtp
24252 GCC can generate code for both VxWorks kernels and real time processes
24253 (RTPs).  This option switches from the former to the latter.  It also
24254 defines the preprocessor macro @code{__RTP__}.
24256 @item -non-static
24257 @opindex non-static
24258 Link an RTP executable against shared libraries rather than static
24259 libraries.  The options @option{-static} and @option{-shared} can
24260 also be used for RTPs (@pxref{Link Options}); @option{-static}
24261 is the default.
24263 @item -Bstatic
24264 @itemx -Bdynamic
24265 @opindex Bstatic
24266 @opindex Bdynamic
24267 These options are passed down to the linker.  They are defined for
24268 compatibility with Diab.
24270 @item -Xbind-lazy
24271 @opindex Xbind-lazy
24272 Enable lazy binding of function calls.  This option is equivalent to
24273 @option{-Wl,-z,now} and is defined for compatibility with Diab.
24275 @item -Xbind-now
24276 @opindex Xbind-now
24277 Disable lazy binding of function calls.  This option is the default and
24278 is defined for compatibility with Diab.
24279 @end table
24281 @node x86 Options
24282 @subsection x86 Options
24283 @cindex x86 Options
24285 These @samp{-m} options are defined for the x86 family of computers.
24287 @table @gcctabopt
24289 @item -march=@var{cpu-type}
24290 @opindex march
24291 Generate instructions for the machine type @var{cpu-type}.  In contrast to
24292 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
24293 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
24294 to generate code that may not run at all on processors other than the one
24295 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
24296 @option{-mtune=@var{cpu-type}}.
24298 The choices for @var{cpu-type} are:
24300 @table @samp
24301 @item native
24302 This selects the CPU to generate code for at compilation time by determining
24303 the processor type of the compiling machine.  Using @option{-march=native}
24304 enables all instruction subsets supported by the local machine (hence
24305 the result might not run on different machines).  Using @option{-mtune=native}
24306 produces code optimized for the local machine under the constraints
24307 of the selected instruction set.  
24309 @item i386
24310 Original Intel i386 CPU@.
24312 @item i486
24313 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
24315 @item i586
24316 @itemx pentium
24317 Intel Pentium CPU with no MMX support.
24319 @item lakemont
24320 Intel Lakemont MCU, based on Intel Pentium CPU.
24322 @item pentium-mmx
24323 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
24325 @item pentiumpro
24326 Intel Pentium Pro CPU@.
24328 @item i686
24329 When used with @option{-march}, the Pentium Pro
24330 instruction set is used, so the code runs on all i686 family chips.
24331 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
24333 @item pentium2
24334 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
24335 support.
24337 @item pentium3
24338 @itemx pentium3m
24339 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
24340 set support.
24342 @item pentium-m
24343 Intel Pentium M; low-power version of Intel Pentium III CPU
24344 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
24346 @item pentium4
24347 @itemx pentium4m
24348 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
24350 @item prescott
24351 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
24352 set support.
24354 @item nocona
24355 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
24356 SSE2 and SSE3 instruction set support.
24358 @item core2
24359 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
24360 instruction set support.
24362 @item nehalem
24363 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24364 SSE4.1, SSE4.2 and POPCNT instruction set support.
24366 @item westmere
24367 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24368 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
24370 @item sandybridge
24371 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24372 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
24374 @item ivybridge
24375 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
24376 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
24377 instruction set support.
24379 @item haswell
24380 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24381 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24382 BMI, BMI2 and F16C instruction set support.
24384 @item broadwell
24385 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24386 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24387 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
24389 @item skylake
24390 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24391 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24392 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
24393 XSAVES instruction set support.
24395 @item bonnell
24396 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
24397 instruction set support.
24399 @item silvermont
24400 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
24401 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
24403 @item knl
24404 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
24405 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24406 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
24407 AVX512CD instruction set support.
24409 @item skylake-avx512
24410 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
24411 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
24412 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
24413 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
24415 @item k6
24416 AMD K6 CPU with MMX instruction set support.
24418 @item k6-2
24419 @itemx k6-3
24420 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
24422 @item athlon
24423 @itemx athlon-tbird
24424 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
24425 support.
24427 @item athlon-4
24428 @itemx athlon-xp
24429 @itemx athlon-mp
24430 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
24431 instruction set support.
24433 @item k8
24434 @itemx opteron
24435 @itemx athlon64
24436 @itemx athlon-fx
24437 Processors based on the AMD K8 core with x86-64 instruction set support,
24438 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
24439 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
24440 instruction set extensions.)
24442 @item k8-sse3
24443 @itemx opteron-sse3
24444 @itemx athlon64-sse3
24445 Improved versions of AMD K8 cores with SSE3 instruction set support.
24447 @item amdfam10
24448 @itemx barcelona
24449 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
24450 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
24451 instruction set extensions.)
24453 @item bdver1
24454 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
24455 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
24456 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
24457 @item bdver2
24458 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
24459 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
24460 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
24461 extensions.)
24462 @item bdver3
24463 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
24464 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
24465 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
24466 64-bit instruction set extensions.
24467 @item bdver4
24468 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
24469 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
24470 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
24471 SSE4.2, ABM and 64-bit instruction set extensions.
24473 @item znver1
24474 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
24475 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
24476 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
24477 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
24478 instruction set extensions.
24480 @item btver1
24481 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
24482 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
24483 instruction set extensions.)
24485 @item btver2
24486 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
24487 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
24488 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
24490 @item winchip-c6
24491 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
24492 set support.
24494 @item winchip2
24495 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
24496 instruction set support.
24498 @item c3
24499 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
24500 (No scheduling is implemented for this chip.)
24502 @item c3-2
24503 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
24504 (No scheduling is implemented for this chip.)
24506 @item c7
24507 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
24508 (No scheduling is implemented for this chip.)
24510 @item samuel-2
24511 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
24512 (No scheduling is implemented for this chip.)
24514 @item nehemiah
24515 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
24516 (No scheduling is implemented for this chip.)
24518 @item esther
24519 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
24520 (No scheduling is implemented for this chip.)
24522 @item eden-x2
24523 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
24524 (No scheduling is implemented for this chip.)
24526 @item eden-x4
24527 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
24528 AVX and AVX2 instruction set support.
24529 (No scheduling is implemented for this chip.)
24531 @item nano
24532 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
24533 instruction set support.
24534 (No scheduling is implemented for this chip.)
24536 @item nano-1000
24537 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
24538 instruction set support.
24539 (No scheduling is implemented for this chip.)
24541 @item nano-2000
24542 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
24543 instruction set support.
24544 (No scheduling is implemented for this chip.)
24546 @item nano-3000
24547 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
24548 instruction set support.
24549 (No scheduling is implemented for this chip.)
24551 @item nano-x2
24552 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
24553 instruction set support.
24554 (No scheduling is implemented for this chip.)
24556 @item nano-x4
24557 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
24558 instruction set support.
24559 (No scheduling is implemented for this chip.)
24561 @item geode
24562 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
24563 @end table
24565 @item -mtune=@var{cpu-type}
24566 @opindex mtune
24567 Tune to @var{cpu-type} everything applicable about the generated code, except
24568 for the ABI and the set of available instructions.  
24569 While picking a specific @var{cpu-type} schedules things appropriately
24570 for that particular chip, the compiler does not generate any code that
24571 cannot run on the default machine type unless you use a
24572 @option{-march=@var{cpu-type}} option.
24573 For example, if GCC is configured for i686-pc-linux-gnu
24574 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
24575 but still runs on i686 machines.
24577 The choices for @var{cpu-type} are the same as for @option{-march}.
24578 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
24580 @table @samp
24581 @item generic
24582 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
24583 If you know the CPU on which your code will run, then you should use
24584 the corresponding @option{-mtune} or @option{-march} option instead of
24585 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
24586 of your application will have, then you should use this option.
24588 As new processors are deployed in the marketplace, the behavior of this
24589 option will change.  Therefore, if you upgrade to a newer version of
24590 GCC, code generation controlled by this option will change to reflect
24591 the processors
24592 that are most common at the time that version of GCC is released.
24594 There is no @option{-march=generic} option because @option{-march}
24595 indicates the instruction set the compiler can use, and there is no
24596 generic instruction set applicable to all processors.  In contrast,
24597 @option{-mtune} indicates the processor (or, in this case, collection of
24598 processors) for which the code is optimized.
24600 @item intel
24601 Produce code optimized for the most current Intel processors, which are
24602 Haswell and Silvermont for this version of GCC.  If you know the CPU
24603 on which your code will run, then you should use the corresponding
24604 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
24605 But, if you want your application performs better on both Haswell and
24606 Silvermont, then you should use this option.
24608 As new Intel processors are deployed in the marketplace, the behavior of
24609 this option will change.  Therefore, if you upgrade to a newer version of
24610 GCC, code generation controlled by this option will change to reflect
24611 the most current Intel processors at the time that version of GCC is
24612 released.
24614 There is no @option{-march=intel} option because @option{-march} indicates
24615 the instruction set the compiler can use, and there is no common
24616 instruction set applicable to all processors.  In contrast,
24617 @option{-mtune} indicates the processor (or, in this case, collection of
24618 processors) for which the code is optimized.
24619 @end table
24621 @item -mcpu=@var{cpu-type}
24622 @opindex mcpu
24623 A deprecated synonym for @option{-mtune}.
24625 @item -mfpmath=@var{unit}
24626 @opindex mfpmath
24627 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
24628 for @var{unit} are:
24630 @table @samp
24631 @item 387
24632 Use the standard 387 floating-point coprocessor present on the majority of chips and
24633 emulated otherwise.  Code compiled with this option runs almost everywhere.
24634 The temporary results are computed in 80-bit precision instead of the precision
24635 specified by the type, resulting in slightly different results compared to most
24636 of other chips.  See @option{-ffloat-store} for more detailed description.
24638 This is the default choice for non-Darwin x86-32 targets.
24640 @item sse
24641 Use scalar floating-point instructions present in the SSE instruction set.
24642 This instruction set is supported by Pentium III and newer chips,
24643 and in the AMD line
24644 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
24645 instruction set supports only single-precision arithmetic, thus the double and
24646 extended-precision arithmetic are still done using 387.  A later version, present
24647 only in Pentium 4 and AMD x86-64 chips, supports double-precision
24648 arithmetic too.
24650 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
24651 or @option{-msse2} switches to enable SSE extensions and make this option
24652 effective.  For the x86-64 compiler, these extensions are enabled by default.
24654 The resulting code should be considerably faster in the majority of cases and avoid
24655 the numerical instability problems of 387 code, but may break some existing
24656 code that expects temporaries to be 80 bits.
24658 This is the default choice for the x86-64 compiler, Darwin x86-32 targets,
24659 and the default choice for x86-32 targets with the SSE2 instruction set
24660 when @option{-ffast-math} is enabled.
24662 @item sse,387
24663 @itemx sse+387
24664 @itemx both
24665 Attempt to utilize both instruction sets at once.  This effectively doubles the
24666 amount of available registers, and on chips with separate execution units for
24667 387 and SSE the execution resources too.  Use this option with care, as it is
24668 still experimental, because the GCC register allocator does not model separate
24669 functional units well, resulting in unstable performance.
24670 @end table
24672 @item -masm=@var{dialect}
24673 @opindex masm=@var{dialect}
24674 Output assembly instructions using selected @var{dialect}.  Also affects
24675 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
24676 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
24677 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
24678 not support @samp{intel}.
24680 @item -mieee-fp
24681 @itemx -mno-ieee-fp
24682 @opindex mieee-fp
24683 @opindex mno-ieee-fp
24684 Control whether or not the compiler uses IEEE floating-point
24685 comparisons.  These correctly handle the case where the result of a
24686 comparison is unordered.
24688 @item -m80387
24689 @item -mhard-float
24690 @opindex 80387
24691 @opindex mhard-float
24692 Generate output containing 80387 instructions for floating point.
24694 @item -mno-80387
24695 @item -msoft-float
24696 @opindex no-80387
24697 @opindex msoft-float
24698 Generate output containing library calls for floating point.
24700 @strong{Warning:} the requisite libraries are not part of GCC@.
24701 Normally the facilities of the machine's usual C compiler are used, but
24702 this cannot be done directly in cross-compilation.  You must make your
24703 own arrangements to provide suitable library functions for
24704 cross-compilation.
24706 On machines where a function returns floating-point results in the 80387
24707 register stack, some floating-point opcodes may be emitted even if
24708 @option{-msoft-float} is used.
24710 @item -mno-fp-ret-in-387
24711 @opindex mno-fp-ret-in-387
24712 Do not use the FPU registers for return values of functions.
24714 The usual calling convention has functions return values of types
24715 @code{float} and @code{double} in an FPU register, even if there
24716 is no FPU@.  The idea is that the operating system should emulate
24717 an FPU@.
24719 The option @option{-mno-fp-ret-in-387} causes such values to be returned
24720 in ordinary CPU registers instead.
24722 @item -mno-fancy-math-387
24723 @opindex mno-fancy-math-387
24724 Some 387 emulators do not support the @code{sin}, @code{cos} and
24725 @code{sqrt} instructions for the 387.  Specify this option to avoid
24726 generating those instructions.  This option is the default on
24727 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
24728 indicates that the target CPU always has an FPU and so the
24729 instruction does not need emulation.  These
24730 instructions are not generated unless you also use the
24731 @option{-funsafe-math-optimizations} switch.
24733 @item -malign-double
24734 @itemx -mno-align-double
24735 @opindex malign-double
24736 @opindex mno-align-double
24737 Control whether GCC aligns @code{double}, @code{long double}, and
24738 @code{long long} variables on a two-word boundary or a one-word
24739 boundary.  Aligning @code{double} variables on a two-word boundary
24740 produces code that runs somewhat faster on a Pentium at the
24741 expense of more memory.
24743 On x86-64, @option{-malign-double} is enabled by default.
24745 @strong{Warning:} if you use the @option{-malign-double} switch,
24746 structures containing the above types are aligned differently than
24747 the published application binary interface specifications for the x86-32
24748 and are not binary compatible with structures in code compiled
24749 without that switch.
24751 @item -m96bit-long-double
24752 @itemx -m128bit-long-double
24753 @opindex m96bit-long-double
24754 @opindex m128bit-long-double
24755 These switches control the size of @code{long double} type.  The x86-32
24756 application binary interface specifies the size to be 96 bits,
24757 so @option{-m96bit-long-double} is the default in 32-bit mode.
24759 Modern architectures (Pentium and newer) prefer @code{long double}
24760 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
24761 conforming to the ABI, this is not possible.  So specifying
24762 @option{-m128bit-long-double} aligns @code{long double}
24763 to a 16-byte boundary by padding the @code{long double} with an additional
24764 32-bit zero.
24766 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
24767 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
24769 Notice that neither of these options enable any extra precision over the x87
24770 standard of 80 bits for a @code{long double}.
24772 @strong{Warning:} if you override the default value for your target ABI, this
24773 changes the size of 
24774 structures and arrays containing @code{long double} variables,
24775 as well as modifying the function calling convention for functions taking
24776 @code{long double}.  Hence they are not binary-compatible
24777 with code compiled without that switch.
24779 @item -mlong-double-64
24780 @itemx -mlong-double-80
24781 @itemx -mlong-double-128
24782 @opindex mlong-double-64
24783 @opindex mlong-double-80
24784 @opindex mlong-double-128
24785 These switches control the size of @code{long double} type. A size
24786 of 64 bits makes the @code{long double} type equivalent to the @code{double}
24787 type. This is the default for 32-bit Bionic C library.  A size
24788 of 128 bits makes the @code{long double} type equivalent to the
24789 @code{__float128} type. This is the default for 64-bit Bionic C library.
24791 @strong{Warning:} if you override the default value for your target ABI, this
24792 changes the size of
24793 structures and arrays containing @code{long double} variables,
24794 as well as modifying the function calling convention for functions taking
24795 @code{long double}.  Hence they are not binary-compatible
24796 with code compiled without that switch.
24798 @item -malign-data=@var{type}
24799 @opindex malign-data
24800 Control how GCC aligns variables.  Supported values for @var{type} are
24801 @samp{compat} uses increased alignment value compatible uses GCC 4.8
24802 and earlier, @samp{abi} uses alignment value as specified by the
24803 psABI, and @samp{cacheline} uses increased alignment value to match
24804 the cache line size.  @samp{compat} is the default.
24806 @item -mlarge-data-threshold=@var{threshold}
24807 @opindex mlarge-data-threshold
24808 When @option{-mcmodel=medium} is specified, data objects larger than
24809 @var{threshold} are placed in the large data section.  This value must be the
24810 same across all objects linked into the binary, and defaults to 65535.
24812 @item -mrtd
24813 @opindex mrtd
24814 Use a different function-calling convention, in which functions that
24815 take a fixed number of arguments return with the @code{ret @var{num}}
24816 instruction, which pops their arguments while returning.  This saves one
24817 instruction in the caller since there is no need to pop the arguments
24818 there.
24820 You can specify that an individual function is called with this calling
24821 sequence with the function attribute @code{stdcall}.  You can also
24822 override the @option{-mrtd} option by using the function attribute
24823 @code{cdecl}.  @xref{Function Attributes}.
24825 @strong{Warning:} this calling convention is incompatible with the one
24826 normally used on Unix, so you cannot use it if you need to call
24827 libraries compiled with the Unix compiler.
24829 Also, you must provide function prototypes for all functions that
24830 take variable numbers of arguments (including @code{printf});
24831 otherwise incorrect code is generated for calls to those
24832 functions.
24834 In addition, seriously incorrect code results if you call a
24835 function with too many arguments.  (Normally, extra arguments are
24836 harmlessly ignored.)
24838 @item -mregparm=@var{num}
24839 @opindex mregparm
24840 Control how many registers are used to pass integer arguments.  By
24841 default, no registers are used to pass arguments, and at most 3
24842 registers can be used.  You can control this behavior for a specific
24843 function by using the function attribute @code{regparm}.
24844 @xref{Function Attributes}.
24846 @strong{Warning:} if you use this switch, and
24847 @var{num} is nonzero, then you must build all modules with the same
24848 value, including any libraries.  This includes the system libraries and
24849 startup modules.
24851 @item -msseregparm
24852 @opindex msseregparm
24853 Use SSE register passing conventions for float and double arguments
24854 and return values.  You can control this behavior for a specific
24855 function by using the function attribute @code{sseregparm}.
24856 @xref{Function Attributes}.
24858 @strong{Warning:} if you use this switch then you must build all
24859 modules with the same value, including any libraries.  This includes
24860 the system libraries and startup modules.
24862 @item -mvect8-ret-in-mem
24863 @opindex mvect8-ret-in-mem
24864 Return 8-byte vectors in memory instead of MMX registers.  This is the
24865 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
24866 Studio compilers until version 12.  Later compiler versions (starting
24867 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
24868 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
24869 you need to remain compatible with existing code produced by those
24870 previous compiler versions or older versions of GCC@.
24872 @item -mpc32
24873 @itemx -mpc64
24874 @itemx -mpc80
24875 @opindex mpc32
24876 @opindex mpc64
24877 @opindex mpc80
24879 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
24880 is specified, the significands of results of floating-point operations are
24881 rounded to 24 bits (single precision); @option{-mpc64} rounds the
24882 significands of results of floating-point operations to 53 bits (double
24883 precision) and @option{-mpc80} rounds the significands of results of
24884 floating-point operations to 64 bits (extended double precision), which is
24885 the default.  When this option is used, floating-point operations in higher
24886 precisions are not available to the programmer without setting the FPU
24887 control word explicitly.
24889 Setting the rounding of floating-point operations to less than the default
24890 80 bits can speed some programs by 2% or more.  Note that some mathematical
24891 libraries assume that extended-precision (80-bit) floating-point operations
24892 are enabled by default; routines in such libraries could suffer significant
24893 loss of accuracy, typically through so-called ``catastrophic cancellation'',
24894 when this option is used to set the precision to less than extended precision.
24896 @item -mstackrealign
24897 @opindex mstackrealign
24898 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
24899 option generates an alternate prologue and epilogue that realigns the
24900 run-time stack if necessary.  This supports mixing legacy codes that keep
24901 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
24902 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
24903 applicable to individual functions.
24905 @item -mpreferred-stack-boundary=@var{num}
24906 @opindex mpreferred-stack-boundary
24907 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
24908 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
24909 the default is 4 (16 bytes or 128 bits).
24911 @strong{Warning:} When generating code for the x86-64 architecture with
24912 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
24913 used to keep the stack boundary aligned to 8 byte boundary.  Since
24914 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
24915 intended to be used in controlled environment where stack space is
24916 important limitation.  This option leads to wrong code when functions
24917 compiled with 16 byte stack alignment (such as functions from a standard
24918 library) are called with misaligned stack.  In this case, SSE
24919 instructions may lead to misaligned memory access traps.  In addition,
24920 variable arguments are handled incorrectly for 16 byte aligned
24921 objects (including x87 long double and __int128), leading to wrong
24922 results.  You must build all modules with
24923 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
24924 includes the system libraries and startup modules.
24926 @item -mincoming-stack-boundary=@var{num}
24927 @opindex mincoming-stack-boundary
24928 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
24929 boundary.  If @option{-mincoming-stack-boundary} is not specified,
24930 the one specified by @option{-mpreferred-stack-boundary} is used.
24932 On Pentium and Pentium Pro, @code{double} and @code{long double} values
24933 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
24934 suffer significant run time performance penalties.  On Pentium III, the
24935 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
24936 properly if it is not 16-byte aligned.
24938 To ensure proper alignment of this values on the stack, the stack boundary
24939 must be as aligned as that required by any value stored on the stack.
24940 Further, every function must be generated such that it keeps the stack
24941 aligned.  Thus calling a function compiled with a higher preferred
24942 stack boundary from a function compiled with a lower preferred stack
24943 boundary most likely misaligns the stack.  It is recommended that
24944 libraries that use callbacks always use the default setting.
24946 This extra alignment does consume extra stack space, and generally
24947 increases code size.  Code that is sensitive to stack space usage, such
24948 as embedded systems and operating system kernels, may want to reduce the
24949 preferred alignment to @option{-mpreferred-stack-boundary=2}.
24951 @need 200
24952 @item -mmmx
24953 @opindex mmmx
24954 @need 200
24955 @itemx -msse
24956 @opindex msse
24957 @need 200
24958 @itemx -msse2
24959 @opindex msse2
24960 @need 200
24961 @itemx -msse3
24962 @opindex msse3
24963 @need 200
24964 @itemx -mssse3
24965 @opindex mssse3
24966 @need 200
24967 @itemx -msse4
24968 @opindex msse4
24969 @need 200
24970 @itemx -msse4a
24971 @opindex msse4a
24972 @need 200
24973 @itemx -msse4.1
24974 @opindex msse4.1
24975 @need 200
24976 @itemx -msse4.2
24977 @opindex msse4.2
24978 @need 200
24979 @itemx -mavx
24980 @opindex mavx
24981 @need 200
24982 @itemx -mavx2
24983 @opindex mavx2
24984 @need 200
24985 @itemx -mavx512f
24986 @opindex mavx512f
24987 @need 200
24988 @itemx -mavx512pf
24989 @opindex mavx512pf
24990 @need 200
24991 @itemx -mavx512er
24992 @opindex mavx512er
24993 @need 200
24994 @itemx -mavx512cd
24995 @opindex mavx512cd
24996 @need 200
24997 @itemx -mavx512vl
24998 @opindex mavx512vl
24999 @need 200
25000 @itemx -mavx512bw
25001 @opindex mavx512bw
25002 @need 200
25003 @itemx -mavx512dq
25004 @opindex mavx512dq
25005 @need 200
25006 @itemx -mavx512ifma
25007 @opindex mavx512ifma
25008 @need 200
25009 @itemx -mavx512vbmi
25010 @opindex mavx512vbmi
25011 @need 200
25012 @itemx -msha
25013 @opindex msha
25014 @need 200
25015 @itemx -maes
25016 @opindex maes
25017 @need 200
25018 @itemx -mpclmul
25019 @opindex mpclmul
25020 @need 200
25021 @itemx -mclfushopt
25022 @opindex mclfushopt
25023 @need 200
25024 @itemx -mfsgsbase
25025 @opindex mfsgsbase
25026 @need 200
25027 @itemx -mrdrnd
25028 @opindex mrdrnd
25029 @need 200
25030 @itemx -mf16c
25031 @opindex mf16c
25032 @need 200
25033 @itemx -mfma
25034 @opindex mfma
25035 @need 200
25036 @itemx -mfma4
25037 @opindex mfma4
25038 @need 200
25039 @itemx -mprefetchwt1
25040 @opindex mprefetchwt1
25041 @need 200
25042 @itemx -mxop
25043 @opindex mxop
25044 @need 200
25045 @itemx -mlwp
25046 @opindex mlwp
25047 @need 200
25048 @itemx -m3dnow
25049 @opindex m3dnow
25050 @need 200
25051 @itemx -m3dnowa
25052 @opindex m3dnowa
25053 @need 200
25054 @itemx -mpopcnt
25055 @opindex mpopcnt
25056 @need 200
25057 @itemx -mabm
25058 @opindex mabm
25059 @need 200
25060 @itemx -mbmi
25061 @opindex mbmi
25062 @need 200
25063 @itemx -mbmi2
25064 @need 200
25065 @itemx -mlzcnt
25066 @opindex mlzcnt
25067 @need 200
25068 @itemx -mfxsr
25069 @opindex mfxsr
25070 @need 200
25071 @itemx -mxsave
25072 @opindex mxsave
25073 @need 200
25074 @itemx -mxsaveopt
25075 @opindex mxsaveopt
25076 @need 200
25077 @itemx -mxsavec
25078 @opindex mxsavec
25079 @need 200
25080 @itemx -mxsaves
25081 @opindex mxsaves
25082 @need 200
25083 @itemx -mrtm
25084 @opindex mrtm
25085 @need 200
25086 @itemx -mtbm
25087 @opindex mtbm
25088 @need 200
25089 @itemx -mmpx
25090 @opindex mmpx
25091 @need 200
25092 @itemx -mmwaitx
25093 @opindex mmwaitx
25094 @need 200
25095 @itemx -mclzero
25096 @opindex mclzero
25097 @itemx -mpku
25098 @opindex mpku
25099 These switches enable the use of instructions in the MMX, SSE,
25100 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
25101 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
25102 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
25103 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU, 3DNow!@: or enhanced 3DNow!@:
25104 extended instruction sets.  Each has a corresponding @option{-mno-} option
25105 to disable use of these instructions.
25107 These extensions are also available as built-in functions: see
25108 @ref{x86 Built-in Functions}, for details of the functions enabled and
25109 disabled by these switches.
25111 To generate SSE/SSE2 instructions automatically from floating-point
25112 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
25114 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
25115 generates new AVX instructions or AVX equivalence for all SSEx instructions
25116 when needed.
25118 These options enable GCC to use these extended instructions in
25119 generated code, even without @option{-mfpmath=sse}.  Applications that
25120 perform run-time CPU detection must compile separate files for each
25121 supported architecture, using the appropriate flags.  In particular,
25122 the file containing the CPU detection code should be compiled without
25123 these options.
25125 @item -mdump-tune-features
25126 @opindex mdump-tune-features
25127 This option instructs GCC to dump the names of the x86 performance 
25128 tuning features and default settings. The names can be used in 
25129 @option{-mtune-ctrl=@var{feature-list}}.
25131 @item -mtune-ctrl=@var{feature-list}
25132 @opindex mtune-ctrl=@var{feature-list}
25133 This option is used to do fine grain control of x86 code generation features.
25134 @var{feature-list} is a comma separated list of @var{feature} names. See also
25135 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
25136 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
25137 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
25138 developers. Using it may lead to code paths not covered by testing and can
25139 potentially result in compiler ICEs or runtime errors.
25141 @item -mno-default
25142 @opindex mno-default
25143 This option instructs GCC to turn off all tunable features. See also 
25144 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
25146 @item -mcld
25147 @opindex mcld
25148 This option instructs GCC to emit a @code{cld} instruction in the prologue
25149 of functions that use string instructions.  String instructions depend on
25150 the DF flag to select between autoincrement or autodecrement mode.  While the
25151 ABI specifies the DF flag to be cleared on function entry, some operating
25152 systems violate this specification by not clearing the DF flag in their
25153 exception dispatchers.  The exception handler can be invoked with the DF flag
25154 set, which leads to wrong direction mode when string instructions are used.
25155 This option can be enabled by default on 32-bit x86 targets by configuring
25156 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
25157 instructions can be suppressed with the @option{-mno-cld} compiler option
25158 in this case.
25160 @item -mvzeroupper
25161 @opindex mvzeroupper
25162 This option instructs GCC to emit a @code{vzeroupper} instruction
25163 before a transfer of control flow out of the function to minimize
25164 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
25165 intrinsics.
25167 @item -mprefer-avx128
25168 @opindex mprefer-avx128
25169 This option instructs GCC to use 128-bit AVX instructions instead of
25170 256-bit AVX instructions in the auto-vectorizer.
25172 @item -mcx16
25173 @opindex mcx16
25174 This option enables GCC to generate @code{CMPXCHG16B} instructions.
25175 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
25176 (or oword) data types.  
25177 This is useful for high-resolution counters that can be updated
25178 by multiple processors (or cores).  This instruction is generated as part of
25179 atomic built-in functions: see @ref{__sync Builtins} or
25180 @ref{__atomic Builtins} for details.
25182 @item -msahf
25183 @opindex msahf
25184 This option enables generation of @code{SAHF} instructions in 64-bit code.
25185 Early Intel Pentium 4 CPUs with Intel 64 support,
25186 prior to the introduction of Pentium 4 G1 step in December 2005,
25187 lacked the @code{LAHF} and @code{SAHF} instructions
25188 which are supported by AMD64.
25189 These are load and store instructions, respectively, for certain status flags.
25190 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
25191 @code{drem}, and @code{remainder} built-in functions;
25192 see @ref{Other Builtins} for details.
25194 @item -mmovbe
25195 @opindex mmovbe
25196 This option enables use of the @code{movbe} instruction to implement
25197 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
25199 @item -mcrc32
25200 @opindex mcrc32
25201 This option enables built-in functions @code{__builtin_ia32_crc32qi},
25202 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
25203 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
25205 @item -mrecip
25206 @opindex mrecip
25207 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
25208 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
25209 with an additional Newton-Raphson step
25210 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
25211 (and their vectorized
25212 variants) for single-precision floating-point arguments.  These instructions
25213 are generated only when @option{-funsafe-math-optimizations} is enabled
25214 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
25215 Note that while the throughput of the sequence is higher than the throughput
25216 of the non-reciprocal instruction, the precision of the sequence can be
25217 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
25219 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
25220 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
25221 combination), and doesn't need @option{-mrecip}.
25223 Also note that GCC emits the above sequence with additional Newton-Raphson step
25224 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
25225 already with @option{-ffast-math} (or the above option combination), and
25226 doesn't need @option{-mrecip}.
25228 @item -mrecip=@var{opt}
25229 @opindex mrecip=opt
25230 This option controls which reciprocal estimate instructions
25231 may be used.  @var{opt} is a comma-separated list of options, which may
25232 be preceded by a @samp{!} to invert the option:
25234 @table @samp
25235 @item all
25236 Enable all estimate instructions.
25238 @item default
25239 Enable the default instructions, equivalent to @option{-mrecip}.
25241 @item none
25242 Disable all estimate instructions, equivalent to @option{-mno-recip}.
25244 @item div
25245 Enable the approximation for scalar division.
25247 @item vec-div
25248 Enable the approximation for vectorized division.
25250 @item sqrt
25251 Enable the approximation for scalar square root.
25253 @item vec-sqrt
25254 Enable the approximation for vectorized square root.
25255 @end table
25257 So, for example, @option{-mrecip=all,!sqrt} enables
25258 all of the reciprocal approximations, except for square root.
25260 @item -mveclibabi=@var{type}
25261 @opindex mveclibabi
25262 Specifies the ABI type to use for vectorizing intrinsics using an
25263 external library.  Supported values for @var{type} are @samp{svml} 
25264 for the Intel short
25265 vector math library and @samp{acml} for the AMD math core library.
25266 To use this option, both @option{-ftree-vectorize} and
25267 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
25268 ABI-compatible library must be specified at link time.
25270 GCC currently emits calls to @code{vmldExp2},
25271 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
25272 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
25273 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
25274 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
25275 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
25276 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
25277 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
25278 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
25279 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
25280 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
25281 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
25282 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
25283 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
25284 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
25285 when @option{-mveclibabi=acml} is used.  
25287 @item -mabi=@var{name}
25288 @opindex mabi
25289 Generate code for the specified calling convention.  Permissible values
25290 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
25291 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
25292 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
25293 You can control this behavior for specific functions by
25294 using the function attributes @code{ms_abi} and @code{sysv_abi}.
25295 @xref{Function Attributes}.
25297 @item -mtls-dialect=@var{type}
25298 @opindex mtls-dialect
25299 Generate code to access thread-local storage using the @samp{gnu} or
25300 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
25301 @samp{gnu2} is more efficient, but it may add compile- and run-time
25302 requirements that cannot be satisfied on all systems.
25304 @item -mpush-args
25305 @itemx -mno-push-args
25306 @opindex mpush-args
25307 @opindex mno-push-args
25308 Use PUSH operations to store outgoing parameters.  This method is shorter
25309 and usually equally fast as method using SUB/MOV operations and is enabled
25310 by default.  In some cases disabling it may improve performance because of
25311 improved scheduling and reduced dependencies.
25313 @item -maccumulate-outgoing-args
25314 @opindex maccumulate-outgoing-args
25315 If enabled, the maximum amount of space required for outgoing arguments is
25316 computed in the function prologue.  This is faster on most modern CPUs
25317 because of reduced dependencies, improved scheduling and reduced stack usage
25318 when the preferred stack boundary is not equal to 2.  The drawback is a notable
25319 increase in code size.  This switch implies @option{-mno-push-args}.
25321 @item -mthreads
25322 @opindex mthreads
25323 Support thread-safe exception handling on MinGW.  Programs that rely
25324 on thread-safe exception handling must compile and link all code with the
25325 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
25326 @option{-D_MT}; when linking, it links in a special thread helper library
25327 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
25329 @item -mms-bitfields
25330 @itemx -mno-ms-bitfields
25331 @opindex mms-bitfields
25332 @opindex mno-ms-bitfields
25334 Enable/disable bit-field layout compatible with the native Microsoft
25335 Windows compiler.  
25337 If @code{packed} is used on a structure, or if bit-fields are used,
25338 it may be that the Microsoft ABI lays out the structure differently
25339 than the way GCC normally does.  Particularly when moving packed
25340 data between functions compiled with GCC and the native Microsoft compiler
25341 (either via function call or as data in a file), it may be necessary to access
25342 either format.
25344 This option is enabled by default for Microsoft Windows
25345 targets.  This behavior can also be controlled locally by use of variable
25346 or type attributes.  For more information, see @ref{x86 Variable Attributes}
25347 and @ref{x86 Type Attributes}.
25349 The Microsoft structure layout algorithm is fairly simple with the exception
25350 of the bit-field packing.  
25351 The padding and alignment of members of structures and whether a bit-field 
25352 can straddle a storage-unit boundary are determine by these rules:
25354 @enumerate
25355 @item Structure members are stored sequentially in the order in which they are
25356 declared: the first member has the lowest memory address and the last member
25357 the highest.
25359 @item Every data object has an alignment requirement.  The alignment requirement
25360 for all data except structures, unions, and arrays is either the size of the
25361 object or the current packing size (specified with either the
25362 @code{aligned} attribute or the @code{pack} pragma),
25363 whichever is less.  For structures, unions, and arrays,
25364 the alignment requirement is the largest alignment requirement of its members.
25365 Every object is allocated an offset so that:
25367 @smallexample
25368 offset % alignment_requirement == 0
25369 @end smallexample
25371 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
25372 unit if the integral types are the same size and if the next bit-field fits
25373 into the current allocation unit without crossing the boundary imposed by the
25374 common alignment requirements of the bit-fields.
25375 @end enumerate
25377 MSVC interprets zero-length bit-fields in the following ways:
25379 @enumerate
25380 @item If a zero-length bit-field is inserted between two bit-fields that
25381 are normally coalesced, the bit-fields are not coalesced.
25383 For example:
25385 @smallexample
25386 struct
25387  @{
25388    unsigned long bf_1 : 12;
25389    unsigned long : 0;
25390    unsigned long bf_2 : 12;
25391  @} t1;
25392 @end smallexample
25394 @noindent
25395 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
25396 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
25398 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
25399 alignment of the zero-length bit-field is greater than the member that follows it,
25400 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
25402 For example:
25404 @smallexample
25405 struct
25406  @{
25407    char foo : 4;
25408    short : 0;
25409    char bar;
25410  @} t2;
25412 struct
25413  @{
25414    char foo : 4;
25415    short : 0;
25416    double bar;
25417  @} t3;
25418 @end smallexample
25420 @noindent
25421 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
25422 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
25423 bit-field does not affect the alignment of @code{bar} or, as a result, the size
25424 of the structure.
25426 Taking this into account, it is important to note the following:
25428 @enumerate
25429 @item If a zero-length bit-field follows a normal bit-field, the type of the
25430 zero-length bit-field may affect the alignment of the structure as whole. For
25431 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
25432 normal bit-field, and is of type short.
25434 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
25435 still affect the alignment of the structure:
25437 @smallexample
25438 struct
25439  @{
25440    char foo : 6;
25441    long : 0;
25442  @} t4;
25443 @end smallexample
25445 @noindent
25446 Here, @code{t4} takes up 4 bytes.
25447 @end enumerate
25449 @item Zero-length bit-fields following non-bit-field members are ignored:
25451 @smallexample
25452 struct
25453  @{
25454    char foo;
25455    long : 0;
25456    char bar;
25457  @} t5;
25458 @end smallexample
25460 @noindent
25461 Here, @code{t5} takes up 2 bytes.
25462 @end enumerate
25465 @item -mno-align-stringops
25466 @opindex mno-align-stringops
25467 Do not align the destination of inlined string operations.  This switch reduces
25468 code size and improves performance in case the destination is already aligned,
25469 but GCC doesn't know about it.
25471 @item -minline-all-stringops
25472 @opindex minline-all-stringops
25473 By default GCC inlines string operations only when the destination is 
25474 known to be aligned to least a 4-byte boundary.  
25475 This enables more inlining and increases code
25476 size, but may improve performance of code that depends on fast
25477 @code{memcpy}, @code{strlen},
25478 and @code{memset} for short lengths.
25480 @item -minline-stringops-dynamically
25481 @opindex minline-stringops-dynamically
25482 For string operations of unknown size, use run-time checks with
25483 inline code for small blocks and a library call for large blocks.
25485 @item -mstringop-strategy=@var{alg}
25486 @opindex mstringop-strategy=@var{alg}
25487 Override the internal decision heuristic for the particular algorithm to use
25488 for inlining string operations.  The allowed values for @var{alg} are:
25490 @table @samp
25491 @item rep_byte
25492 @itemx rep_4byte
25493 @itemx rep_8byte
25494 Expand using i386 @code{rep} prefix of the specified size.
25496 @item byte_loop
25497 @itemx loop
25498 @itemx unrolled_loop
25499 Expand into an inline loop.
25501 @item libcall
25502 Always use a library call.
25503 @end table
25505 @item -mmemcpy-strategy=@var{strategy}
25506 @opindex mmemcpy-strategy=@var{strategy}
25507 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
25508 should be inlined and what inline algorithm to use when the expected size
25509 of the copy operation is known. @var{strategy} 
25510 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
25511 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
25512 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
25513 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
25514 in the list must be specified in increasing order.  The minimal byte size for 
25515 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
25516 preceding range.
25518 @item -mmemset-strategy=@var{strategy}
25519 @opindex mmemset-strategy=@var{strategy}
25520 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
25521 @code{__builtin_memset} expansion.
25523 @item -momit-leaf-frame-pointer
25524 @opindex momit-leaf-frame-pointer
25525 Don't keep the frame pointer in a register for leaf functions.  This
25526 avoids the instructions to save, set up, and restore frame pointers and
25527 makes an extra register available in leaf functions.  The option
25528 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
25529 which might make debugging harder.
25531 @item -mtls-direct-seg-refs
25532 @itemx -mno-tls-direct-seg-refs
25533 @opindex mtls-direct-seg-refs
25534 Controls whether TLS variables may be accessed with offsets from the
25535 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
25536 or whether the thread base pointer must be added.  Whether or not this
25537 is valid depends on the operating system, and whether it maps the
25538 segment to cover the entire TLS area.
25540 For systems that use the GNU C Library, the default is on.
25542 @item -msse2avx
25543 @itemx -mno-sse2avx
25544 @opindex msse2avx
25545 Specify that the assembler should encode SSE instructions with VEX
25546 prefix.  The option @option{-mavx} turns this on by default.
25548 @item -mfentry
25549 @itemx -mno-fentry
25550 @opindex mfentry
25551 If profiling is active (@option{-pg}), put the profiling
25552 counter call before the prologue.
25553 Note: On x86 architectures the attribute @code{ms_hook_prologue}
25554 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
25556 @item -mrecord-mcount
25557 @itemx -mno-record-mcount
25558 @opindex mrecord-mcount
25559 If profiling is active (@option{-pg}), generate a __mcount_loc section
25560 that contains pointers to each profiling call. This is useful for
25561 automatically patching and out calls.
25563 @item -mnop-mcount
25564 @itemx -mno-nop-mcount
25565 @opindex mnop-mcount
25566 If profiling is active (@option{-pg}), generate the calls to
25567 the profiling functions as NOPs. This is useful when they
25568 should be patched in later dynamically. This is likely only
25569 useful together with @option{-mrecord-mcount}.
25571 @item -mskip-rax-setup
25572 @itemx -mno-skip-rax-setup
25573 @opindex mskip-rax-setup
25574 When generating code for the x86-64 architecture with SSE extensions
25575 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
25576 register when there are no variable arguments passed in vector registers.
25578 @strong{Warning:} Since RAX register is used to avoid unnecessarily
25579 saving vector registers on stack when passing variable arguments, the
25580 impacts of this option are callees may waste some stack space,
25581 misbehave or jump to a random location.  GCC 4.4 or newer don't have
25582 those issues, regardless the RAX register value.
25584 @item -m8bit-idiv
25585 @itemx -mno-8bit-idiv
25586 @opindex m8bit-idiv
25587 On some processors, like Intel Atom, 8-bit unsigned integer divide is
25588 much faster than 32-bit/64-bit integer divide.  This option generates a
25589 run-time check.  If both dividend and divisor are within range of 0
25590 to 255, 8-bit unsigned integer divide is used instead of
25591 32-bit/64-bit integer divide.
25593 @item -mavx256-split-unaligned-load
25594 @itemx -mavx256-split-unaligned-store
25595 @opindex mavx256-split-unaligned-load
25596 @opindex mavx256-split-unaligned-store
25597 Split 32-byte AVX unaligned load and store.
25599 @item -mstack-protector-guard=@var{guard}
25600 @opindex mstack-protector-guard=@var{guard}
25601 Generate stack protection code using canary at @var{guard}.  Supported
25602 locations are @samp{global} for global canary or @samp{tls} for per-thread
25603 canary in the TLS block (the default).  This option has effect only when
25604 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
25606 @item -mmitigate-rop
25607 @opindex mmitigate-rop
25608 Try to avoid generating code sequences that contain unintended return
25609 opcodes, to mitigate against certain forms of attack. At the moment,
25610 this option is limited in what it can do and should not be relied
25611 on to provide serious protection.
25613 @item -mgeneral-regs-only
25614 @opindex mgeneral-regs-only
25615 Generate code that uses only the general-purpose registers.  This
25616 prevents the compiler from using floating-point, vector, mask and bound
25617 registers.
25619 @end table
25621 These @samp{-m} switches are supported in addition to the above
25622 on x86-64 processors in 64-bit environments.
25624 @table @gcctabopt
25625 @item -m32
25626 @itemx -m64
25627 @itemx -mx32
25628 @itemx -m16
25629 @itemx -miamcu
25630 @opindex m32
25631 @opindex m64
25632 @opindex mx32
25633 @opindex m16
25634 @opindex miamcu
25635 Generate code for a 16-bit, 32-bit or 64-bit environment.
25636 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
25637 to 32 bits, and
25638 generates code that runs on any i386 system.
25640 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
25641 types to 64 bits, and generates code for the x86-64 architecture.
25642 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
25643 and @option{-mdynamic-no-pic} options.
25645 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
25646 to 32 bits, and
25647 generates code for the x86-64 architecture.
25649 The @option{-m16} option is the same as @option{-m32}, except for that
25650 it outputs the @code{.code16gcc} assembly directive at the beginning of
25651 the assembly output so that the binary can run in 16-bit mode.
25653 The @option{-miamcu} option generates code which conforms to Intel MCU
25654 psABI.  It requires the @option{-m32} option to be turned on.
25656 @item -mno-red-zone
25657 @opindex mno-red-zone
25658 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
25659 by the x86-64 ABI; it is a 128-byte area beyond the location of the
25660 stack pointer that is not modified by signal or interrupt handlers
25661 and therefore can be used for temporary data without adjusting the stack
25662 pointer.  The flag @option{-mno-red-zone} disables this red zone.
25664 @item -mcmodel=small
25665 @opindex mcmodel=small
25666 Generate code for the small code model: the program and its symbols must
25667 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
25668 Programs can be statically or dynamically linked.  This is the default
25669 code model.
25671 @item -mcmodel=kernel
25672 @opindex mcmodel=kernel
25673 Generate code for the kernel code model.  The kernel runs in the
25674 negative 2 GB of the address space.
25675 This model has to be used for Linux kernel code.
25677 @item -mcmodel=medium
25678 @opindex mcmodel=medium
25679 Generate code for the medium model: the program is linked in the lower 2
25680 GB of the address space.  Small symbols are also placed there.  Symbols
25681 with sizes larger than @option{-mlarge-data-threshold} are put into
25682 large data or BSS sections and can be located above 2GB.  Programs can
25683 be statically or dynamically linked.
25685 @item -mcmodel=large
25686 @opindex mcmodel=large
25687 Generate code for the large model.  This model makes no assumptions
25688 about addresses and sizes of sections.
25690 @item -maddress-mode=long
25691 @opindex maddress-mode=long
25692 Generate code for long address mode.  This is only supported for 64-bit
25693 and x32 environments.  It is the default address mode for 64-bit
25694 environments.
25696 @item -maddress-mode=short
25697 @opindex maddress-mode=short
25698 Generate code for short address mode.  This is only supported for 32-bit
25699 and x32 environments.  It is the default address mode for 32-bit and
25700 x32 environments.
25701 @end table
25703 @node x86 Windows Options
25704 @subsection x86 Windows Options
25705 @cindex x86 Windows Options
25706 @cindex Windows Options for x86
25708 These additional options are available for Microsoft Windows targets:
25710 @table @gcctabopt
25711 @item -mconsole
25712 @opindex mconsole
25713 This option
25714 specifies that a console application is to be generated, by
25715 instructing the linker to set the PE header subsystem type
25716 required for console applications.
25717 This option is available for Cygwin and MinGW targets and is
25718 enabled by default on those targets.
25720 @item -mdll
25721 @opindex mdll
25722 This option is available for Cygwin and MinGW targets.  It
25723 specifies that a DLL---a dynamic link library---is to be
25724 generated, enabling the selection of the required runtime
25725 startup object and entry point.
25727 @item -mnop-fun-dllimport
25728 @opindex mnop-fun-dllimport
25729 This option is available for Cygwin and MinGW targets.  It
25730 specifies that the @code{dllimport} attribute should be ignored.
25732 @item -mthread
25733 @opindex mthread
25734 This option is available for MinGW targets. It specifies
25735 that MinGW-specific thread support is to be used.
25737 @item -municode
25738 @opindex municode
25739 This option is available for MinGW-w64 targets.  It causes
25740 the @code{UNICODE} preprocessor macro to be predefined, and
25741 chooses Unicode-capable runtime startup code.
25743 @item -mwin32
25744 @opindex mwin32
25745 This option is available for Cygwin and MinGW targets.  It
25746 specifies that the typical Microsoft Windows predefined macros are to
25747 be set in the pre-processor, but does not influence the choice
25748 of runtime library/startup code.
25750 @item -mwindows
25751 @opindex mwindows
25752 This option is available for Cygwin and MinGW targets.  It
25753 specifies that a GUI application is to be generated by
25754 instructing the linker to set the PE header subsystem type
25755 appropriately.
25757 @item -fno-set-stack-executable
25758 @opindex fno-set-stack-executable
25759 This option is available for MinGW targets. It specifies that
25760 the executable flag for the stack used by nested functions isn't
25761 set. This is necessary for binaries running in kernel mode of
25762 Microsoft Windows, as there the User32 API, which is used to set executable
25763 privileges, isn't available.
25765 @item -fwritable-relocated-rdata
25766 @opindex fno-writable-relocated-rdata
25767 This option is available for MinGW and Cygwin targets.  It specifies
25768 that relocated-data in read-only section is put into the @code{.data}
25769 section.  This is a necessary for older runtimes not supporting
25770 modification of @code{.rdata} sections for pseudo-relocation.
25772 @item -mpe-aligned-commons
25773 @opindex mpe-aligned-commons
25774 This option is available for Cygwin and MinGW targets.  It
25775 specifies that the GNU extension to the PE file format that
25776 permits the correct alignment of COMMON variables should be
25777 used when generating code.  It is enabled by default if
25778 GCC detects that the target assembler found during configuration
25779 supports the feature.
25780 @end table
25782 See also under @ref{x86 Options} for standard options.
25784 @node Xstormy16 Options
25785 @subsection Xstormy16 Options
25786 @cindex Xstormy16 Options
25788 These options are defined for Xstormy16:
25790 @table @gcctabopt
25791 @item -msim
25792 @opindex msim
25793 Choose startup files and linker script suitable for the simulator.
25794 @end table
25796 @node Xtensa Options
25797 @subsection Xtensa Options
25798 @cindex Xtensa Options
25800 These options are supported for Xtensa targets:
25802 @table @gcctabopt
25803 @item -mconst16
25804 @itemx -mno-const16
25805 @opindex mconst16
25806 @opindex mno-const16
25807 Enable or disable use of @code{CONST16} instructions for loading
25808 constant values.  The @code{CONST16} instruction is currently not a
25809 standard option from Tensilica.  When enabled, @code{CONST16}
25810 instructions are always used in place of the standard @code{L32R}
25811 instructions.  The use of @code{CONST16} is enabled by default only if
25812 the @code{L32R} instruction is not available.
25814 @item -mfused-madd
25815 @itemx -mno-fused-madd
25816 @opindex mfused-madd
25817 @opindex mno-fused-madd
25818 Enable or disable use of fused multiply/add and multiply/subtract
25819 instructions in the floating-point option.  This has no effect if the
25820 floating-point option is not also enabled.  Disabling fused multiply/add
25821 and multiply/subtract instructions forces the compiler to use separate
25822 instructions for the multiply and add/subtract operations.  This may be
25823 desirable in some cases where strict IEEE 754-compliant results are
25824 required: the fused multiply add/subtract instructions do not round the
25825 intermediate result, thereby producing results with @emph{more} bits of
25826 precision than specified by the IEEE standard.  Disabling fused multiply
25827 add/subtract instructions also ensures that the program output is not
25828 sensitive to the compiler's ability to combine multiply and add/subtract
25829 operations.
25831 @item -mserialize-volatile
25832 @itemx -mno-serialize-volatile
25833 @opindex mserialize-volatile
25834 @opindex mno-serialize-volatile
25835 When this option is enabled, GCC inserts @code{MEMW} instructions before
25836 @code{volatile} memory references to guarantee sequential consistency.
25837 The default is @option{-mserialize-volatile}.  Use
25838 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
25840 @item -mforce-no-pic
25841 @opindex mforce-no-pic
25842 For targets, like GNU/Linux, where all user-mode Xtensa code must be
25843 position-independent code (PIC), this option disables PIC for compiling
25844 kernel code.
25846 @item -mtext-section-literals
25847 @itemx -mno-text-section-literals
25848 @opindex mtext-section-literals
25849 @opindex mno-text-section-literals
25850 These options control the treatment of literal pools.  The default is
25851 @option{-mno-text-section-literals}, which places literals in a separate
25852 section in the output file.  This allows the literal pool to be placed
25853 in a data RAM/ROM, and it also allows the linker to combine literal
25854 pools from separate object files to remove redundant literals and
25855 improve code size.  With @option{-mtext-section-literals}, the literals
25856 are interspersed in the text section in order to keep them as close as
25857 possible to their references.  This may be necessary for large assembly
25858 files.  Literals for each function are placed right before that function.
25860 @item -mauto-litpools
25861 @itemx -mno-auto-litpools
25862 @opindex mauto-litpools
25863 @opindex mno-auto-litpools
25864 These options control the treatment of literal pools.  The default is
25865 @option{-mno-auto-litpools}, which places literals in a separate
25866 section in the output file unless @option{-mtext-section-literals} is
25867 used.  With @option{-mauto-litpools} the literals are interspersed in
25868 the text section by the assembler.  Compiler does not produce explicit
25869 @code{.literal} directives and loads literals into registers with
25870 @code{MOVI} instructions instead of @code{L32R} to let the assembler
25871 do relaxation and place literals as necessary.  This option allows
25872 assembler to create several literal pools per function and assemble
25873 very big functions, which may not be possible with
25874 @option{-mtext-section-literals}.
25876 @item -mtarget-align
25877 @itemx -mno-target-align
25878 @opindex mtarget-align
25879 @opindex mno-target-align
25880 When this option is enabled, GCC instructs the assembler to
25881 automatically align instructions to reduce branch penalties at the
25882 expense of some code density.  The assembler attempts to widen density
25883 instructions to align branch targets and the instructions following call
25884 instructions.  If there are not enough preceding safe density
25885 instructions to align a target, no widening is performed.  The
25886 default is @option{-mtarget-align}.  These options do not affect the
25887 treatment of auto-aligned instructions like @code{LOOP}, which the
25888 assembler always aligns, either by widening density instructions or
25889 by inserting NOP instructions.
25891 @item -mlongcalls
25892 @itemx -mno-longcalls
25893 @opindex mlongcalls
25894 @opindex mno-longcalls
25895 When this option is enabled, GCC instructs the assembler to translate
25896 direct calls to indirect calls unless it can determine that the target
25897 of a direct call is in the range allowed by the call instruction.  This
25898 translation typically occurs for calls to functions in other source
25899 files.  Specifically, the assembler translates a direct @code{CALL}
25900 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
25901 The default is @option{-mno-longcalls}.  This option should be used in
25902 programs where the call target can potentially be out of range.  This
25903 option is implemented in the assembler, not the compiler, so the
25904 assembly code generated by GCC still shows direct call
25905 instructions---look at the disassembled object code to see the actual
25906 instructions.  Note that the assembler uses an indirect call for
25907 every cross-file call, not just those that really are out of range.
25908 @end table
25910 @node zSeries Options
25911 @subsection zSeries Options
25912 @cindex zSeries options
25914 These are listed under @xref{S/390 and zSeries Options}.
25917 @c man end
25919 @node Spec Files
25920 @section Specifying Subprocesses and the Switches to Pass to Them
25921 @cindex Spec Files
25923 @command{gcc} is a driver program.  It performs its job by invoking a
25924 sequence of other programs to do the work of compiling, assembling and
25925 linking.  GCC interprets its command-line parameters and uses these to
25926 deduce which programs it should invoke, and which command-line options
25927 it ought to place on their command lines.  This behavior is controlled
25928 by @dfn{spec strings}.  In most cases there is one spec string for each
25929 program that GCC can invoke, but a few programs have multiple spec
25930 strings to control their behavior.  The spec strings built into GCC can
25931 be overridden by using the @option{-specs=} command-line switch to specify
25932 a spec file.
25934 @dfn{Spec files} are plain-text files that are used to construct spec
25935 strings.  They consist of a sequence of directives separated by blank
25936 lines.  The type of directive is determined by the first non-whitespace
25937 character on the line, which can be one of the following:
25939 @table @code
25940 @item %@var{command}
25941 Issues a @var{command} to the spec file processor.  The commands that can
25942 appear here are:
25944 @table @code
25945 @item %include <@var{file}>
25946 @cindex @code{%include}
25947 Search for @var{file} and insert its text at the current point in the
25948 specs file.
25950 @item %include_noerr <@var{file}>
25951 @cindex @code{%include_noerr}
25952 Just like @samp{%include}, but do not generate an error message if the include
25953 file cannot be found.
25955 @item %rename @var{old_name} @var{new_name}
25956 @cindex @code{%rename}
25957 Rename the spec string @var{old_name} to @var{new_name}.
25959 @end table
25961 @item *[@var{spec_name}]:
25962 This tells the compiler to create, override or delete the named spec
25963 string.  All lines after this directive up to the next directive or
25964 blank line are considered to be the text for the spec string.  If this
25965 results in an empty string then the spec is deleted.  (Or, if the
25966 spec did not exist, then nothing happens.)  Otherwise, if the spec
25967 does not currently exist a new spec is created.  If the spec does
25968 exist then its contents are overridden by the text of this
25969 directive, unless the first character of that text is the @samp{+}
25970 character, in which case the text is appended to the spec.
25972 @item [@var{suffix}]:
25973 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
25974 and up to the next directive or blank line are considered to make up the
25975 spec string for the indicated suffix.  When the compiler encounters an
25976 input file with the named suffix, it processes the spec string in
25977 order to work out how to compile that file.  For example:
25979 @smallexample
25980 .ZZ:
25981 z-compile -input %i
25982 @end smallexample
25984 This says that any input file whose name ends in @samp{.ZZ} should be
25985 passed to the program @samp{z-compile}, which should be invoked with the
25986 command-line switch @option{-input} and with the result of performing the
25987 @samp{%i} substitution.  (See below.)
25989 As an alternative to providing a spec string, the text following a
25990 suffix directive can be one of the following:
25992 @table @code
25993 @item @@@var{language}
25994 This says that the suffix is an alias for a known @var{language}.  This is
25995 similar to using the @option{-x} command-line switch to GCC to specify a
25996 language explicitly.  For example:
25998 @smallexample
25999 .ZZ:
26000 @@c++
26001 @end smallexample
26003 Says that .ZZ files are, in fact, C++ source files.
26005 @item #@var{name}
26006 This causes an error messages saying:
26008 @smallexample
26009 @var{name} compiler not installed on this system.
26010 @end smallexample
26011 @end table
26013 GCC already has an extensive list of suffixes built into it.
26014 This directive adds an entry to the end of the list of suffixes, but
26015 since the list is searched from the end backwards, it is effectively
26016 possible to override earlier entries using this technique.
26018 @end table
26020 GCC has the following spec strings built into it.  Spec files can
26021 override these strings or create their own.  Note that individual
26022 targets can also add their own spec strings to this list.
26024 @smallexample
26025 asm          Options to pass to the assembler
26026 asm_final    Options to pass to the assembler post-processor
26027 cpp          Options to pass to the C preprocessor
26028 cc1          Options to pass to the C compiler
26029 cc1plus      Options to pass to the C++ compiler
26030 endfile      Object files to include at the end of the link
26031 link         Options to pass to the linker
26032 lib          Libraries to include on the command line to the linker
26033 libgcc       Decides which GCC support library to pass to the linker
26034 linker       Sets the name of the linker
26035 predefines   Defines to be passed to the C preprocessor
26036 signed_char  Defines to pass to CPP to say whether @code{char} is signed
26037              by default
26038 startfile    Object files to include at the start of the link
26039 @end smallexample
26041 Here is a small example of a spec file:
26043 @smallexample
26044 %rename lib                 old_lib
26046 *lib:
26047 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
26048 @end smallexample
26050 This example renames the spec called @samp{lib} to @samp{old_lib} and
26051 then overrides the previous definition of @samp{lib} with a new one.
26052 The new definition adds in some extra command-line options before
26053 including the text of the old definition.
26055 @dfn{Spec strings} are a list of command-line options to be passed to their
26056 corresponding program.  In addition, the spec strings can contain
26057 @samp{%}-prefixed sequences to substitute variable text or to
26058 conditionally insert text into the command line.  Using these constructs
26059 it is possible to generate quite complex command lines.
26061 Here is a table of all defined @samp{%}-sequences for spec
26062 strings.  Note that spaces are not generated automatically around the
26063 results of expanding these sequences.  Therefore you can concatenate them
26064 together or combine them with constant text in a single argument.
26066 @table @code
26067 @item %%
26068 Substitute one @samp{%} into the program name or argument.
26070 @item %i
26071 Substitute the name of the input file being processed.
26073 @item %b
26074 Substitute the basename of the input file being processed.
26075 This is the substring up to (and not including) the last period
26076 and not including the directory.
26078 @item %B
26079 This is the same as @samp{%b}, but include the file suffix (text after
26080 the last period).
26082 @item %d
26083 Marks the argument containing or following the @samp{%d} as a
26084 temporary file name, so that that file is deleted if GCC exits
26085 successfully.  Unlike @samp{%g}, this contributes no text to the
26086 argument.
26088 @item %g@var{suffix}
26089 Substitute a file name that has suffix @var{suffix} and is chosen
26090 once per compilation, and mark the argument in the same way as
26091 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
26092 name is now chosen in a way that is hard to predict even when previously
26093 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
26094 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
26095 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
26096 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
26097 was simply substituted with a file name chosen once per compilation,
26098 without regard to any appended suffix (which was therefore treated
26099 just like ordinary text), making such attacks more likely to succeed.
26101 @item %u@var{suffix}
26102 Like @samp{%g}, but generates a new temporary file name
26103 each time it appears instead of once per compilation.
26105 @item %U@var{suffix}
26106 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
26107 new one if there is no such last file name.  In the absence of any
26108 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
26109 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
26110 involves the generation of two distinct file names, one
26111 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
26112 simply substituted with a file name chosen for the previous @samp{%u},
26113 without regard to any appended suffix.
26115 @item %j@var{suffix}
26116 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
26117 writable, and if @option{-save-temps} is not used; 
26118 otherwise, substitute the name
26119 of a temporary file, just like @samp{%u}.  This temporary file is not
26120 meant for communication between processes, but rather as a junk
26121 disposal mechanism.
26123 @item %|@var{suffix}
26124 @itemx %m@var{suffix}
26125 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
26126 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
26127 all.  These are the two most common ways to instruct a program that it
26128 should read from standard input or write to standard output.  If you
26129 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
26130 construct: see for example @file{f/lang-specs.h}.
26132 @item %.@var{SUFFIX}
26133 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
26134 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
26135 terminated by the next space or %.
26137 @item %w
26138 Marks the argument containing or following the @samp{%w} as the
26139 designated output file of this compilation.  This puts the argument
26140 into the sequence of arguments that @samp{%o} substitutes.
26142 @item %o
26143 Substitutes the names of all the output files, with spaces
26144 automatically placed around them.  You should write spaces
26145 around the @samp{%o} as well or the results are undefined.
26146 @samp{%o} is for use in the specs for running the linker.
26147 Input files whose names have no recognized suffix are not compiled
26148 at all, but they are included among the output files, so they are
26149 linked.
26151 @item %O
26152 Substitutes the suffix for object files.  Note that this is
26153 handled specially when it immediately follows @samp{%g, %u, or %U},
26154 because of the need for those to form complete file names.  The
26155 handling is such that @samp{%O} is treated exactly as if it had already
26156 been substituted, except that @samp{%g, %u, and %U} do not currently
26157 support additional @var{suffix} characters following @samp{%O} as they do
26158 following, for example, @samp{.o}.
26160 @item %p
26161 Substitutes the standard macro predefinitions for the
26162 current target machine.  Use this when running @command{cpp}.
26164 @item %P
26165 Like @samp{%p}, but puts @samp{__} before and after the name of each
26166 predefined macro, except for macros that start with @samp{__} or with
26167 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
26170 @item %I
26171 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
26172 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
26173 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
26174 and @option{-imultilib} as necessary.
26176 @item %s
26177 Current argument is the name of a library or startup file of some sort.
26178 Search for that file in a standard list of directories and substitute
26179 the full name found.  The current working directory is included in the
26180 list of directories scanned.
26182 @item %T
26183 Current argument is the name of a linker script.  Search for that file
26184 in the current list of directories to scan for libraries. If the file
26185 is located insert a @option{--script} option into the command line
26186 followed by the full path name found.  If the file is not found then
26187 generate an error message.  Note: the current working directory is not
26188 searched.
26190 @item %e@var{str}
26191 Print @var{str} as an error message.  @var{str} is terminated by a newline.
26192 Use this when inconsistent options are detected.
26194 @item %(@var{name})
26195 Substitute the contents of spec string @var{name} at this point.
26197 @item %x@{@var{option}@}
26198 Accumulate an option for @samp{%X}.
26200 @item %X
26201 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
26202 spec string.
26204 @item %Y
26205 Output the accumulated assembler options specified by @option{-Wa}.
26207 @item %Z
26208 Output the accumulated preprocessor options specified by @option{-Wp}.
26210 @item %a
26211 Process the @code{asm} spec.  This is used to compute the
26212 switches to be passed to the assembler.
26214 @item %A
26215 Process the @code{asm_final} spec.  This is a spec string for
26216 passing switches to an assembler post-processor, if such a program is
26217 needed.
26219 @item %l
26220 Process the @code{link} spec.  This is the spec for computing the
26221 command line passed to the linker.  Typically it makes use of the
26222 @samp{%L %G %S %D and %E} sequences.
26224 @item %D
26225 Dump out a @option{-L} option for each directory that GCC believes might
26226 contain startup files.  If the target supports multilibs then the
26227 current multilib directory is prepended to each of these paths.
26229 @item %L
26230 Process the @code{lib} spec.  This is a spec string for deciding which
26231 libraries are included on the command line to the linker.
26233 @item %G
26234 Process the @code{libgcc} spec.  This is a spec string for deciding
26235 which GCC support library is included on the command line to the linker.
26237 @item %S
26238 Process the @code{startfile} spec.  This is a spec for deciding which
26239 object files are the first ones passed to the linker.  Typically
26240 this might be a file named @file{crt0.o}.
26242 @item %E
26243 Process the @code{endfile} spec.  This is a spec string that specifies
26244 the last object files that are passed to the linker.
26246 @item %C
26247 Process the @code{cpp} spec.  This is used to construct the arguments
26248 to be passed to the C preprocessor.
26250 @item %1
26251 Process the @code{cc1} spec.  This is used to construct the options to be
26252 passed to the actual C compiler (@command{cc1}).
26254 @item %2
26255 Process the @code{cc1plus} spec.  This is used to construct the options to be
26256 passed to the actual C++ compiler (@command{cc1plus}).
26258 @item %*
26259 Substitute the variable part of a matched option.  See below.
26260 Note that each comma in the substituted string is replaced by
26261 a single space.
26263 @item %<@code{S}
26264 Remove all occurrences of @code{-S} from the command line.  Note---this
26265 command is position dependent.  @samp{%} commands in the spec string
26266 before this one see @code{-S}, @samp{%} commands in the spec string
26267 after this one do not.
26269 @item %:@var{function}(@var{args})
26270 Call the named function @var{function}, passing it @var{args}.
26271 @var{args} is first processed as a nested spec string, then split
26272 into an argument vector in the usual fashion.  The function returns
26273 a string which is processed as if it had appeared literally as part
26274 of the current spec.
26276 The following built-in spec functions are provided:
26278 @table @code
26279 @item @code{getenv}
26280 The @code{getenv} spec function takes two arguments: an environment
26281 variable name and a string.  If the environment variable is not
26282 defined, a fatal error is issued.  Otherwise, the return value is the
26283 value of the environment variable concatenated with the string.  For
26284 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
26286 @smallexample
26287 %:getenv(TOPDIR /include)
26288 @end smallexample
26290 expands to @file{/path/to/top/include}.
26292 @item @code{if-exists}
26293 The @code{if-exists} spec function takes one argument, an absolute
26294 pathname to a file.  If the file exists, @code{if-exists} returns the
26295 pathname.  Here is a small example of its usage:
26297 @smallexample
26298 *startfile:
26299 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
26300 @end smallexample
26302 @item @code{if-exists-else}
26303 The @code{if-exists-else} spec function is similar to the @code{if-exists}
26304 spec function, except that it takes two arguments.  The first argument is
26305 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
26306 returns the pathname.  If it does not exist, it returns the second argument.
26307 This way, @code{if-exists-else} can be used to select one file or another,
26308 based on the existence of the first.  Here is a small example of its usage:
26310 @smallexample
26311 *startfile:
26312 crt0%O%s %:if-exists(crti%O%s) \
26313 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
26314 @end smallexample
26316 @item @code{replace-outfile}
26317 The @code{replace-outfile} spec function takes two arguments.  It looks for the
26318 first argument in the outfiles array and replaces it with the second argument.  Here
26319 is a small example of its usage:
26321 @smallexample
26322 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
26323 @end smallexample
26325 @item @code{remove-outfile}
26326 The @code{remove-outfile} spec function takes one argument.  It looks for the
26327 first argument in the outfiles array and removes it.  Here is a small example
26328 its usage:
26330 @smallexample
26331 %:remove-outfile(-lm)
26332 @end smallexample
26334 @item @code{pass-through-libs}
26335 The @code{pass-through-libs} spec function takes any number of arguments.  It
26336 finds any @option{-l} options and any non-options ending in @file{.a} (which it
26337 assumes are the names of linker input library archive files) and returns a
26338 result containing all the found arguments each prepended by
26339 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
26340 intended to be passed to the LTO linker plugin.
26342 @smallexample
26343 %:pass-through-libs(%G %L %G)
26344 @end smallexample
26346 @item @code{print-asm-header}
26347 The @code{print-asm-header} function takes no arguments and simply
26348 prints a banner like:
26350 @smallexample
26351 Assembler options
26352 =================
26354 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
26355 @end smallexample
26357 It is used to separate compiler options from assembler options
26358 in the @option{--target-help} output.
26359 @end table
26361 @item %@{@code{S}@}
26362 Substitutes the @code{-S} switch, if that switch is given to GCC@.
26363 If that switch is not specified, this substitutes nothing.  Note that
26364 the leading dash is omitted when specifying this option, and it is
26365 automatically inserted if the substitution is performed.  Thus the spec
26366 string @samp{%@{foo@}} matches the command-line option @option{-foo}
26367 and outputs the command-line option @option{-foo}.
26369 @item %W@{@code{S}@}
26370 Like %@{@code{S}@} but mark last argument supplied within as a file to be
26371 deleted on failure.
26373 @item %@{@code{S}*@}
26374 Substitutes all the switches specified to GCC whose names start
26375 with @code{-S}, but which also take an argument.  This is used for
26376 switches like @option{-o}, @option{-D}, @option{-I}, etc.
26377 GCC considers @option{-o foo} as being
26378 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
26379 text, including the space.  Thus two arguments are generated.
26381 @item %@{@code{S}*&@code{T}*@}
26382 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
26383 (the order of @code{S} and @code{T} in the spec is not significant).
26384 There can be any number of ampersand-separated variables; for each the
26385 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
26387 @item %@{@code{S}:@code{X}@}
26388 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
26390 @item %@{!@code{S}:@code{X}@}
26391 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
26393 @item %@{@code{S}*:@code{X}@}
26394 Substitutes @code{X} if one or more switches whose names start with
26395 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
26396 once, no matter how many such switches appeared.  However, if @code{%*}
26397 appears somewhere in @code{X}, then @code{X} is substituted once
26398 for each matching switch, with the @code{%*} replaced by the part of
26399 that switch matching the @code{*}.
26401 If @code{%*} appears as the last part of a spec sequence then a space
26402 is added after the end of the last substitution.  If there is more
26403 text in the sequence, however, then a space is not generated.  This
26404 allows the @code{%*} substitution to be used as part of a larger
26405 string.  For example, a spec string like this:
26407 @smallexample
26408 %@{mcu=*:--script=%*/memory.ld@}
26409 @end smallexample
26411 @noindent
26412 when matching an option like @option{-mcu=newchip} produces:
26414 @smallexample
26415 --script=newchip/memory.ld
26416 @end smallexample
26418 @item %@{.@code{S}:@code{X}@}
26419 Substitutes @code{X}, if processing a file with suffix @code{S}.
26421 @item %@{!.@code{S}:@code{X}@}
26422 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
26424 @item %@{,@code{S}:@code{X}@}
26425 Substitutes @code{X}, if processing a file for language @code{S}.
26427 @item %@{!,@code{S}:@code{X}@}
26428 Substitutes @code{X}, if not processing a file for language @code{S}.
26430 @item %@{@code{S}|@code{P}:@code{X}@}
26431 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
26432 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
26433 @code{*} sequences as well, although they have a stronger binding than
26434 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
26435 alternatives must be starred, and only the first matching alternative
26436 is substituted.
26438 For example, a spec string like this:
26440 @smallexample
26441 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
26442 @end smallexample
26444 @noindent
26445 outputs the following command-line options from the following input
26446 command-line options:
26448 @smallexample
26449 fred.c        -foo -baz
26450 jim.d         -bar -boggle
26451 -d fred.c     -foo -baz -boggle
26452 -d jim.d      -bar -baz -boggle
26453 @end smallexample
26455 @item %@{S:X; T:Y; :D@}
26457 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
26458 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
26459 be as many clauses as you need.  This may be combined with @code{.},
26460 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
26463 @end table
26465 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
26466 construct may contain other nested @samp{%} constructs or spaces, or
26467 even newlines.  They are processed as usual, as described above.
26468 Trailing white space in @code{X} is ignored.  White space may also
26469 appear anywhere on the left side of the colon in these constructs,
26470 except between @code{.} or @code{*} and the corresponding word.
26472 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
26473 handled specifically in these constructs.  If another value of
26474 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
26475 @option{-W} switch is found later in the command line, the earlier
26476 switch value is ignored, except with @{@code{S}*@} where @code{S} is
26477 just one letter, which passes all matching options.
26479 The character @samp{|} at the beginning of the predicate text is used to
26480 indicate that a command should be piped to the following command, but
26481 only if @option{-pipe} is specified.
26483 It is built into GCC which switches take arguments and which do not.
26484 (You might think it would be useful to generalize this to allow each
26485 compiler's spec to say which switches take arguments.  But this cannot
26486 be done in a consistent fashion.  GCC cannot even decide which input
26487 files have been specified without knowing which switches take arguments,
26488 and it must know which input files to compile in order to tell which
26489 compilers to run).
26491 GCC also knows implicitly that arguments starting in @option{-l} are to be
26492 treated as compiler output files, and passed to the linker in their
26493 proper position among the other output files.
26495 @node Environment Variables
26496 @section Environment Variables Affecting GCC
26497 @cindex environment variables
26499 @c man begin ENVIRONMENT
26500 This section describes several environment variables that affect how GCC
26501 operates.  Some of them work by specifying directories or prefixes to use
26502 when searching for various kinds of files.  Some are used to specify other
26503 aspects of the compilation environment.
26505 Note that you can also specify places to search using options such as
26506 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
26507 take precedence over places specified using environment variables, which
26508 in turn take precedence over those specified by the configuration of GCC@.
26509 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
26510 GNU Compiler Collection (GCC) Internals}.
26512 @table @env
26513 @item LANG
26514 @itemx LC_CTYPE
26515 @c @itemx LC_COLLATE
26516 @itemx LC_MESSAGES
26517 @c @itemx LC_MONETARY
26518 @c @itemx LC_NUMERIC
26519 @c @itemx LC_TIME
26520 @itemx LC_ALL
26521 @findex LANG
26522 @findex LC_CTYPE
26523 @c @findex LC_COLLATE
26524 @findex LC_MESSAGES
26525 @c @findex LC_MONETARY
26526 @c @findex LC_NUMERIC
26527 @c @findex LC_TIME
26528 @findex LC_ALL
26529 @cindex locale
26530 These environment variables control the way that GCC uses
26531 localization information which allows GCC to work with different
26532 national conventions.  GCC inspects the locale categories
26533 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
26534 so.  These locale categories can be set to any value supported by your
26535 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
26536 Kingdom encoded in UTF-8.
26538 The @env{LC_CTYPE} environment variable specifies character
26539 classification.  GCC uses it to determine the character boundaries in
26540 a string; this is needed for some multibyte encodings that contain quote
26541 and escape characters that are otherwise interpreted as a string
26542 end or escape.
26544 The @env{LC_MESSAGES} environment variable specifies the language to
26545 use in diagnostic messages.
26547 If the @env{LC_ALL} environment variable is set, it overrides the value
26548 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
26549 and @env{LC_MESSAGES} default to the value of the @env{LANG}
26550 environment variable.  If none of these variables are set, GCC
26551 defaults to traditional C English behavior.
26553 @item TMPDIR
26554 @findex TMPDIR
26555 If @env{TMPDIR} is set, it specifies the directory to use for temporary
26556 files.  GCC uses temporary files to hold the output of one stage of
26557 compilation which is to be used as input to the next stage: for example,
26558 the output of the preprocessor, which is the input to the compiler
26559 proper.
26561 @item GCC_COMPARE_DEBUG
26562 @findex GCC_COMPARE_DEBUG
26563 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
26564 @option{-fcompare-debug} to the compiler driver.  See the documentation
26565 of this option for more details.
26567 @item GCC_EXEC_PREFIX
26568 @findex GCC_EXEC_PREFIX
26569 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
26570 names of the subprograms executed by the compiler.  No slash is added
26571 when this prefix is combined with the name of a subprogram, but you can
26572 specify a prefix that ends with a slash if you wish.
26574 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
26575 an appropriate prefix to use based on the pathname it is invoked with.
26577 If GCC cannot find the subprogram using the specified prefix, it
26578 tries looking in the usual places for the subprogram.
26580 The default value of @env{GCC_EXEC_PREFIX} is
26581 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
26582 the installed compiler. In many cases @var{prefix} is the value
26583 of @code{prefix} when you ran the @file{configure} script.
26585 Other prefixes specified with @option{-B} take precedence over this prefix.
26587 This prefix is also used for finding files such as @file{crt0.o} that are
26588 used for linking.
26590 In addition, the prefix is used in an unusual way in finding the
26591 directories to search for header files.  For each of the standard
26592 directories whose name normally begins with @samp{/usr/local/lib/gcc}
26593 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
26594 replacing that beginning with the specified prefix to produce an
26595 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
26596 @file{foo/bar} just before it searches the standard directory 
26597 @file{/usr/local/lib/bar}.
26598 If a standard directory begins with the configured
26599 @var{prefix} then the value of @var{prefix} is replaced by
26600 @env{GCC_EXEC_PREFIX} when looking for header files.
26602 @item COMPILER_PATH
26603 @findex COMPILER_PATH
26604 The value of @env{COMPILER_PATH} is a colon-separated list of
26605 directories, much like @env{PATH}.  GCC tries the directories thus
26606 specified when searching for subprograms, if it cannot find the
26607 subprograms using @env{GCC_EXEC_PREFIX}.
26609 @item LIBRARY_PATH
26610 @findex LIBRARY_PATH
26611 The value of @env{LIBRARY_PATH} is a colon-separated list of
26612 directories, much like @env{PATH}.  When configured as a native compiler,
26613 GCC tries the directories thus specified when searching for special
26614 linker files, if it cannot find them using @env{GCC_EXEC_PREFIX}.  Linking
26615 using GCC also uses these directories when searching for ordinary
26616 libraries for the @option{-l} option (but directories specified with
26617 @option{-L} come first).
26619 @item LANG
26620 @findex LANG
26621 @cindex locale definition
26622 This variable is used to pass locale information to the compiler.  One way in
26623 which this information is used is to determine the character set to be used
26624 when character literals, string literals and comments are parsed in C and C++.
26625 When the compiler is configured to allow multibyte characters,
26626 the following values for @env{LANG} are recognized:
26628 @table @samp
26629 @item C-JIS
26630 Recognize JIS characters.
26631 @item C-SJIS
26632 Recognize SJIS characters.
26633 @item C-EUCJP
26634 Recognize EUCJP characters.
26635 @end table
26637 If @env{LANG} is not defined, or if it has some other value, then the
26638 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
26639 recognize and translate multibyte characters.
26640 @end table
26642 @noindent
26643 Some additional environment variables affect the behavior of the
26644 preprocessor.
26646 @include cppenv.texi
26648 @c man end
26650 @node Precompiled Headers
26651 @section Using Precompiled Headers
26652 @cindex precompiled headers
26653 @cindex speed of compilation
26655 Often large projects have many header files that are included in every
26656 source file.  The time the compiler takes to process these header files
26657 over and over again can account for nearly all of the time required to
26658 build the project.  To make builds faster, GCC allows you to
26659 @dfn{precompile} a header file.
26661 To create a precompiled header file, simply compile it as you would any
26662 other file, if necessary using the @option{-x} option to make the driver
26663 treat it as a C or C++ header file.  You may want to use a
26664 tool like @command{make} to keep the precompiled header up-to-date when
26665 the headers it contains change.
26667 A precompiled header file is searched for when @code{#include} is
26668 seen in the compilation.  As it searches for the included file
26669 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
26670 compiler looks for a precompiled header in each directory just before it
26671 looks for the include file in that directory.  The name searched for is
26672 the name specified in the @code{#include} with @samp{.gch} appended.  If
26673 the precompiled header file cannot be used, it is ignored.
26675 For instance, if you have @code{#include "all.h"}, and you have
26676 @file{all.h.gch} in the same directory as @file{all.h}, then the
26677 precompiled header file is used if possible, and the original
26678 header is used otherwise.
26680 Alternatively, you might decide to put the precompiled header file in a
26681 directory and use @option{-I} to ensure that directory is searched
26682 before (or instead of) the directory containing the original header.
26683 Then, if you want to check that the precompiled header file is always
26684 used, you can put a file of the same name as the original header in this
26685 directory containing an @code{#error} command.
26687 This also works with @option{-include}.  So yet another way to use
26688 precompiled headers, good for projects not designed with precompiled
26689 header files in mind, is to simply take most of the header files used by
26690 a project, include them from another header file, precompile that header
26691 file, and @option{-include} the precompiled header.  If the header files
26692 have guards against multiple inclusion, they are skipped because
26693 they've already been included (in the precompiled header).
26695 If you need to precompile the same header file for different
26696 languages, targets, or compiler options, you can instead make a
26697 @emph{directory} named like @file{all.h.gch}, and put each precompiled
26698 header in the directory, perhaps using @option{-o}.  It doesn't matter
26699 what you call the files in the directory; every precompiled header in
26700 the directory is considered.  The first precompiled header
26701 encountered in the directory that is valid for this compilation is
26702 used; they're searched in no particular order.
26704 There are many other possibilities, limited only by your imagination,
26705 good sense, and the constraints of your build system.
26707 A precompiled header file can be used only when these conditions apply:
26709 @itemize
26710 @item
26711 Only one precompiled header can be used in a particular compilation.
26713 @item
26714 A precompiled header cannot be used once the first C token is seen.  You
26715 can have preprocessor directives before a precompiled header; you cannot
26716 include a precompiled header from inside another header.
26718 @item
26719 The precompiled header file must be produced for the same language as
26720 the current compilation.  You cannot use a C precompiled header for a C++
26721 compilation.
26723 @item
26724 The precompiled header file must have been produced by the same compiler
26725 binary as the current compilation is using.
26727 @item
26728 Any macros defined before the precompiled header is included must
26729 either be defined in the same way as when the precompiled header was
26730 generated, or must not affect the precompiled header, which usually
26731 means that they don't appear in the precompiled header at all.
26733 The @option{-D} option is one way to define a macro before a
26734 precompiled header is included; using a @code{#define} can also do it.
26735 There are also some options that define macros implicitly, like
26736 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
26737 defined this way.
26739 @item If debugging information is output when using the precompiled
26740 header, using @option{-g} or similar, the same kind of debugging information
26741 must have been output when building the precompiled header.  However,
26742 a precompiled header built using @option{-g} can be used in a compilation
26743 when no debugging information is being output.
26745 @item The same @option{-m} options must generally be used when building
26746 and using the precompiled header.  @xref{Submodel Options},
26747 for any cases where this rule is relaxed.
26749 @item Each of the following options must be the same when building and using
26750 the precompiled header:
26752 @gccoptlist{-fexceptions}
26754 @item
26755 Some other command-line options starting with @option{-f},
26756 @option{-p}, or @option{-O} must be defined in the same way as when
26757 the precompiled header was generated.  At present, it's not clear
26758 which options are safe to change and which are not; the safest choice
26759 is to use exactly the same options when generating and using the
26760 precompiled header.  The following are known to be safe:
26762 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
26763 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
26764 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
26765 -pedantic-errors}
26767 @end itemize
26769 For all of these except the last, the compiler automatically
26770 ignores the precompiled header if the conditions aren't met.  If you
26771 find an option combination that doesn't work and doesn't cause the
26772 precompiled header to be ignored, please consider filing a bug report,
26773 see @ref{Bugs}.
26775 If you do use differing options when generating and using the
26776 precompiled header, the actual behavior is a mixture of the
26777 behavior for the options.  For instance, if you use @option{-g} to
26778 generate the precompiled header but not when using it, you may or may
26779 not get debugging information for routines in the precompiled header.