[ARM] Add initial support for Cortex-A73
[official-gcc.git] / gcc / doc / invoke.texi
blobfdb65f025a1aa626da771a8b58651c7541385fe2
1 @c Copyright (C) 1988-2016 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-2016 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 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
182 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
183 -fhosted  -ffreestanding -fopenacc -fopenmp -fopenmp-simd @gol
184 -fms-extensions -fplan9-extensions -fsso-struct=@var{endianness}
185 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
186 -fsigned-bitfields  -fsigned-char @gol
187 -funsigned-bitfields  -funsigned-char @gol
188 -trigraphs -traditional -traditional-cpp}
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 -fargs-in-order=@var{n} -fcheck-new @gol
194 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
195 -fno-elide-constructors @gol
196 -fno-enforce-eh-specs @gol
197 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
198 -fno-implicit-templates @gol
199 -fno-implicit-inline-templates @gol
200 -fno-implement-inlines  -fms-extensions @gol
201 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
202 -fno-optional-diags  -fpermissive @gol
203 -fno-pretty-templates @gol
204 -frepo  -fno-rtti -fsized-deallocation @gol
205 -ftemplate-backtrace-limit=@var{n} @gol
206 -ftemplate-depth=@var{n} @gol
207 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
208 -fno-weak  -nostdinc++ @gol
209 -fvisibility-inlines-hidden @gol
210 -fvisibility-ms-compat @gol
211 -fext-numeric-literals @gol
212 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
213 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol
214 -Wnamespaces -Wnarrowing @gol
215 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
216 -Weffc++  -Wstrict-null-sentinel -Wtemplates @gol
217 -Wno-non-template-friend  -Wold-style-cast @gol
218 -Woverloaded-virtual  -Wno-pmf-conversions @gol
219 -Wsign-promo -Wvirtual-inheritance}
221 @item Objective-C and Objective-C++ Language Options
222 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
223 Objective-C and Objective-C++ Dialects}.
224 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
225 -fgnu-runtime  -fnext-runtime @gol
226 -fno-nil-receivers @gol
227 -fobjc-abi-version=@var{n} @gol
228 -fobjc-call-cxx-cdtors @gol
229 -fobjc-direct-dispatch @gol
230 -fobjc-exceptions @gol
231 -fobjc-gc @gol
232 -fobjc-nilcheck @gol
233 -fobjc-std=objc1 @gol
234 -fno-local-ivars @gol
235 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
236 -freplace-objc-classes @gol
237 -fzero-link @gol
238 -gen-decls @gol
239 -Wassign-intercept @gol
240 -Wno-protocol  -Wselector @gol
241 -Wstrict-selector-match @gol
242 -Wundeclared-selector}
244 @item Diagnostic Message Formatting Options
245 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
246 @gccoptlist{-fmessage-length=@var{n}  @gol
247 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
248 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
249 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
251 @item Warning Options
252 @xref{Warning Options,,Options to Request or Suppress Warnings}.
253 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
254 -pedantic-errors @gol
255 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
256 -Wno-aggressive-loop-optimizations -Warray-bounds -Warray-bounds=@var{n} @gol
257 -Wno-attributes -Wbool-compare -Wno-builtin-macro-redefined @gol
258 -Wc90-c99-compat -Wc99-c11-compat @gol
259 -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align  -Wcast-qual  @gol
260 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
261 -Wconversion -Wcoverage-mismatch -Wno-cpp -Wdangling-else -Wdate-time @gol
262 -Wdelete-incomplete @gol
263 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
264 -Wdisabled-optimization @gol
265 -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
266 -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol
267 -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
268 -Werror  -Werror=* -Wfatal-errors -Wfloat-equal  -Wformat  -Wformat=2 @gol
269 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
270 -Wformat-security  -Wformat-signedness  -Wformat-y2k -Wframe-address @gol
271 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
272 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
273 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
274 -Winit-self  -Winline  -Wno-int-conversion @gol
275 -Wno-int-to-pointer-cast -Winvalid-memory-model -Wno-invalid-offsetof @gol
276 -Winvalid-pch -Wlarger-than=@var{len} @gol
277 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
278 -Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args @gol
279 -Wmisleading-indentation -Wmissing-braces @gol
280 -Wmissing-field-initializers -Wmissing-include-dirs @gol
281 -Wno-multichar -Wnonnull -Wnonnull-compare @gol
282 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
283 -Wnull-dereference -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
284 -Woverride-init-side-effects -Woverlength-strings @gol
285 -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
286 -Wparentheses -Wno-pedantic-ms-format @gol
287 -Wplacement-new -Wplacement-new=@var{n} @gol
288 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
289 -Wno-pragmas -Wredundant-decls  -Wno-return-local-addr @gol
290 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
291 -Wshift-overflow -Wshift-overflow=@var{n} @gol
292 -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value @gol
293 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
294 -Wno-scalar-storage-order @gol
295 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
296 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
297 -Wstrict-aliasing=n -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
298 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
299 -Wsuggest-final-types @gol -Wsuggest-final-methods -Wsuggest-override @gol
300 -Wmissing-format-attribute -Wsubobject-linkage @gol
301 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
302 -Wswitch-unreachable  -Wsync-nand @gol
303 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
304 -Wtype-limits  -Wundef @gol
305 -Wuninitialized  -Wunknown-pragmas  -Wunsafe-loop-optimizations @gol
306 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
307 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
308 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
309 -Wunused-const-variable -Wunused-const-variable=@var{n} @gol
310 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
311 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
312 -Wvla -Wvolatile-register-var  -Wwrite-strings @gol
313 -Wzero-as-null-pointer-constant -Whsa}
315 @item C and Objective-C-only Warning Options
316 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
317 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
318 -Wold-style-declaration  -Wold-style-definition @gol
319 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
320 -Wdeclaration-after-statement -Wpointer-sign}
322 @item Debugging Options
323 @xref{Debugging Options,,Options for Debugging Your Program}.
324 @gccoptlist{-g  -g@var{level}  -gcoff  -gdwarf -gdwarf-@var{version} @gol
325 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
326 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
327 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
328 -fdebug-prefix-map=@var{old}=@var{new} -fdebug-types-section @gol
329 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
330 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
331 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
332 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
333 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
334 -fvar-tracking -fvar-tracking-assignments}
336 @item Optimization Options
337 @xref{Optimize Options,,Options that Control Optimization}.
338 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
339 -falign-jumps[=@var{n}] @gol
340 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
341 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
342 -fauto-inc-dec -fbranch-probabilities @gol
343 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
344 -fbtr-bb-exclusive -fcaller-saves @gol
345 -fcombine-stack-adjustments -fconserve-stack @gol
346 -fcompare-elim -fcprop-registers -fcrossjumping @gol
347 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
348 -fcx-limited-range @gol
349 -fdata-sections -fdce -fdelayed-branch @gol
350 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively @gol
351 -fdevirtualize-at-ltrans -fdse @gol
352 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
353 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
354 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
355 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
356 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
357 -fif-conversion2 -findirect-inlining @gol
358 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
359 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-cp-alignment @gol
360 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
361 -fira-algorithm=@var{algorithm} @gol
362 -fira-region=@var{region} -fira-hoist-pressure @gol
363 -fira-loop-pressure -fno-ira-share-save-slots @gol
364 -fno-ira-share-spill-slots @gol
365 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
366 -fivopts -fkeep-inline-functions -fkeep-static-functions @gol
367 -fkeep-static-consts -flive-range-shrinkage @gol
368 -floop-block -floop-interchange -floop-strip-mine @gol
369 -floop-unroll-and-jam -floop-nest-optimize @gol
370 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
371 -flto-partition=@var{alg} -fmerge-all-constants @gol
372 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
373 -fmove-loop-invariants -fno-branch-count-reg @gol
374 -fno-defer-pop -fno-fp-int-builtin-inexact -fno-function-cse @gol
375 -fno-guess-branch-probability -fno-inline -fno-math-errno -fno-peephole @gol
376 -fno-peephole2 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
377 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
378 -fomit-frame-pointer -foptimize-sibling-calls @gol
379 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
380 -fprefetch-loop-arrays @gol
381 -fprofile-correction @gol
382 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
383 -fprofile-reorder-functions @gol
384 -freciprocal-math -free -frename-registers -freorder-blocks @gol
385 -freorder-blocks-algorithm=@var{algorithm} @gol
386 -freorder-blocks-and-partition -freorder-functions @gol
387 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
388 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
389 -fsched-spec-load -fsched-spec-load-dangerous @gol
390 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
391 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
392 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
393 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
394 -fschedule-fusion @gol
395 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
396 -fselective-scheduling -fselective-scheduling2 @gol
397 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
398 -fsemantic-interposition -fshrink-wrap -fsignaling-nans @gol
399 -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
400 -fsplit-paths @gol
401 -fsplit-wide-types -fssa-backprop -fssa-phiopt @gol
402 -fstdarg-opt -fstrict-aliasing @gol
403 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
404 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
405 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts @gol
406 -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
407 -ftree-loop-if-convert-stores -ftree-loop-im @gol
408 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
409 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
410 -ftree-loop-vectorize @gol
411 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
412 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
413 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
414 -ftree-vectorize -ftree-vrp -funconstrained-commons @gol
415 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
416 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
417 -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
418 -fweb -fwhole-program -fwpa -fuse-linker-plugin @gol
419 --param @var{name}=@var{value}
420 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
422 @item Program Instrumentation Options
423 @xref{Instrumentation Options,,Program Instrumentation Options}.
424 @gccoptlist{-p  -pg  -fprofile-arcs --coverage -ftest-coverage @gol
425 -fprofile-dir=@var{path} -fprofile-generate -fprofile-generate=@var{path} @gol
426 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
427 -fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
428 -fsanitize-undefined-trap-on-error -fbounds-check @gol
429 -fcheck-pointer-bounds -fchkp-check-incomplete-type @gol
430 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
431 -fchkp-narrow-to-innermost-array -fchkp-optimize @gol
432 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
433 -fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
434 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
435 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
436 -fchkp-instrument-calls -fchkp-instrument-marked-only @gol
437 -fchkp-use-wrappers @gol
438 -fstack-protector -fstack-protector-all -fstack-protector-strong @gol
439 -fstack-protector-explicit -fstack-check @gol
440 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
441 -fno-stack-limit -fsplit-stack @gol
442 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
443 -fvtv-counts -fvtv-debug @gol
444 -finstrument-functions @gol
445 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
446 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
448 @item Preprocessor Options
449 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
450 @gccoptlist{-A@var{question}=@var{answer} @gol
451 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
452 -C  -dD  -dI  -dM  -dN @gol
453 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
454 -idirafter @var{dir} @gol
455 -include @var{file}  -imacros @var{file} @gol
456 -iprefix @var{file}  -iwithprefix @var{dir} @gol
457 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
458 -imultilib @var{dir} -isysroot @var{dir} @gol
459 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
460 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
461 -remap -trigraphs  -undef  -U@var{macro}  @gol
462 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
464 @item Assembler Option
465 @xref{Assembler Options,,Passing Options to the Assembler}.
466 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
468 @item Linker Options
469 @xref{Link Options,,Options for Linking}.
470 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker} -l@var{library} @gol
471 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
472 -s  -static -static-libgcc -static-libstdc++ @gol
473 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
474 -static-libmpx -static-libmpxwrappers @gol
475 -shared -shared-libgcc  -symbolic @gol
476 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
477 -u @var{symbol} -z @var{keyword}}
479 @item Directory Options
480 @xref{Directory Options,,Options for Directory Search}.
481 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
482 -iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol
483 --sysroot=@var{dir} --no-sysroot-suffix}
485 @item Code Generation Options
486 @xref{Code Gen Options,,Options for Code Generation Conventions}.
487 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
488 -ffixed-@var{reg}  -fexceptions @gol
489 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
490 -fasynchronous-unwind-tables @gol
491 -fno-gnu-unique @gol
492 -finhibit-size-directive  -fno-common  -fno-ident @gol
493 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE -fno-plt @gol
494 -fno-jump-tables @gol
495 -frecord-gcc-switches @gol
496 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
497 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
498 -fleading-underscore  -ftls-model=@var{model} @gol
499 -fstack-reuse=@var{reuse_level} @gol
500 -ftrapv  -fwrapv @gol
501 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
502 -fstrict-volatile-bitfields -fsync-libcalls}
504 @item Developer Options
505 @xref{Developer Options,,GCC Developer Options}.
506 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
507 -fchecking -fchecking=@var{n} -fdbg-cnt-list @gol
508 -fdbg-cnt=@var{counter-value-list} @gol
509 -fdisable-ipa-@var{pass_name} @gol
510 -fdisable-rtl-@var{pass_name} @gol
511 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
512 -fdisable-tree-@var{pass_name} @gol
513 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
514 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
515 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
516 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
517 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
518 -fdump-passes @gol
519 -fdump-rtl-@var{pass} -fdump-rtl-@var{pass}=@var{filename} @gol
520 -fdump-statistics @gol
521 -fdump-tree-all @gol
522 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
523 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
524 -fdump-tree-cfg -fdump-tree-alias @gol
525 -fdump-tree-ch @gol
526 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
527 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
528 -fdump-tree-gimple@r{[}-raw@r{]} @gol
529 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
530 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
531 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
532 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
533 -fdump-tree-backprop@r{[}-@var{n}@r{]} @gol
534 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
535 -fdump-tree-nrv -fdump-tree-vect @gol
536 -fdump-tree-sink @gol
537 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
538 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
539 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
540 -fdump-tree-vtable-verify @gol
541 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
542 -fdump-tree-split-paths@r{[}-@var{n}@r{]} @gol
543 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
544 -fdump-final-insns=@var{file} @gol
545 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
546 -fenable-@var{kind}-@var{pass} @gol
547 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
548 -fira-verbose=@var{n} @gol
549 -flto-report -flto-report-wpa -fmem-report-wpa @gol
550 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report @gol
551 -fopt-info -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
552 -fprofile-report @gol
553 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
554 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
555 -fstats  -fstack-usage  -ftime-report @gol
556 -fvar-tracking-assignments-toggle -gtoggle @gol
557 -print-file-name=@var{library}  -print-libgcc-file-name @gol
558 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
559 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
560 -print-sysroot -print-sysroot-headers-suffix @gol
561 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
563 @item Machine-Dependent Options
564 @xref{Submodel Options,,Machine-Dependent Options}.
565 @c This list is ordered alphanumerically by subsection name.
566 @c Try and put the significant identifier (CPU or system) first,
567 @c so users have a clue at guessing where the ones they want will be.
569 @emph{AArch64 Options}
570 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
571 -mgeneral-regs-only @gol
572 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
573 -mstrict-align @gol
574 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
575 -mtls-dialect=desc  -mtls-dialect=traditional @gol
576 -mtls-size=@var{size} @gol
577 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
578 -mfix-cortex-a53-843419  -mno-fix-cortex-a53-843419 @gol
579 -mlow-precision-recip-sqrt -mno-low-precision-recip-sqrt@gol
580 -mlow-precision-sqrt -mno-low-precision-sqrt@gol
581 -mlow-precision-div -mno-low-precision-div @gol
582 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
584 @emph{Adapteva Epiphany Options}
585 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
586 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
587 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
588 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
589 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
590 -msplit-vecmove-early -m1reg-@var{reg}}
592 @emph{ARC Options}
593 @gccoptlist{-mbarrel-shifter @gol
594 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
595 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
596 -mea -mno-mpy -mmul32x16 -mmul64 -matomic @gol
597 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
598 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
599 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
600 -mlong-calls -mmedium-calls -msdata @gol
601 -mucb-mcount -mvolatile-cache -mtp-regno=@var{regno} @gol
602 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
603 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
604 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
605 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
606 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
607 -mtune=@var{cpu} -mmultcost=@var{num} @gol
608 -munalign-prob-threshold=@var{probability} -mmpy-option=@var{multo} @gol
609 -mdiv-rem -mcode-density -mll64 -mfpu=@var{fpu}}
611 @emph{ARM Options}
612 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
613 -mabi=@var{name} @gol
614 -mapcs-stack-check  -mno-apcs-stack-check @gol
615 -mapcs-float  -mno-apcs-float @gol
616 -mapcs-reentrant  -mno-apcs-reentrant @gol
617 -msched-prolog  -mno-sched-prolog @gol
618 -mlittle-endian  -mbig-endian @gol
619 -mfloat-abi=@var{name} @gol
620 -mfp16-format=@var{name}
621 -mthumb-interwork  -mno-thumb-interwork @gol
622 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
623 -mtune=@var{name} -mprint-tune-info @gol
624 -mstructure-size-boundary=@var{n} @gol
625 -mabort-on-noreturn @gol
626 -mlong-calls  -mno-long-calls @gol
627 -msingle-pic-base  -mno-single-pic-base @gol
628 -mpic-register=@var{reg} @gol
629 -mnop-fun-dllimport @gol
630 -mpoke-function-name @gol
631 -mthumb  -marm @gol
632 -mtpcs-frame  -mtpcs-leaf-frame @gol
633 -mcaller-super-interworking  -mcallee-super-interworking @gol
634 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
635 -mword-relocations @gol
636 -mfix-cortex-m3-ldrd @gol
637 -munaligned-access @gol
638 -mneon-for-64bits @gol
639 -mslow-flash-data @gol
640 -masm-syntax-unified @gol
641 -mrestrict-it}
643 @emph{AVR Options}
644 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
645 -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol
646 -mrelax -mrmw -mstrict-X -mtiny-stack -nodevicelib -Waddr-space-convert @gol
647 -Wmisspelled-isr}
649 @emph{Blackfin Options}
650 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
651 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
652 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
653 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
654 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
655 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
656 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
657 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
658 -micplb}
660 @emph{C6X Options}
661 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
662 -msim -msdata=@var{sdata-type}}
664 @emph{CRIS Options}
665 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
666 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
667 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
668 -mstack-align  -mdata-align  -mconst-align @gol
669 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
670 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
671 -mmul-bug-workaround  -mno-mul-bug-workaround}
673 @emph{CR16 Options}
674 @gccoptlist{-mmac @gol
675 -mcr16cplus -mcr16c @gol
676 -msim -mint32 -mbit-ops
677 -mdata-model=@var{model}}
679 @emph{Darwin Options}
680 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
681 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
682 -client_name  -compatibility_version  -current_version @gol
683 -dead_strip @gol
684 -dependency-file  -dylib_file  -dylinker_install_name @gol
685 -dynamic  -dynamiclib  -exported_symbols_list @gol
686 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
687 -force_flat_namespace  -headerpad_max_install_names @gol
688 -iframework @gol
689 -image_base  -init  -install_name  -keep_private_externs @gol
690 -multi_module  -multiply_defined  -multiply_defined_unused @gol
691 -noall_load   -no_dead_strip_inits_and_terms @gol
692 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
693 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
694 -private_bundle  -read_only_relocs  -sectalign @gol
695 -sectobjectsymbols  -whyload  -seg1addr @gol
696 -sectcreate  -sectobjectsymbols  -sectorder @gol
697 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
698 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
699 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
700 -single_module  -static  -sub_library  -sub_umbrella @gol
701 -twolevel_namespace  -umbrella  -undefined @gol
702 -unexported_symbols_list  -weak_reference_mismatches @gol
703 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
704 -mkernel -mone-byte-bool}
706 @emph{DEC Alpha Options}
707 @gccoptlist{-mno-fp-regs  -msoft-float @gol
708 -mieee  -mieee-with-inexact  -mieee-conformant @gol
709 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
710 -mtrap-precision=@var{mode}  -mbuild-constants @gol
711 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
712 -mbwx  -mmax  -mfix  -mcix @gol
713 -mfloat-vax  -mfloat-ieee @gol
714 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
715 -msmall-text  -mlarge-text @gol
716 -mmemory-latency=@var{time}}
718 @emph{FR30 Options}
719 @gccoptlist{-msmall-model -mno-lsim}
721 @emph{FT32 Options}
722 @gccoptlist{-msim -mlra -mnodiv}
724 @emph{FRV Options}
725 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
726 -mhard-float  -msoft-float @gol
727 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
728 -mdouble  -mno-double @gol
729 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
730 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
731 -mlinked-fp  -mlong-calls  -malign-labels @gol
732 -mlibrary-pic  -macc-4  -macc-8 @gol
733 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
734 -moptimize-membar -mno-optimize-membar @gol
735 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
736 -mvliw-branch  -mno-vliw-branch @gol
737 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
738 -mno-nested-cond-exec  -mtomcat-stats @gol
739 -mTLS -mtls @gol
740 -mcpu=@var{cpu}}
742 @emph{GNU/Linux Options}
743 @gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
744 -tno-android-cc -tno-android-ld}
746 @emph{H8/300 Options}
747 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
749 @emph{HPPA Options}
750 @gccoptlist{-march=@var{architecture-type} @gol
751 -mdisable-fpregs  -mdisable-indexing @gol
752 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
753 -mfixed-range=@var{register-range} @gol
754 -mjump-in-delay -mlinker-opt -mlong-calls @gol
755 -mlong-load-store  -mno-disable-fpregs @gol
756 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
757 -mno-jump-in-delay  -mno-long-load-store @gol
758 -mno-portable-runtime  -mno-soft-float @gol
759 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
760 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
761 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
762 -munix=@var{unix-std}  -nolibdld  -static  -threads}
764 @emph{IA-64 Options}
765 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
766 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
767 -mconstant-gp  -mauto-pic  -mfused-madd @gol
768 -minline-float-divide-min-latency @gol
769 -minline-float-divide-max-throughput @gol
770 -mno-inline-float-divide @gol
771 -minline-int-divide-min-latency @gol
772 -minline-int-divide-max-throughput  @gol
773 -mno-inline-int-divide @gol
774 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
775 -mno-inline-sqrt @gol
776 -mdwarf2-asm -mearly-stop-bits @gol
777 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
778 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
779 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
780 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
781 -msched-spec-ldc -msched-spec-control-ldc @gol
782 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
783 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
784 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
785 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
787 @emph{LM32 Options}
788 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
789 -msign-extend-enabled -muser-enabled}
791 @emph{M32R/D Options}
792 @gccoptlist{-m32r2 -m32rx -m32r @gol
793 -mdebug @gol
794 -malign-loops -mno-align-loops @gol
795 -missue-rate=@var{number} @gol
796 -mbranch-cost=@var{number} @gol
797 -mmodel=@var{code-size-model-type} @gol
798 -msdata=@var{sdata-type} @gol
799 -mno-flush-func -mflush-func=@var{name} @gol
800 -mno-flush-trap -mflush-trap=@var{number} @gol
801 -G @var{num}}
803 @emph{M32C Options}
804 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
806 @emph{M680x0 Options}
807 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
808 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
809 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
810 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
811 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
812 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
813 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
814 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
815 -mxgot -mno-xgot}
817 @emph{MCore Options}
818 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
819 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
820 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
821 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
822 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
824 @emph{MeP Options}
825 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
826 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
827 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
828 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
829 -mtiny=@var{n}}
831 @emph{MicroBlaze Options}
832 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
833 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
834 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
835 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
836 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
838 @emph{MIPS Options}
839 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
840 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
841 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
842 -mips16  -mno-mips16  -mflip-mips16 @gol
843 -minterlink-compressed -mno-interlink-compressed @gol
844 -minterlink-mips16  -mno-interlink-mips16 @gol
845 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
846 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
847 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
848 -mno-float  -msingle-float  -mdouble-float @gol
849 -modd-spreg -mno-odd-spreg @gol
850 -mabs=@var{mode}  -mnan=@var{encoding} @gol
851 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
852 -mmcu -mmno-mcu @gol
853 -meva -mno-eva @gol
854 -mvirt -mno-virt @gol
855 -mxpa -mno-xpa @gol
856 -mmicromips -mno-micromips @gol
857 -mmsa -mno-msa @gol
858 -mfpu=@var{fpu-type} @gol
859 -msmartmips  -mno-smartmips @gol
860 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
861 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
862 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
863 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
864 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
865 -membedded-data  -mno-embedded-data @gol
866 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
867 -mcode-readable=@var{setting} @gol
868 -msplit-addresses  -mno-split-addresses @gol
869 -mexplicit-relocs  -mno-explicit-relocs @gol
870 -mcheck-zero-division  -mno-check-zero-division @gol
871 -mdivide-traps  -mdivide-breaks @gol
872 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
873 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
874 -mfix-24k -mno-fix-24k @gol
875 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
876 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
877 -mfix-vr4120  -mno-fix-vr4120 @gol
878 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
879 -mflush-func=@var{func}  -mno-flush-func @gol
880 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
881 -mcompact-branches=@var{policy} @gol
882 -mfp-exceptions -mno-fp-exceptions @gol
883 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
884 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address @gol
885 -mframe-header-opt -mno-frame-header-opt}
887 @emph{MMIX Options}
888 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
889 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
890 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
891 -mno-base-addresses  -msingle-exit  -mno-single-exit}
893 @emph{MN10300 Options}
894 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
895 -mno-am33 -mam33 -mam33-2 -mam34 @gol
896 -mtune=@var{cpu-type} @gol
897 -mreturn-pointer-on-d0 @gol
898 -mno-crt0  -mrelax -mliw -msetlb}
900 @emph{Moxie Options}
901 @gccoptlist{-meb -mel -mmul.x -mno-crt0}
903 @emph{MSP430 Options}
904 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
905 -mwarn-mcu @gol
906 -mcode-region= -mdata-region= @gol
907 -msilicon-errata= -msilicon-errata-warn= @gol
908 -mhwmult= -minrt}
910 @emph{NDS32 Options}
911 @gccoptlist{-mbig-endian -mlittle-endian @gol
912 -mreduced-regs -mfull-regs @gol
913 -mcmov -mno-cmov @gol
914 -mperf-ext -mno-perf-ext @gol
915 -mv3push -mno-v3push @gol
916 -m16bit -mno-16bit @gol
917 -misr-vector-size=@var{num} @gol
918 -mcache-block-size=@var{num} @gol
919 -march=@var{arch} @gol
920 -mcmodel=@var{code-model} @gol
921 -mctor-dtor -mrelax}
923 @emph{Nios II Options}
924 @gccoptlist{-G @var{num} -mgpopt=@var{option} -mgpopt -mno-gpopt @gol
925 -mel -meb @gol
926 -mno-bypass-cache -mbypass-cache @gol
927 -mno-cache-volatile -mcache-volatile @gol
928 -mno-fast-sw-div -mfast-sw-div @gol
929 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
930 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
931 -mcustom-fpu-cfg=@var{name} @gol
932 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name} @gol
933 -march=@var{arch} -mbmx -mno-bmx -mcdx -mno-cdx}
935 @emph{Nvidia PTX Options}
936 @gccoptlist{-m32 -m64 -mmainkernel -moptimize}
938 @emph{PDP-11 Options}
939 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
940 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
941 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
942 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
943 -mbranch-expensive  -mbranch-cheap @gol
944 -munix-asm  -mdec-asm}
946 @emph{picoChip Options}
947 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
948 -msymbol-as-address -mno-inefficient-warnings}
950 @emph{PowerPC Options}
951 See RS/6000 and PowerPC Options.
953 @emph{RL78 Options}
954 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
955 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14 @gol
956 -m64bit-doubles -m32bit-doubles -msave-mduc-in-interrupts}
958 @emph{RS/6000 and PowerPC Options}
959 @gccoptlist{-mcpu=@var{cpu-type} @gol
960 -mtune=@var{cpu-type} @gol
961 -mcmodel=@var{code-model} @gol
962 -mpowerpc64 @gol
963 -maltivec  -mno-altivec @gol
964 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
965 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
966 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
967 -mfprnd  -mno-fprnd @gol
968 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
969 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
970 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
971 -malign-power  -malign-natural @gol
972 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
973 -msingle-float -mdouble-float -msimple-fpu @gol
974 -mstring  -mno-string  -mupdate  -mno-update @gol
975 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
976 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
977 -mstrict-align  -mno-strict-align  -mrelocatable @gol
978 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
979 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
980 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
981 -mprioritize-restricted-insns=@var{priority} @gol
982 -msched-costly-dep=@var{dependence_type} @gol
983 -minsert-sched-nops=@var{scheme} @gol
984 -mcall-sysv  -mcall-netbsd @gol
985 -maix-struct-return  -msvr4-struct-return @gol
986 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
987 -mblock-move-inline-limit=@var{num} @gol
988 -misel -mno-isel @gol
989 -misel=yes  -misel=no @gol
990 -mspe -mno-spe @gol
991 -mspe=yes  -mspe=no @gol
992 -mpaired @gol
993 -mgen-cell-microcode -mwarn-cell-microcode @gol
994 -mvrsave -mno-vrsave @gol
995 -mmulhw -mno-mulhw @gol
996 -mdlmzb -mno-dlmzb @gol
997 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
998 -mprototype  -mno-prototype @gol
999 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
1000 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
1001 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
1002 -mno-recip-precision @gol
1003 -mveclibabi=@var{type} -mfriz -mno-friz @gol
1004 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
1005 -msave-toc-indirect -mno-save-toc-indirect @gol
1006 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
1007 -mcrypto -mno-crypto -mhtm -mno-htm -mdirect-move -mno-direct-move @gol
1008 -mquad-memory -mno-quad-memory @gol
1009 -mquad-memory-atomic -mno-quad-memory-atomic @gol
1010 -mcompat-align-parm -mno-compat-align-parm @gol
1011 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf -mno-upper-regs-sf @gol
1012 -mupper-regs-di -mno-upper-regs-di @gol
1013 -mupper-regs -mno-upper-regs -mmodulo -mno-modulo @gol
1014 -mfloat128 -mno-float128 -mfloat128-hardware -mno-float128-hardware @gol
1015 -mpower9-fusion -mno-mpower9-fusion -mpower9-vector -mno-power9-vector @gol
1016 -mpower9-dform -mno-power9-dform -mlra -mno-lra}
1018 @emph{RX Options}
1019 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1020 -mcpu=@gol
1021 -mbig-endian-data -mlittle-endian-data @gol
1022 -msmall-data @gol
1023 -msim  -mno-sim@gol
1024 -mas100-syntax -mno-as100-syntax@gol
1025 -mrelax@gol
1026 -mmax-constant-size=@gol
1027 -mint-register=@gol
1028 -mpid@gol
1029 -mallow-string-insns -mno-allow-string-insns@gol
1030 -mjsr@gol
1031 -mno-warn-multiple-fast-interrupts@gol
1032 -msave-acc-in-interrupts}
1034 @emph{S/390 and zSeries Options}
1035 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1036 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
1037 -mlong-double-64 -mlong-double-128 @gol
1038 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
1039 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
1040 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1041 -mhtm -mvx -mzvector @gol
1042 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1043 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
1044 -mhotpatch=@var{halfwords},@var{halfwords}}
1046 @emph{Score Options}
1047 @gccoptlist{-meb -mel @gol
1048 -mnhwloop @gol
1049 -muls @gol
1050 -mmac @gol
1051 -mscore5 -mscore5u -mscore7 -mscore7d}
1053 @emph{SH Options}
1054 @gccoptlist{-m1  -m2  -m2e @gol
1055 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
1056 -m3  -m3e @gol
1057 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1058 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
1059 -mb  -ml  -mdalign  -mrelax @gol
1060 -mbigtable -mfmovd -mrenesas -mno-renesas -mnomacsave @gol
1061 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
1062 -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
1063 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
1064 -maccumulate-outgoing-args @gol
1065 -matomic-model=@var{atomic-model} @gol
1066 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
1067 -mcbranch-force-delay-slot @gol
1068 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
1069 -mpretend-cmove -mtas}
1071 @emph{Solaris 2 Options}
1072 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
1073 -pthreads -pthread}
1075 @emph{SPARC Options}
1076 @gccoptlist{-mcpu=@var{cpu-type} @gol
1077 -mtune=@var{cpu-type} @gol
1078 -mcmodel=@var{code-model} @gol
1079 -mmemory-model=@var{mem-model} @gol
1080 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1081 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1082 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1083 -mhard-quad-float  -msoft-quad-float @gol
1084 -mstack-bias  -mno-stack-bias @gol
1085 -mstd-struct-return  -mno-std-struct-return @gol
1086 -munaligned-doubles  -mno-unaligned-doubles @gol
1087 -muser-mode  -mno-user-mode @gol
1088 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1089 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1090 -mcbcond -mno-cbcond @gol
1091 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1092 -mfix-at697f -mfix-ut699}
1094 @emph{SPU Options}
1095 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1096 -msafe-dma -munsafe-dma @gol
1097 -mbranch-hints @gol
1098 -msmall-mem -mlarge-mem -mstdmain @gol
1099 -mfixed-range=@var{register-range} @gol
1100 -mea32 -mea64 @gol
1101 -maddress-space-conversion -mno-address-space-conversion @gol
1102 -mcache-size=@var{cache-size} @gol
1103 -matomic-updates -mno-atomic-updates}
1105 @emph{System V Options}
1106 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1108 @emph{TILE-Gx Options}
1109 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1110 -mcmodel=@var{code-model}}
1112 @emph{TILEPro Options}
1113 @gccoptlist{-mcpu=@var{cpu} -m32}
1115 @emph{V850 Options}
1116 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1117 -mprolog-function  -mno-prolog-function  -mspace @gol
1118 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1119 -mapp-regs  -mno-app-regs @gol
1120 -mdisable-callt  -mno-disable-callt @gol
1121 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1122 -mv850e -mv850 -mv850e3v5 @gol
1123 -mloop @gol
1124 -mrelax @gol
1125 -mlong-jumps @gol
1126 -msoft-float @gol
1127 -mhard-float @gol
1128 -mgcc-abi @gol
1129 -mrh850-abi @gol
1130 -mbig-switch}
1132 @emph{VAX Options}
1133 @gccoptlist{-mg  -mgnu  -munix}
1135 @emph{Visium Options}
1136 @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol
1137 -mcpu=@var{cpu-type} -mtune=@var{cpu-type} -msv-mode -muser-mode}
1139 @emph{VMS Options}
1140 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1141 -mpointer-size=@var{size}}
1143 @emph{VxWorks Options}
1144 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1145 -Xbind-lazy  -Xbind-now}
1147 @emph{x86 Options}
1148 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1149 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
1150 -mfpmath=@var{unit} @gol
1151 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1152 -mno-fp-ret-in-387 -m80387 -mhard-float -msoft-float @gol
1153 -mno-wide-multiply  -mrtd  -malign-double @gol
1154 -mpreferred-stack-boundary=@var{num} @gol
1155 -mincoming-stack-boundary=@var{num} @gol
1156 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
1157 -mrecip -mrecip=@var{opt} @gol
1158 -mvzeroupper -mprefer-avx128 @gol
1159 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
1160 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl @gol
1161 -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi -msha -maes @gol
1162 -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
1163 -mprefetchwt1 -mclflushopt -mxsavec -mxsaves @gol
1164 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
1165 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mclzero
1166 -mpku -mthreads @gol
1167 -mms-bitfields -mno-align-stringops  -minline-all-stringops @gol
1168 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
1169 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} @gol
1170 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1171 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
1172 -mregparm=@var{num}  -msseregparm @gol
1173 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
1174 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
1175 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
1176 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
1177 -m32 -m64 -mx32 -m16 -miamcu -mlarge-data-threshold=@var{num} @gol
1178 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
1179 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
1180 -malign-data=@var{type} -mstack-protector-guard=@var{guard} @gol
1181 -mmitigate-rop -mgeneral-regs-only}
1183 @emph{x86 Windows Options}
1184 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
1185 -mnop-fun-dllimport -mthread @gol
1186 -municode -mwin32 -mwindows -fno-set-stack-executable}
1188 @emph{Xstormy16 Options}
1189 @gccoptlist{-msim}
1191 @emph{Xtensa Options}
1192 @gccoptlist{-mconst16 -mno-const16 @gol
1193 -mfused-madd  -mno-fused-madd @gol
1194 -mforce-no-pic @gol
1195 -mserialize-volatile  -mno-serialize-volatile @gol
1196 -mtext-section-literals  -mno-text-section-literals @gol
1197 -mauto-litpools  -mno-auto-litpools @gol
1198 -mtarget-align  -mno-target-align @gol
1199 -mlongcalls  -mno-longcalls}
1201 @emph{zSeries Options}
1202 See S/390 and zSeries Options.
1203 @end table
1206 @node Overall Options
1207 @section Options Controlling the Kind of Output
1209 Compilation can involve up to four stages: preprocessing, compilation
1210 proper, assembly and linking, always in that order.  GCC is capable of
1211 preprocessing and compiling several files either into several
1212 assembler input files, or into one assembler input file; then each
1213 assembler input file produces an object file, and linking combines all
1214 the object files (those newly compiled, and those specified as input)
1215 into an executable file.
1217 @cindex file name suffix
1218 For any given input file, the file name suffix determines what kind of
1219 compilation is done:
1221 @table @gcctabopt
1222 @item @var{file}.c
1223 C source code that must be preprocessed.
1225 @item @var{file}.i
1226 C source code that should not be preprocessed.
1228 @item @var{file}.ii
1229 C++ source code that should not be preprocessed.
1231 @item @var{file}.m
1232 Objective-C source code.  Note that you must link with the @file{libobjc}
1233 library to make an Objective-C program work.
1235 @item @var{file}.mi
1236 Objective-C source code that should not be preprocessed.
1238 @item @var{file}.mm
1239 @itemx @var{file}.M
1240 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1241 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1242 to a literal capital M@.
1244 @item @var{file}.mii
1245 Objective-C++ source code that should not be preprocessed.
1247 @item @var{file}.h
1248 C, C++, Objective-C or Objective-C++ header file to be turned into a
1249 precompiled header (default), or C, C++ header file to be turned into an
1250 Ada spec (via the @option{-fdump-ada-spec} switch).
1252 @item @var{file}.cc
1253 @itemx @var{file}.cp
1254 @itemx @var{file}.cxx
1255 @itemx @var{file}.cpp
1256 @itemx @var{file}.CPP
1257 @itemx @var{file}.c++
1258 @itemx @var{file}.C
1259 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1260 the last two letters must both be literally @samp{x}.  Likewise,
1261 @samp{.C} refers to a literal capital C@.
1263 @item @var{file}.mm
1264 @itemx @var{file}.M
1265 Objective-C++ source code that must be preprocessed.
1267 @item @var{file}.mii
1268 Objective-C++ source code that should not be preprocessed.
1270 @item @var{file}.hh
1271 @itemx @var{file}.H
1272 @itemx @var{file}.hp
1273 @itemx @var{file}.hxx
1274 @itemx @var{file}.hpp
1275 @itemx @var{file}.HPP
1276 @itemx @var{file}.h++
1277 @itemx @var{file}.tcc
1278 C++ header file to be turned into a precompiled header or Ada spec.
1280 @item @var{file}.f
1281 @itemx @var{file}.for
1282 @itemx @var{file}.ftn
1283 Fixed form Fortran source code that should not be preprocessed.
1285 @item @var{file}.F
1286 @itemx @var{file}.FOR
1287 @itemx @var{file}.fpp
1288 @itemx @var{file}.FPP
1289 @itemx @var{file}.FTN
1290 Fixed form Fortran source code that must be preprocessed (with the traditional
1291 preprocessor).
1293 @item @var{file}.f90
1294 @itemx @var{file}.f95
1295 @itemx @var{file}.f03
1296 @itemx @var{file}.f08
1297 Free form Fortran source code that should not be preprocessed.
1299 @item @var{file}.F90
1300 @itemx @var{file}.F95
1301 @itemx @var{file}.F03
1302 @itemx @var{file}.F08
1303 Free form Fortran source code that must be preprocessed (with the
1304 traditional preprocessor).
1306 @item @var{file}.go
1307 Go source code.
1309 @c FIXME: Descriptions of Java file types.
1310 @c @var{file}.java
1311 @c @var{file}.class
1312 @c @var{file}.zip
1313 @c @var{file}.jar
1315 @item @var{file}.ads
1316 Ada source code file that contains a library unit declaration (a
1317 declaration of a package, subprogram, or generic, or a generic
1318 instantiation), or a library unit renaming declaration (a package,
1319 generic, or subprogram renaming declaration).  Such files are also
1320 called @dfn{specs}.
1322 @item @var{file}.adb
1323 Ada source code file containing a library unit body (a subprogram or
1324 package body).  Such files are also called @dfn{bodies}.
1326 @c GCC also knows about some suffixes for languages not yet included:
1327 @c Pascal:
1328 @c @var{file}.p
1329 @c @var{file}.pas
1330 @c Ratfor:
1331 @c @var{file}.r
1333 @item @var{file}.s
1334 Assembler code.
1336 @item @var{file}.S
1337 @itemx @var{file}.sx
1338 Assembler code that must be preprocessed.
1340 @item @var{other}
1341 An object file to be fed straight into linking.
1342 Any file name with no recognized suffix is treated this way.
1343 @end table
1345 @opindex x
1346 You can specify the input language explicitly with the @option{-x} option:
1348 @table @gcctabopt
1349 @item -x @var{language}
1350 Specify explicitly the @var{language} for the following input files
1351 (rather than letting the compiler choose a default based on the file
1352 name suffix).  This option applies to all following input files until
1353 the next @option{-x} option.  Possible values for @var{language} are:
1354 @smallexample
1355 c  c-header  cpp-output
1356 c++  c++-header  c++-cpp-output
1357 objective-c  objective-c-header  objective-c-cpp-output
1358 objective-c++ objective-c++-header objective-c++-cpp-output
1359 assembler  assembler-with-cpp
1361 f77  f77-cpp-input f95  f95-cpp-input
1363 java
1364 @end smallexample
1366 @item -x none
1367 Turn off any specification of a language, so that subsequent files are
1368 handled according to their file name suffixes (as they are if @option{-x}
1369 has not been used at all).
1370 @end table
1372 If you only want some of the stages of compilation, you can use
1373 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1374 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1375 @command{gcc} is to stop.  Note that some combinations (for example,
1376 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1378 @table @gcctabopt
1379 @item -c
1380 @opindex c
1381 Compile or assemble the source files, but do not link.  The linking
1382 stage simply is not done.  The ultimate output is in the form of an
1383 object file for each source file.
1385 By default, the object file name for a source file is made by replacing
1386 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1388 Unrecognized input files, not requiring compilation or assembly, are
1389 ignored.
1391 @item -S
1392 @opindex S
1393 Stop after the stage of compilation proper; do not assemble.  The output
1394 is in the form of an assembler code file for each non-assembler input
1395 file specified.
1397 By default, the assembler file name for a source file is made by
1398 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1400 Input files that don't require compilation are ignored.
1402 @item -E
1403 @opindex E
1404 Stop after the preprocessing stage; do not run the compiler proper.  The
1405 output is in the form of preprocessed source code, which is sent to the
1406 standard output.
1408 Input files that don't require preprocessing are ignored.
1410 @cindex output file option
1411 @item -o @var{file}
1412 @opindex o
1413 Place output in file @var{file}.  This applies to whatever
1414 sort of output is being produced, whether it be an executable file,
1415 an object file, an assembler file or preprocessed C code.
1417 If @option{-o} is not specified, the default is to put an executable
1418 file in @file{a.out}, the object file for
1419 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1420 assembler file in @file{@var{source}.s}, a precompiled header file in
1421 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1422 standard output.
1424 @item -v
1425 @opindex v
1426 Print (on standard error output) the commands executed to run the stages
1427 of compilation.  Also print the version number of the compiler driver
1428 program and of the preprocessor and the compiler proper.
1430 @item -###
1431 @opindex ###
1432 Like @option{-v} except the commands are not executed and arguments
1433 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1434 This is useful for shell scripts to capture the driver-generated command lines.
1436 @item --help
1437 @opindex help
1438 Print (on the standard output) a description of the command-line options
1439 understood by @command{gcc}.  If the @option{-v} option is also specified
1440 then @option{--help} is also passed on to the various processes
1441 invoked by @command{gcc}, so that they can display the command-line options
1442 they accept.  If the @option{-Wextra} option has also been specified
1443 (prior to the @option{--help} option), then command-line options that
1444 have no documentation associated with them are also displayed.
1446 @item --target-help
1447 @opindex target-help
1448 Print (on the standard output) a description of target-specific command-line
1449 options for each tool.  For some targets extra target-specific
1450 information may also be printed.
1452 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1453 Print (on the standard output) a description of the command-line
1454 options understood by the compiler that fit into all specified classes
1455 and qualifiers.  These are the supported classes:
1457 @table @asis
1458 @item @samp{optimizers}
1459 Display all of the optimization options supported by the
1460 compiler.
1462 @item @samp{warnings}
1463 Display all of the options controlling warning messages
1464 produced by the compiler.
1466 @item @samp{target}
1467 Display target-specific options.  Unlike the
1468 @option{--target-help} option however, target-specific options of the
1469 linker and assembler are not displayed.  This is because those
1470 tools do not currently support the extended @option{--help=} syntax.
1472 @item @samp{params}
1473 Display the values recognized by the @option{--param}
1474 option.
1476 @item @var{language}
1477 Display the options supported for @var{language}, where
1478 @var{language} is the name of one of the languages supported in this
1479 version of GCC@.
1481 @item @samp{common}
1482 Display the options that are common to all languages.
1483 @end table
1485 These are the supported qualifiers:
1487 @table @asis
1488 @item @samp{undocumented}
1489 Display only those options that are undocumented.
1491 @item @samp{joined}
1492 Display options taking an argument that appears after an equal
1493 sign in the same continuous piece of text, such as:
1494 @samp{--help=target}.
1496 @item @samp{separate}
1497 Display options taking an argument that appears as a separate word
1498 following the original option, such as: @samp{-o output-file}.
1499 @end table
1501 Thus for example to display all the undocumented target-specific
1502 switches supported by the compiler, use:
1504 @smallexample
1505 --help=target,undocumented
1506 @end smallexample
1508 The sense of a qualifier can be inverted by prefixing it with the
1509 @samp{^} character, so for example to display all binary warning
1510 options (i.e., ones that are either on or off and that do not take an
1511 argument) that have a description, use:
1513 @smallexample
1514 --help=warnings,^joined,^undocumented
1515 @end smallexample
1517 The argument to @option{--help=} should not consist solely of inverted
1518 qualifiers.
1520 Combining several classes is possible, although this usually
1521 restricts the output so much that there is nothing to display.  One
1522 case where it does work, however, is when one of the classes is
1523 @var{target}.  For example, to display all the target-specific
1524 optimization options, use:
1526 @smallexample
1527 --help=target,optimizers
1528 @end smallexample
1530 The @option{--help=} option can be repeated on the command line.  Each
1531 successive use displays its requested class of options, skipping
1532 those that have already been displayed.
1534 If the @option{-Q} option appears on the command line before the
1535 @option{--help=} option, then the descriptive text displayed by
1536 @option{--help=} is changed.  Instead of describing the displayed
1537 options, an indication is given as to whether the option is enabled,
1538 disabled or set to a specific value (assuming that the compiler
1539 knows this at the point where the @option{--help=} option is used).
1541 Here is a truncated example from the ARM port of @command{gcc}:
1543 @smallexample
1544   % gcc -Q -mabi=2 --help=target -c
1545   The following options are target specific:
1546   -mabi=                                2
1547   -mabort-on-noreturn                   [disabled]
1548   -mapcs                                [disabled]
1549 @end smallexample
1551 The output is sensitive to the effects of previous command-line
1552 options, so for example it is possible to find out which optimizations
1553 are enabled at @option{-O2} by using:
1555 @smallexample
1556 -Q -O2 --help=optimizers
1557 @end smallexample
1559 Alternatively you can discover which binary optimizations are enabled
1560 by @option{-O3} by using:
1562 @smallexample
1563 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1564 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1565 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1566 @end smallexample
1568 @item --version
1569 @opindex version
1570 Display the version number and copyrights of the invoked GCC@.
1572 @item -pass-exit-codes
1573 @opindex pass-exit-codes
1574 Normally the @command{gcc} program exits with the code of 1 if any
1575 phase of the compiler returns a non-success return code.  If you specify
1576 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1577 the numerically highest error produced by any phase returning an error
1578 indication.  The C, C++, and Fortran front ends return 4 if an internal
1579 compiler error is encountered.
1581 @item -pipe
1582 @opindex pipe
1583 Use pipes rather than temporary files for communication between the
1584 various stages of compilation.  This fails to work on some systems where
1585 the assembler is unable to read from a pipe; but the GNU assembler has
1586 no trouble.
1588 @item -specs=@var{file}
1589 @opindex specs
1590 Process @var{file} after the compiler reads in the standard @file{specs}
1591 file, in order to override the defaults which the @command{gcc} driver
1592 program uses when determining what switches to pass to @command{cc1},
1593 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1594 @option{-specs=@var{file}} can be specified on the command line, and they
1595 are processed in order, from left to right.  @xref{Spec Files}, for
1596 information about the format of the @var{file}.
1598 @item -wrapper
1599 @opindex wrapper
1600 Invoke all subcommands under a wrapper program.  The name of the
1601 wrapper program and its parameters are passed as a comma separated
1602 list.
1604 @smallexample
1605 gcc -c t.c -wrapper gdb,--args
1606 @end smallexample
1608 @noindent
1609 This invokes all subprograms of @command{gcc} under
1610 @samp{gdb --args}, thus the invocation of @command{cc1} is
1611 @samp{gdb --args cc1 @dots{}}.
1613 @item -fplugin=@var{name}.so
1614 @opindex fplugin
1615 Load the plugin code in file @var{name}.so, assumed to be a
1616 shared object to be dlopen'd by the compiler.  The base name of
1617 the shared object file is used to identify the plugin for the
1618 purposes of argument parsing (See
1619 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1620 Each plugin should define the callback functions specified in the
1621 Plugins API.
1623 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1624 @opindex fplugin-arg
1625 Define an argument called @var{key} with a value of @var{value}
1626 for the plugin called @var{name}.
1628 @item -fdump-ada-spec@r{[}-slim@r{]}
1629 @opindex fdump-ada-spec
1630 For C and C++ source and include files, generate corresponding Ada specs.
1631 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1632 GNAT User's Guide}, which provides detailed documentation on this feature.
1634 @item -fada-spec-parent=@var{unit}
1635 @opindex fada-spec-parent
1636 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1637 Ada specs as child units of parent @var{unit}.
1639 @item -fdump-go-spec=@var{file}
1640 @opindex fdump-go-spec
1641 For input files in any language, generate corresponding Go
1642 declarations in @var{file}.  This generates Go @code{const},
1643 @code{type}, @code{var}, and @code{func} declarations which may be a
1644 useful way to start writing a Go interface to code written in some
1645 other language.
1647 @include @value{srcdir}/../libiberty/at-file.texi
1648 @end table
1650 @node Invoking G++
1651 @section Compiling C++ Programs
1653 @cindex suffixes for C++ source
1654 @cindex C++ source file suffixes
1655 C++ source files conventionally use one of the suffixes @samp{.C},
1656 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1657 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1658 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1659 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1660 files with these names and compiles them as C++ programs even if you
1661 call the compiler the same way as for compiling C programs (usually
1662 with the name @command{gcc}).
1664 @findex g++
1665 @findex c++
1666 However, the use of @command{gcc} does not add the C++ library.
1667 @command{g++} is a program that calls GCC and automatically specifies linking
1668 against the C++ library.  It treats @samp{.c},
1669 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1670 files unless @option{-x} is used.  This program is also useful when
1671 precompiling a C header file with a @samp{.h} extension for use in C++
1672 compilations.  On many systems, @command{g++} is also installed with
1673 the name @command{c++}.
1675 @cindex invoking @command{g++}
1676 When you compile C++ programs, you may specify many of the same
1677 command-line options that you use for compiling programs in any
1678 language; or command-line options meaningful for C and related
1679 languages; or options that are meaningful only for C++ programs.
1680 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1681 explanations of options for languages related to C@.
1682 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1683 explanations of options that are meaningful only for C++ programs.
1685 @node C Dialect Options
1686 @section Options Controlling C Dialect
1687 @cindex dialect options
1688 @cindex language dialect options
1689 @cindex options, dialect
1691 The following options control the dialect of C (or languages derived
1692 from C, such as C++, Objective-C and Objective-C++) that the compiler
1693 accepts:
1695 @table @gcctabopt
1696 @cindex ANSI support
1697 @cindex ISO support
1698 @item -ansi
1699 @opindex ansi
1700 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1701 equivalent to @option{-std=c++98}.
1703 This turns off certain features of GCC that are incompatible with ISO
1704 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1705 such as the @code{asm} and @code{typeof} keywords, and
1706 predefined macros such as @code{unix} and @code{vax} that identify the
1707 type of system you are using.  It also enables the undesirable and
1708 rarely used ISO trigraph feature.  For the C compiler,
1709 it disables recognition of C++ style @samp{//} comments as well as
1710 the @code{inline} keyword.
1712 The alternate keywords @code{__asm__}, @code{__extension__},
1713 @code{__inline__} and @code{__typeof__} continue to work despite
1714 @option{-ansi}.  You would not want to use them in an ISO C program, of
1715 course, but it is useful to put them in header files that might be included
1716 in compilations done with @option{-ansi}.  Alternate predefined macros
1717 such as @code{__unix__} and @code{__vax__} are also available, with or
1718 without @option{-ansi}.
1720 The @option{-ansi} option does not cause non-ISO programs to be
1721 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1722 addition to @option{-ansi}.  @xref{Warning Options}.
1724 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1725 option is used.  Some header files may notice this macro and refrain
1726 from declaring certain functions or defining certain macros that the
1727 ISO standard doesn't call for; this is to avoid interfering with any
1728 programs that might use these names for other things.
1730 Functions that are normally built in but do not have semantics
1731 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1732 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1733 built-in functions provided by GCC}, for details of the functions
1734 affected.
1736 @item -std=
1737 @opindex std
1738 Determine the language standard. @xref{Standards,,Language Standards
1739 Supported by GCC}, for details of these standard versions.  This option
1740 is currently only supported when compiling C or C++.
1742 The compiler can accept several base standards, such as @samp{c90} or
1743 @samp{c++98}, and GNU dialects of those standards, such as
1744 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1745 compiler accepts all programs following that standard plus those
1746 using GNU extensions that do not contradict it.  For example,
1747 @option{-std=c90} turns off certain features of GCC that are
1748 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1749 keywords, but not other GNU extensions that do not have a meaning in
1750 ISO C90, such as omitting the middle term of a @code{?:}
1751 expression. On the other hand, when a GNU dialect of a standard is
1752 specified, all features supported by the compiler are enabled, even when
1753 those features change the meaning of the base standard.  As a result, some
1754 strict-conforming programs may be rejected.  The particular standard
1755 is used by @option{-Wpedantic} to identify which features are GNU
1756 extensions given that version of the standard. For example
1757 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1758 comments, while @option{-std=gnu99 -Wpedantic} does not.
1760 A value for this option must be provided; possible values are
1762 @table @samp
1763 @item c90
1764 @itemx c89
1765 @itemx iso9899:1990
1766 Support all ISO C90 programs (certain GNU extensions that conflict
1767 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1769 @item iso9899:199409
1770 ISO C90 as modified in amendment 1.
1772 @item c99
1773 @itemx c9x
1774 @itemx iso9899:1999
1775 @itemx iso9899:199x
1776 ISO C99.  This standard is substantially completely supported, modulo
1777 bugs and floating-point issues
1778 (mainly but not entirely relating to optional C99 features from
1779 Annexes F and G).  See
1780 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1781 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1783 @item c11
1784 @itemx c1x
1785 @itemx iso9899:2011
1786 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1787 substantially completely supported, modulo bugs, floating-point issues
1788 (mainly but not entirely relating to optional C11 features from
1789 Annexes F and G) and the optional Annexes K (Bounds-checking
1790 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1792 @item gnu90
1793 @itemx gnu89
1794 GNU dialect of ISO C90 (including some C99 features).
1796 @item gnu99
1797 @itemx gnu9x
1798 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1800 @item gnu11
1801 @itemx gnu1x
1802 GNU dialect of ISO C11.  This is the default for C code.
1803 The name @samp{gnu1x} is deprecated.
1805 @item c++98
1806 @itemx c++03
1807 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1808 additional defect reports. Same as @option{-ansi} for C++ code.
1810 @item gnu++98
1811 @itemx gnu++03
1812 GNU dialect of @option{-std=c++98}.
1814 @item c++11
1815 @itemx c++0x
1816 The 2011 ISO C++ standard plus amendments.
1817 The name @samp{c++0x} is deprecated.
1819 @item gnu++11
1820 @itemx gnu++0x
1821 GNU dialect of @option{-std=c++11}.
1822 The name @samp{gnu++0x} is deprecated.
1824 @item c++14
1825 @itemx c++1y
1826 The 2014 ISO C++ standard plus amendments.
1827 The name @samp{c++1y} is deprecated.
1829 @item gnu++14
1830 @itemx gnu++1y
1831 GNU dialect of @option{-std=c++14}.
1832 This is the default for C++ code.
1833 The name @samp{gnu++1y} is deprecated.
1835 @item c++1z
1836 The next revision of the ISO C++ standard, tentatively planned for
1837 2017.  Support is highly experimental, and will almost certainly
1838 change in incompatible ways in future releases.
1840 @item gnu++1z
1841 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1842 and will almost certainly change in incompatible ways in future
1843 releases.
1844 @end table
1846 @item -fgnu89-inline
1847 @opindex fgnu89-inline
1848 The option @option{-fgnu89-inline} tells GCC to use the traditional
1849 GNU semantics for @code{inline} functions when in C99 mode.
1850 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1851 Using this option is roughly equivalent to adding the
1852 @code{gnu_inline} function attribute to all inline functions
1853 (@pxref{Function Attributes}).
1855 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1856 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1857 specifies the default behavior).
1858 This option is not supported in @option{-std=c90} or
1859 @option{-std=gnu90} mode.
1861 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1862 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1863 in effect for @code{inline} functions.  @xref{Common Predefined
1864 Macros,,,cpp,The C Preprocessor}.
1866 @item -aux-info @var{filename}
1867 @opindex aux-info
1868 Output to the given filename prototyped declarations for all functions
1869 declared and/or defined in a translation unit, including those in header
1870 files.  This option is silently ignored in any language other than C@.
1872 Besides declarations, the file indicates, in comments, the origin of
1873 each declaration (source file and line), whether the declaration was
1874 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1875 @samp{O} for old, respectively, in the first character after the line
1876 number and the colon), and whether it came from a declaration or a
1877 definition (@samp{C} or @samp{F}, respectively, in the following
1878 character).  In the case of function definitions, a K&R-style list of
1879 arguments followed by their declarations is also provided, inside
1880 comments, after the declaration.
1882 @item -fallow-parameterless-variadic-functions
1883 @opindex fallow-parameterless-variadic-functions
1884 Accept variadic functions without named parameters.
1886 Although it is possible to define such a function, this is not very
1887 useful as it is not possible to read the arguments.  This is only
1888 supported for C as this construct is allowed by C++.
1890 @item -fno-asm
1891 @opindex fno-asm
1892 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1893 keyword, so that code can use these words as identifiers.  You can use
1894 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1895 instead.  @option{-ansi} implies @option{-fno-asm}.
1897 In C++, this switch only affects the @code{typeof} keyword, since
1898 @code{asm} and @code{inline} are standard keywords.  You may want to
1899 use the @option{-fno-gnu-keywords} flag instead, which has the same
1900 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1901 switch only affects the @code{asm} and @code{typeof} keywords, since
1902 @code{inline} is a standard keyword in ISO C99.
1904 @item -fno-builtin
1905 @itemx -fno-builtin-@var{function}
1906 @opindex fno-builtin
1907 @cindex built-in functions
1908 Don't recognize built-in functions that do not begin with
1909 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1910 functions provided by GCC}, for details of the functions affected,
1911 including those which are not built-in functions when @option{-ansi} or
1912 @option{-std} options for strict ISO C conformance are used because they
1913 do not have an ISO standard meaning.
1915 GCC normally generates special code to handle certain built-in functions
1916 more efficiently; for instance, calls to @code{alloca} may become single
1917 instructions which adjust the stack directly, and calls to @code{memcpy}
1918 may become inline copy loops.  The resulting code is often both smaller
1919 and faster, but since the function calls no longer appear as such, you
1920 cannot set a breakpoint on those calls, nor can you change the behavior
1921 of the functions by linking with a different library.  In addition,
1922 when a function is recognized as a built-in function, GCC may use
1923 information about that function to warn about problems with calls to
1924 that function, or to generate more efficient code, even if the
1925 resulting code still contains calls to that function.  For example,
1926 warnings are given with @option{-Wformat} for bad calls to
1927 @code{printf} when @code{printf} is built in and @code{strlen} is
1928 known not to modify global memory.
1930 With the @option{-fno-builtin-@var{function}} option
1931 only the built-in function @var{function} is
1932 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1933 function is named that is not built-in in this version of GCC, this
1934 option is ignored.  There is no corresponding
1935 @option{-fbuiltin-@var{function}} option; if you wish to enable
1936 built-in functions selectively when using @option{-fno-builtin} or
1937 @option{-ffreestanding}, you may define macros such as:
1939 @smallexample
1940 #define abs(n)          __builtin_abs ((n))
1941 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1942 @end smallexample
1944 @item -fhosted
1945 @opindex fhosted
1946 @cindex hosted environment
1948 Assert that compilation targets a hosted environment.  This implies
1949 @option{-fbuiltin}.  A hosted environment is one in which the
1950 entire standard library is available, and in which @code{main} has a return
1951 type of @code{int}.  Examples are nearly everything except a kernel.
1952 This is equivalent to @option{-fno-freestanding}.
1954 @item -ffreestanding
1955 @opindex ffreestanding
1956 @cindex hosted environment
1958 Assert that compilation targets a freestanding environment.  This
1959 implies @option{-fno-builtin}.  A freestanding environment
1960 is one in which the standard library may not exist, and program startup may
1961 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1962 This is equivalent to @option{-fno-hosted}.
1964 @xref{Standards,,Language Standards Supported by GCC}, for details of
1965 freestanding and hosted environments.
1967 @item -fopenacc
1968 @opindex fopenacc
1969 @cindex OpenACC accelerator programming
1970 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
1971 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
1972 compiler generates accelerated code according to the OpenACC Application
1973 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1974 implies @option{-pthread}, and thus is only supported on targets that
1975 have support for @option{-pthread}.
1977 @item -fopenacc-dim=@var{geom}
1978 @opindex fopenacc-dim
1979 @cindex OpenACC accelerator programming
1980 Specify default compute dimensions for parallel offload regions that do
1981 not explicitly specify.  The @var{geom} value is a triple of
1982 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
1983 can be omitted, to use a target-specific default value.
1985 @item -fopenmp
1986 @opindex fopenmp
1987 @cindex OpenMP parallel
1988 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1989 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1990 compiler generates parallel code according to the OpenMP Application
1991 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1992 implies @option{-pthread}, and thus is only supported on targets that
1993 have support for @option{-pthread}. @option{-fopenmp} implies
1994 @option{-fopenmp-simd}.
1996 @item -fopenmp-simd
1997 @opindex fopenmp-simd
1998 @cindex OpenMP SIMD
1999 @cindex SIMD
2000 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
2001 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
2002 are ignored.
2004 @item -fcilkplus
2005 @opindex fcilkplus
2006 @cindex Enable Cilk Plus
2007 Enable the usage of Cilk Plus language extension features for C/C++.
2008 When the option @option{-fcilkplus} is specified, enable the usage of
2009 the Cilk Plus Language extension features for C/C++.  The present
2010 implementation follows ABI version 1.2.  This is an experimental
2011 feature that is only partially complete, and whose interface may
2012 change in future versions of GCC as the official specification
2013 changes.  Currently, all features but @code{_Cilk_for} have been
2014 implemented.
2016 @item -fgnu-tm
2017 @opindex fgnu-tm
2018 When the option @option{-fgnu-tm} is specified, the compiler
2019 generates code for the Linux variant of Intel's current Transactional
2020 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2021 an experimental feature whose interface may change in future versions
2022 of GCC, as the official specification changes.  Please note that not
2023 all architectures are supported for this feature.
2025 For more information on GCC's support for transactional memory,
2026 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2027 Transactional Memory Library}.
2029 Note that the transactional memory feature is not supported with
2030 non-call exceptions (@option{-fnon-call-exceptions}).
2032 @item -fms-extensions
2033 @opindex fms-extensions
2034 Accept some non-standard constructs used in Microsoft header files.
2036 In C++ code, this allows member names in structures to be similar
2037 to previous types declarations.
2039 @smallexample
2040 typedef int UOW;
2041 struct ABC @{
2042   UOW UOW;
2044 @end smallexample
2046 Some cases of unnamed fields in structures and unions are only
2047 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2048 fields within structs/unions}, for details.
2050 Note that this option is off for all targets but x86 
2051 targets using ms-abi.
2053 @item -fplan9-extensions
2054 @opindex fplan9-extensions
2055 Accept some non-standard constructs used in Plan 9 code.
2057 This enables @option{-fms-extensions}, permits passing pointers to
2058 structures with anonymous fields to functions that expect pointers to
2059 elements of the type of the field, and permits referring to anonymous
2060 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2061 struct/union fields within structs/unions}, for details.  This is only
2062 supported for C, not C++.
2064 @item -trigraphs
2065 @opindex trigraphs
2066 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
2067 options for strict ISO C conformance) implies @option{-trigraphs}.
2069 @cindex traditional C language
2070 @cindex C language, traditional
2071 @item -traditional
2072 @itemx -traditional-cpp
2073 @opindex traditional-cpp
2074 @opindex traditional
2075 Formerly, these options caused GCC to attempt to emulate a pre-standard
2076 C compiler.  They are now only supported with the @option{-E} switch.
2077 The preprocessor continues to support a pre-standard mode.  See the GNU
2078 CPP manual for details.
2080 @item -fcond-mismatch
2081 @opindex fcond-mismatch
2082 Allow conditional expressions with mismatched types in the second and
2083 third arguments.  The value of such an expression is void.  This option
2084 is not supported for C++.
2086 @item -flax-vector-conversions
2087 @opindex flax-vector-conversions
2088 Allow implicit conversions between vectors with differing numbers of
2089 elements and/or incompatible element types.  This option should not be
2090 used for new code.
2092 @item -funsigned-char
2093 @opindex funsigned-char
2094 Let the type @code{char} be unsigned, like @code{unsigned char}.
2096 Each kind of machine has a default for what @code{char} should
2097 be.  It is either like @code{unsigned char} by default or like
2098 @code{signed char} by default.
2100 Ideally, a portable program should always use @code{signed char} or
2101 @code{unsigned char} when it depends on the signedness of an object.
2102 But many programs have been written to use plain @code{char} and
2103 expect it to be signed, or expect it to be unsigned, depending on the
2104 machines they were written for.  This option, and its inverse, let you
2105 make such a program work with the opposite default.
2107 The type @code{char} is always a distinct type from each of
2108 @code{signed char} or @code{unsigned char}, even though its behavior
2109 is always just like one of those two.
2111 @item -fsigned-char
2112 @opindex fsigned-char
2113 Let the type @code{char} be signed, like @code{signed char}.
2115 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2116 the negative form of @option{-funsigned-char}.  Likewise, the option
2117 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2119 @item -fsigned-bitfields
2120 @itemx -funsigned-bitfields
2121 @itemx -fno-signed-bitfields
2122 @itemx -fno-unsigned-bitfields
2123 @opindex fsigned-bitfields
2124 @opindex funsigned-bitfields
2125 @opindex fno-signed-bitfields
2126 @opindex fno-unsigned-bitfields
2127 These options control whether a bit-field is signed or unsigned, when the
2128 declaration does not use either @code{signed} or @code{unsigned}.  By
2129 default, such a bit-field is signed, because this is consistent: the
2130 basic integer types such as @code{int} are signed types.
2132 @item -fsso-struct=@var{endianness}
2133 @opindex fsso-struct
2134 Set the default scalar storage order of structures and unions to the
2135 specified endianness.  The accepted values are @samp{big-endian} and
2136 @samp{little-endian}.  If the option is not passed, the compiler uses
2137 the native endianness of the target.  This option is not supported for C++.
2139 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2140 code that is not binary compatible with code generated without it if the
2141 specified endianness is not the native endianness of the target.
2142 @end table
2144 @node C++ Dialect Options
2145 @section Options Controlling C++ Dialect
2147 @cindex compiler options, C++
2148 @cindex C++ options, command-line
2149 @cindex options, C++
2150 This section describes the command-line options that are only meaningful
2151 for C++ programs.  You can also use most of the GNU compiler options
2152 regardless of what language your program is in.  For example, you
2153 might compile a file @file{firstClass.C} like this:
2155 @smallexample
2156 g++ -g -fstrict-enums -O -c firstClass.C
2157 @end smallexample
2159 @noindent
2160 In this example, only @option{-fstrict-enums} is an option meant
2161 only for C++ programs; you can use the other options with any
2162 language supported by GCC@.
2164 Some options for compiling C programs, such as @option{-std}, are also
2165 relevant for C++ programs.
2166 @xref{C Dialect Options,,Options Controlling C Dialect}.
2168 Here is a list of options that are @emph{only} for compiling C++ programs:
2170 @table @gcctabopt
2172 @item -fabi-version=@var{n}
2173 @opindex fabi-version
2174 Use version @var{n} of the C++ ABI@.  The default is version 0.
2176 Version 0 refers to the version conforming most closely to
2177 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2178 will change in different versions of G++ as ABI bugs are fixed.
2180 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2182 Version 2 is the version of the C++ ABI that first appeared in G++
2183 3.4, and was the default through G++ 4.9.
2185 Version 3 corrects an error in mangling a constant address as a
2186 template argument.
2188 Version 4, which first appeared in G++ 4.5, implements a standard
2189 mangling for vector types.
2191 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2192 attribute const/volatile on function pointer types, decltype of a
2193 plain decl, and use of a function parameter in the declaration of
2194 another parameter.
2196 Version 6, which first appeared in G++ 4.7, corrects the promotion
2197 behavior of C++11 scoped enums and the mangling of template argument
2198 packs, const/static_cast, prefix ++ and --, and a class scope function
2199 used as a template argument.
2201 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2202 builtin type and corrects the mangling of lambdas in default argument
2203 scope.
2205 Version 8, which first appeared in G++ 4.9, corrects the substitution
2206 behavior of function types with function-cv-qualifiers.
2208 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2209 @code{nullptr_t}.
2211 Version 10, which first appeared in G++ 6.1, adds mangling of
2212 attributes that affect type identity, such as ia32 calling convention
2213 attributes (e.g. @samp{stdcall}).
2215 See also @option{-Wabi}.
2217 @item -fabi-compat-version=@var{n}
2218 @opindex fabi-compat-version
2219 On targets that support strong aliases, G++
2220 works around mangling changes by creating an alias with the correct
2221 mangled name when defining a symbol with an incorrect mangled name.
2222 This switch specifies which ABI version to use for the alias.
2224 With @option{-fabi-version=0} (the default), this defaults to 8 (GCC 5
2225 compatibility).  If another ABI version is explicitly selected, this
2226 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2227 use @option{-fabi-compat-version=2}.
2229 If this option is not provided but @option{-Wabi=@var{n}} is, that
2230 version is used for compatibility aliases.  If this option is provided
2231 along with @option{-Wabi} (without the version), the version from this
2232 option is used for the warning.
2234 @item -fno-access-control
2235 @opindex fno-access-control
2236 Turn off all access checking.  This switch is mainly useful for working
2237 around bugs in the access control code.
2239 @item -fargs-in-order
2240 @opindex fargs-in-order
2241 Evaluate function arguments and operands of some binary expressions in
2242 left-to-right order, and evaluate the right side of an assignment
2243 before the left side, as proposed in P0145R2.  Enabled by default with
2244 @option{-std=c++1z}.  @option{-fargs-in-order=1} implements all of the
2245 ordering requirements except function arguments.
2247 @item -fcheck-new
2248 @opindex fcheck-new
2249 Check that the pointer returned by @code{operator new} is non-null
2250 before attempting to modify the storage allocated.  This check is
2251 normally unnecessary because the C++ standard specifies that
2252 @code{operator new} only returns @code{0} if it is declared
2253 @code{throw()}, in which case the compiler always checks the
2254 return value even without this option.  In all other cases, when
2255 @code{operator new} has a non-empty exception specification, memory
2256 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2257 @samp{new (nothrow)}.
2259 @item -fconcepts
2260 @opindex fconcepts
2261 Enable support for the C++ Extensions for Concepts Technical
2262 Specification, ISO 19217 (2015), which allows code like
2264 @smallexample
2265 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2266 template <Addable T> T add (T a, T b) @{ return a + b; @}
2267 @end smallexample
2269 @item -fconstexpr-depth=@var{n}
2270 @opindex fconstexpr-depth
2271 Set the maximum nested evaluation depth for C++11 constexpr functions
2272 to @var{n}.  A limit is needed to detect endless recursion during
2273 constant expression evaluation.  The minimum specified by the standard
2274 is 512.
2276 @item -fdeduce-init-list
2277 @opindex fdeduce-init-list
2278 Enable deduction of a template type parameter as
2279 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2281 @smallexample
2282 template <class T> auto forward(T t) -> decltype (realfn (t))
2284   return realfn (t);
2287 void f()
2289   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2291 @end smallexample
2293 This deduction was implemented as a possible extension to the
2294 originally proposed semantics for the C++11 standard, but was not part
2295 of the final standard, so it is disabled by default.  This option is
2296 deprecated, and may be removed in a future version of G++.
2298 @item -ffriend-injection
2299 @opindex ffriend-injection
2300 Inject friend functions into the enclosing namespace, so that they are
2301 visible outside the scope of the class in which they are declared.
2302 Friend functions were documented to work this way in the old Annotated
2303 C++ Reference Manual.  
2304 However, in ISO C++ a friend function that is not declared
2305 in an enclosing scope can only be found using argument dependent
2306 lookup.  GCC defaults to the standard behavior.
2308 This option is for compatibility, and may be removed in a future
2309 release of G++.
2311 @item -fno-elide-constructors
2312 @opindex fno-elide-constructors
2313 The C++ standard allows an implementation to omit creating a temporary
2314 that is only used to initialize another object of the same type.
2315 Specifying this option disables that optimization, and forces G++ to
2316 call the copy constructor in all cases.
2318 @item -fno-enforce-eh-specs
2319 @opindex fno-enforce-eh-specs
2320 Don't generate code to check for violation of exception specifications
2321 at run time.  This option violates the C++ standard, but may be useful
2322 for reducing code size in production builds, much like defining
2323 @code{NDEBUG}.  This does not give user code permission to throw
2324 exceptions in violation of the exception specifications; the compiler
2325 still optimizes based on the specifications, so throwing an
2326 unexpected exception results in undefined behavior at run time.
2328 @item -fextern-tls-init
2329 @itemx -fno-extern-tls-init
2330 @opindex fextern-tls-init
2331 @opindex fno-extern-tls-init
2332 The C++11 and OpenMP standards allow @code{thread_local} and
2333 @code{threadprivate} variables to have dynamic (runtime)
2334 initialization.  To support this, any use of such a variable goes
2335 through a wrapper function that performs any necessary initialization.
2336 When the use and definition of the variable are in the same
2337 translation unit, this overhead can be optimized away, but when the
2338 use is in a different translation unit there is significant overhead
2339 even if the variable doesn't actually need dynamic initialization.  If
2340 the programmer can be sure that no use of the variable in a
2341 non-defining TU needs to trigger dynamic initialization (either
2342 because the variable is statically initialized, or a use of the
2343 variable in the defining TU will be executed before any uses in
2344 another TU), they can avoid this overhead with the
2345 @option{-fno-extern-tls-init} option.
2347 On targets that support symbol aliases, the default is
2348 @option{-fextern-tls-init}.  On targets that do not support symbol
2349 aliases, the default is @option{-fno-extern-tls-init}.
2351 @item -ffor-scope
2352 @itemx -fno-for-scope
2353 @opindex ffor-scope
2354 @opindex fno-for-scope
2355 If @option{-ffor-scope} is specified, the scope of variables declared in
2356 a @i{for-init-statement} is limited to the @code{for} loop itself,
2357 as specified by the C++ standard.
2358 If @option{-fno-for-scope} is specified, the scope of variables declared in
2359 a @i{for-init-statement} extends to the end of the enclosing scope,
2360 as was the case in old versions of G++, and other (traditional)
2361 implementations of C++.
2363 If neither flag is given, the default is to follow the standard,
2364 but to allow and give a warning for old-style code that would
2365 otherwise be invalid, or have different behavior.
2367 @item -fno-gnu-keywords
2368 @opindex fno-gnu-keywords
2369 Do not recognize @code{typeof} as a keyword, so that code can use this
2370 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2371 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2372 @option{-std=c++98}, @option{-std=c++11}, etc.
2374 @item -fno-implicit-templates
2375 @opindex fno-implicit-templates
2376 Never emit code for non-inline templates that are instantiated
2377 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2378 @xref{Template Instantiation}, for more information.
2380 @item -fno-implicit-inline-templates
2381 @opindex fno-implicit-inline-templates
2382 Don't emit code for implicit instantiations of inline templates, either.
2383 The default is to handle inlines differently so that compiles with and
2384 without optimization need the same set of explicit instantiations.
2386 @item -fno-implement-inlines
2387 @opindex fno-implement-inlines
2388 To save space, do not emit out-of-line copies of inline functions
2389 controlled by @code{#pragma implementation}.  This causes linker
2390 errors if these functions are not inlined everywhere they are called.
2392 @item -fms-extensions
2393 @opindex fms-extensions
2394 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2395 int and getting a pointer to member function via non-standard syntax.
2397 @item -fno-nonansi-builtins
2398 @opindex fno-nonansi-builtins
2399 Disable built-in declarations of functions that are not mandated by
2400 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2401 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2403 @item -fnothrow-opt
2404 @opindex fnothrow-opt
2405 Treat a @code{throw()} exception specification as if it were a
2406 @code{noexcept} specification to reduce or eliminate the text size
2407 overhead relative to a function with no exception specification.  If
2408 the function has local variables of types with non-trivial
2409 destructors, the exception specification actually makes the
2410 function smaller because the EH cleanups for those variables can be
2411 optimized away.  The semantic effect is that an exception thrown out of
2412 a function with such an exception specification results in a call
2413 to @code{terminate} rather than @code{unexpected}.
2415 @item -fno-operator-names
2416 @opindex fno-operator-names
2417 Do not treat the operator name keywords @code{and}, @code{bitand},
2418 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2419 synonyms as keywords.
2421 @item -fno-optional-diags
2422 @opindex fno-optional-diags
2423 Disable diagnostics that the standard says a compiler does not need to
2424 issue.  Currently, the only such diagnostic issued by G++ is the one for
2425 a name having multiple meanings within a class.
2427 @item -fpermissive
2428 @opindex fpermissive
2429 Downgrade some diagnostics about nonconformant code from errors to
2430 warnings.  Thus, using @option{-fpermissive} allows some
2431 nonconforming code to compile.
2433 @item -fno-pretty-templates
2434 @opindex fno-pretty-templates
2435 When an error message refers to a specialization of a function
2436 template, the compiler normally prints the signature of the
2437 template followed by the template arguments and any typedefs or
2438 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2439 rather than @code{void f(int)}) so that it's clear which template is
2440 involved.  When an error message refers to a specialization of a class
2441 template, the compiler omits any template arguments that match
2442 the default template arguments for that template.  If either of these
2443 behaviors make it harder to understand the error message rather than
2444 easier, you can use @option{-fno-pretty-templates} to disable them.
2446 @item -frepo
2447 @opindex frepo
2448 Enable automatic template instantiation at link time.  This option also
2449 implies @option{-fno-implicit-templates}.  @xref{Template
2450 Instantiation}, for more information.
2452 @item -fno-rtti
2453 @opindex fno-rtti
2454 Disable generation of information about every class with virtual
2455 functions for use by the C++ run-time type identification features
2456 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2457 of the language, you can save some space by using this flag.  Note that
2458 exception handling uses the same information, but G++ generates it as
2459 needed. The @code{dynamic_cast} operator can still be used for casts that
2460 do not require run-time type information, i.e.@: casts to @code{void *} or to
2461 unambiguous base classes.
2463 @item -fsized-deallocation
2464 @opindex fsized-deallocation
2465 Enable the built-in global declarations
2466 @smallexample
2467 void operator delete (void *, std::size_t) noexcept;
2468 void operator delete[] (void *, std::size_t) noexcept;
2469 @end smallexample
2470 as introduced in C++14.  This is useful for user-defined replacement
2471 deallocation functions that, for example, use the size of the object
2472 to make deallocation faster.  Enabled by default under
2473 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2474 warns about places that might want to add a definition.
2476 @item -fstrict-enums
2477 @opindex fstrict-enums
2478 Allow the compiler to optimize using the assumption that a value of
2479 enumerated type can only be one of the values of the enumeration (as
2480 defined in the C++ standard; basically, a value that can be
2481 represented in the minimum number of bits needed to represent all the
2482 enumerators).  This assumption may not be valid if the program uses a
2483 cast to convert an arbitrary integer value to the enumerated type.
2485 @item -ftemplate-backtrace-limit=@var{n}
2486 @opindex ftemplate-backtrace-limit
2487 Set the maximum number of template instantiation notes for a single
2488 warning or error to @var{n}.  The default value is 10.
2490 @item -ftemplate-depth=@var{n}
2491 @opindex ftemplate-depth
2492 Set the maximum instantiation depth for template classes to @var{n}.
2493 A limit on the template instantiation depth is needed to detect
2494 endless recursions during template class instantiation.  ANSI/ISO C++
2495 conforming programs must not rely on a maximum depth greater than 17
2496 (changed to 1024 in C++11).  The default value is 900, as the compiler
2497 can run out of stack space before hitting 1024 in some situations.
2499 @item -fno-threadsafe-statics
2500 @opindex fno-threadsafe-statics
2501 Do not emit the extra code to use the routines specified in the C++
2502 ABI for thread-safe initialization of local statics.  You can use this
2503 option to reduce code size slightly in code that doesn't need to be
2504 thread-safe.
2506 @item -fuse-cxa-atexit
2507 @opindex fuse-cxa-atexit
2508 Register destructors for objects with static storage duration with the
2509 @code{__cxa_atexit} function rather than the @code{atexit} function.
2510 This option is required for fully standards-compliant handling of static
2511 destructors, but only works if your C library supports
2512 @code{__cxa_atexit}.
2514 @item -fno-use-cxa-get-exception-ptr
2515 @opindex fno-use-cxa-get-exception-ptr
2516 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2517 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2518 if the runtime routine is not available.
2520 @item -fvisibility-inlines-hidden
2521 @opindex fvisibility-inlines-hidden
2522 This switch declares that the user does not attempt to compare
2523 pointers to inline functions or methods where the addresses of the two functions
2524 are taken in different shared objects.
2526 The effect of this is that GCC may, effectively, mark inline methods with
2527 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2528 appear in the export table of a DSO and do not require a PLT indirection
2529 when used within the DSO@.  Enabling this option can have a dramatic effect
2530 on load and link times of a DSO as it massively reduces the size of the
2531 dynamic export table when the library makes heavy use of templates.
2533 The behavior of this switch is not quite the same as marking the
2534 methods as hidden directly, because it does not affect static variables
2535 local to the function or cause the compiler to deduce that
2536 the function is defined in only one shared object.
2538 You may mark a method as having a visibility explicitly to negate the
2539 effect of the switch for that method.  For example, if you do want to
2540 compare pointers to a particular inline method, you might mark it as
2541 having default visibility.  Marking the enclosing class with explicit
2542 visibility has no effect.
2544 Explicitly instantiated inline methods are unaffected by this option
2545 as their linkage might otherwise cross a shared library boundary.
2546 @xref{Template Instantiation}.
2548 @item -fvisibility-ms-compat
2549 @opindex fvisibility-ms-compat
2550 This flag attempts to use visibility settings to make GCC's C++
2551 linkage model compatible with that of Microsoft Visual Studio.
2553 The flag makes these changes to GCC's linkage model:
2555 @enumerate
2556 @item
2557 It sets the default visibility to @code{hidden}, like
2558 @option{-fvisibility=hidden}.
2560 @item
2561 Types, but not their members, are not hidden by default.
2563 @item
2564 The One Definition Rule is relaxed for types without explicit
2565 visibility specifications that are defined in more than one
2566 shared object: those declarations are permitted if they are
2567 permitted when this option is not used.
2568 @end enumerate
2570 In new code it is better to use @option{-fvisibility=hidden} and
2571 export those classes that are intended to be externally visible.
2572 Unfortunately it is possible for code to rely, perhaps accidentally,
2573 on the Visual Studio behavior.
2575 Among the consequences of these changes are that static data members
2576 of the same type with the same name but defined in different shared
2577 objects are different, so changing one does not change the other;
2578 and that pointers to function members defined in different shared
2579 objects may not compare equal.  When this flag is given, it is a
2580 violation of the ODR to define types with the same name differently.
2582 @item -fno-weak
2583 @opindex fno-weak
2584 Do not use weak symbol support, even if it is provided by the linker.
2585 By default, G++ uses weak symbols if they are available.  This
2586 option exists only for testing, and should not be used by end-users;
2587 it results in inferior code and has no benefits.  This option may
2588 be removed in a future release of G++.
2590 @item -nostdinc++
2591 @opindex nostdinc++
2592 Do not search for header files in the standard directories specific to
2593 C++, but do still search the other standard directories.  (This option
2594 is used when building the C++ library.)
2595 @end table
2597 In addition, these optimization, warning, and code generation options
2598 have meanings only for C++ programs:
2600 @table @gcctabopt
2601 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2602 @opindex Wabi
2603 @opindex Wno-abi
2604 Warn when G++ it generates code that is probably not compatible with
2605 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2606 ABI with each major release, normally @option{-Wabi} will warn only if
2607 there is a check added later in a release series for an ABI issue
2608 discovered since the initial release.  @option{-Wabi} will warn about
2609 more things if an older ABI version is selected (with
2610 @option{-fabi-version=@var{n}}).
2612 @option{-Wabi} can also be used with an explicit version number to
2613 warn about compatibility with a particular @option{-fabi-version}
2614 level, e.g. @option{-Wabi=2} to warn about changes relative to
2615 @option{-fabi-version=2}.
2617 If an explicit version number is provided and
2618 @option{-fabi-compat-version} is not specified, the version number
2619 from this option is used for compatibility aliases.  If no explicit
2620 version number is provided with this option, but
2621 @option{-fabi-compat-version} is specified, that version number is
2622 used for ABI warnings.
2624 Although an effort has been made to warn about
2625 all such cases, there are probably some cases that are not warned about,
2626 even though G++ is generating incompatible code.  There may also be
2627 cases where warnings are emitted even though the code that is generated
2628 is compatible.
2630 You should rewrite your code to avoid these warnings if you are
2631 concerned about the fact that code generated by G++ may not be binary
2632 compatible with code generated by other compilers.
2634 Known incompatibilities in @option{-fabi-version=2} (which was the
2635 default from GCC 3.4 to 4.9) include:
2637 @itemize @bullet
2639 @item
2640 A template with a non-type template parameter of reference type was
2641 mangled incorrectly:
2642 @smallexample
2643 extern int N;
2644 template <int &> struct S @{@};
2645 void n (S<N>) @{2@}
2646 @end smallexample
2648 This was fixed in @option{-fabi-version=3}.
2650 @item
2651 SIMD vector types declared using @code{__attribute ((vector_size))} were
2652 mangled in a non-standard way that does not allow for overloading of
2653 functions taking vectors of different sizes.
2655 The mangling was changed in @option{-fabi-version=4}.
2657 @item
2658 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2659 qualifiers, and @code{decltype} of a plain declaration was folded away.
2661 These mangling issues were fixed in @option{-fabi-version=5}.
2663 @item
2664 Scoped enumerators passed as arguments to a variadic function are
2665 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2666 On most targets this does not actually affect the parameter passing
2667 ABI, as there is no way to pass an argument smaller than @code{int}.
2669 Also, the ABI changed the mangling of template argument packs,
2670 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2671 a class scope function used as a template argument.
2673 These issues were corrected in @option{-fabi-version=6}.
2675 @item
2676 Lambdas in default argument scope were mangled incorrectly, and the
2677 ABI changed the mangling of @code{nullptr_t}.
2679 These issues were corrected in @option{-fabi-version=7}.
2681 @item
2682 When mangling a function type with function-cv-qualifiers, the
2683 un-qualified function type was incorrectly treated as a substitution
2684 candidate.
2686 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2688 @item
2689 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2690 unaligned accesses.  Note that this did not affect the ABI of a
2691 function with a @code{nullptr_t} parameter, as parameters have a
2692 minimum alignment.
2694 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2696 @item
2697 Target-specific attributes that affect the identity of a type, such as
2698 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2699 did not affect the mangled name, leading to name collisions when
2700 function pointers were used as template arguments.
2702 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2704 @end itemize
2706 It also warns about psABI-related changes.  The known psABI changes at this
2707 point include:
2709 @itemize @bullet
2711 @item
2712 For SysV/x86-64, unions with @code{long double} members are 
2713 passed in memory as specified in psABI.  For example:
2715 @smallexample
2716 union U @{
2717   long double ld;
2718   int i;
2720 @end smallexample
2722 @noindent
2723 @code{union U} is always passed in memory.
2725 @end itemize
2727 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2728 @opindex Wabi-tag
2729 @opindex -Wabi-tag
2730 Warn when a type with an ABI tag is used in a context that does not
2731 have that ABI tag.  See @ref{C++ Attributes} for more information
2732 about ABI tags.
2734 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2735 @opindex Wctor-dtor-privacy
2736 @opindex Wno-ctor-dtor-privacy
2737 Warn when a class seems unusable because all the constructors or
2738 destructors in that class are private, and it has neither friends nor
2739 public static member functions.  Also warn if there are no non-private
2740 methods, and there's at least one private member function that isn't
2741 a constructor or destructor.
2743 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2744 @opindex Wdelete-non-virtual-dtor
2745 @opindex Wno-delete-non-virtual-dtor
2746 Warn when @code{delete} is used to destroy an instance of a class that
2747 has virtual functions and non-virtual destructor. It is unsafe to delete
2748 an instance of a derived class through a pointer to a base class if the
2749 base class does not have a virtual destructor.  This warning is enabled
2750 by @option{-Wall}.
2752 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2753 @opindex Wliteral-suffix
2754 @opindex Wno-literal-suffix
2755 Warn when a string or character literal is followed by a ud-suffix which does
2756 not begin with an underscore.  As a conforming extension, GCC treats such
2757 suffixes as separate preprocessing tokens in order to maintain backwards
2758 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2759 For example:
2761 @smallexample
2762 #define __STDC_FORMAT_MACROS
2763 #include <inttypes.h>
2764 #include <stdio.h>
2766 int main() @{
2767   int64_t i64 = 123;
2768   printf("My int64: %" PRId64"\n", i64);
2770 @end smallexample
2772 In this case, @code{PRId64} is treated as a separate preprocessing token.
2774 This warning is enabled by default.
2776 @item -Wlto-type-mismatch
2777 @opindex Wlto-type-mismatch
2778 @opindex Wno-lto-type-mismatch
2780 During the link-time optimization warn about type mismatches in
2781 global declarations from different compilation units.
2782 Requires @option{-flto} to be enabled.  Enabled by default.
2784 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2785 @opindex Wnarrowing
2786 @opindex Wno-narrowing
2787 With @option{-std=gnu++98} or @option{-std=c++98}, warn when a narrowing
2788 conversion prohibited by C++11 occurs within
2789 @samp{@{ @}}, e.g.
2791 @smallexample
2792 int i = @{ 2.2 @}; // error: narrowing from double to int
2793 @end smallexample
2795 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2797 When a later standard is in effect, e.g. when using @option{-std=c++11},
2798 narrowing conversions are diagnosed by default, as required by the standard.
2799 A narrowing conversion from a constant produces an error,
2800 and a narrowing conversion from a non-constant produces a warning,
2801 but @option{-Wno-narrowing} suppresses the diagnostic.
2802 Note that this does not affect the meaning of well-formed code;
2803 narrowing conversions are still considered ill-formed in SFINAE contexts.
2805 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2806 @opindex Wnoexcept
2807 @opindex Wno-noexcept
2808 Warn when a noexcept-expression evaluates to false because of a call
2809 to a function that does not have a non-throwing exception
2810 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2811 the compiler to never throw an exception.
2813 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2814 @opindex Wnon-virtual-dtor
2815 @opindex Wno-non-virtual-dtor
2816 Warn when a class has virtual functions and an accessible non-virtual
2817 destructor itself or in an accessible polymorphic base class, in which
2818 case it is possible but unsafe to delete an instance of a derived
2819 class through a pointer to the class itself or base class.  This
2820 warning is automatically enabled if @option{-Weffc++} is specified.
2822 @item -Wreorder @r{(C++ and Objective-C++ only)}
2823 @opindex Wreorder
2824 @opindex Wno-reorder
2825 @cindex reordering, warning
2826 @cindex warning for reordering of member initializers
2827 Warn when the order of member initializers given in the code does not
2828 match the order in which they must be executed.  For instance:
2830 @smallexample
2831 struct A @{
2832   int i;
2833   int j;
2834   A(): j (0), i (1) @{ @}
2836 @end smallexample
2838 @noindent
2839 The compiler rearranges the member initializers for @code{i}
2840 and @code{j} to match the declaration order of the members, emitting
2841 a warning to that effect.  This warning is enabled by @option{-Wall}.
2843 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2844 @opindex fext-numeric-literals
2845 @opindex fno-ext-numeric-literals
2846 Accept imaginary, fixed-point, or machine-defined
2847 literal number suffixes as GNU extensions.
2848 When this option is turned off these suffixes are treated
2849 as C++11 user-defined literal numeric suffixes.
2850 This is on by default for all pre-C++11 dialects and all GNU dialects:
2851 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2852 @option{-std=gnu++14}.
2853 This option is off by default
2854 for ISO C++11 onwards (@option{-std=c++11}, ...).
2855 @end table
2857 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2859 @table @gcctabopt
2860 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2861 @opindex Weffc++
2862 @opindex Wno-effc++
2863 Warn about violations of the following style guidelines from Scott Meyers'
2864 @cite{Effective C++} series of books:
2866 @itemize @bullet
2867 @item
2868 Define a copy constructor and an assignment operator for classes
2869 with dynamically-allocated memory.
2871 @item
2872 Prefer initialization to assignment in constructors.
2874 @item
2875 Have @code{operator=} return a reference to @code{*this}.
2877 @item
2878 Don't try to return a reference when you must return an object.
2880 @item
2881 Distinguish between prefix and postfix forms of increment and
2882 decrement operators.
2884 @item
2885 Never overload @code{&&}, @code{||}, or @code{,}.
2887 @end itemize
2889 This option also enables @option{-Wnon-virtual-dtor}, which is also
2890 one of the effective C++ recommendations.  However, the check is
2891 extended to warn about the lack of virtual destructor in accessible
2892 non-polymorphic bases classes too.
2894 When selecting this option, be aware that the standard library
2895 headers do not obey all of these guidelines; use @samp{grep -v}
2896 to filter out those warnings.
2898 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2899 @opindex Wstrict-null-sentinel
2900 @opindex Wno-strict-null-sentinel
2901 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2902 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2903 to @code{__null}.  Although it is a null pointer constant rather than a
2904 null pointer, it is guaranteed to be of the same size as a pointer.
2905 But this use is not portable across different compilers.
2907 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2908 @opindex Wno-non-template-friend
2909 @opindex Wnon-template-friend
2910 Disable warnings when non-templatized friend functions are declared
2911 within a template.  Since the advent of explicit template specification
2912 support in G++, if the name of the friend is an unqualified-id (i.e.,
2913 @samp{friend foo(int)}), the C++ language specification demands that the
2914 friend declare or define an ordinary, nontemplate function.  (Section
2915 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2916 could be interpreted as a particular specialization of a templatized
2917 function.  Because this non-conforming behavior is no longer the default
2918 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2919 check existing code for potential trouble spots and is on by default.
2920 This new compiler behavior can be turned off with
2921 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2922 but disables the helpful warning.
2924 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2925 @opindex Wold-style-cast
2926 @opindex Wno-old-style-cast
2927 Warn if an old-style (C-style) cast to a non-void type is used within
2928 a C++ program.  The new-style casts (@code{dynamic_cast},
2929 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
2930 less vulnerable to unintended effects and much easier to search for.
2932 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2933 @opindex Woverloaded-virtual
2934 @opindex Wno-overloaded-virtual
2935 @cindex overloaded virtual function, warning
2936 @cindex warning for overloaded virtual function
2937 Warn when a function declaration hides virtual functions from a
2938 base class.  For example, in:
2940 @smallexample
2941 struct A @{
2942   virtual void f();
2945 struct B: public A @{
2946   void f(int);
2948 @end smallexample
2950 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2951 like:
2953 @smallexample
2954 B* b;
2955 b->f();
2956 @end smallexample
2958 @noindent
2959 fails to compile.
2961 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2962 @opindex Wno-pmf-conversions
2963 @opindex Wpmf-conversions
2964 Disable the diagnostic for converting a bound pointer to member function
2965 to a plain pointer.
2967 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2968 @opindex Wsign-promo
2969 @opindex Wno-sign-promo
2970 Warn when overload resolution chooses a promotion from unsigned or
2971 enumerated type to a signed type, over a conversion to an unsigned type of
2972 the same size.  Previous versions of G++ tried to preserve
2973 unsignedness, but the standard mandates the current behavior.
2975 @item -Wtemplates @r{(C++ and Objective-C++ only)}
2976 @opindex Wtemplates
2977 Warn when a primary template declaration is encountered.  Some coding
2978 rules disallow templates, and this may be used to enforce that rule.
2979 The warning is inactive inside a system header file, such as the STL, so
2980 one can still use the STL.  One may also instantiate or specialize
2981 templates.
2983 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
2984 @opindex Wmultiple-inheritance
2985 Warn when a class is defined with multiple direct base classes.  Some
2986 coding rules disallow multiple inheritance, and this may be used to
2987 enforce that rule.  The warning is inactive inside a system header file,
2988 such as the STL, so one can still use the STL.  One may also define
2989 classes that indirectly use multiple inheritance.
2991 @item -Wvirtual-inheritance
2992 @opindex Wvirtual-inheritance
2993 Warn when a class is defined with a virtual direct base classe.  Some
2994 coding rules disallow multiple inheritance, and this may be used to
2995 enforce that rule.  The warning is inactive inside a system header file,
2996 such as the STL, so one can still use the STL.  One may also define
2997 classes that indirectly use virtual inheritance.
2999 @item -Wnamespaces
3000 @opindex Wnamespaces
3001 Warn when a namespace definition is opened.  Some coding rules disallow
3002 namespaces, and this may be used to enforce that rule.  The warning is
3003 inactive inside a system header file, such as the STL, so one can still
3004 use the STL.  One may also use using directives and qualified names.
3006 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
3007 @opindex Wterminate
3008 @opindex Wno-terminate
3009 Disable the warning about a throw-expression that will immediately
3010 result in a call to @code{terminate}.
3011 @end table
3013 @node Objective-C and Objective-C++ Dialect Options
3014 @section Options Controlling Objective-C and Objective-C++ Dialects
3016 @cindex compiler options, Objective-C and Objective-C++
3017 @cindex Objective-C and Objective-C++ options, command-line
3018 @cindex options, Objective-C and Objective-C++
3019 (NOTE: This manual does not describe the Objective-C and Objective-C++
3020 languages themselves.  @xref{Standards,,Language Standards
3021 Supported by GCC}, for references.)
3023 This section describes the command-line options that are only meaningful
3024 for Objective-C and Objective-C++ programs.  You can also use most of
3025 the language-independent GNU compiler options.
3026 For example, you might compile a file @file{some_class.m} like this:
3028 @smallexample
3029 gcc -g -fgnu-runtime -O -c some_class.m
3030 @end smallexample
3032 @noindent
3033 In this example, @option{-fgnu-runtime} is an option meant only for
3034 Objective-C and Objective-C++ programs; you can use the other options with
3035 any language supported by GCC@.
3037 Note that since Objective-C is an extension of the C language, Objective-C
3038 compilations may also use options specific to the C front-end (e.g.,
3039 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3040 C++-specific options (e.g., @option{-Wabi}).
3042 Here is a list of options that are @emph{only} for compiling Objective-C
3043 and Objective-C++ programs:
3045 @table @gcctabopt
3046 @item -fconstant-string-class=@var{class-name}
3047 @opindex fconstant-string-class
3048 Use @var{class-name} as the name of the class to instantiate for each
3049 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3050 class name is @code{NXConstantString} if the GNU runtime is being used, and
3051 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3052 @option{-fconstant-cfstrings} option, if also present, overrides the
3053 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3054 to be laid out as constant CoreFoundation strings.
3056 @item -fgnu-runtime
3057 @opindex fgnu-runtime
3058 Generate object code compatible with the standard GNU Objective-C
3059 runtime.  This is the default for most types of systems.
3061 @item -fnext-runtime
3062 @opindex fnext-runtime
3063 Generate output compatible with the NeXT runtime.  This is the default
3064 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3065 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3066 used.
3068 @item -fno-nil-receivers
3069 @opindex fno-nil-receivers
3070 Assume that all Objective-C message dispatches (@code{[receiver
3071 message:arg]}) in this translation unit ensure that the receiver is
3072 not @code{nil}.  This allows for more efficient entry points in the
3073 runtime to be used.  This option is only available in conjunction with
3074 the NeXT runtime and ABI version 0 or 1.
3076 @item -fobjc-abi-version=@var{n}
3077 @opindex fobjc-abi-version
3078 Use version @var{n} of the Objective-C ABI for the selected runtime.
3079 This option is currently supported only for the NeXT runtime.  In that
3080 case, Version 0 is the traditional (32-bit) ABI without support for
3081 properties and other Objective-C 2.0 additions.  Version 1 is the
3082 traditional (32-bit) ABI with support for properties and other
3083 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3084 nothing is specified, the default is Version 0 on 32-bit target
3085 machines, and Version 2 on 64-bit target machines.
3087 @item -fobjc-call-cxx-cdtors
3088 @opindex fobjc-call-cxx-cdtors
3089 For each Objective-C class, check if any of its instance variables is a
3090 C++ object with a non-trivial default constructor.  If so, synthesize a
3091 special @code{- (id) .cxx_construct} instance method which runs
3092 non-trivial default constructors on any such instance variables, in order,
3093 and then return @code{self}.  Similarly, check if any instance variable
3094 is a C++ object with a non-trivial destructor, and if so, synthesize a
3095 special @code{- (void) .cxx_destruct} method which runs
3096 all such default destructors, in reverse order.
3098 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3099 methods thusly generated only operate on instance variables
3100 declared in the current Objective-C class, and not those inherited
3101 from superclasses.  It is the responsibility of the Objective-C
3102 runtime to invoke all such methods in an object's inheritance
3103 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3104 by the runtime immediately after a new object instance is allocated;
3105 the @code{- (void) .cxx_destruct} methods are invoked immediately
3106 before the runtime deallocates an object instance.
3108 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3109 support for invoking the @code{- (id) .cxx_construct} and
3110 @code{- (void) .cxx_destruct} methods.
3112 @item -fobjc-direct-dispatch
3113 @opindex fobjc-direct-dispatch
3114 Allow fast jumps to the message dispatcher.  On Darwin this is
3115 accomplished via the comm page.
3117 @item -fobjc-exceptions
3118 @opindex fobjc-exceptions
3119 Enable syntactic support for structured exception handling in
3120 Objective-C, similar to what is offered by C++ and Java.  This option
3121 is required to use the Objective-C keywords @code{@@try},
3122 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3123 @code{@@synchronized}.  This option is available with both the GNU
3124 runtime and the NeXT runtime (but not available in conjunction with
3125 the NeXT runtime on Mac OS X 10.2 and earlier).
3127 @item -fobjc-gc
3128 @opindex fobjc-gc
3129 Enable garbage collection (GC) in Objective-C and Objective-C++
3130 programs.  This option is only available with the NeXT runtime; the
3131 GNU runtime has a different garbage collection implementation that
3132 does not require special compiler flags.
3134 @item -fobjc-nilcheck
3135 @opindex fobjc-nilcheck
3136 For the NeXT runtime with version 2 of the ABI, check for a nil
3137 receiver in method invocations before doing the actual method call.
3138 This is the default and can be disabled using
3139 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3140 checked for nil in this way no matter what this flag is set to.
3141 Currently this flag does nothing when the GNU runtime, or an older
3142 version of the NeXT runtime ABI, is used.
3144 @item -fobjc-std=objc1
3145 @opindex fobjc-std
3146 Conform to the language syntax of Objective-C 1.0, the language
3147 recognized by GCC 4.0.  This only affects the Objective-C additions to
3148 the C/C++ language; it does not affect conformance to C/C++ standards,
3149 which is controlled by the separate C/C++ dialect option flags.  When
3150 this option is used with the Objective-C or Objective-C++ compiler,
3151 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3152 This is useful if you need to make sure that your Objective-C code can
3153 be compiled with older versions of GCC@.
3155 @item -freplace-objc-classes
3156 @opindex freplace-objc-classes
3157 Emit a special marker instructing @command{ld(1)} not to statically link in
3158 the resulting object file, and allow @command{dyld(1)} to load it in at
3159 run time instead.  This is used in conjunction with the Fix-and-Continue
3160 debugging mode, where the object file in question may be recompiled and
3161 dynamically reloaded in the course of program execution, without the need
3162 to restart the program itself.  Currently, Fix-and-Continue functionality
3163 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3164 and later.
3166 @item -fzero-link
3167 @opindex fzero-link
3168 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3169 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3170 compile time) with static class references that get initialized at load time,
3171 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3172 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3173 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3174 for individual class implementations to be modified during program execution.
3175 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3176 regardless of command-line options.
3178 @item -fno-local-ivars
3179 @opindex fno-local-ivars
3180 @opindex flocal-ivars
3181 By default instance variables in Objective-C can be accessed as if
3182 they were local variables from within the methods of the class they're
3183 declared in.  This can lead to shadowing between instance variables
3184 and other variables declared either locally inside a class method or
3185 globally with the same name.  Specifying the @option{-fno-local-ivars}
3186 flag disables this behavior thus avoiding variable shadowing issues.
3188 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3189 @opindex fivar-visibility
3190 Set the default instance variable visibility to the specified option
3191 so that instance variables declared outside the scope of any access
3192 modifier directives default to the specified visibility.
3194 @item -gen-decls
3195 @opindex gen-decls
3196 Dump interface declarations for all classes seen in the source file to a
3197 file named @file{@var{sourcename}.decl}.
3199 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3200 @opindex Wassign-intercept
3201 @opindex Wno-assign-intercept
3202 Warn whenever an Objective-C assignment is being intercepted by the
3203 garbage collector.
3205 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3206 @opindex Wno-protocol
3207 @opindex Wprotocol
3208 If a class is declared to implement a protocol, a warning is issued for
3209 every method in the protocol that is not implemented by the class.  The
3210 default behavior is to issue a warning for every method not explicitly
3211 implemented in the class, even if a method implementation is inherited
3212 from the superclass.  If you use the @option{-Wno-protocol} option, then
3213 methods inherited from the superclass are considered to be implemented,
3214 and no warning is issued for them.
3216 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3217 @opindex Wselector
3218 @opindex Wno-selector
3219 Warn if multiple methods of different types for the same selector are
3220 found during compilation.  The check is performed on the list of methods
3221 in the final stage of compilation.  Additionally, a check is performed
3222 for each selector appearing in a @code{@@selector(@dots{})}
3223 expression, and a corresponding method for that selector has been found
3224 during compilation.  Because these checks scan the method table only at
3225 the end of compilation, these warnings are not produced if the final
3226 stage of compilation is not reached, for example because an error is
3227 found during compilation, or because the @option{-fsyntax-only} option is
3228 being used.
3230 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3231 @opindex Wstrict-selector-match
3232 @opindex Wno-strict-selector-match
3233 Warn if multiple methods with differing argument and/or return types are
3234 found for a given selector when attempting to send a message using this
3235 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3236 is off (which is the default behavior), the compiler omits such warnings
3237 if any differences found are confined to types that share the same size
3238 and alignment.
3240 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3241 @opindex Wundeclared-selector
3242 @opindex Wno-undeclared-selector
3243 Warn if a @code{@@selector(@dots{})} expression referring to an
3244 undeclared selector is found.  A selector is considered undeclared if no
3245 method with that name has been declared before the
3246 @code{@@selector(@dots{})} expression, either explicitly in an
3247 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3248 an @code{@@implementation} section.  This option always performs its
3249 checks as soon as a @code{@@selector(@dots{})} expression is found,
3250 while @option{-Wselector} only performs its checks in the final stage of
3251 compilation.  This also enforces the coding style convention
3252 that methods and selectors must be declared before being used.
3254 @item -print-objc-runtime-info
3255 @opindex print-objc-runtime-info
3256 Generate C header describing the largest structure that is passed by
3257 value, if any.
3259 @end table
3261 @node Diagnostic Message Formatting Options
3262 @section Options to Control Diagnostic Messages Formatting
3263 @cindex options to control diagnostics formatting
3264 @cindex diagnostic messages
3265 @cindex message formatting
3267 Traditionally, diagnostic messages have been formatted irrespective of
3268 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3269 options described below
3270 to control the formatting algorithm for diagnostic messages, 
3271 e.g.@: how many characters per line, how often source location
3272 information should be reported.  Note that some language front ends may not
3273 honor these options.
3275 @table @gcctabopt
3276 @item -fmessage-length=@var{n}
3277 @opindex fmessage-length
3278 Try to format error messages so that they fit on lines of about
3279 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3280 done; each error message appears on a single line.  This is the
3281 default for all front ends.
3283 @item -fdiagnostics-show-location=once
3284 @opindex fdiagnostics-show-location
3285 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3286 reporter to emit source location information @emph{once}; that is, in
3287 case the message is too long to fit on a single physical line and has to
3288 be wrapped, the source location won't be emitted (as prefix) again,
3289 over and over, in subsequent continuation lines.  This is the default
3290 behavior.
3292 @item -fdiagnostics-show-location=every-line
3293 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3294 messages reporter to emit the same source location information (as
3295 prefix) for physical lines that result from the process of breaking
3296 a message which is too long to fit on a single line.
3298 @item -fdiagnostics-color[=@var{WHEN}]
3299 @itemx -fno-diagnostics-color
3300 @opindex fdiagnostics-color
3301 @cindex highlight, color
3302 @vindex GCC_COLORS @r{environment variable}
3303 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3304 or @samp{auto}.  The default depends on how the compiler has been configured,
3305 it can be any of the above @var{WHEN} options or also @samp{never}
3306 if @env{GCC_COLORS} environment variable isn't present in the environment,
3307 and @samp{auto} otherwise.
3308 @samp{auto} means to use color only when the standard error is a terminal.
3309 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3310 aliases for @option{-fdiagnostics-color=always} and
3311 @option{-fdiagnostics-color=never}, respectively.
3313 The colors are defined by the environment variable @env{GCC_COLORS}.
3314 Its value is a colon-separated list of capabilities and Select Graphic
3315 Rendition (SGR) substrings. SGR commands are interpreted by the
3316 terminal or terminal emulator.  (See the section in the documentation
3317 of your text terminal for permitted values and their meanings as
3318 character attributes.)  These substring values are integers in decimal
3319 representation and can be concatenated with semicolons.
3320 Common values to concatenate include
3321 @samp{1} for bold,
3322 @samp{4} for underline,
3323 @samp{5} for blink,
3324 @samp{7} for inverse,
3325 @samp{39} for default foreground color,
3326 @samp{30} to @samp{37} for foreground colors,
3327 @samp{90} to @samp{97} for 16-color mode foreground colors,
3328 @samp{38;5;0} to @samp{38;5;255}
3329 for 88-color and 256-color modes foreground colors,
3330 @samp{49} for default background color,
3331 @samp{40} to @samp{47} for background colors,
3332 @samp{100} to @samp{107} for 16-color mode background colors,
3333 and @samp{48;5;0} to @samp{48;5;255}
3334 for 88-color and 256-color modes background colors.
3336 The default @env{GCC_COLORS} is
3337 @smallexample
3338 error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
3339 @end smallexample
3340 @noindent
3341 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3342 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3343 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3344 string disables colors.
3345 Supported capabilities are as follows.
3347 @table @code
3348 @item error=
3349 @vindex error GCC_COLORS @r{capability}
3350 SGR substring for error: markers.
3352 @item warning=
3353 @vindex warning GCC_COLORS @r{capability}
3354 SGR substring for warning: markers.
3356 @item note=
3357 @vindex note GCC_COLORS @r{capability}
3358 SGR substring for note: markers.
3360 @item caret=
3361 @vindex caret GCC_COLORS @r{capability}
3362 SGR substring for caret line.
3364 @item locus=
3365 @vindex locus GCC_COLORS @r{capability}
3366 SGR substring for location information, @samp{file:line} or
3367 @samp{file:line:column} etc.
3369 @item quote=
3370 @vindex quote GCC_COLORS @r{capability}
3371 SGR substring for information printed within quotes.
3372 @end table
3374 @item -fno-diagnostics-show-option
3375 @opindex fno-diagnostics-show-option
3376 @opindex fdiagnostics-show-option
3377 By default, each diagnostic emitted includes text indicating the
3378 command-line option that directly controls the diagnostic (if such an
3379 option is known to the diagnostic machinery).  Specifying the
3380 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3382 @item -fno-diagnostics-show-caret
3383 @opindex fno-diagnostics-show-caret
3384 @opindex fdiagnostics-show-caret
3385 By default, each diagnostic emitted includes the original source line
3386 and a caret @samp{^} indicating the column.  This option suppresses this
3387 information.  The source line is truncated to @var{n} characters, if
3388 the @option{-fmessage-length=n} option is given.  When the output is done
3389 to the terminal, the width is limited to the width given by the
3390 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3392 @end table
3394 @node Warning Options
3395 @section Options to Request or Suppress Warnings
3396 @cindex options to control warnings
3397 @cindex warning messages
3398 @cindex messages, warning
3399 @cindex suppressing warnings
3401 Warnings are diagnostic messages that report constructions that
3402 are not inherently erroneous but that are risky or suggest there
3403 may have been an error.
3405 The following language-independent options do not enable specific
3406 warnings but control the kinds of diagnostics produced by GCC@.
3408 @table @gcctabopt
3409 @cindex syntax checking
3410 @item -fsyntax-only
3411 @opindex fsyntax-only
3412 Check the code for syntax errors, but don't do anything beyond that.
3414 @item -fmax-errors=@var{n}
3415 @opindex fmax-errors
3416 Limits the maximum number of error messages to @var{n}, at which point
3417 GCC bails out rather than attempting to continue processing the source
3418 code.  If @var{n} is 0 (the default), there is no limit on the number
3419 of error messages produced.  If @option{-Wfatal-errors} is also
3420 specified, then @option{-Wfatal-errors} takes precedence over this
3421 option.
3423 @item -w
3424 @opindex w
3425 Inhibit all warning messages.
3427 @item -Werror
3428 @opindex Werror
3429 @opindex Wno-error
3430 Make all warnings into errors.
3432 @item -Werror=
3433 @opindex Werror=
3434 @opindex Wno-error=
3435 Make the specified warning into an error.  The specifier for a warning
3436 is appended; for example @option{-Werror=switch} turns the warnings
3437 controlled by @option{-Wswitch} into errors.  This switch takes a
3438 negative form, to be used to negate @option{-Werror} for specific
3439 warnings; for example @option{-Wno-error=switch} makes
3440 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3441 is in effect.
3443 The warning message for each controllable warning includes the
3444 option that controls the warning.  That option can then be used with
3445 @option{-Werror=} and @option{-Wno-error=} as described above.
3446 (Printing of the option in the warning message can be disabled using the
3447 @option{-fno-diagnostics-show-option} flag.)
3449 Note that specifying @option{-Werror=}@var{foo} automatically implies
3450 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3451 imply anything.
3453 @item -Wfatal-errors
3454 @opindex Wfatal-errors
3455 @opindex Wno-fatal-errors
3456 This option causes the compiler to abort compilation on the first error
3457 occurred rather than trying to keep going and printing further error
3458 messages.
3460 @end table
3462 You can request many specific warnings with options beginning with
3463 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3464 implicit declarations.  Each of these specific warning options also
3465 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3466 example, @option{-Wno-implicit}.  This manual lists only one of the
3467 two forms, whichever is not the default.  For further
3468 language-specific options also refer to @ref{C++ Dialect Options} and
3469 @ref{Objective-C and Objective-C++ Dialect Options}.
3471 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3472 options, such as @option{-Wunused}, which may turn on further options,
3473 such as @option{-Wunused-value}. The combined effect of positive and
3474 negative forms is that more specific options have priority over less
3475 specific ones, independently of their position in the command-line. For
3476 options of the same specificity, the last one takes effect. Options
3477 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3478 as if they appeared at the end of the command-line.
3480 When an unrecognized warning option is requested (e.g.,
3481 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3482 that the option is not recognized.  However, if the @option{-Wno-} form
3483 is used, the behavior is slightly different: no diagnostic is
3484 produced for @option{-Wno-unknown-warning} unless other diagnostics
3485 are being produced.  This allows the use of new @option{-Wno-} options
3486 with old compilers, but if something goes wrong, the compiler
3487 warns that an unrecognized option is present.
3489 @table @gcctabopt
3490 @item -Wpedantic
3491 @itemx -pedantic
3492 @opindex pedantic
3493 @opindex Wpedantic
3494 Issue all the warnings demanded by strict ISO C and ISO C++;
3495 reject all programs that use forbidden extensions, and some other
3496 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3497 version of the ISO C standard specified by any @option{-std} option used.
3499 Valid ISO C and ISO C++ programs should compile properly with or without
3500 this option (though a rare few require @option{-ansi} or a
3501 @option{-std} option specifying the required version of ISO C)@.  However,
3502 without this option, certain GNU extensions and traditional C and C++
3503 features are supported as well.  With this option, they are rejected.
3505 @option{-Wpedantic} does not cause warning messages for use of the
3506 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3507 warnings are also disabled in the expression that follows
3508 @code{__extension__}.  However, only system header files should use
3509 these escape routes; application programs should avoid them.
3510 @xref{Alternate Keywords}.
3512 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3513 C conformance.  They soon find that it does not do quite what they want:
3514 it finds some non-ISO practices, but not all---only those for which
3515 ISO C @emph{requires} a diagnostic, and some others for which
3516 diagnostics have been added.
3518 A feature to report any failure to conform to ISO C might be useful in
3519 some instances, but would require considerable additional work and would
3520 be quite different from @option{-Wpedantic}.  We don't have plans to
3521 support such a feature in the near future.
3523 Where the standard specified with @option{-std} represents a GNU
3524 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3525 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3526 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3527 where they are required by the base standard.  (It does not make sense
3528 for such warnings to be given only for features not in the specified GNU
3529 C dialect, since by definition the GNU dialects of C include all
3530 features the compiler supports with the given option, and there would be
3531 nothing to warn about.)
3533 @item -pedantic-errors
3534 @opindex pedantic-errors
3535 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3536 requires a diagnostic, in some cases where there is undefined behavior
3537 at compile-time and in some other cases that do not prevent compilation
3538 of programs that are valid according to the standard. This is not
3539 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3540 by this option and not enabled by the latter and vice versa.
3542 @item -Wall
3543 @opindex Wall
3544 @opindex Wno-all
3545 This enables all the warnings about constructions that some users
3546 consider questionable, and that are easy to avoid (or modify to
3547 prevent the warning), even in conjunction with macros.  This also
3548 enables some language-specific warnings described in @ref{C++ Dialect
3549 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3551 @option{-Wall} turns on the following warning flags:
3553 @gccoptlist{-Waddress   @gol
3554 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3555 -Wbool-compare  @gol
3556 -Wc++11-compat  -Wc++14-compat@gol
3557 -Wchar-subscripts  @gol
3558 -Wcomment  @gol
3559 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
3560 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3561 -Wformat   @gol
3562 -Wimplicit @r{(C and Objective-C only)} @gol
3563 -Wimplicit-int @r{(C and Objective-C only)} @gol
3564 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3565 -Winit-self @r{(only for C++)} @gol
3566 -Wlogical-not-parentheses
3567 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3568 -Wmaybe-uninitialized @gol
3569 -Wmemset-elt-size @gol
3570 -Wmemset-transposed-args @gol
3571 -Wmisleading-indentation @r{(only for C/C++)} @gol
3572 -Wmissing-braces @r{(only for C/ObjC)} @gol
3573 -Wnarrowing @r{(only for C++)}  @gol
3574 -Wnonnull  @gol
3575 -Wnonnull-compare  @gol
3576 -Wopenmp-simd @gol
3577 -Wparentheses  @gol
3578 -Wpointer-sign  @gol
3579 -Wreorder   @gol
3580 -Wreturn-type  @gol
3581 -Wsequence-point  @gol
3582 -Wsign-compare @r{(only in C++)}  @gol
3583 -Wsizeof-pointer-memaccess @gol
3584 -Wstrict-aliasing  @gol
3585 -Wstrict-overflow=1  @gol
3586 -Wswitch  @gol
3587 -Wtautological-compare  @gol
3588 -Wtrigraphs  @gol
3589 -Wuninitialized  @gol
3590 -Wunknown-pragmas  @gol
3591 -Wunused-function  @gol
3592 -Wunused-label     @gol
3593 -Wunused-value     @gol
3594 -Wunused-variable  @gol
3595 -Wvolatile-register-var @gol
3598 Note that some warning flags are not implied by @option{-Wall}.  Some of
3599 them warn about constructions that users generally do not consider
3600 questionable, but which occasionally you might wish to check for;
3601 others warn about constructions that are necessary or hard to avoid in
3602 some cases, and there is no simple way to modify the code to suppress
3603 the warning. Some of them are enabled by @option{-Wextra} but many of
3604 them must be enabled individually.
3606 @item -Wextra
3607 @opindex W
3608 @opindex Wextra
3609 @opindex Wno-extra
3610 This enables some extra warning flags that are not enabled by
3611 @option{-Wall}. (This option used to be called @option{-W}.  The older
3612 name is still supported, but the newer name is more descriptive.)
3614 @gccoptlist{-Wclobbered  @gol
3615 -Wempty-body  @gol
3616 -Wignored-qualifiers @gol
3617 -Wmissing-field-initializers  @gol
3618 -Wmissing-parameter-type @r{(C only)}  @gol
3619 -Wold-style-declaration @r{(C only)}  @gol
3620 -Woverride-init  @gol
3621 -Wsign-compare @r{(C only)} @gol
3622 -Wtype-limits  @gol
3623 -Wuninitialized  @gol
3624 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
3625 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3626 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3629 The option @option{-Wextra} also prints warning messages for the
3630 following cases:
3632 @itemize @bullet
3634 @item
3635 A pointer is compared against integer zero with @code{<}, @code{<=},
3636 @code{>}, or @code{>=}.
3638 @item
3639 (C++ only) An enumerator and a non-enumerator both appear in a
3640 conditional expression.
3642 @item
3643 (C++ only) Ambiguous virtual bases.
3645 @item
3646 (C++ only) Subscripting an array that has been declared @code{register}.
3648 @item
3649 (C++ only) Taking the address of a variable that has been declared
3650 @code{register}.
3652 @item
3653 (C++ only) A base class is not initialized in a derived class's copy
3654 constructor.
3656 @end itemize
3658 @item -Wchar-subscripts
3659 @opindex Wchar-subscripts
3660 @opindex Wno-char-subscripts
3661 Warn if an array subscript has type @code{char}.  This is a common cause
3662 of error, as programmers often forget that this type is signed on some
3663 machines.
3664 This warning is enabled by @option{-Wall}.
3666 @item -Wcomment
3667 @opindex Wcomment
3668 @opindex Wno-comment
3669 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3670 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3671 This warning is enabled by @option{-Wall}.
3673 @item -Wno-coverage-mismatch
3674 @opindex Wno-coverage-mismatch
3675 Warn if feedback profiles do not match when using the
3676 @option{-fprofile-use} option.
3677 If a source file is changed between compiling with @option{-fprofile-gen} and
3678 with @option{-fprofile-use}, the files with the profile feedback can fail
3679 to match the source file and GCC cannot use the profile feedback
3680 information.  By default, this warning is enabled and is treated as an
3681 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3682 warning or @option{-Wno-error=coverage-mismatch} can be used to
3683 disable the error.  Disabling the error for this warning can result in
3684 poorly optimized code and is useful only in the
3685 case of very minor changes such as bug fixes to an existing code-base.
3686 Completely disabling the warning is not recommended.
3688 @item -Wno-cpp
3689 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3691 Suppress warning messages emitted by @code{#warning} directives.
3693 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3694 @opindex Wdouble-promotion
3695 @opindex Wno-double-promotion
3696 Give a warning when a value of type @code{float} is implicitly
3697 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3698 floating-point unit implement @code{float} in hardware, but emulate
3699 @code{double} in software.  On such a machine, doing computations
3700 using @code{double} values is much more expensive because of the
3701 overhead required for software emulation.
3703 It is easy to accidentally do computations with @code{double} because
3704 floating-point literals are implicitly of type @code{double}.  For
3705 example, in:
3706 @smallexample
3707 @group
3708 float area(float radius)
3710    return 3.14159 * radius * radius;
3712 @end group
3713 @end smallexample
3714 the compiler performs the entire computation with @code{double}
3715 because the floating-point literal is a @code{double}.
3717 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
3718 @opindex Wduplicate-decl-specifier
3719 @opindex Wno-duplicate-decl-specifier
3720 Warn if a declaration has duplicate @code{const}, @code{volatile},
3721 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
3722 @option{-Wall}.
3724 @item -Wformat
3725 @itemx -Wformat=@var{n}
3726 @opindex Wformat
3727 @opindex Wno-format
3728 @opindex ffreestanding
3729 @opindex fno-builtin
3730 @opindex Wformat=
3731 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3732 the arguments supplied have types appropriate to the format string
3733 specified, and that the conversions specified in the format string make
3734 sense.  This includes standard functions, and others specified by format
3735 attributes (@pxref{Function Attributes}), in the @code{printf},
3736 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3737 not in the C standard) families (or other target-specific families).
3738 Which functions are checked without format attributes having been
3739 specified depends on the standard version selected, and such checks of
3740 functions without the attribute specified are disabled by
3741 @option{-ffreestanding} or @option{-fno-builtin}.
3743 The formats are checked against the format features supported by GNU
3744 libc version 2.2.  These include all ISO C90 and C99 features, as well
3745 as features from the Single Unix Specification and some BSD and GNU
3746 extensions.  Other library implementations may not support all these
3747 features; GCC does not support warning about features that go beyond a
3748 particular library's limitations.  However, if @option{-Wpedantic} is used
3749 with @option{-Wformat}, warnings are given about format features not
3750 in the selected standard version (but not for @code{strfmon} formats,
3751 since those are not in any version of the C standard).  @xref{C Dialect
3752 Options,,Options Controlling C Dialect}.
3754 @table @gcctabopt
3755 @item -Wformat=1
3756 @itemx -Wformat
3757 @opindex Wformat
3758 @opindex Wformat=1
3759 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3760 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3761 @option{-Wformat} also checks for null format arguments for several
3762 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3763 aspects of this level of format checking can be disabled by the
3764 options: @option{-Wno-format-contains-nul},
3765 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3766 @option{-Wformat} is enabled by @option{-Wall}.
3768 @item -Wno-format-contains-nul
3769 @opindex Wno-format-contains-nul
3770 @opindex Wformat-contains-nul
3771 If @option{-Wformat} is specified, do not warn about format strings that
3772 contain NUL bytes.
3774 @item -Wno-format-extra-args
3775 @opindex Wno-format-extra-args
3776 @opindex Wformat-extra-args
3777 If @option{-Wformat} is specified, do not warn about excess arguments to a
3778 @code{printf} or @code{scanf} format function.  The C standard specifies
3779 that such arguments are ignored.
3781 Where the unused arguments lie between used arguments that are
3782 specified with @samp{$} operand number specifications, normally
3783 warnings are still given, since the implementation could not know what
3784 type to pass to @code{va_arg} to skip the unused arguments.  However,
3785 in the case of @code{scanf} formats, this option suppresses the
3786 warning if the unused arguments are all pointers, since the Single
3787 Unix Specification says that such unused arguments are allowed.
3789 @item -Wno-format-zero-length
3790 @opindex Wno-format-zero-length
3791 @opindex Wformat-zero-length
3792 If @option{-Wformat} is specified, do not warn about zero-length formats.
3793 The C standard specifies that zero-length formats are allowed.
3796 @item -Wformat=2
3797 @opindex Wformat=2
3798 Enable @option{-Wformat} plus additional format checks.  Currently
3799 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3800 -Wformat-y2k}.
3802 @item -Wformat-nonliteral
3803 @opindex Wformat-nonliteral
3804 @opindex Wno-format-nonliteral
3805 If @option{-Wformat} is specified, also warn if the format string is not a
3806 string literal and so cannot be checked, unless the format function
3807 takes its format arguments as a @code{va_list}.
3809 @item -Wformat-security
3810 @opindex Wformat-security
3811 @opindex Wno-format-security
3812 If @option{-Wformat} is specified, also warn about uses of format
3813 functions that represent possible security problems.  At present, this
3814 warns about calls to @code{printf} and @code{scanf} functions where the
3815 format string is not a string literal and there are no format arguments,
3816 as in @code{printf (foo);}.  This may be a security hole if the format
3817 string came from untrusted input and contains @samp{%n}.  (This is
3818 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3819 in future warnings may be added to @option{-Wformat-security} that are not
3820 included in @option{-Wformat-nonliteral}.)
3822 @item -Wformat-signedness
3823 @opindex Wformat-signedness
3824 @opindex Wno-format-signedness
3825 If @option{-Wformat} is specified, also warn if the format string
3826 requires an unsigned argument and the argument is signed and vice versa.
3828 @item -Wformat-y2k
3829 @opindex Wformat-y2k
3830 @opindex Wno-format-y2k
3831 If @option{-Wformat} is specified, also warn about @code{strftime}
3832 formats that may yield only a two-digit year.
3833 @end table
3835 @item -Wnonnull
3836 @opindex Wnonnull
3837 @opindex Wno-nonnull
3838 Warn about passing a null pointer for arguments marked as
3839 requiring a non-null value by the @code{nonnull} function attribute.
3841 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3842 can be disabled with the @option{-Wno-nonnull} option.
3844 @item -Wnonnull-compare
3845 @opindex Wnonnull-compare
3846 @opindex Wno-nonnull-compare
3847 Warn when comparing an argument marked with the @code{nonnull}
3848 function attribute against null inside the function.
3850 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
3851 can be disabled with the @option{-Wno-nonnull-compare} option.
3853 @item -Wnull-dereference
3854 @opindex Wnull-dereference
3855 @opindex Wno-null-dereference
3856 Warn if the compiler detects paths that trigger erroneous or
3857 undefined behavior due to dereferencing a null pointer.  This option
3858 is only active when @option{-fdelete-null-pointer-checks} is active,
3859 which is enabled by optimizations in most targets.  The precision of
3860 the warnings depends on the optimization options used.
3862 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3863 @opindex Winit-self
3864 @opindex Wno-init-self
3865 Warn about uninitialized variables that are initialized with themselves.
3866 Note this option can only be used with the @option{-Wuninitialized} option.
3868 For example, GCC warns about @code{i} being uninitialized in the
3869 following snippet only when @option{-Winit-self} has been specified:
3870 @smallexample
3871 @group
3872 int f()
3874   int i = i;
3875   return i;
3877 @end group
3878 @end smallexample
3880 This warning is enabled by @option{-Wall} in C++.
3882 @item -Wimplicit-int @r{(C and Objective-C only)}
3883 @opindex Wimplicit-int
3884 @opindex Wno-implicit-int
3885 Warn when a declaration does not specify a type.
3886 This warning is enabled by @option{-Wall}.
3888 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3889 @opindex Wimplicit-function-declaration
3890 @opindex Wno-implicit-function-declaration
3891 Give a warning whenever a function is used before being declared. In
3892 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3893 enabled by default and it is made into an error by
3894 @option{-pedantic-errors}. This warning is also enabled by
3895 @option{-Wall}.
3897 @item -Wimplicit @r{(C and Objective-C only)}
3898 @opindex Wimplicit
3899 @opindex Wno-implicit
3900 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3901 This warning is enabled by @option{-Wall}.
3903 @item -Wignored-qualifiers @r{(C and C++ only)}
3904 @opindex Wignored-qualifiers
3905 @opindex Wno-ignored-qualifiers
3906 Warn if the return type of a function has a type qualifier
3907 such as @code{const}.  For ISO C such a type qualifier has no effect,
3908 since the value returned by a function is not an lvalue.
3909 For C++, the warning is only emitted for scalar types or @code{void}.
3910 ISO C prohibits qualified @code{void} return types on function
3911 definitions, so such return types always receive a warning
3912 even without this option.
3914 This warning is also enabled by @option{-Wextra}.
3916 @item -Wignored-attributes @r{(C and C++ only)}
3917 @opindex Wignored-attributes
3918 @opindex Wno-ignored-attributes
3919 Warn when an attribute is ignored.  This is different from the
3920 @option{-Wattributes} option in that it warns whenever the compiler decides
3921 to drop an attribute, not that the attribute is either unknown, used in a
3922 wrong place, etc.  This warning is enabled by default.
3924 @item -Wmain
3925 @opindex Wmain
3926 @opindex Wno-main
3927 Warn if the type of @code{main} is suspicious.  @code{main} should be
3928 a function with external linkage, returning int, taking either zero
3929 arguments, two, or three arguments of appropriate types.  This warning
3930 is enabled by default in C++ and is enabled by either @option{-Wall}
3931 or @option{-Wpedantic}.
3933 @item -Wmisleading-indentation @r{(C and C++ only)}
3934 @opindex Wmisleading-indentation
3935 @opindex Wno-misleading-indentation
3936 Warn when the indentation of the code does not reflect the block structure.
3937 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
3938 @code{for} clauses with a guarded statement that does not use braces,
3939 followed by an unguarded statement with the same indentation.
3941 In the following example, the call to ``bar'' is misleadingly indented as
3942 if it were guarded by the ``if'' conditional.
3944 @smallexample
3945   if (some_condition ())
3946     foo ();
3947     bar ();  /* Gotcha: this is not guarded by the "if".  */
3948 @end smallexample
3950 In the case of mixed tabs and spaces, the warning uses the
3951 @option{-ftabstop=} option to determine if the statements line up
3952 (defaulting to 8).
3954 The warning is not issued for code involving multiline preprocessor logic
3955 such as the following example.
3957 @smallexample
3958   if (flagA)
3959     foo (0);
3960 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
3961   if (flagB)
3962 #endif
3963     foo (1);
3964 @end smallexample
3966 The warning is not issued after a @code{#line} directive, since this
3967 typically indicates autogenerated code, and no assumptions can be made
3968 about the layout of the file that the directive references.
3970 This warning is enabled by @option{-Wall} in C and C++.
3972 @item -Wmissing-braces
3973 @opindex Wmissing-braces
3974 @opindex Wno-missing-braces
3975 Warn if an aggregate or union initializer is not fully bracketed.  In
3976 the following example, the initializer for @code{a} is not fully
3977 bracketed, but that for @code{b} is fully bracketed.  This warning is
3978 enabled by @option{-Wall} in C.
3980 @smallexample
3981 int a[2][2] = @{ 0, 1, 2, 3 @};
3982 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3983 @end smallexample
3985 This warning is enabled by @option{-Wall}.
3987 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3988 @opindex Wmissing-include-dirs
3989 @opindex Wno-missing-include-dirs
3990 Warn if a user-supplied include directory does not exist.
3992 @item -Wparentheses
3993 @opindex Wparentheses
3994 @opindex Wno-parentheses
3995 Warn if parentheses are omitted in certain contexts, such
3996 as when there is an assignment in a context where a truth value
3997 is expected, or when operators are nested whose precedence people
3998 often get confused about.
4000 Also warn if a comparison like @code{x<=y<=z} appears; this is
4001 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
4002 interpretation from that of ordinary mathematical notation.
4004 Also warn for dangerous uses of the GNU extension to
4005 @code{?:} with omitted middle operand. When the condition
4006 in the @code{?}: operator is a boolean expression, the omitted value is
4007 always 1.  Often programmers expect it to be a value computed
4008 inside the conditional expression instead.
4010 This warning is enabled by @option{-Wall}.
4012 @item -Wsequence-point
4013 @opindex Wsequence-point
4014 @opindex Wno-sequence-point
4015 Warn about code that may have undefined semantics because of violations
4016 of sequence point rules in the C and C++ standards.
4018 The C and C++ standards define the order in which expressions in a C/C++
4019 program are evaluated in terms of @dfn{sequence points}, which represent
4020 a partial ordering between the execution of parts of the program: those
4021 executed before the sequence point, and those executed after it.  These
4022 occur after the evaluation of a full expression (one which is not part
4023 of a larger expression), after the evaluation of the first operand of a
4024 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4025 function is called (but after the evaluation of its arguments and the
4026 expression denoting the called function), and in certain other places.
4027 Other than as expressed by the sequence point rules, the order of
4028 evaluation of subexpressions of an expression is not specified.  All
4029 these rules describe only a partial order rather than a total order,
4030 since, for example, if two functions are called within one expression
4031 with no sequence point between them, the order in which the functions
4032 are called is not specified.  However, the standards committee have
4033 ruled that function calls do not overlap.
4035 It is not specified when between sequence points modifications to the
4036 values of objects take effect.  Programs whose behavior depends on this
4037 have undefined behavior; the C and C++ standards specify that ``Between
4038 the previous and next sequence point an object shall have its stored
4039 value modified at most once by the evaluation of an expression.
4040 Furthermore, the prior value shall be read only to determine the value
4041 to be stored.''.  If a program breaks these rules, the results on any
4042 particular implementation are entirely unpredictable.
4044 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4045 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4046 diagnosed by this option, and it may give an occasional false positive
4047 result, but in general it has been found fairly effective at detecting
4048 this sort of problem in programs.
4050 The standard is worded confusingly, therefore there is some debate
4051 over the precise meaning of the sequence point rules in subtle cases.
4052 Links to discussions of the problem, including proposed formal
4053 definitions, may be found on the GCC readings page, at
4054 @uref{http://gcc.gnu.org/@/readings.html}.
4056 This warning is enabled by @option{-Wall} for C and C++.
4058 @item -Wno-return-local-addr
4059 @opindex Wno-return-local-addr
4060 @opindex Wreturn-local-addr
4061 Do not warn about returning a pointer (or in C++, a reference) to a
4062 variable that goes out of scope after the function returns.
4064 @item -Wreturn-type
4065 @opindex Wreturn-type
4066 @opindex Wno-return-type
4067 Warn whenever a function is defined with a return type that defaults
4068 to @code{int}.  Also warn about any @code{return} statement with no
4069 return value in a function whose return type is not @code{void}
4070 (falling off the end of the function body is considered returning
4071 without a value).
4073 For C only, warn about a @code{return} statement with an expression in a
4074 function whose return type is @code{void}, unless the expression type is
4075 also @code{void}.  As a GNU extension, the latter case is accepted
4076 without a warning unless @option{-Wpedantic} is used.
4078 For C++, a function without return type always produces a diagnostic
4079 message, even when @option{-Wno-return-type} is specified.  The only
4080 exceptions are @code{main} and functions defined in system headers.
4082 This warning is enabled by @option{-Wall}.
4084 @item -Wshift-count-negative
4085 @opindex Wshift-count-negative
4086 @opindex Wno-shift-count-negative
4087 Warn if shift count is negative. This warning is enabled by default.
4089 @item -Wshift-count-overflow
4090 @opindex Wshift-count-overflow
4091 @opindex Wno-shift-count-overflow
4092 Warn if shift count >= width of type. This warning is enabled by default.
4094 @item -Wshift-negative-value
4095 @opindex Wshift-negative-value
4096 @opindex Wno-shift-negative-value
4097 Warn if left shifting a negative value.  This warning is enabled by
4098 @option{-Wextra} in C99 and C++11 modes (and newer).
4100 @item -Wshift-overflow
4101 @itemx -Wshift-overflow=@var{n}
4102 @opindex Wshift-overflow
4103 @opindex Wno-shift-overflow
4104 Warn about left shift overflows.  This warning is enabled by
4105 default in C99 and C++11 modes (and newer).
4107 @table @gcctabopt
4108 @item -Wshift-overflow=1
4109 This is the warning level of @option{-Wshift-overflow} and is enabled
4110 by default in C99 and C++11 modes (and newer).  This warning level does
4111 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4112 an overflow is still rejected in contexts where an integer constant expression
4113 is required.)
4115 @item -Wshift-overflow=2
4116 This warning level also warns about left-shifting 1 into the sign bit,
4117 unless C++14 mode is active.
4118 @end table
4120 @item -Wswitch
4121 @opindex Wswitch
4122 @opindex Wno-switch
4123 Warn whenever a @code{switch} statement has an index of enumerated type
4124 and lacks a @code{case} for one or more of the named codes of that
4125 enumeration.  (The presence of a @code{default} label prevents this
4126 warning.)  @code{case} labels outside the enumeration range also
4127 provoke warnings when this option is used (even if there is a
4128 @code{default} label).
4129 This warning is enabled by @option{-Wall}.
4131 @item -Wswitch-default
4132 @opindex Wswitch-default
4133 @opindex Wno-switch-default
4134 Warn whenever a @code{switch} statement does not have a @code{default}
4135 case.
4137 @item -Wswitch-enum
4138 @opindex Wswitch-enum
4139 @opindex Wno-switch-enum
4140 Warn whenever a @code{switch} statement has an index of enumerated type
4141 and lacks a @code{case} for one or more of the named codes of that
4142 enumeration.  @code{case} labels outside the enumeration range also
4143 provoke warnings when this option is used.  The only difference
4144 between @option{-Wswitch} and this option is that this option gives a
4145 warning about an omitted enumeration code even if there is a
4146 @code{default} label.
4148 @item -Wswitch-bool
4149 @opindex Wswitch-bool
4150 @opindex Wno-switch-bool
4151 Warn whenever a @code{switch} statement has an index of boolean type
4152 and the case values are outside the range of a boolean type.
4153 It is possible to suppress this warning by casting the controlling
4154 expression to a type other than @code{bool}.  For example:
4155 @smallexample
4156 @group
4157 switch ((int) (a == 4))
4158   @{
4159   @dots{}
4160   @}
4161 @end group
4162 @end smallexample
4163 This warning is enabled by default for C and C++ programs.
4165 @item -Wswitch-unreachable
4166 @opindex Wswitch-unreachable
4167 @opindex Wno-switch-unreachable
4168 Warn whenever a @code{switch} statement contains statements between the
4169 controlling expression and the first case label, which will never be
4170 executed.  For example:
4171 @smallexample
4172 @group
4173 switch (cond)
4174   @{
4175    i = 15;
4176   @dots{}
4177    case 5:
4178   @dots{}
4179   @}
4180 @end group
4181 @end smallexample
4182 @option{-Wswitch-unreachable} does not warn if the statement between the
4183 controlling expression and the first case label is just a declaration:
4184 @smallexample
4185 @group
4186 switch (cond)
4187   @{
4188    int i;
4189   @dots{}
4190    case 5:
4191    i = 5;
4192   @dots{}
4193   @}
4194 @end group
4195 @end smallexample
4196 This warning is enabled by default for C and C++ programs.
4198 @item -Wsync-nand @r{(C and C++ only)}
4199 @opindex Wsync-nand
4200 @opindex Wno-sync-nand
4201 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4202 built-in functions are used.  These functions changed semantics in GCC 4.4.
4204 @item -Wtrigraphs
4205 @opindex Wtrigraphs
4206 @opindex Wno-trigraphs
4207 Warn if any trigraphs are encountered that might change the meaning of
4208 the program (trigraphs within comments are not warned about).
4209 This warning is enabled by @option{-Wall}.
4211 @item -Wunused-but-set-parameter
4212 @opindex Wunused-but-set-parameter
4213 @opindex Wno-unused-but-set-parameter
4214 Warn whenever a function parameter is assigned to, but otherwise unused
4215 (aside from its declaration).
4217 To suppress this warning use the @code{unused} attribute
4218 (@pxref{Variable Attributes}).
4220 This warning is also enabled by @option{-Wunused} together with
4221 @option{-Wextra}.
4223 @item -Wunused-but-set-variable
4224 @opindex Wunused-but-set-variable
4225 @opindex Wno-unused-but-set-variable
4226 Warn whenever a local variable is assigned to, but otherwise unused
4227 (aside from its declaration).
4228 This warning is enabled by @option{-Wall}.
4230 To suppress this warning use the @code{unused} attribute
4231 (@pxref{Variable Attributes}).
4233 This warning is also enabled by @option{-Wunused}, which is enabled
4234 by @option{-Wall}.
4236 @item -Wunused-function
4237 @opindex Wunused-function
4238 @opindex Wno-unused-function
4239 Warn whenever a static function is declared but not defined or a
4240 non-inline static function is unused.
4241 This warning is enabled by @option{-Wall}.
4243 @item -Wunused-label
4244 @opindex Wunused-label
4245 @opindex Wno-unused-label
4246 Warn whenever a label is declared but not used.
4247 This warning is enabled by @option{-Wall}.
4249 To suppress this warning use the @code{unused} attribute
4250 (@pxref{Variable Attributes}).
4252 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4253 @opindex Wunused-local-typedefs
4254 Warn when a typedef locally defined in a function is not used.
4255 This warning is enabled by @option{-Wall}.
4257 @item -Wunused-parameter
4258 @opindex Wunused-parameter
4259 @opindex Wno-unused-parameter
4260 Warn whenever a function parameter is unused aside from its declaration.
4262 To suppress this warning use the @code{unused} attribute
4263 (@pxref{Variable Attributes}).
4265 @item -Wno-unused-result
4266 @opindex Wunused-result
4267 @opindex Wno-unused-result
4268 Do not warn if a caller of a function marked with attribute
4269 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4270 its return value. The default is @option{-Wunused-result}.
4272 @item -Wunused-variable
4273 @opindex Wunused-variable
4274 @opindex Wno-unused-variable
4275 Warn whenever a local or static variable is unused aside from its
4276 declaration. This option implies @option{-Wunused-const-variable=1} for C,
4277 but not for C++. This warning is enabled by @option{-Wall}.
4279 To suppress this warning use the @code{unused} attribute
4280 (@pxref{Variable Attributes}).
4282 @item -Wunused-const-variable
4283 @itemx -Wunused-const-variable=@var{n}
4284 @opindex Wunused-const-variable
4285 @opindex Wno-unused-const-variable
4286 Warn whenever a constant static variable is unused aside from its declaration.
4287 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
4288 for C, but not for C++. In C this declares variable storage, but in C++ this
4289 is not an error since const variables take the place of @code{#define}s.
4291 To suppress this warning use the @code{unused} attribute
4292 (@pxref{Variable Attributes}).
4294 @table @gcctabopt
4295 @item -Wunused-const-variable=1
4296 This is the warning level that is enabled by @option{-Wunused-variable} for
4297 C.  It warns only about unused static const variables defined in the main
4298 compilation unit, but not about static const variables declared in any
4299 header included.
4301 @item -Wunused-const-variable=2
4302 This warning level also warns for unused constant static variables in
4303 headers (excluding system headers).  This is the warning level of
4304 @option{-Wunused-const-variable} and must be explicitly requested since
4305 in C++ this isn't an error and in C it might be harder to clean up all
4306 headers included.
4307 @end table
4309 @item -Wunused-value
4310 @opindex Wunused-value
4311 @opindex Wno-unused-value
4312 Warn whenever a statement computes a result that is explicitly not
4313 used. To suppress this warning cast the unused expression to
4314 @code{void}. This includes an expression-statement or the left-hand
4315 side of a comma expression that contains no side effects. For example,
4316 an expression such as @code{x[i,j]} causes a warning, while
4317 @code{x[(void)i,j]} does not.
4319 This warning is enabled by @option{-Wall}.
4321 @item -Wunused
4322 @opindex Wunused
4323 @opindex Wno-unused
4324 All the above @option{-Wunused} options combined.
4326 In order to get a warning about an unused function parameter, you must
4327 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4328 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4330 @item -Wuninitialized
4331 @opindex Wuninitialized
4332 @opindex Wno-uninitialized
4333 Warn if an automatic variable is used without first being initialized
4334 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4335 warn if a non-static reference or non-static @code{const} member
4336 appears in a class without constructors.
4338 If you want to warn about code that uses the uninitialized value of the
4339 variable in its own initializer, use the @option{-Winit-self} option.
4341 These warnings occur for individual uninitialized or clobbered
4342 elements of structure, union or array variables as well as for
4343 variables that are uninitialized or clobbered as a whole.  They do
4344 not occur for variables or elements declared @code{volatile}.  Because
4345 these warnings depend on optimization, the exact variables or elements
4346 for which there are warnings depends on the precise optimization
4347 options and version of GCC used.
4349 Note that there may be no warning about a variable that is used only
4350 to compute a value that itself is never used, because such
4351 computations may be deleted by data flow analysis before the warnings
4352 are printed.
4354 @item -Winvalid-memory-model
4355 @opindex Winvalid-memory-model
4356 @opindex Wno-invalid-memory-model
4357 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
4358 and the C11 atomic generic functions with a memory consistency argument
4359 that is either invalid for the operation or outside the range of values
4360 of the @code{memory_order} enumeration.  For example, since the
4361 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
4362 defined for the relaxed, release, and sequentially consistent memory
4363 orders the following code is diagnosed:
4365 @smallexample
4366 void store (int *i)
4368   __atomic_store_n (i, 0, memory_order_consume);
4370 @end smallexample
4372 @option{-Winvalid-memory-model} is enabled by default.
4374 @item -Wmaybe-uninitialized
4375 @opindex Wmaybe-uninitialized
4376 @opindex Wno-maybe-uninitialized
4377 For an automatic variable, if there exists a path from the function
4378 entry to a use of the variable that is initialized, but there exist
4379 some other paths for which the variable is not initialized, the compiler
4380 emits a warning if it cannot prove the uninitialized paths are not
4381 executed at run time. These warnings are made optional because GCC is
4382 not smart enough to see all the reasons why the code might be correct
4383 in spite of appearing to have an error.  Here is one example of how
4384 this can happen:
4386 @smallexample
4387 @group
4389   int x;
4390   switch (y)
4391     @{
4392     case 1: x = 1;
4393       break;
4394     case 2: x = 4;
4395       break;
4396     case 3: x = 5;
4397     @}
4398   foo (x);
4400 @end group
4401 @end smallexample
4403 @noindent
4404 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4405 always initialized, but GCC doesn't know this. To suppress the
4406 warning, you need to provide a default case with assert(0) or
4407 similar code.
4409 @cindex @code{longjmp} warnings
4410 This option also warns when a non-volatile automatic variable might be
4411 changed by a call to @code{longjmp}.  These warnings as well are possible
4412 only in optimizing compilation.
4414 The compiler sees only the calls to @code{setjmp}.  It cannot know
4415 where @code{longjmp} will be called; in fact, a signal handler could
4416 call it at any point in the code.  As a result, you may get a warning
4417 even when there is in fact no problem because @code{longjmp} cannot
4418 in fact be called at the place that would cause a problem.
4420 Some spurious warnings can be avoided if you declare all the functions
4421 you use that never return as @code{noreturn}.  @xref{Function
4422 Attributes}.
4424 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4426 @item -Wunknown-pragmas
4427 @opindex Wunknown-pragmas
4428 @opindex Wno-unknown-pragmas
4429 @cindex warning for unknown pragmas
4430 @cindex unknown pragmas, warning
4431 @cindex pragmas, warning of unknown
4432 Warn when a @code{#pragma} directive is encountered that is not understood by 
4433 GCC@.  If this command-line option is used, warnings are even issued
4434 for unknown pragmas in system header files.  This is not the case if
4435 the warnings are only enabled by the @option{-Wall} command-line option.
4437 @item -Wno-pragmas
4438 @opindex Wno-pragmas
4439 @opindex Wpragmas
4440 Do not warn about misuses of pragmas, such as incorrect parameters,
4441 invalid syntax, or conflicts between pragmas.  See also
4442 @option{-Wunknown-pragmas}.
4444 @item -Wstrict-aliasing
4445 @opindex Wstrict-aliasing
4446 @opindex Wno-strict-aliasing
4447 This option is only active when @option{-fstrict-aliasing} is active.
4448 It warns about code that might break the strict aliasing rules that the
4449 compiler is using for optimization.  The warning does not catch all
4450 cases, but does attempt to catch the more common pitfalls.  It is
4451 included in @option{-Wall}.
4452 It is equivalent to @option{-Wstrict-aliasing=3}
4454 @item -Wstrict-aliasing=n
4455 @opindex Wstrict-aliasing=n
4456 This option is only active when @option{-fstrict-aliasing} is active.
4457 It warns about code that might break the strict aliasing rules that the
4458 compiler is using for optimization.
4459 Higher levels correspond to higher accuracy (fewer false positives).
4460 Higher levels also correspond to more effort, similar to the way @option{-O} 
4461 works.
4462 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4464 Level 1: Most aggressive, quick, least accurate.
4465 Possibly useful when higher levels
4466 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4467 false negatives.  However, it has many false positives.
4468 Warns for all pointer conversions between possibly incompatible types,
4469 even if never dereferenced.  Runs in the front end only.
4471 Level 2: Aggressive, quick, not too precise.
4472 May still have many false positives (not as many as level 1 though),
4473 and few false negatives (but possibly more than level 1).
4474 Unlike level 1, it only warns when an address is taken.  Warns about
4475 incomplete types.  Runs in the front end only.
4477 Level 3 (default for @option{-Wstrict-aliasing}):
4478 Should have very few false positives and few false
4479 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4480 Takes care of the common pun+dereference pattern in the front end:
4481 @code{*(int*)&some_float}.
4482 If optimization is enabled, it also runs in the back end, where it deals
4483 with multiple statement cases using flow-sensitive points-to information.
4484 Only warns when the converted pointer is dereferenced.
4485 Does not warn about incomplete types.
4487 @item -Wstrict-overflow
4488 @itemx -Wstrict-overflow=@var{n}
4489 @opindex Wstrict-overflow
4490 @opindex Wno-strict-overflow
4491 This option is only active when @option{-fstrict-overflow} is active.
4492 It warns about cases where the compiler optimizes based on the
4493 assumption that signed overflow does not occur.  Note that it does not
4494 warn about all cases where the code might overflow: it only warns
4495 about cases where the compiler implements some optimization.  Thus
4496 this warning depends on the optimization level.
4498 An optimization that assumes that signed overflow does not occur is
4499 perfectly safe if the values of the variables involved are such that
4500 overflow never does, in fact, occur.  Therefore this warning can
4501 easily give a false positive: a warning about code that is not
4502 actually a problem.  To help focus on important issues, several
4503 warning levels are defined.  No warnings are issued for the use of
4504 undefined signed overflow when estimating how many iterations a loop
4505 requires, in particular when determining whether a loop will be
4506 executed at all.
4508 @table @gcctabopt
4509 @item -Wstrict-overflow=1
4510 Warn about cases that are both questionable and easy to avoid.  For
4511 example,  with @option{-fstrict-overflow}, the compiler simplifies
4512 @code{x + 1 > x} to @code{1}.  This level of
4513 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4514 are not, and must be explicitly requested.
4516 @item -Wstrict-overflow=2
4517 Also warn about other cases where a comparison is simplified to a
4518 constant.  For example: @code{abs (x) >= 0}.  This can only be
4519 simplified when @option{-fstrict-overflow} is in effect, because
4520 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4521 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4522 @option{-Wstrict-overflow=2}.
4524 @item -Wstrict-overflow=3
4525 Also warn about other cases where a comparison is simplified.  For
4526 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4528 @item -Wstrict-overflow=4
4529 Also warn about other simplifications not covered by the above cases.
4530 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4532 @item -Wstrict-overflow=5
4533 Also warn about cases where the compiler reduces the magnitude of a
4534 constant involved in a comparison.  For example: @code{x + 2 > y} is
4535 simplified to @code{x + 1 >= y}.  This is reported only at the
4536 highest warning level because this simplification applies to many
4537 comparisons, so this warning level gives a very large number of
4538 false positives.
4539 @end table
4541 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4542 @opindex Wsuggest-attribute=
4543 @opindex Wno-suggest-attribute=
4544 Warn for cases where adding an attribute may be beneficial. The
4545 attributes currently supported are listed below.
4547 @table @gcctabopt
4548 @item -Wsuggest-attribute=pure
4549 @itemx -Wsuggest-attribute=const
4550 @itemx -Wsuggest-attribute=noreturn
4551 @opindex Wsuggest-attribute=pure
4552 @opindex Wno-suggest-attribute=pure
4553 @opindex Wsuggest-attribute=const
4554 @opindex Wno-suggest-attribute=const
4555 @opindex Wsuggest-attribute=noreturn
4556 @opindex Wno-suggest-attribute=noreturn
4558 Warn about functions that might be candidates for attributes
4559 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4560 functions visible in other compilation units or (in the case of @code{pure} and
4561 @code{const}) if it cannot prove that the function returns normally. A function
4562 returns normally if it doesn't contain an infinite loop or return abnormally
4563 by throwing, calling @code{abort} or trapping.  This analysis requires option
4564 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4565 higher.  Higher optimization levels improve the accuracy of the analysis.
4567 @item -Wsuggest-attribute=format
4568 @itemx -Wmissing-format-attribute
4569 @opindex Wsuggest-attribute=format
4570 @opindex Wmissing-format-attribute
4571 @opindex Wno-suggest-attribute=format
4572 @opindex Wno-missing-format-attribute
4573 @opindex Wformat
4574 @opindex Wno-format
4576 Warn about function pointers that might be candidates for @code{format}
4577 attributes.  Note these are only possible candidates, not absolute ones.
4578 GCC guesses that function pointers with @code{format} attributes that
4579 are used in assignment, initialization, parameter passing or return
4580 statements should have a corresponding @code{format} attribute in the
4581 resulting type.  I.e.@: the left-hand side of the assignment or
4582 initialization, the type of the parameter variable, or the return type
4583 of the containing function respectively should also have a @code{format}
4584 attribute to avoid the warning.
4586 GCC also warns about function definitions that might be
4587 candidates for @code{format} attributes.  Again, these are only
4588 possible candidates.  GCC guesses that @code{format} attributes
4589 might be appropriate for any function that calls a function like
4590 @code{vprintf} or @code{vscanf}, but this might not always be the
4591 case, and some functions for which @code{format} attributes are
4592 appropriate may not be detected.
4593 @end table
4595 @item -Wsuggest-final-types
4596 @opindex Wno-suggest-final-types
4597 @opindex Wsuggest-final-types
4598 Warn about types with virtual methods where code quality would be improved
4599 if the type were declared with the C++11 @code{final} specifier, 
4600 or, if possible,
4601 declared in an anonymous namespace. This allows GCC to more aggressively
4602 devirtualize the polymorphic calls. This warning is more effective with link
4603 time optimization, where the information about the class hierarchy graph is
4604 more complete.
4606 @item -Wsuggest-final-methods
4607 @opindex Wno-suggest-final-methods
4608 @opindex Wsuggest-final-methods
4609 Warn about virtual methods where code quality would be improved if the method
4610 were declared with the C++11 @code{final} specifier, 
4611 or, if possible, its type were
4612 declared in an anonymous namespace or with the @code{final} specifier.
4613 This warning is
4614 more effective with link time optimization, where the information about the
4615 class hierarchy graph is more complete. It is recommended to first consider
4616 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4617 annotations.
4619 @item -Wsuggest-override
4620 Warn about overriding virtual functions that are not marked with the override
4621 keyword.
4623 @item -Warray-bounds
4624 @itemx -Warray-bounds=@var{n}
4625 @opindex Wno-array-bounds
4626 @opindex Warray-bounds
4627 This option is only active when @option{-ftree-vrp} is active
4628 (default for @option{-O2} and above). It warns about subscripts to arrays
4629 that are always out of bounds. This warning is enabled by @option{-Wall}.
4631 @table @gcctabopt
4632 @item -Warray-bounds=1
4633 This is the warning level of @option{-Warray-bounds} and is enabled
4634 by @option{-Wall}; higher levels are not, and must be explicitly requested.
4636 @item -Warray-bounds=2
4637 This warning level also warns about out of bounds access for
4638 arrays at the end of a struct and for arrays accessed through
4639 pointers. This warning level may give a larger number of
4640 false positives and is deactivated by default.
4641 @end table
4643 @item -Wbool-compare
4644 @opindex Wno-bool-compare
4645 @opindex Wbool-compare
4646 Warn about boolean expression compared with an integer value different from
4647 @code{true}/@code{false}.  For instance, the following comparison is
4648 always false:
4649 @smallexample
4650 int n = 5;
4651 @dots{}
4652 if ((n > 1) == 2) @{ @dots{} @}
4653 @end smallexample
4654 This warning is enabled by @option{-Wall}.
4656 @item -Wduplicated-cond
4657 @opindex Wno-duplicated-cond
4658 @opindex Wduplicated-cond
4659 Warn about duplicated conditions in an if-else-if chain.  For instance,
4660 warn for the following code:
4661 @smallexample
4662 if (p->q != NULL) @{ @dots{} @}
4663 else if (p->q != NULL) @{ @dots{} @}
4664 @end smallexample
4666 @item -Wframe-address
4667 @opindex Wno-frame-address
4668 @opindex Wframe-address
4669 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
4670 is called with an argument greater than 0.  Such calls may return indeterminate
4671 values or crash the program.  The warning is included in @option{-Wall}.
4673 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4674 @opindex Wno-discarded-qualifiers
4675 @opindex Wdiscarded-qualifiers
4676 Do not warn if type qualifiers on pointers are being discarded.
4677 Typically, the compiler warns if a @code{const char *} variable is
4678 passed to a function that takes a @code{char *} parameter.  This option
4679 can be used to suppress such a warning.
4681 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
4682 @opindex Wno-discarded-array-qualifiers
4683 @opindex Wdiscarded-array-qualifiers
4684 Do not warn if type qualifiers on arrays which are pointer targets
4685 are being discarded. Typically, the compiler warns if a
4686 @code{const int (*)[]} variable is passed to a function that
4687 takes a @code{int (*)[]} parameter.  This option can be used to
4688 suppress such a warning.
4690 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4691 @opindex Wno-incompatible-pointer-types
4692 @opindex Wincompatible-pointer-types
4693 Do not warn when there is a conversion between pointers that have incompatible
4694 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4695 which warns for pointer argument passing or assignment with different
4696 signedness.
4698 @item -Wno-int-conversion @r{(C and Objective-C only)}
4699 @opindex Wno-int-conversion
4700 @opindex Wint-conversion
4701 Do not warn about incompatible integer to pointer and pointer to integer
4702 conversions.  This warning is about implicit conversions; for explicit
4703 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4704 @option{-Wno-pointer-to-int-cast} may be used.
4706 @item -Wno-div-by-zero
4707 @opindex Wno-div-by-zero
4708 @opindex Wdiv-by-zero
4709 Do not warn about compile-time integer division by zero.  Floating-point
4710 division by zero is not warned about, as it can be a legitimate way of
4711 obtaining infinities and NaNs.
4713 @item -Wsystem-headers
4714 @opindex Wsystem-headers
4715 @opindex Wno-system-headers
4716 @cindex warnings from system headers
4717 @cindex system headers, warnings from
4718 Print warning messages for constructs found in system header files.
4719 Warnings from system headers are normally suppressed, on the assumption
4720 that they usually do not indicate real problems and would only make the
4721 compiler output harder to read.  Using this command-line option tells
4722 GCC to emit warnings from system headers as if they occurred in user
4723 code.  However, note that using @option{-Wall} in conjunction with this
4724 option does @emph{not} warn about unknown pragmas in system
4725 headers---for that, @option{-Wunknown-pragmas} must also be used.
4727 @item -Wtautological-compare
4728 @opindex Wtautological-compare
4729 @opindex Wno-tautological-compare
4730 Warn if a self-comparison always evaluates to true or false.  This
4731 warning detects various mistakes such as:
4732 @smallexample
4733 int i = 1;
4734 @dots{}
4735 if (i > i) @{ @dots{} @}
4736 @end smallexample
4737 This warning is enabled by @option{-Wall}.
4739 @item -Wtrampolines
4740 @opindex Wtrampolines
4741 @opindex Wno-trampolines
4742 Warn about trampolines generated for pointers to nested functions.
4743 A trampoline is a small piece of data or code that is created at run
4744 time on the stack when the address of a nested function is taken, and is
4745 used to call the nested function indirectly.  For some targets, it is
4746 made up of data only and thus requires no special treatment.  But, for
4747 most targets, it is made up of code and thus requires the stack to be
4748 made executable in order for the program to work properly.
4750 @item -Wfloat-equal
4751 @opindex Wfloat-equal
4752 @opindex Wno-float-equal
4753 Warn if floating-point values are used in equality comparisons.
4755 The idea behind this is that sometimes it is convenient (for the
4756 programmer) to consider floating-point values as approximations to
4757 infinitely precise real numbers.  If you are doing this, then you need
4758 to compute (by analyzing the code, or in some other way) the maximum or
4759 likely maximum error that the computation introduces, and allow for it
4760 when performing comparisons (and when producing output, but that's a
4761 different problem).  In particular, instead of testing for equality, you
4762 should check to see whether the two values have ranges that overlap; and
4763 this is done with the relational operators, so equality comparisons are
4764 probably mistaken.
4766 @item -Wtraditional @r{(C and Objective-C only)}
4767 @opindex Wtraditional
4768 @opindex Wno-traditional
4769 Warn about certain constructs that behave differently in traditional and
4770 ISO C@.  Also warn about ISO C constructs that have no traditional C
4771 equivalent, and/or problematic constructs that should be avoided.
4773 @itemize @bullet
4774 @item
4775 Macro parameters that appear within string literals in the macro body.
4776 In traditional C macro replacement takes place within string literals,
4777 but in ISO C it does not.
4779 @item
4780 In traditional C, some preprocessor directives did not exist.
4781 Traditional preprocessors only considered a line to be a directive
4782 if the @samp{#} appeared in column 1 on the line.  Therefore
4783 @option{-Wtraditional} warns about directives that traditional C
4784 understands but ignores because the @samp{#} does not appear as the
4785 first character on the line.  It also suggests you hide directives like
4786 @code{#pragma} not understood by traditional C by indenting them.  Some
4787 traditional implementations do not recognize @code{#elif}, so this option
4788 suggests avoiding it altogether.
4790 @item
4791 A function-like macro that appears without arguments.
4793 @item
4794 The unary plus operator.
4796 @item
4797 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4798 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4799 constants.)  Note, these suffixes appear in macros defined in the system
4800 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4801 Use of these macros in user code might normally lead to spurious
4802 warnings, however GCC's integrated preprocessor has enough context to
4803 avoid warning in these cases.
4805 @item
4806 A function declared external in one block and then used after the end of
4807 the block.
4809 @item
4810 A @code{switch} statement has an operand of type @code{long}.
4812 @item
4813 A non-@code{static} function declaration follows a @code{static} one.
4814 This construct is not accepted by some traditional C compilers.
4816 @item
4817 The ISO type of an integer constant has a different width or
4818 signedness from its traditional type.  This warning is only issued if
4819 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4820 typically represent bit patterns, are not warned about.
4822 @item
4823 Usage of ISO string concatenation is detected.
4825 @item
4826 Initialization of automatic aggregates.
4828 @item
4829 Identifier conflicts with labels.  Traditional C lacks a separate
4830 namespace for labels.
4832 @item
4833 Initialization of unions.  If the initializer is zero, the warning is
4834 omitted.  This is done under the assumption that the zero initializer in
4835 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4836 initializer warnings and relies on default initialization to zero in the
4837 traditional C case.
4839 @item
4840 Conversions by prototypes between fixed/floating-point values and vice
4841 versa.  The absence of these prototypes when compiling with traditional
4842 C causes serious problems.  This is a subset of the possible
4843 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4845 @item
4846 Use of ISO C style function definitions.  This warning intentionally is
4847 @emph{not} issued for prototype declarations or variadic functions
4848 because these ISO C features appear in your code when using
4849 libiberty's traditional C compatibility macros, @code{PARAMS} and
4850 @code{VPARAMS}.  This warning is also bypassed for nested functions
4851 because that feature is already a GCC extension and thus not relevant to
4852 traditional C compatibility.
4853 @end itemize
4855 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4856 @opindex Wtraditional-conversion
4857 @opindex Wno-traditional-conversion
4858 Warn if a prototype causes a type conversion that is different from what
4859 would happen to the same argument in the absence of a prototype.  This
4860 includes conversions of fixed point to floating and vice versa, and
4861 conversions changing the width or signedness of a fixed-point argument
4862 except when the same as the default promotion.
4864 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4865 @opindex Wdeclaration-after-statement
4866 @opindex Wno-declaration-after-statement
4867 Warn when a declaration is found after a statement in a block.  This
4868 construct, known from C++, was introduced with ISO C99 and is by default
4869 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
4871 @item -Wundef
4872 @opindex Wundef
4873 @opindex Wno-undef
4874 Warn if an undefined identifier is evaluated in an @code{#if} directive.
4876 @item -Wno-endif-labels
4877 @opindex Wno-endif-labels
4878 @opindex Wendif-labels
4879 Do not warn whenever an @code{#else} or an @code{#endif} are followed by text.
4881 @item -Wshadow
4882 @opindex Wshadow
4883 @opindex Wno-shadow
4884 Warn whenever a local variable or type declaration shadows another
4885 variable, parameter, type, class member (in C++), or instance variable
4886 (in Objective-C) or whenever a built-in function is shadowed. Note
4887 that in C++, the compiler warns if a local variable shadows an
4888 explicit typedef, but not if it shadows a struct/class/enum.
4890 @item -Wno-shadow-ivar @r{(Objective-C only)}
4891 @opindex Wno-shadow-ivar
4892 @opindex Wshadow-ivar
4893 Do not warn whenever a local variable shadows an instance variable in an
4894 Objective-C method.
4896 @item -Wlarger-than=@var{len}
4897 @opindex Wlarger-than=@var{len}
4898 @opindex Wlarger-than-@var{len}
4899 Warn whenever an object of larger than @var{len} bytes is defined.
4901 @item -Wframe-larger-than=@var{len}
4902 @opindex Wframe-larger-than
4903 Warn if the size of a function frame is larger than @var{len} bytes.
4904 The computation done to determine the stack frame size is approximate
4905 and not conservative.
4906 The actual requirements may be somewhat greater than @var{len}
4907 even if you do not get a warning.  In addition, any space allocated
4908 via @code{alloca}, variable-length arrays, or related constructs
4909 is not included by the compiler when determining
4910 whether or not to issue a warning.
4912 @item -Wno-free-nonheap-object
4913 @opindex Wno-free-nonheap-object
4914 @opindex Wfree-nonheap-object
4915 Do not warn when attempting to free an object that was not allocated
4916 on the heap.
4918 @item -Wstack-usage=@var{len}
4919 @opindex Wstack-usage
4920 Warn if the stack usage of a function might be larger than @var{len} bytes.
4921 The computation done to determine the stack usage is conservative.
4922 Any space allocated via @code{alloca}, variable-length arrays, or related
4923 constructs is included by the compiler when determining whether or not to
4924 issue a warning.
4926 The message is in keeping with the output of @option{-fstack-usage}.
4928 @itemize
4929 @item
4930 If the stack usage is fully static but exceeds the specified amount, it's:
4932 @smallexample
4933   warning: stack usage is 1120 bytes
4934 @end smallexample
4935 @item
4936 If the stack usage is (partly) dynamic but bounded, it's:
4938 @smallexample
4939   warning: stack usage might be 1648 bytes
4940 @end smallexample
4941 @item
4942 If the stack usage is (partly) dynamic and not bounded, it's:
4944 @smallexample
4945   warning: stack usage might be unbounded
4946 @end smallexample
4947 @end itemize
4949 @item -Wunsafe-loop-optimizations
4950 @opindex Wunsafe-loop-optimizations
4951 @opindex Wno-unsafe-loop-optimizations
4952 Warn if the loop cannot be optimized because the compiler cannot
4953 assume anything on the bounds of the loop indices.  With
4954 @option{-funsafe-loop-optimizations} warn if the compiler makes
4955 such assumptions.
4957 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4958 @opindex Wno-pedantic-ms-format
4959 @opindex Wpedantic-ms-format
4960 When used in combination with @option{-Wformat}
4961 and @option{-pedantic} without GNU extensions, this option
4962 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4963 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4964 which depend on the MS runtime.
4966 @item -Wplacement-new
4967 @itemx -Wplacement-new=@var{n}
4968 @opindex Wplacement-new
4969 @opindex Wno-placement-new
4970 Warn about placement new expressions with undefined behavior, such as
4971 constructing an object in a buffer that is smaller than the type of
4972 the object.  For example, the placement new expression below is diagnosed
4973 because it attempts to construct an array of 64 integers in a buffer only
4974 64 bytes large.
4975 @smallexample
4976 char buf [64];
4977 new (buf) int[64];
4978 @end smallexample
4979 This warning is enabled by default.
4981 @table @gcctabopt
4982 @item -Wplacement-new=1
4983 This is the default warning level of @option{-Wplacement-new}.  At this
4984 level the warning is not issued for some strictly undefined constructs that
4985 GCC allows as extensions for compatibility with legacy code.  For example,
4986 the following @code{new} expression is not diagnosed at this level even
4987 though it has undefined behavior according to the C++ standard because
4988 it writes past the end of the one-element array.
4989 @smallexample
4990 struct S @{ int n, a[1]; @};
4991 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
4992 new (s->a)int [32]();
4993 @end smallexample
4995 @item -Wplacement-new=2
4996 At this level, in addition to diagnosing all the same constructs as at level
4997 1, a diagnostic is also issued for placement new expressions that construct
4998 an object in the last member of structure whose type is an array of a single
4999 element and whose size is less than the size of the object being constructed.
5000 While the previous example would be diagnosed, the following construct makes
5001 use of the flexible member array extension to avoid the warning at level 2.
5002 @smallexample
5003 struct S @{ int n, a[]; @};
5004 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
5005 new (s->a)int [32]();
5006 @end smallexample
5008 @end table
5010 @item -Wpointer-arith
5011 @opindex Wpointer-arith
5012 @opindex Wno-pointer-arith
5013 Warn about anything that depends on the ``size of'' a function type or
5014 of @code{void}.  GNU C assigns these types a size of 1, for
5015 convenience in calculations with @code{void *} pointers and pointers
5016 to functions.  In C++, warn also when an arithmetic operation involves
5017 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
5019 @item -Wtype-limits
5020 @opindex Wtype-limits
5021 @opindex Wno-type-limits
5022 Warn if a comparison is always true or always false due to the limited
5023 range of the data type, but do not warn for constant expressions.  For
5024 example, warn if an unsigned variable is compared against zero with
5025 @code{<} or @code{>=}.  This warning is also enabled by
5026 @option{-Wextra}.
5028 @item -Wbad-function-cast @r{(C and Objective-C only)}
5029 @opindex Wbad-function-cast
5030 @opindex Wno-bad-function-cast
5031 Warn when a function call is cast to a non-matching type.
5032 For example, warn if a call to a function returning an integer type 
5033 is cast to a pointer type.
5035 @item -Wc90-c99-compat @r{(C and Objective-C only)}
5036 @opindex Wc90-c99-compat
5037 @opindex Wno-c90-c99-compat
5038 Warn about features not present in ISO C90, but present in ISO C99.
5039 For instance, warn about use of variable length arrays, @code{long long}
5040 type, @code{bool} type, compound literals, designated initializers, and so
5041 on.  This option is independent of the standards mode.  Warnings are disabled
5042 in the expression that follows @code{__extension__}.
5044 @item -Wc99-c11-compat @r{(C and Objective-C only)}
5045 @opindex Wc99-c11-compat
5046 @opindex Wno-c99-c11-compat
5047 Warn about features not present in ISO C99, but present in ISO C11.
5048 For instance, warn about use of anonymous structures and unions,
5049 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
5050 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
5051 and so on.  This option is independent of the standards mode.  Warnings are
5052 disabled in the expression that follows @code{__extension__}.
5054 @item -Wc++-compat @r{(C and Objective-C only)}
5055 @opindex Wc++-compat
5056 Warn about ISO C constructs that are outside of the common subset of
5057 ISO C and ISO C++, e.g.@: request for implicit conversion from
5058 @code{void *} to a pointer to non-@code{void} type.
5060 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
5061 @opindex Wc++11-compat
5062 Warn about C++ constructs whose meaning differs between ISO C++ 1998
5063 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
5064 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
5065 enabled by @option{-Wall}.
5067 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
5068 @opindex Wc++14-compat
5069 Warn about C++ constructs whose meaning differs between ISO C++ 2011
5070 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
5072 @item -Wcast-qual
5073 @opindex Wcast-qual
5074 @opindex Wno-cast-qual
5075 Warn whenever a pointer is cast so as to remove a type qualifier from
5076 the target type.  For example, warn if a @code{const char *} is cast
5077 to an ordinary @code{char *}.
5079 Also warn when making a cast that introduces a type qualifier in an
5080 unsafe way.  For example, casting @code{char **} to @code{const char **}
5081 is unsafe, as in this example:
5083 @smallexample
5084   /* p is char ** value.  */
5085   const char **q = (const char **) p;
5086   /* Assignment of readonly string to const char * is OK.  */
5087   *q = "string";
5088   /* Now char** pointer points to read-only memory.  */
5089   **p = 'b';
5090 @end smallexample
5092 @item -Wcast-align
5093 @opindex Wcast-align
5094 @opindex Wno-cast-align
5095 Warn whenever a pointer is cast such that the required alignment of the
5096 target is increased.  For example, warn if a @code{char *} is cast to
5097 an @code{int *} on machines where integers can only be accessed at
5098 two- or four-byte boundaries.
5100 @item -Wwrite-strings
5101 @opindex Wwrite-strings
5102 @opindex Wno-write-strings
5103 When compiling C, give string constants the type @code{const
5104 char[@var{length}]} so that copying the address of one into a
5105 non-@code{const} @code{char *} pointer produces a warning.  These
5106 warnings help you find at compile time code that can try to write
5107 into a string constant, but only if you have been very careful about
5108 using @code{const} in declarations and prototypes.  Otherwise, it is
5109 just a nuisance. This is why we did not make @option{-Wall} request
5110 these warnings.
5112 When compiling C++, warn about the deprecated conversion from string
5113 literals to @code{char *}.  This warning is enabled by default for C++
5114 programs.
5116 @item -Wclobbered
5117 @opindex Wclobbered
5118 @opindex Wno-clobbered
5119 Warn for variables that might be changed by @code{longjmp} or
5120 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5122 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5123 @opindex Wconditionally-supported
5124 @opindex Wno-conditionally-supported
5125 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5127 @item -Wconversion
5128 @opindex Wconversion
5129 @opindex Wno-conversion
5130 Warn for implicit conversions that may alter a value. This includes
5131 conversions between real and integer, like @code{abs (x)} when
5132 @code{x} is @code{double}; conversions between signed and unsigned,
5133 like @code{unsigned ui = -1}; and conversions to smaller types, like
5134 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5135 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5136 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5137 conversions between signed and unsigned integers can be disabled by
5138 using @option{-Wno-sign-conversion}.
5140 For C++, also warn for confusing overload resolution for user-defined
5141 conversions; and conversions that never use a type conversion
5142 operator: conversions to @code{void}, the same type, a base class or a
5143 reference to them. Warnings about conversions between signed and
5144 unsigned integers are disabled by default in C++ unless
5145 @option{-Wsign-conversion} is explicitly enabled.
5147 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5148 @opindex Wconversion-null
5149 @opindex Wno-conversion-null
5150 Do not warn for conversions between @code{NULL} and non-pointer
5151 types. @option{-Wconversion-null} is enabled by default.
5153 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5154 @opindex Wzero-as-null-pointer-constant
5155 @opindex Wno-zero-as-null-pointer-constant
5156 Warn when a literal @samp{0} is used as null pointer constant.  This can
5157 be useful to facilitate the conversion to @code{nullptr} in C++11.
5159 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
5160 @opindex Wsubobject-linkage
5161 @opindex Wno-subobject-linkage
5162 Warn if a class type has a base or a field whose type uses the anonymous
5163 namespace or depends on a type with no linkage.  If a type A depends on
5164 a type B with no or internal linkage, defining it in multiple
5165 translation units would be an ODR violation because the meaning of B
5166 is different in each translation unit.  If A only appears in a single
5167 translation unit, the best way to silence the warning is to give it
5168 internal linkage by putting it in an anonymous namespace as well.  The
5169 compiler doesn't give this warning for types defined in the main .C
5170 file, as those are unlikely to have multiple definitions.
5171 @option{-Wsubobject-linkage} is enabled by default.
5173 @item -Wdangling-else
5174 @opindex Wdangling-else
5175 @opindex Wno-dangling-else
5176 Warn about constructions where there may be confusion to which
5177 @code{if} statement an @code{else} branch belongs.  Here is an example of
5178 such a case:
5180 @smallexample
5181 @group
5183   if (a)
5184     if (b)
5185       foo ();
5186   else
5187     bar ();
5189 @end group
5190 @end smallexample
5192 In C/C++, every @code{else} branch belongs to the innermost possible
5193 @code{if} statement, which in this example is @code{if (b)}.  This is
5194 often not what the programmer expected, as illustrated in the above
5195 example by indentation the programmer chose.  When there is the
5196 potential for this confusion, GCC issues a warning when this flag
5197 is specified.  To eliminate the warning, add explicit braces around
5198 the innermost @code{if} statement so there is no way the @code{else}
5199 can belong to the enclosing @code{if}.  The resulting code
5200 looks like this:
5202 @smallexample
5203 @group
5205   if (a)
5206     @{
5207       if (b)
5208         foo ();
5209       else
5210         bar ();
5211     @}
5213 @end group
5214 @end smallexample
5216 This warning is enabled by @option{-Wparentheses}.
5218 @item -Wdate-time
5219 @opindex Wdate-time
5220 @opindex Wno-date-time
5221 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
5222 are encountered as they might prevent bit-wise-identical reproducible
5223 compilations.
5225 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
5226 @opindex Wdelete-incomplete
5227 @opindex Wno-delete-incomplete
5228 Warn when deleting a pointer to incomplete type, which may cause
5229 undefined behavior at runtime.  This warning is enabled by default.
5231 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
5232 @opindex Wuseless-cast
5233 @opindex Wno-useless-cast
5234 Warn when an expression is casted to its own type.
5236 @item -Wempty-body
5237 @opindex Wempty-body
5238 @opindex Wno-empty-body
5239 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
5240 while} statement.  This warning is also enabled by @option{-Wextra}.
5242 @item -Wenum-compare
5243 @opindex Wenum-compare
5244 @opindex Wno-enum-compare
5245 Warn about a comparison between values of different enumerated types.
5246 In C++ enumeral mismatches in conditional expressions are also
5247 diagnosed and the warning is enabled by default.  In C this warning is 
5248 enabled by @option{-Wall}.
5250 @item -Wjump-misses-init @r{(C, Objective-C only)}
5251 @opindex Wjump-misses-init
5252 @opindex Wno-jump-misses-init
5253 Warn if a @code{goto} statement or a @code{switch} statement jumps
5254 forward across the initialization of a variable, or jumps backward to a
5255 label after the variable has been initialized.  This only warns about
5256 variables that are initialized when they are declared.  This warning is
5257 only supported for C and Objective-C; in C++ this sort of branch is an
5258 error in any case.
5260 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
5261 can be disabled with the @option{-Wno-jump-misses-init} option.
5263 @item -Wsign-compare
5264 @opindex Wsign-compare
5265 @opindex Wno-sign-compare
5266 @cindex warning for comparison of signed and unsigned values
5267 @cindex comparison of signed and unsigned values, warning
5268 @cindex signed and unsigned values, comparison warning
5269 Warn when a comparison between signed and unsigned values could produce
5270 an incorrect result when the signed value is converted to unsigned.
5271 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
5272 also enabled by @option{-Wextra}.
5274 @item -Wsign-conversion
5275 @opindex Wsign-conversion
5276 @opindex Wno-sign-conversion
5277 Warn for implicit conversions that may change the sign of an integer
5278 value, like assigning a signed integer expression to an unsigned
5279 integer variable. An explicit cast silences the warning. In C, this
5280 option is enabled also by @option{-Wconversion}.
5282 @item -Wfloat-conversion
5283 @opindex Wfloat-conversion
5284 @opindex Wno-float-conversion
5285 Warn for implicit conversions that reduce the precision of a real value.
5286 This includes conversions from real to integer, and from higher precision
5287 real to lower precision real values.  This option is also enabled by
5288 @option{-Wconversion}.
5290 @item -Wno-scalar-storage-order
5291 @opindex -Wno-scalar-storage-order
5292 @opindex -Wscalar-storage-order
5293 Do not warn on suspicious constructs involving reverse scalar storage order.
5295 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
5296 @opindex Wsized-deallocation
5297 @opindex Wno-sized-deallocation
5298 Warn about a definition of an unsized deallocation function
5299 @smallexample
5300 void operator delete (void *) noexcept;
5301 void operator delete[] (void *) noexcept;
5302 @end smallexample
5303 without a definition of the corresponding sized deallocation function
5304 @smallexample
5305 void operator delete (void *, std::size_t) noexcept;
5306 void operator delete[] (void *, std::size_t) noexcept;
5307 @end smallexample
5308 or vice versa.  Enabled by @option{-Wextra} along with
5309 @option{-fsized-deallocation}.
5311 @item -Wsizeof-pointer-memaccess
5312 @opindex Wsizeof-pointer-memaccess
5313 @opindex Wno-sizeof-pointer-memaccess
5314 Warn for suspicious length parameters to certain string and memory built-in
5315 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
5316 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
5317 but a pointer, and suggests a possible fix, or about
5318 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
5319 @option{-Wall}.
5321 @item -Wsizeof-array-argument
5322 @opindex Wsizeof-array-argument
5323 @opindex Wno-sizeof-array-argument
5324 Warn when the @code{sizeof} operator is applied to a parameter that is
5325 declared as an array in a function definition.  This warning is enabled by
5326 default for C and C++ programs.
5328 @item -Wmemset-elt-size
5329 @opindex Wmemset-elt-size
5330 @opindex Wno-memset-elt-size
5331 Warn for suspicious calls to the @code{memset} built-in function, if the
5332 first argument references an array, and the third argument is a number
5333 equal to the number of elements, but not equal to the size of the array
5334 in memory.  This indicates that the user has omitted a multiplication by
5335 the element size.  This warning is enabled by @option{-Wall}.
5337 @item -Wmemset-transposed-args
5338 @opindex Wmemset-transposed-args
5339 @opindex Wno-memset-transposed-args
5340 Warn for suspicious calls to the @code{memset} built-in function, if the
5341 second argument is not zero and the third argument is zero.  This warns e.g.@
5342 about @code{memset (buf, sizeof buf, 0)} where most probably
5343 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
5344 is only emitted if the third argument is literal zero.  If it is some
5345 expression that is folded to zero, a cast of zero to some type, etc., 
5346 it is far less likely that the user has mistakenly exchanged the arguments 
5347 and no warning is emitted.  This warning is enabled by @option{-Wall}.
5349 @item -Waddress
5350 @opindex Waddress
5351 @opindex Wno-address
5352 Warn about suspicious uses of memory addresses. These include using
5353 the address of a function in a conditional expression, such as
5354 @code{void func(void); if (func)}, and comparisons against the memory
5355 address of a string literal, such as @code{if (x == "abc")}.  Such
5356 uses typically indicate a programmer error: the address of a function
5357 always evaluates to true, so their use in a conditional usually
5358 indicate that the programmer forgot the parentheses in a function
5359 call; and comparisons against string literals result in unspecified
5360 behavior and are not portable in C, so they usually indicate that the
5361 programmer intended to use @code{strcmp}.  This warning is enabled by
5362 @option{-Wall}.
5364 @item -Wlogical-op
5365 @opindex Wlogical-op
5366 @opindex Wno-logical-op
5367 Warn about suspicious uses of logical operators in expressions.
5368 This includes using logical operators in contexts where a
5369 bit-wise operator is likely to be expected.  Also warns when
5370 the operands of a logical operator are the same:
5371 @smallexample
5372 extern int a;
5373 if (a < 0 && a < 0) @{ @dots{} @}
5374 @end smallexample
5376 @item -Wlogical-not-parentheses
5377 @opindex Wlogical-not-parentheses
5378 @opindex Wno-logical-not-parentheses
5379 Warn about logical not used on the left hand side operand of a comparison.
5380 This option does not warn if the RHS operand is of a boolean type.  Its
5381 purpose is to detect suspicious code like the following:
5382 @smallexample
5383 int a;
5384 @dots{}
5385 if (!a > 1) @{ @dots{} @}
5386 @end smallexample
5388 It is possible to suppress the warning by wrapping the LHS into
5389 parentheses:
5390 @smallexample
5391 if ((!a) > 1) @{ @dots{} @}
5392 @end smallexample
5394 This warning is enabled by @option{-Wall}.
5396 @item -Waggregate-return
5397 @opindex Waggregate-return
5398 @opindex Wno-aggregate-return
5399 Warn if any functions that return structures or unions are defined or
5400 called.  (In languages where you can return an array, this also elicits
5401 a warning.)
5403 @item -Wno-aggressive-loop-optimizations
5404 @opindex Wno-aggressive-loop-optimizations
5405 @opindex Waggressive-loop-optimizations
5406 Warn if in a loop with constant number of iterations the compiler detects
5407 undefined behavior in some statement during one or more of the iterations.
5409 @item -Wno-attributes
5410 @opindex Wno-attributes
5411 @opindex Wattributes
5412 Do not warn if an unexpected @code{__attribute__} is used, such as
5413 unrecognized attributes, function attributes applied to variables,
5414 etc.  This does not stop errors for incorrect use of supported
5415 attributes.
5417 @item -Wno-builtin-macro-redefined
5418 @opindex Wno-builtin-macro-redefined
5419 @opindex Wbuiltin-macro-redefined
5420 Do not warn if certain built-in macros are redefined.  This suppresses
5421 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
5422 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
5424 @item -Wstrict-prototypes @r{(C and Objective-C only)}
5425 @opindex Wstrict-prototypes
5426 @opindex Wno-strict-prototypes
5427 Warn if a function is declared or defined without specifying the
5428 argument types.  (An old-style function definition is permitted without
5429 a warning if preceded by a declaration that specifies the argument
5430 types.)
5432 @item -Wold-style-declaration @r{(C and Objective-C only)}
5433 @opindex Wold-style-declaration
5434 @opindex Wno-old-style-declaration
5435 Warn for obsolescent usages, according to the C Standard, in a
5436 declaration. For example, warn if storage-class specifiers like
5437 @code{static} are not the first things in a declaration.  This warning
5438 is also enabled by @option{-Wextra}.
5440 @item -Wold-style-definition @r{(C and Objective-C only)}
5441 @opindex Wold-style-definition
5442 @opindex Wno-old-style-definition
5443 Warn if an old-style function definition is used.  A warning is given
5444 even if there is a previous prototype.
5446 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
5447 @opindex Wmissing-parameter-type
5448 @opindex Wno-missing-parameter-type
5449 A function parameter is declared without a type specifier in K&R-style
5450 functions:
5452 @smallexample
5453 void foo(bar) @{ @}
5454 @end smallexample
5456 This warning is also enabled by @option{-Wextra}.
5458 @item -Wmissing-prototypes @r{(C and Objective-C only)}
5459 @opindex Wmissing-prototypes
5460 @opindex Wno-missing-prototypes
5461 Warn if a global function is defined without a previous prototype
5462 declaration.  This warning is issued even if the definition itself
5463 provides a prototype.  Use this option to detect global functions
5464 that do not have a matching prototype declaration in a header file.
5465 This option is not valid for C++ because all function declarations
5466 provide prototypes and a non-matching declaration declares an
5467 overload rather than conflict with an earlier declaration.
5468 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
5470 @item -Wmissing-declarations
5471 @opindex Wmissing-declarations
5472 @opindex Wno-missing-declarations
5473 Warn if a global function is defined without a previous declaration.
5474 Do so even if the definition itself provides a prototype.
5475 Use this option to detect global functions that are not declared in
5476 header files.  In C, no warnings are issued for functions with previous
5477 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
5478 missing prototypes.  In C++, no warnings are issued for function templates,
5479 or for inline functions, or for functions in anonymous namespaces.
5481 @item -Wmissing-field-initializers
5482 @opindex Wmissing-field-initializers
5483 @opindex Wno-missing-field-initializers
5484 @opindex W
5485 @opindex Wextra
5486 @opindex Wno-extra
5487 Warn if a structure's initializer has some fields missing.  For
5488 example, the following code causes such a warning, because
5489 @code{x.h} is implicitly zero:
5491 @smallexample
5492 struct s @{ int f, g, h; @};
5493 struct s x = @{ 3, 4 @};
5494 @end smallexample
5496 This option does not warn about designated initializers, so the following
5497 modification does not trigger a warning:
5499 @smallexample
5500 struct s @{ int f, g, h; @};
5501 struct s x = @{ .f = 3, .g = 4 @};
5502 @end smallexample
5504 In C++ this option does not warn either about the empty @{ @}
5505 initializer, for example:
5507 @smallexample
5508 struct s @{ int f, g, h; @};
5509 s x = @{ @};
5510 @end smallexample
5512 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
5513 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
5515 @item -Wno-multichar
5516 @opindex Wno-multichar
5517 @opindex Wmultichar
5518 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
5519 Usually they indicate a typo in the user's code, as they have
5520 implementation-defined values, and should not be used in portable code.
5522 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
5523 @opindex Wnormalized=
5524 @opindex Wnormalized
5525 @opindex Wno-normalized
5526 @cindex NFC
5527 @cindex NFKC
5528 @cindex character set, input normalization
5529 In ISO C and ISO C++, two identifiers are different if they are
5530 different sequences of characters.  However, sometimes when characters
5531 outside the basic ASCII character set are used, you can have two
5532 different character sequences that look the same.  To avoid confusion,
5533 the ISO 10646 standard sets out some @dfn{normalization rules} which
5534 when applied ensure that two sequences that look the same are turned into
5535 the same sequence.  GCC can warn you if you are using identifiers that
5536 have not been normalized; this option controls that warning.
5538 There are four levels of warning supported by GCC@.  The default is
5539 @option{-Wnormalized=nfc}, which warns about any identifier that is
5540 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
5541 recommended form for most uses.  It is equivalent to
5542 @option{-Wnormalized}.
5544 Unfortunately, there are some characters allowed in identifiers by
5545 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
5546 identifiers.  That is, there's no way to use these symbols in portable
5547 ISO C or C++ and have all your identifiers in NFC@.
5548 @option{-Wnormalized=id} suppresses the warning for these characters.
5549 It is hoped that future versions of the standards involved will correct
5550 this, which is why this option is not the default.
5552 You can switch the warning off for all characters by writing
5553 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
5554 only do this if you are using some other normalization scheme (like
5555 ``D''), because otherwise you can easily create bugs that are
5556 literally impossible to see.
5558 Some characters in ISO 10646 have distinct meanings but look identical
5559 in some fonts or display methodologies, especially once formatting has
5560 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
5561 LETTER N'', displays just like a regular @code{n} that has been
5562 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
5563 normalization scheme to convert all these into a standard form as
5564 well, and GCC warns if your code is not in NFKC if you use
5565 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
5566 about every identifier that contains the letter O because it might be
5567 confused with the digit 0, and so is not the default, but may be
5568 useful as a local coding convention if the programming environment 
5569 cannot be fixed to display these characters distinctly.
5571 @item -Wno-deprecated
5572 @opindex Wno-deprecated
5573 @opindex Wdeprecated
5574 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
5576 @item -Wno-deprecated-declarations
5577 @opindex Wno-deprecated-declarations
5578 @opindex Wdeprecated-declarations
5579 Do not warn about uses of functions (@pxref{Function Attributes}),
5580 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5581 Attributes}) marked as deprecated by using the @code{deprecated}
5582 attribute.
5584 @item -Wno-overflow
5585 @opindex Wno-overflow
5586 @opindex Woverflow
5587 Do not warn about compile-time overflow in constant expressions.
5589 @item -Wno-odr
5590 @opindex Wno-odr
5591 @opindex Wodr
5592 Warn about One Definition Rule violations during link-time optimization.
5593 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5595 @item -Wopenmp-simd
5596 @opindex Wopenm-simd
5597 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5598 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
5599 option can be used to relax the cost model.
5601 @item -Woverride-init @r{(C and Objective-C only)}
5602 @opindex Woverride-init
5603 @opindex Wno-override-init
5604 @opindex W
5605 @opindex Wextra
5606 @opindex Wno-extra
5607 Warn if an initialized field without side effects is overridden when
5608 using designated initializers (@pxref{Designated Inits, , Designated
5609 Initializers}).
5611 This warning is included in @option{-Wextra}.  To get other
5612 @option{-Wextra} warnings without this one, use @option{-Wextra
5613 -Wno-override-init}.
5615 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
5616 @opindex Woverride-init-side-effects
5617 @opindex Wno-override-init-side-effects
5618 Warn if an initialized field with side effects is overridden when
5619 using designated initializers (@pxref{Designated Inits, , Designated
5620 Initializers}).  This warning is enabled by default.
5622 @item -Wpacked
5623 @opindex Wpacked
5624 @opindex Wno-packed
5625 Warn if a structure is given the packed attribute, but the packed
5626 attribute has no effect on the layout or size of the structure.
5627 Such structures may be mis-aligned for little benefit.  For
5628 instance, in this code, the variable @code{f.x} in @code{struct bar}
5629 is misaligned even though @code{struct bar} does not itself
5630 have the packed attribute:
5632 @smallexample
5633 @group
5634 struct foo @{
5635   int x;
5636   char a, b, c, d;
5637 @} __attribute__((packed));
5638 struct bar @{
5639   char z;
5640   struct foo f;
5642 @end group
5643 @end smallexample
5645 @item -Wpacked-bitfield-compat
5646 @opindex Wpacked-bitfield-compat
5647 @opindex Wno-packed-bitfield-compat
5648 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5649 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5650 the change can lead to differences in the structure layout.  GCC
5651 informs you when the offset of such a field has changed in GCC 4.4.
5652 For example there is no longer a 4-bit padding between field @code{a}
5653 and @code{b} in this structure:
5655 @smallexample
5656 struct foo
5658   char a:4;
5659   char b:8;
5660 @} __attribute__ ((packed));
5661 @end smallexample
5663 This warning is enabled by default.  Use
5664 @option{-Wno-packed-bitfield-compat} to disable this warning.
5666 @item -Wpadded
5667 @opindex Wpadded
5668 @opindex Wno-padded
5669 Warn if padding is included in a structure, either to align an element
5670 of the structure or to align the whole structure.  Sometimes when this
5671 happens it is possible to rearrange the fields of the structure to
5672 reduce the padding and so make the structure smaller.
5674 @item -Wredundant-decls
5675 @opindex Wredundant-decls
5676 @opindex Wno-redundant-decls
5677 Warn if anything is declared more than once in the same scope, even in
5678 cases where multiple declaration is valid and changes nothing.
5680 @item -Wnested-externs @r{(C and Objective-C only)}
5681 @opindex Wnested-externs
5682 @opindex Wno-nested-externs
5683 Warn if an @code{extern} declaration is encountered within a function.
5685 @item -Wno-inherited-variadic-ctor
5686 @opindex Winherited-variadic-ctor
5687 @opindex Wno-inherited-variadic-ctor
5688 Suppress warnings about use of C++11 inheriting constructors when the
5689 base class inherited from has a C variadic constructor; the warning is
5690 on by default because the ellipsis is not inherited.
5692 @item -Winline
5693 @opindex Winline
5694 @opindex Wno-inline
5695 Warn if a function that is declared as inline cannot be inlined.
5696 Even with this option, the compiler does not warn about failures to
5697 inline functions declared in system headers.
5699 The compiler uses a variety of heuristics to determine whether or not
5700 to inline a function.  For example, the compiler takes into account
5701 the size of the function being inlined and the amount of inlining
5702 that has already been done in the current function.  Therefore,
5703 seemingly insignificant changes in the source program can cause the
5704 warnings produced by @option{-Winline} to appear or disappear.
5706 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5707 @opindex Wno-invalid-offsetof
5708 @opindex Winvalid-offsetof
5709 Suppress warnings from applying the @code{offsetof} macro to a non-POD
5710 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
5711 to a non-standard-layout type is undefined.  In existing C++ implementations,
5712 however, @code{offsetof} typically gives meaningful results.
5713 This flag is for users who are aware that they are
5714 writing nonportable code and who have deliberately chosen to ignore the
5715 warning about it.
5717 The restrictions on @code{offsetof} may be relaxed in a future version
5718 of the C++ standard.
5720 @item -Wno-int-to-pointer-cast
5721 @opindex Wno-int-to-pointer-cast
5722 @opindex Wint-to-pointer-cast
5723 Suppress warnings from casts to pointer type of an integer of a
5724 different size. In C++, casting to a pointer type of smaller size is
5725 an error. @option{Wint-to-pointer-cast} is enabled by default.
5728 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5729 @opindex Wno-pointer-to-int-cast
5730 @opindex Wpointer-to-int-cast
5731 Suppress warnings from casts from a pointer to an integer type of a
5732 different size.
5734 @item -Winvalid-pch
5735 @opindex Winvalid-pch
5736 @opindex Wno-invalid-pch
5737 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5738 the search path but can't be used.
5740 @item -Wlong-long
5741 @opindex Wlong-long
5742 @opindex Wno-long-long
5743 Warn if @code{long long} type is used.  This is enabled by either
5744 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5745 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5747 @item -Wvariadic-macros
5748 @opindex Wvariadic-macros
5749 @opindex Wno-variadic-macros
5750 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5751 alternate syntax is used in ISO C99 mode.  This is enabled by either
5752 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5753 messages, use @option{-Wno-variadic-macros}.
5755 @item -Wvarargs
5756 @opindex Wvarargs
5757 @opindex Wno-varargs
5758 Warn upon questionable usage of the macros used to handle variable
5759 arguments like @code{va_start}.  This is default.  To inhibit the
5760 warning messages, use @option{-Wno-varargs}.
5762 @item -Wvector-operation-performance
5763 @opindex Wvector-operation-performance
5764 @opindex Wno-vector-operation-performance
5765 Warn if vector operation is not implemented via SIMD capabilities of the
5766 architecture.  Mainly useful for the performance tuning.
5767 Vector operation can be implemented @code{piecewise}, which means that the
5768 scalar operation is performed on every vector element; 
5769 @code{in parallel}, which means that the vector operation is implemented
5770 using scalars of wider type, which normally is more performance efficient;
5771 and @code{as a single scalar}, which means that vector fits into a
5772 scalar type.
5774 @item -Wno-virtual-move-assign
5775 @opindex Wvirtual-move-assign
5776 @opindex Wno-virtual-move-assign
5777 Suppress warnings about inheriting from a virtual base with a
5778 non-trivial C++11 move assignment operator.  This is dangerous because
5779 if the virtual base is reachable along more than one path, it is
5780 moved multiple times, which can mean both objects end up in the
5781 moved-from state.  If the move assignment operator is written to avoid
5782 moving from a moved-from object, this warning can be disabled.
5784 @item -Wvla
5785 @opindex Wvla
5786 @opindex Wno-vla
5787 Warn if variable length array is used in the code.
5788 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5789 the variable length array.
5791 @item -Wvolatile-register-var
5792 @opindex Wvolatile-register-var
5793 @opindex Wno-volatile-register-var
5794 Warn if a register variable is declared volatile.  The volatile
5795 modifier does not inhibit all optimizations that may eliminate reads
5796 and/or writes to register variables.  This warning is enabled by
5797 @option{-Wall}.
5799 @item -Wdisabled-optimization
5800 @opindex Wdisabled-optimization
5801 @opindex Wno-disabled-optimization
5802 Warn if a requested optimization pass is disabled.  This warning does
5803 not generally indicate that there is anything wrong with your code; it
5804 merely indicates that GCC's optimizers are unable to handle the code
5805 effectively.  Often, the problem is that your code is too big or too
5806 complex; GCC refuses to optimize programs when the optimization
5807 itself is likely to take inordinate amounts of time.
5809 @item -Wpointer-sign @r{(C and Objective-C only)}
5810 @opindex Wpointer-sign
5811 @opindex Wno-pointer-sign
5812 Warn for pointer argument passing or assignment with different signedness.
5813 This option is only supported for C and Objective-C@.  It is implied by
5814 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5815 @option{-Wno-pointer-sign}.
5817 @item -Wstack-protector
5818 @opindex Wstack-protector
5819 @opindex Wno-stack-protector
5820 This option is only active when @option{-fstack-protector} is active.  It
5821 warns about functions that are not protected against stack smashing.
5823 @item -Woverlength-strings
5824 @opindex Woverlength-strings
5825 @opindex Wno-overlength-strings
5826 Warn about string constants that are longer than the ``minimum
5827 maximum'' length specified in the C standard.  Modern compilers
5828 generally allow string constants that are much longer than the
5829 standard's minimum limit, but very portable programs should avoid
5830 using longer strings.
5832 The limit applies @emph{after} string constant concatenation, and does
5833 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5834 C99, it was raised to 4095.  C++98 does not specify a normative
5835 minimum maximum, so we do not diagnose overlength strings in C++@.
5837 This option is implied by @option{-Wpedantic}, and can be disabled with
5838 @option{-Wno-overlength-strings}.
5840 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5841 @opindex Wunsuffixed-float-constants
5843 Issue a warning for any floating constant that does not have
5844 a suffix.  When used together with @option{-Wsystem-headers} it
5845 warns about such constants in system header files.  This can be useful
5846 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5847 from the decimal floating-point extension to C99.
5849 @item -Wno-designated-init @r{(C and Objective-C only)}
5850 Suppress warnings when a positional initializer is used to initialize
5851 a structure that has been marked with the @code{designated_init}
5852 attribute.
5854 @item -Whsa
5855 Issue a warning when HSAIL cannot be emitted for the compiled function or
5856 OpenMP construct.
5858 @end table
5860 @node Debugging Options
5861 @section Options for Debugging Your Program
5862 @cindex options, debugging
5863 @cindex debugging information options
5865 To tell GCC to emit extra information for use by a debugger, in almost 
5866 all cases you need only to add @option{-g} to your other options.
5868 GCC allows you to use @option{-g} with
5869 @option{-O}.  The shortcuts taken by optimized code may occasionally
5870 be surprising: some variables you declared may not exist
5871 at all; flow of control may briefly move where you did not expect it;
5872 some statements may not be executed because they compute constant
5873 results or their values are already at hand; some statements may
5874 execute in different places because they have been moved out of loops.
5875 Nevertheless it is possible to debug optimized output.  This makes
5876 it reasonable to use the optimizer for programs that might have bugs.
5878 If you are not using some other optimization option, consider
5879 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
5880 With no @option{-O} option at all, some compiler passes that collect
5881 information useful for debugging do not run at all, so that
5882 @option{-Og} may result in a better debugging experience.
5884 @table @gcctabopt
5885 @item -g
5886 @opindex g
5887 Produce debugging information in the operating system's native format
5888 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
5889 information.
5891 On most systems that use stabs format, @option{-g} enables use of extra
5892 debugging information that only GDB can use; this extra information
5893 makes debugging work better in GDB but probably makes other debuggers
5894 crash or
5895 refuse to read the program.  If you want to control for certain whether
5896 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5897 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5899 @item -ggdb
5900 @opindex ggdb
5901 Produce debugging information for use by GDB@.  This means to use the
5902 most expressive format available (DWARF, stabs, or the native format
5903 if neither of those are supported), including GDB extensions if at all
5904 possible.
5906 @item -gdwarf
5907 @itemx -gdwarf-@var{version}
5908 @opindex gdwarf
5909 Produce debugging information in DWARF format (if that is supported).
5910 The value of @var{version} may be either 2, 3, 4 or 5; the default version
5911 for most targets is 4.  DWARF Version 5 is only experimental.
5913 Note that with DWARF Version 2, some ports require and always
5914 use some non-conflicting DWARF 3 extensions in the unwind tables.
5916 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5917 for maximum benefit.
5919 GCC no longer supports DWARF Version 1, which is substantially
5920 different than Version 2 and later.  For historical reasons, some
5921 other DWARF-related options (including @option{-feliminate-dwarf2-dups} 
5922 and @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
5923 in their names, but apply to all currently-supported versions of DWARF.
5925 @item -gstabs
5926 @opindex gstabs
5927 Produce debugging information in stabs format (if that is supported),
5928 without GDB extensions.  This is the format used by DBX on most BSD
5929 systems.  On MIPS, Alpha and System V Release 4 systems this option
5930 produces stabs debugging output that is not understood by DBX or SDB@.
5931 On System V Release 4 systems this option requires the GNU assembler.
5933 @item -gstabs+
5934 @opindex gstabs+
5935 Produce debugging information in stabs format (if that is supported),
5936 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5937 use of these extensions is likely to make other debuggers crash or
5938 refuse to read the program.
5940 @item -gcoff
5941 @opindex gcoff
5942 Produce debugging information in COFF format (if that is supported).
5943 This is the format used by SDB on most System V systems prior to
5944 System V Release 4.
5946 @item -gxcoff
5947 @opindex gxcoff
5948 Produce debugging information in XCOFF format (if that is supported).
5949 This is the format used by the DBX debugger on IBM RS/6000 systems.
5951 @item -gxcoff+
5952 @opindex gxcoff+
5953 Produce debugging information in XCOFF format (if that is supported),
5954 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5955 use of these extensions is likely to make other debuggers crash or
5956 refuse to read the program, and may cause assemblers other than the GNU
5957 assembler (GAS) to fail with an error.
5959 @item -gvms
5960 @opindex gvms
5961 Produce debugging information in Alpha/VMS debug format (if that is
5962 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5964 @item -g@var{level}
5965 @itemx -ggdb@var{level}
5966 @itemx -gstabs@var{level}
5967 @itemx -gcoff@var{level}
5968 @itemx -gxcoff@var{level}
5969 @itemx -gvms@var{level}
5970 Request debugging information and also use @var{level} to specify how
5971 much information.  The default level is 2.
5973 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5974 @option{-g}.
5976 Level 1 produces minimal information, enough for making backtraces in
5977 parts of the program that you don't plan to debug.  This includes
5978 descriptions of functions and external variables, and line number
5979 tables, but no information about local variables.
5981 Level 3 includes extra information, such as all the macro definitions
5982 present in the program.  Some debuggers support macro expansion when
5983 you use @option{-g3}.
5985 @option{-gdwarf} does not accept a concatenated debug level, to avoid
5986 confusion with @option{-gdwarf-@var{level}}.
5987 Instead use an additional @option{-g@var{level}} option to change the
5988 debug level for DWARF.
5990 @item -feliminate-unused-debug-symbols
5991 @opindex feliminate-unused-debug-symbols
5992 Produce debugging information in stabs format (if that is supported),
5993 for only symbols that are actually used.
5995 @item -femit-class-debug-always
5996 @opindex femit-class-debug-always
5997 Instead of emitting debugging information for a C++ class in only one
5998 object file, emit it in all object files using the class.  This option
5999 should be used only with debuggers that are unable to handle the way GCC
6000 normally emits debugging information for classes because using this
6001 option increases the size of debugging information by as much as a
6002 factor of two.
6004 @item -fno-merge-debug-strings
6005 @opindex fmerge-debug-strings
6006 @opindex fno-merge-debug-strings
6007 Direct the linker to not merge together strings in the debugging
6008 information that are identical in different object files.  Merging is
6009 not supported by all assemblers or linkers.  Merging decreases the size
6010 of the debug information in the output file at the cost of increasing
6011 link processing time.  Merging is enabled by default.
6013 @item -fdebug-prefix-map=@var{old}=@var{new}
6014 @opindex fdebug-prefix-map
6015 When compiling files in directory @file{@var{old}}, record debugging
6016 information describing them as in @file{@var{new}} instead.
6018 @item -fvar-tracking
6019 @opindex fvar-tracking
6020 Run variable tracking pass.  It computes where variables are stored at each
6021 position in code.  Better debugging information is then generated
6022 (if the debugging information format supports this information).
6024 It is enabled by default when compiling with optimization (@option{-Os},
6025 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6026 the debug info format supports it.
6028 @item -fvar-tracking-assignments
6029 @opindex fvar-tracking-assignments
6030 @opindex fno-var-tracking-assignments
6031 Annotate assignments to user variables early in the compilation and
6032 attempt to carry the annotations over throughout the compilation all the
6033 way to the end, in an attempt to improve debug information while
6034 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6036 It can be enabled even if var-tracking is disabled, in which case
6037 annotations are created and maintained, but discarded at the end.
6038 By default, this flag is enabled together with @option{-fvar-tracking},
6039 except when selective scheduling is enabled.
6041 @item -gsplit-dwarf
6042 @opindex gsplit-dwarf
6043 Separate as much DWARF debugging information as possible into a
6044 separate output file with the extension @file{.dwo}.  This option allows
6045 the build system to avoid linking files with debug information.  To
6046 be useful, this option requires a debugger capable of reading @file{.dwo}
6047 files.
6049 @item -gpubnames
6050 @opindex gpubnames
6051 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
6053 @item -ggnu-pubnames
6054 @opindex ggnu-pubnames
6055 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
6056 suitable for conversion into a GDB@ index.  This option is only useful
6057 with a linker that can produce GDB@ index version 7.
6059 @item -fdebug-types-section
6060 @opindex fdebug-types-section
6061 @opindex fno-debug-types-section
6062 When using DWARF Version 4 or higher, type DIEs can be put into
6063 their own @code{.debug_types} section instead of making them part of the
6064 @code{.debug_info} section.  It is more efficient to put them in a separate
6065 comdat sections since the linker can then remove duplicates.
6066 But not all DWARF consumers support @code{.debug_types} sections yet
6067 and on some objects @code{.debug_types} produces larger instead of smaller
6068 debugging information.
6070 @item -grecord-gcc-switches
6071 @item -gno-record-gcc-switches
6072 @opindex grecord-gcc-switches
6073 @opindex gno-record-gcc-switches
6074 This switch causes the command-line options used to invoke the
6075 compiler that may affect code generation to be appended to the
6076 DW_AT_producer attribute in DWARF debugging information.  The options
6077 are concatenated with spaces separating them from each other and from
6078 the compiler version.  
6079 It is enabled by default.
6080 See also @option{-frecord-gcc-switches} for another
6081 way of storing compiler options into the object file.  
6083 @item -gstrict-dwarf
6084 @opindex gstrict-dwarf
6085 Disallow using extensions of later DWARF standard version than selected
6086 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
6087 DWARF extensions from later standard versions is allowed.
6089 @item -gno-strict-dwarf
6090 @opindex gno-strict-dwarf
6091 Allow using extensions of later DWARF standard version than selected with
6092 @option{-gdwarf-@var{version}}.
6094 @item -gz@r{[}=@var{type}@r{]}
6095 @opindex gz
6096 Produce compressed debug sections in DWARF format, if that is supported.
6097 If @var{type} is not given, the default type depends on the capabilities
6098 of the assembler and linker used.  @var{type} may be one of
6099 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
6100 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
6101 compression in traditional GNU format).  If the linker doesn't support
6102 writing compressed debug sections, the option is rejected.  Otherwise,
6103 if the assembler does not support them, @option{-gz} is silently ignored
6104 when producing object files.
6106 @item -feliminate-dwarf2-dups
6107 @opindex feliminate-dwarf2-dups
6108 Compress DWARF debugging information by eliminating duplicated
6109 information about each symbol.  This option only makes sense when
6110 generating DWARF debugging information.
6112 @item -femit-struct-debug-baseonly
6113 @opindex femit-struct-debug-baseonly
6114 Emit debug information for struct-like types
6115 only when the base name of the compilation source file
6116 matches the base name of file in which the struct is defined.
6118 This option substantially reduces the size of debugging information,
6119 but at significant potential loss in type information to the debugger.
6120 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6121 See @option{-femit-struct-debug-detailed} for more detailed control.
6123 This option works only with DWARF debug output.
6125 @item -femit-struct-debug-reduced
6126 @opindex femit-struct-debug-reduced
6127 Emit debug information for struct-like types
6128 only when the base name of the compilation source file
6129 matches the base name of file in which the type is defined,
6130 unless the struct is a template or defined in a system header.
6132 This option significantly reduces the size of debugging information,
6133 with some potential loss in type information to the debugger.
6134 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6135 See @option{-femit-struct-debug-detailed} for more detailed control.
6137 This option works only with DWARF debug output.
6139 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6140 @opindex femit-struct-debug-detailed
6141 Specify the struct-like types
6142 for which the compiler generates debug information.
6143 The intent is to reduce duplicate struct debug information
6144 between different object files within the same program.
6146 This option is a detailed version of
6147 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6148 which serves for most needs.
6150 A specification has the syntax@*
6151 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6153 The optional first word limits the specification to
6154 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6155 A struct type is used directly when it is the type of a variable, member.
6156 Indirect uses arise through pointers to structs.
6157 That is, when use of an incomplete struct is valid, the use is indirect.
6158 An example is
6159 @samp{struct one direct; struct two * indirect;}.
6161 The optional second word limits the specification to
6162 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6163 Generic structs are a bit complicated to explain.
6164 For C++, these are non-explicit specializations of template classes,
6165 or non-template classes within the above.
6166 Other programming languages have generics,
6167 but @option{-femit-struct-debug-detailed} does not yet implement them.
6169 The third word specifies the source files for those
6170 structs for which the compiler should emit debug information.
6171 The values @samp{none} and @samp{any} have the normal meaning.
6172 The value @samp{base} means that
6173 the base of name of the file in which the type declaration appears
6174 must match the base of the name of the main compilation file.
6175 In practice, this means that when compiling @file{foo.c}, debug information
6176 is generated for types declared in that file and @file{foo.h},
6177 but not other header files.
6178 The value @samp{sys} means those types satisfying @samp{base}
6179 or declared in system or compiler headers.
6181 You may need to experiment to determine the best settings for your application.
6183 The default is @option{-femit-struct-debug-detailed=all}.
6185 This option works only with DWARF debug output.
6187 @item -fno-dwarf2-cfi-asm
6188 @opindex fdwarf2-cfi-asm
6189 @opindex fno-dwarf2-cfi-asm
6190 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
6191 instead of using GAS @code{.cfi_*} directives.
6193 @item -fno-eliminate-unused-debug-types
6194 @opindex feliminate-unused-debug-types
6195 @opindex fno-eliminate-unused-debug-types
6196 Normally, when producing DWARF output, GCC avoids producing debug symbol 
6197 output for types that are nowhere used in the source file being compiled.
6198 Sometimes it is useful to have GCC emit debugging
6199 information for all types declared in a compilation
6200 unit, regardless of whether or not they are actually used
6201 in that compilation unit, for example 
6202 if, in the debugger, you want to cast a value to a type that is
6203 not actually used in your program (but is declared).  More often,
6204 however, this results in a significant amount of wasted space.
6205 @end table
6207 @node Optimize Options
6208 @section Options That Control Optimization
6209 @cindex optimize options
6210 @cindex options, optimization
6212 These options control various sorts of optimizations.
6214 Without any optimization option, the compiler's goal is to reduce the
6215 cost of compilation and to make debugging produce the expected
6216 results.  Statements are independent: if you stop the program with a
6217 breakpoint between statements, you can then assign a new value to any
6218 variable or change the program counter to any other statement in the
6219 function and get exactly the results you expect from the source
6220 code.
6222 Turning on optimization flags makes the compiler attempt to improve
6223 the performance and/or code size at the expense of compilation time
6224 and possibly the ability to debug the program.
6226 The compiler performs optimization based on the knowledge it has of the
6227 program.  Compiling multiple files at once to a single output file mode allows
6228 the compiler to use information gained from all of the files when compiling
6229 each of them.
6231 Not all optimizations are controlled directly by a flag.  Only
6232 optimizations that have a flag are listed in this section.
6234 Most optimizations are only enabled if an @option{-O} level is set on
6235 the command line.  Otherwise they are disabled, even if individual
6236 optimization flags are specified.
6238 Depending on the target and how GCC was configured, a slightly different
6239 set of optimizations may be enabled at each @option{-O} level than
6240 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6241 to find out the exact set of optimizations that are enabled at each level.
6242 @xref{Overall Options}, for examples.
6244 @table @gcctabopt
6245 @item -O
6246 @itemx -O1
6247 @opindex O
6248 @opindex O1
6249 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6250 more memory for a large function.
6252 With @option{-O}, the compiler tries to reduce code size and execution
6253 time, without performing any optimizations that take a great deal of
6254 compilation time.
6256 @option{-O} turns on the following optimization flags:
6257 @gccoptlist{
6258 -fauto-inc-dec @gol
6259 -fbranch-count-reg @gol
6260 -fcombine-stack-adjustments @gol
6261 -fcompare-elim @gol
6262 -fcprop-registers @gol
6263 -fdce @gol
6264 -fdefer-pop @gol
6265 -fdelayed-branch @gol
6266 -fdse @gol
6267 -fforward-propagate @gol
6268 -fguess-branch-probability @gol
6269 -fif-conversion2 @gol
6270 -fif-conversion @gol
6271 -finline-functions-called-once @gol
6272 -fipa-pure-const @gol
6273 -fipa-profile @gol
6274 -fipa-reference @gol
6275 -fmerge-constants @gol
6276 -fmove-loop-invariants @gol
6277 -freorder-blocks @gol
6278 -fshrink-wrap @gol
6279 -fsplit-wide-types @gol
6280 -fssa-backprop @gol
6281 -fssa-phiopt @gol
6282 -ftree-bit-ccp @gol
6283 -ftree-ccp @gol
6284 -ftree-ch @gol
6285 -ftree-coalesce-vars @gol
6286 -ftree-copy-prop @gol
6287 -ftree-dce @gol
6288 -ftree-dominator-opts @gol
6289 -ftree-dse @gol
6290 -ftree-forwprop @gol
6291 -ftree-fre @gol
6292 -ftree-phiprop @gol
6293 -ftree-sink @gol
6294 -ftree-slsr @gol
6295 -ftree-sra @gol
6296 -ftree-pta @gol
6297 -ftree-ter @gol
6298 -funit-at-a-time}
6300 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6301 where doing so does not interfere with debugging.
6303 @item -O2
6304 @opindex O2
6305 Optimize even more.  GCC performs nearly all supported optimizations
6306 that do not involve a space-speed tradeoff.
6307 As compared to @option{-O}, this option increases both compilation time
6308 and the performance of the generated code.
6310 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6311 also turns on the following optimization flags:
6312 @gccoptlist{-fthread-jumps @gol
6313 -falign-functions  -falign-jumps @gol
6314 -falign-loops  -falign-labels @gol
6315 -fcaller-saves @gol
6316 -fcrossjumping @gol
6317 -fcse-follow-jumps  -fcse-skip-blocks @gol
6318 -fdelete-null-pointer-checks @gol
6319 -fdevirtualize -fdevirtualize-speculatively @gol
6320 -fexpensive-optimizations @gol
6321 -fgcse  -fgcse-lm  @gol
6322 -fhoist-adjacent-loads @gol
6323 -finline-small-functions @gol
6324 -findirect-inlining @gol
6325 -fipa-cp @gol
6326 -fipa-cp-alignment @gol
6327 -fipa-sra @gol
6328 -fipa-icf @gol
6329 -fisolate-erroneous-paths-dereference @gol
6330 -flra-remat @gol
6331 -foptimize-sibling-calls @gol
6332 -foptimize-strlen @gol
6333 -fpartial-inlining @gol
6334 -fpeephole2 @gol
6335 -freorder-blocks-algorithm=stc @gol
6336 -freorder-blocks-and-partition -freorder-functions @gol
6337 -frerun-cse-after-loop  @gol
6338 -fsched-interblock  -fsched-spec @gol
6339 -fschedule-insns  -fschedule-insns2 @gol
6340 -fstrict-aliasing -fstrict-overflow @gol
6341 -ftree-builtin-call-dce @gol
6342 -ftree-switch-conversion -ftree-tail-merge @gol
6343 -ftree-pre @gol
6344 -ftree-vrp @gol
6345 -fipa-ra}
6347 Please note the warning under @option{-fgcse} about
6348 invoking @option{-O2} on programs that use computed gotos.
6350 @item -O3
6351 @opindex O3
6352 Optimize yet more.  @option{-O3} turns on all optimizations specified
6353 by @option{-O2} and also turns on the @option{-finline-functions},
6354 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6355 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
6356 @option{-ftree-loop-distribute-patterns}, @option{-fsplit-paths}
6357 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
6358 @option{-ftree-partial-pre}, @option{-fpeel-loops}
6359 and @option{-fipa-cp-clone} options.
6361 @item -O0
6362 @opindex O0
6363 Reduce compilation time and make debugging produce the expected
6364 results.  This is the default.
6366 @item -Os
6367 @opindex Os
6368 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6369 do not typically increase code size.  It also performs further
6370 optimizations designed to reduce code size.
6372 @option{-Os} disables the following optimization flags:
6373 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6374 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
6375 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
6377 @item -Ofast
6378 @opindex Ofast
6379 Disregard strict standards compliance.  @option{-Ofast} enables all
6380 @option{-O3} optimizations.  It also enables optimizations that are not
6381 valid for all standard-compliant programs.
6382 It turns on @option{-ffast-math} and the Fortran-specific
6383 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6385 @item -Og
6386 @opindex Og
6387 Optimize debugging experience.  @option{-Og} enables optimizations
6388 that do not interfere with debugging. It should be the optimization
6389 level of choice for the standard edit-compile-debug cycle, offering
6390 a reasonable level of optimization while maintaining fast compilation
6391 and a good debugging experience.
6392 @end table
6394 If you use multiple @option{-O} options, with or without level numbers,
6395 the last such option is the one that is effective.
6397 Options of the form @option{-f@var{flag}} specify machine-independent
6398 flags.  Most flags have both positive and negative forms; the negative
6399 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6400 below, only one of the forms is listed---the one you typically 
6401 use.  You can figure out the other form by either removing @samp{no-}
6402 or adding it.
6404 The following options control specific optimizations.  They are either
6405 activated by @option{-O} options or are related to ones that are.  You
6406 can use the following flags in the rare cases when ``fine-tuning'' of
6407 optimizations to be performed is desired.
6409 @table @gcctabopt
6410 @item -fno-defer-pop
6411 @opindex fno-defer-pop
6412 Always pop the arguments to each function call as soon as that function
6413 returns.  For machines that must pop arguments after a function call,
6414 the compiler normally lets arguments accumulate on the stack for several
6415 function calls and pops them all at once.
6417 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6419 @item -fforward-propagate
6420 @opindex fforward-propagate
6421 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6422 instructions and checks if the result can be simplified.  If loop unrolling
6423 is active, two passes are performed and the second is scheduled after
6424 loop unrolling.
6426 This option is enabled by default at optimization levels @option{-O},
6427 @option{-O2}, @option{-O3}, @option{-Os}.
6429 @item -ffp-contract=@var{style}
6430 @opindex ffp-contract
6431 @option{-ffp-contract=off} disables floating-point expression contraction.
6432 @option{-ffp-contract=fast} enables floating-point expression contraction
6433 such as forming of fused multiply-add operations if the target has
6434 native support for them.
6435 @option{-ffp-contract=on} enables floating-point expression contraction
6436 if allowed by the language standard.  This is currently not implemented
6437 and treated equal to @option{-ffp-contract=off}.
6439 The default is @option{-ffp-contract=fast}.
6441 @item -fomit-frame-pointer
6442 @opindex fomit-frame-pointer
6443 Don't keep the frame pointer in a register for functions that
6444 don't need one.  This avoids the instructions to save, set up and
6445 restore frame pointers; it also makes an extra register available
6446 in many functions.  @strong{It also makes debugging impossible on
6447 some machines.}
6449 On some machines, such as the VAX, this flag has no effect, because
6450 the standard calling sequence automatically handles the frame pointer
6451 and nothing is saved by pretending it doesn't exist.  The
6452 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6453 whether a target machine supports this flag.  @xref{Registers,,Register
6454 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6456 The default setting (when not optimizing for
6457 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
6458 @option{-fomit-frame-pointer}.  You can configure GCC with the
6459 @option{--enable-frame-pointer} configure option to change the default.
6461 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6463 @item -foptimize-sibling-calls
6464 @opindex foptimize-sibling-calls
6465 Optimize sibling and tail recursive calls.
6467 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6469 @item -foptimize-strlen
6470 @opindex foptimize-strlen
6471 Optimize various standard C string functions (e.g. @code{strlen},
6472 @code{strchr} or @code{strcpy}) and
6473 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
6475 Enabled at levels @option{-O2}, @option{-O3}.
6477 @item -fno-inline
6478 @opindex fno-inline
6479 Do not expand any functions inline apart from those marked with
6480 the @code{always_inline} attribute.  This is the default when not
6481 optimizing.
6483 Single functions can be exempted from inlining by marking them
6484 with the @code{noinline} attribute.
6486 @item -finline-small-functions
6487 @opindex finline-small-functions
6488 Integrate functions into their callers when their body is smaller than expected
6489 function call code (so overall size of program gets smaller).  The compiler
6490 heuristically decides which functions are simple enough to be worth integrating
6491 in this way.  This inlining applies to all functions, even those not declared
6492 inline.
6494 Enabled at level @option{-O2}.
6496 @item -findirect-inlining
6497 @opindex findirect-inlining
6498 Inline also indirect calls that are discovered to be known at compile
6499 time thanks to previous inlining.  This option has any effect only
6500 when inlining itself is turned on by the @option{-finline-functions}
6501 or @option{-finline-small-functions} options.
6503 Enabled at level @option{-O2}.
6505 @item -finline-functions
6506 @opindex finline-functions
6507 Consider all functions for inlining, even if they are not declared inline.
6508 The compiler heuristically decides which functions are worth integrating
6509 in this way.
6511 If all calls to a given function are integrated, and the function is
6512 declared @code{static}, then the function is normally not output as
6513 assembler code in its own right.
6515 Enabled at level @option{-O3}.
6517 @item -finline-functions-called-once
6518 @opindex finline-functions-called-once
6519 Consider all @code{static} functions called once for inlining into their
6520 caller even if they are not marked @code{inline}.  If a call to a given
6521 function is integrated, then the function is not output as assembler code
6522 in its own right.
6524 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6526 @item -fearly-inlining
6527 @opindex fearly-inlining
6528 Inline functions marked by @code{always_inline} and functions whose body seems
6529 smaller than the function call overhead early before doing
6530 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6531 makes profiling significantly cheaper and usually inlining faster on programs
6532 having large chains of nested wrapper functions.
6534 Enabled by default.
6536 @item -fipa-sra
6537 @opindex fipa-sra
6538 Perform interprocedural scalar replacement of aggregates, removal of
6539 unused parameters and replacement of parameters passed by reference
6540 by parameters passed by value.
6542 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6544 @item -finline-limit=@var{n}
6545 @opindex finline-limit
6546 By default, GCC limits the size of functions that can be inlined.  This flag
6547 allows coarse control of this limit.  @var{n} is the size of functions that
6548 can be inlined in number of pseudo instructions.
6550 Inlining is actually controlled by a number of parameters, which may be
6551 specified individually by using @option{--param @var{name}=@var{value}}.
6552 The @option{-finline-limit=@var{n}} option sets some of these parameters
6553 as follows:
6555 @table @gcctabopt
6556 @item max-inline-insns-single
6557 is set to @var{n}/2.
6558 @item max-inline-insns-auto
6559 is set to @var{n}/2.
6560 @end table
6562 See below for a documentation of the individual
6563 parameters controlling inlining and for the defaults of these parameters.
6565 @emph{Note:} there may be no value to @option{-finline-limit} that results
6566 in default behavior.
6568 @emph{Note:} pseudo instruction represents, in this particular context, an
6569 abstract measurement of function's size.  In no way does it represent a count
6570 of assembly instructions and as such its exact meaning might change from one
6571 release to an another.
6573 @item -fno-keep-inline-dllexport
6574 @opindex fno-keep-inline-dllexport
6575 This is a more fine-grained version of @option{-fkeep-inline-functions},
6576 which applies only to functions that are declared using the @code{dllexport}
6577 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6578 Functions}.)
6580 @item -fkeep-inline-functions
6581 @opindex fkeep-inline-functions
6582 In C, emit @code{static} functions that are declared @code{inline}
6583 into the object file, even if the function has been inlined into all
6584 of its callers.  This switch does not affect functions using the
6585 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6586 inline functions into the object file.
6588 @item -fkeep-static-functions
6589 @opindex fkeep-static-functions
6590 Emit @code{static} functions into the object file, even if the function
6591 is never used.
6593 @item -fkeep-static-consts
6594 @opindex fkeep-static-consts
6595 Emit variables declared @code{static const} when optimization isn't turned
6596 on, even if the variables aren't referenced.
6598 GCC enables this option by default.  If you want to force the compiler to
6599 check if a variable is referenced, regardless of whether or not
6600 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6602 @item -fmerge-constants
6603 @opindex fmerge-constants
6604 Attempt to merge identical constants (string constants and floating-point
6605 constants) across compilation units.
6607 This option is the default for optimized compilation if the assembler and
6608 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6609 behavior.
6611 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6613 @item -fmerge-all-constants
6614 @opindex fmerge-all-constants
6615 Attempt to merge identical constants and identical variables.
6617 This option implies @option{-fmerge-constants}.  In addition to
6618 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6619 arrays or initialized constant variables with integral or floating-point
6620 types.  Languages like C or C++ require each variable, including multiple
6621 instances of the same variable in recursive calls, to have distinct locations,
6622 so using this option results in non-conforming
6623 behavior.
6625 @item -fmodulo-sched
6626 @opindex fmodulo-sched
6627 Perform swing modulo scheduling immediately before the first scheduling
6628 pass.  This pass looks at innermost loops and reorders their
6629 instructions by overlapping different iterations.
6631 @item -fmodulo-sched-allow-regmoves
6632 @opindex fmodulo-sched-allow-regmoves
6633 Perform more aggressive SMS-based modulo scheduling with register moves
6634 allowed.  By setting this flag certain anti-dependences edges are
6635 deleted, which triggers the generation of reg-moves based on the
6636 life-range analysis.  This option is effective only with
6637 @option{-fmodulo-sched} enabled.
6639 @item -fno-branch-count-reg
6640 @opindex fno-branch-count-reg
6641 Avoid running a pass scanning for opportunities to use ``decrement and
6642 branch'' instructions on a count register instead of generating sequences
6643 of instructions that decrement a register, compare it against zero, and
6644 then branch based upon the result.  This option is only meaningful on
6645 architectures that support such instructions, which include x86, PowerPC,
6646 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
6647 doesn't remove the decrement and branch instructions from the generated
6648 instruction stream introduced by other optimization passes.
6650 Enabled by default at @option{-O1} and higher.
6652 The default is @option{-fbranch-count-reg}.
6654 @item -fno-function-cse
6655 @opindex fno-function-cse
6656 Do not put function addresses in registers; make each instruction that
6657 calls a constant function contain the function's address explicitly.
6659 This option results in less efficient code, but some strange hacks
6660 that alter the assembler output may be confused by the optimizations
6661 performed when this option is not used.
6663 The default is @option{-ffunction-cse}
6665 @item -fno-zero-initialized-in-bss
6666 @opindex fno-zero-initialized-in-bss
6667 If the target supports a BSS section, GCC by default puts variables that
6668 are initialized to zero into BSS@.  This can save space in the resulting
6669 code.
6671 This option turns off this behavior because some programs explicitly
6672 rely on variables going to the data section---e.g., so that the
6673 resulting executable can find the beginning of that section and/or make
6674 assumptions based on that.
6676 The default is @option{-fzero-initialized-in-bss}.
6678 @item -fthread-jumps
6679 @opindex fthread-jumps
6680 Perform optimizations that check to see if a jump branches to a
6681 location where another comparison subsumed by the first is found.  If
6682 so, the first branch is redirected to either the destination of the
6683 second branch or a point immediately following it, depending on whether
6684 the condition is known to be true or false.
6686 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6688 @item -fsplit-wide-types
6689 @opindex fsplit-wide-types
6690 When using a type that occupies multiple registers, such as @code{long
6691 long} on a 32-bit system, split the registers apart and allocate them
6692 independently.  This normally generates better code for those types,
6693 but may make debugging more difficult.
6695 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6696 @option{-Os}.
6698 @item -fcse-follow-jumps
6699 @opindex fcse-follow-jumps
6700 In common subexpression elimination (CSE), scan through jump instructions
6701 when the target of the jump is not reached by any other path.  For
6702 example, when CSE encounters an @code{if} statement with an
6703 @code{else} clause, CSE follows the jump when the condition
6704 tested is false.
6706 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6708 @item -fcse-skip-blocks
6709 @opindex fcse-skip-blocks
6710 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6711 follow jumps that conditionally skip over blocks.  When CSE
6712 encounters a simple @code{if} statement with no else clause,
6713 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6714 body of the @code{if}.
6716 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6718 @item -frerun-cse-after-loop
6719 @opindex frerun-cse-after-loop
6720 Re-run common subexpression elimination after loop optimizations are
6721 performed.
6723 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6725 @item -fgcse
6726 @opindex fgcse
6727 Perform a global common subexpression elimination pass.
6728 This pass also performs global constant and copy propagation.
6730 @emph{Note:} When compiling a program using computed gotos, a GCC
6731 extension, you may get better run-time performance if you disable
6732 the global common subexpression elimination pass by adding
6733 @option{-fno-gcse} to the command line.
6735 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6737 @item -fgcse-lm
6738 @opindex fgcse-lm
6739 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6740 attempts to move loads that are only killed by stores into themselves.  This
6741 allows a loop containing a load/store sequence to be changed to a load outside
6742 the loop, and a copy/store within the loop.
6744 Enabled by default when @option{-fgcse} is enabled.
6746 @item -fgcse-sm
6747 @opindex fgcse-sm
6748 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6749 global common subexpression elimination.  This pass attempts to move
6750 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6751 loops containing a load/store sequence can be changed to a load before
6752 the loop and a store after the loop.
6754 Not enabled at any optimization level.
6756 @item -fgcse-las
6757 @opindex fgcse-las
6758 When @option{-fgcse-las} is enabled, the global common subexpression
6759 elimination pass eliminates redundant loads that come after stores to the
6760 same memory location (both partial and full redundancies).
6762 Not enabled at any optimization level.
6764 @item -fgcse-after-reload
6765 @opindex fgcse-after-reload
6766 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6767 pass is performed after reload.  The purpose of this pass is to clean up
6768 redundant spilling.
6770 @item -faggressive-loop-optimizations
6771 @opindex faggressive-loop-optimizations
6772 This option tells the loop optimizer to use language constraints to
6773 derive bounds for the number of iterations of a loop.  This assumes that
6774 loop code does not invoke undefined behavior by for example causing signed
6775 integer overflows or out-of-bound array accesses.  The bounds for the
6776 number of iterations of a loop are used to guide loop unrolling and peeling
6777 and loop exit test optimizations.
6778 This option is enabled by default.
6780 @item -funsafe-loop-optimizations
6781 @opindex funsafe-loop-optimizations
6782 This option tells the loop optimizer to assume that loop indices do not
6783 overflow, and that loops with nontrivial exit condition are not
6784 infinite.  This enables a wider range of loop optimizations even if
6785 the loop optimizer itself cannot prove that these assumptions are valid.
6786 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
6787 if it finds this kind of loop.
6789 @item -funconstrained-commons
6790 @opindex funconstrained-commons
6791 This option tells the compiler that variables declared in common blocks
6792 (e.g. Fortran) may later be overridden with longer trailing arrays. This
6793 prevents certain optimizations that depend on knowing the array bounds.
6795 @item -fcrossjumping
6796 @opindex fcrossjumping
6797 Perform cross-jumping transformation.
6798 This transformation unifies equivalent code and saves code size.  The
6799 resulting code may or may not perform better than without cross-jumping.
6801 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6803 @item -fauto-inc-dec
6804 @opindex fauto-inc-dec
6805 Combine increments or decrements of addresses with memory accesses.
6806 This pass is always skipped on architectures that do not have
6807 instructions to support this.  Enabled by default at @option{-O} and
6808 higher on architectures that support this.
6810 @item -fdce
6811 @opindex fdce
6812 Perform dead code elimination (DCE) on RTL@.
6813 Enabled by default at @option{-O} and higher.
6815 @item -fdse
6816 @opindex fdse
6817 Perform dead store elimination (DSE) on RTL@.
6818 Enabled by default at @option{-O} and higher.
6820 @item -fif-conversion
6821 @opindex fif-conversion
6822 Attempt to transform conditional jumps into branch-less equivalents.  This
6823 includes use of conditional moves, min, max, set flags and abs instructions, and
6824 some tricks doable by standard arithmetics.  The use of conditional execution
6825 on chips where it is available is controlled by @option{-fif-conversion2}.
6827 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6829 @item -fif-conversion2
6830 @opindex fif-conversion2
6831 Use conditional execution (where available) to transform conditional jumps into
6832 branch-less equivalents.
6834 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6836 @item -fdeclone-ctor-dtor
6837 @opindex fdeclone-ctor-dtor
6838 The C++ ABI requires multiple entry points for constructors and
6839 destructors: one for a base subobject, one for a complete object, and
6840 one for a virtual destructor that calls operator delete afterwards.
6841 For a hierarchy with virtual bases, the base and complete variants are
6842 clones, which means two copies of the function.  With this option, the
6843 base and complete variants are changed to be thunks that call a common
6844 implementation.
6846 Enabled by @option{-Os}.
6848 @item -fdelete-null-pointer-checks
6849 @opindex fdelete-null-pointer-checks
6850 Assume that programs cannot safely dereference null pointers, and that
6851 no code or data element resides at address zero.
6852 This option enables simple constant
6853 folding optimizations at all optimization levels.  In addition, other
6854 optimization passes in GCC use this flag to control global dataflow
6855 analyses that eliminate useless checks for null pointers; these assume
6856 that a memory access to address zero always results in a trap, so
6857 that if a pointer is checked after it has already been dereferenced,
6858 it cannot be null.
6860 Note however that in some environments this assumption is not true.
6861 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6862 for programs that depend on that behavior.
6864 This option is enabled by default on most targets.  On Nios II ELF, it
6865 defaults to off.  On AVR and CR16, this option is completely disabled.  
6867 Passes that use the dataflow information
6868 are enabled independently at different optimization levels.
6870 @item -fdevirtualize
6871 @opindex fdevirtualize
6872 Attempt to convert calls to virtual functions to direct calls.  This
6873 is done both within a procedure and interprocedurally as part of
6874 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
6875 propagation (@option{-fipa-cp}).
6876 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6878 @item -fdevirtualize-speculatively
6879 @opindex fdevirtualize-speculatively
6880 Attempt to convert calls to virtual functions to speculative direct calls.
6881 Based on the analysis of the type inheritance graph, determine for a given call
6882 the set of likely targets. If the set is small, preferably of size 1, change
6883 the call into a conditional deciding between direct and indirect calls.  The
6884 speculative calls enable more optimizations, such as inlining.  When they seem
6885 useless after further optimization, they are converted back into original form.
6887 @item -fdevirtualize-at-ltrans
6888 @opindex fdevirtualize-at-ltrans
6889 Stream extra information needed for aggressive devirtualization when running
6890 the link-time optimizer in local transformation mode.  
6891 This option enables more devirtualization but
6892 significantly increases the size of streamed data. For this reason it is
6893 disabled by default.
6895 @item -fexpensive-optimizations
6896 @opindex fexpensive-optimizations
6897 Perform a number of minor optimizations that are relatively expensive.
6899 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6901 @item -free
6902 @opindex free
6903 Attempt to remove redundant extension instructions.  This is especially
6904 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
6905 registers after writing to their lower 32-bit half.
6907 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
6908 @option{-O3}, @option{-Os}.
6910 @item -fno-lifetime-dse
6911 @opindex fno-lifetime-dse
6912 In C++ the value of an object is only affected by changes within its
6913 lifetime: when the constructor begins, the object has an indeterminate
6914 value, and any changes during the lifetime of the object are dead when
6915 the object is destroyed.  Normally dead store elimination will take
6916 advantage of this; if your code relies on the value of the object
6917 storage persisting beyond the lifetime of the object, you can use this
6918 flag to disable this optimization.  To preserve stores before the
6919 constructor starts (e.g. because your operator new clears the object
6920 storage) but still treat the object as dead after the destructor you,
6921 can use @option{-flifetime-dse=1}.  The default behavior can be
6922 explicitly selected with @option{-flifetime-dse=2}.
6923 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
6925 @item -flive-range-shrinkage
6926 @opindex flive-range-shrinkage
6927 Attempt to decrease register pressure through register live range
6928 shrinkage.  This is helpful for fast processors with small or moderate
6929 size register sets.
6931 @item -fira-algorithm=@var{algorithm}
6932 @opindex fira-algorithm
6933 Use the specified coloring algorithm for the integrated register
6934 allocator.  The @var{algorithm} argument can be @samp{priority}, which
6935 specifies Chow's priority coloring, or @samp{CB}, which specifies
6936 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
6937 for all architectures, but for those targets that do support it, it is
6938 the default because it generates better code.
6940 @item -fira-region=@var{region}
6941 @opindex fira-region
6942 Use specified regions for the integrated register allocator.  The
6943 @var{region} argument should be one of the following:
6945 @table @samp
6947 @item all
6948 Use all loops as register allocation regions.
6949 This can give the best results for machines with a small and/or
6950 irregular register set.
6952 @item mixed
6953 Use all loops except for loops with small register pressure 
6954 as the regions.  This value usually gives
6955 the best results in most cases and for most architectures,
6956 and is enabled by default when compiling with optimization for speed
6957 (@option{-O}, @option{-O2}, @dots{}).
6959 @item one
6960 Use all functions as a single region.  
6961 This typically results in the smallest code size, and is enabled by default for
6962 @option{-Os} or @option{-O0}.
6964 @end table
6966 @item -fira-hoist-pressure
6967 @opindex fira-hoist-pressure
6968 Use IRA to evaluate register pressure in the code hoisting pass for
6969 decisions to hoist expressions.  This option usually results in smaller
6970 code, but it can slow the compiler down.
6972 This option is enabled at level @option{-Os} for all targets.
6974 @item -fira-loop-pressure
6975 @opindex fira-loop-pressure
6976 Use IRA to evaluate register pressure in loops for decisions to move
6977 loop invariants.  This option usually results in generation
6978 of faster and smaller code on machines with large register files (>= 32
6979 registers), but it can slow the compiler down.
6981 This option is enabled at level @option{-O3} for some targets.
6983 @item -fno-ira-share-save-slots
6984 @opindex fno-ira-share-save-slots
6985 Disable sharing of stack slots used for saving call-used hard
6986 registers living through a call.  Each hard register gets a
6987 separate stack slot, and as a result function stack frames are
6988 larger.
6990 @item -fno-ira-share-spill-slots
6991 @opindex fno-ira-share-spill-slots
6992 Disable sharing of stack slots allocated for pseudo-registers.  Each
6993 pseudo-register that does not get a hard register gets a separate
6994 stack slot, and as a result function stack frames are larger.
6996 @item -flra-remat
6997 @opindex flra-remat
6998 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
6999 values of spilled pseudos, LRA tries to rematerialize (recalculate)
7000 values if it is profitable.
7002 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7004 @item -fdelayed-branch
7005 @opindex fdelayed-branch
7006 If supported for the target machine, attempt to reorder instructions
7007 to exploit instruction slots available after delayed branch
7008 instructions.
7010 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7012 @item -fschedule-insns
7013 @opindex fschedule-insns
7014 If supported for the target machine, attempt to reorder instructions to
7015 eliminate execution stalls due to required data being unavailable.  This
7016 helps machines that have slow floating point or memory load instructions
7017 by allowing other instructions to be issued until the result of the load
7018 or floating-point instruction is required.
7020 Enabled at levels @option{-O2}, @option{-O3}.
7022 @item -fschedule-insns2
7023 @opindex fschedule-insns2
7024 Similar to @option{-fschedule-insns}, but requests an additional pass of
7025 instruction scheduling after register allocation has been done.  This is
7026 especially useful on machines with a relatively small number of
7027 registers and where memory load instructions take more than one cycle.
7029 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7031 @item -fno-sched-interblock
7032 @opindex fno-sched-interblock
7033 Don't schedule instructions across basic blocks.  This is normally
7034 enabled by default when scheduling before register allocation, i.e.@:
7035 with @option{-fschedule-insns} or at @option{-O2} or higher.
7037 @item -fno-sched-spec
7038 @opindex fno-sched-spec
7039 Don't allow speculative motion of non-load instructions.  This is normally
7040 enabled by default when scheduling before register allocation, i.e.@:
7041 with @option{-fschedule-insns} or at @option{-O2} or higher.
7043 @item -fsched-pressure
7044 @opindex fsched-pressure
7045 Enable register pressure sensitive insn scheduling before register
7046 allocation.  This only makes sense when scheduling before register
7047 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7048 @option{-O2} or higher.  Usage of this option can improve the
7049 generated code and decrease its size by preventing register pressure
7050 increase above the number of available hard registers and subsequent
7051 spills in register allocation.
7053 @item -fsched-spec-load
7054 @opindex fsched-spec-load
7055 Allow speculative motion of some load instructions.  This only makes
7056 sense when scheduling before register allocation, i.e.@: with
7057 @option{-fschedule-insns} or at @option{-O2} or higher.
7059 @item -fsched-spec-load-dangerous
7060 @opindex fsched-spec-load-dangerous
7061 Allow speculative motion of more load instructions.  This only makes
7062 sense when scheduling before register allocation, i.e.@: with
7063 @option{-fschedule-insns} or at @option{-O2} or higher.
7065 @item -fsched-stalled-insns
7066 @itemx -fsched-stalled-insns=@var{n}
7067 @opindex fsched-stalled-insns
7068 Define how many insns (if any) can be moved prematurely from the queue
7069 of stalled insns into the ready list during the second scheduling pass.
7070 @option{-fno-sched-stalled-insns} means that no insns are moved
7071 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7072 on how many queued insns can be moved prematurely.
7073 @option{-fsched-stalled-insns} without a value is equivalent to
7074 @option{-fsched-stalled-insns=1}.
7076 @item -fsched-stalled-insns-dep
7077 @itemx -fsched-stalled-insns-dep=@var{n}
7078 @opindex fsched-stalled-insns-dep
7079 Define how many insn groups (cycles) are examined for a dependency
7080 on a stalled insn that is a candidate for premature removal from the queue
7081 of stalled insns.  This has an effect only during the second scheduling pass,
7082 and only if @option{-fsched-stalled-insns} is used.
7083 @option{-fno-sched-stalled-insns-dep} is equivalent to
7084 @option{-fsched-stalled-insns-dep=0}.
7085 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7086 @option{-fsched-stalled-insns-dep=1}.
7088 @item -fsched2-use-superblocks
7089 @opindex fsched2-use-superblocks
7090 When scheduling after register allocation, use superblock scheduling.
7091 This allows motion across basic block boundaries,
7092 resulting in faster schedules.  This option is experimental, as not all machine
7093 descriptions used by GCC model the CPU closely enough to avoid unreliable
7094 results from the algorithm.
7096 This only makes sense when scheduling after register allocation, i.e.@: with
7097 @option{-fschedule-insns2} or at @option{-O2} or higher.
7099 @item -fsched-group-heuristic
7100 @opindex fsched-group-heuristic
7101 Enable the group heuristic in the scheduler.  This heuristic favors
7102 the instruction that belongs to a schedule group.  This is enabled
7103 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7104 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7106 @item -fsched-critical-path-heuristic
7107 @opindex fsched-critical-path-heuristic
7108 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7109 instructions on the critical path.  This is enabled by default when
7110 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7111 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7113 @item -fsched-spec-insn-heuristic
7114 @opindex fsched-spec-insn-heuristic
7115 Enable the speculative instruction heuristic in the scheduler.  This
7116 heuristic favors speculative instructions with greater dependency weakness.
7117 This is enabled by default when scheduling is enabled, i.e.@:
7118 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7119 or at @option{-O2} or higher.
7121 @item -fsched-rank-heuristic
7122 @opindex fsched-rank-heuristic
7123 Enable the rank heuristic in the scheduler.  This heuristic favors
7124 the instruction belonging to a basic block with greater size or frequency.
7125 This is enabled by default when scheduling is enabled, i.e.@:
7126 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7127 at @option{-O2} or higher.
7129 @item -fsched-last-insn-heuristic
7130 @opindex fsched-last-insn-heuristic
7131 Enable the last-instruction heuristic in the scheduler.  This heuristic
7132 favors the instruction that is less dependent on the last instruction
7133 scheduled.  This is enabled by default when scheduling is enabled,
7134 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7135 at @option{-O2} or higher.
7137 @item -fsched-dep-count-heuristic
7138 @opindex fsched-dep-count-heuristic
7139 Enable the dependent-count heuristic in the scheduler.  This heuristic
7140 favors the instruction that has more instructions depending on it.
7141 This is enabled by default when scheduling is enabled, i.e.@:
7142 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7143 at @option{-O2} or higher.
7145 @item -freschedule-modulo-scheduled-loops
7146 @opindex freschedule-modulo-scheduled-loops
7147 Modulo scheduling is performed before traditional scheduling.  If a loop
7148 is modulo scheduled, later scheduling passes may change its schedule.  
7149 Use this option to control that behavior.
7151 @item -fselective-scheduling
7152 @opindex fselective-scheduling
7153 Schedule instructions using selective scheduling algorithm.  Selective
7154 scheduling runs instead of the first scheduler pass.
7156 @item -fselective-scheduling2
7157 @opindex fselective-scheduling2
7158 Schedule instructions using selective scheduling algorithm.  Selective
7159 scheduling runs instead of the second scheduler pass.
7161 @item -fsel-sched-pipelining
7162 @opindex fsel-sched-pipelining
7163 Enable software pipelining of innermost loops during selective scheduling.
7164 This option has no effect unless one of @option{-fselective-scheduling} or
7165 @option{-fselective-scheduling2} is turned on.
7167 @item -fsel-sched-pipelining-outer-loops
7168 @opindex fsel-sched-pipelining-outer-loops
7169 When pipelining loops during selective scheduling, also pipeline outer loops.
7170 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7172 @item -fsemantic-interposition
7173 @opindex fsemantic-interposition
7174 Some object formats, like ELF, allow interposing of symbols by the 
7175 dynamic linker.
7176 This means that for symbols exported from the DSO, the compiler cannot perform
7177 interprocedural propagation, inlining and other optimizations in anticipation
7178 that the function or variable in question may change. While this feature is
7179 useful, for example, to rewrite memory allocation functions by a debugging
7180 implementation, it is expensive in the terms of code quality.
7181 With @option{-fno-semantic-interposition} the compiler assumes that 
7182 if interposition happens for functions the overwriting function will have 
7183 precisely the same semantics (and side effects). 
7184 Similarly if interposition happens
7185 for variables, the constructor of the variable will be the same. The flag
7186 has no effect for functions explicitly declared inline 
7187 (where it is never allowed for interposition to change semantics) 
7188 and for symbols explicitly declared weak.
7190 @item -fshrink-wrap
7191 @opindex fshrink-wrap
7192 Emit function prologues only before parts of the function that need it,
7193 rather than at the top of the function.  This flag is enabled by default at
7194 @option{-O} and higher.
7196 @item -fcaller-saves
7197 @opindex fcaller-saves
7198 Enable allocation of values to registers that are clobbered by
7199 function calls, by emitting extra instructions to save and restore the
7200 registers around such calls.  Such allocation is done only when it
7201 seems to result in better code.
7203 This option is always enabled by default on certain machines, usually
7204 those which have no call-preserved registers to use instead.
7206 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7208 @item -fcombine-stack-adjustments
7209 @opindex fcombine-stack-adjustments
7210 Tracks stack adjustments (pushes and pops) and stack memory references
7211 and then tries to find ways to combine them.
7213 Enabled by default at @option{-O1} and higher.
7215 @item -fipa-ra
7216 @opindex fipa-ra
7217 Use caller save registers for allocation if those registers are not used by
7218 any called function.  In that case it is not necessary to save and restore
7219 them around calls.  This is only possible if called functions are part of
7220 same compilation unit as current function and they are compiled before it.
7222 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7224 @item -fconserve-stack
7225 @opindex fconserve-stack
7226 Attempt to minimize stack usage.  The compiler attempts to use less
7227 stack space, even if that makes the program slower.  This option
7228 implies setting the @option{large-stack-frame} parameter to 100
7229 and the @option{large-stack-frame-growth} parameter to 400.
7231 @item -ftree-reassoc
7232 @opindex ftree-reassoc
7233 Perform reassociation on trees.  This flag is enabled by default
7234 at @option{-O} and higher.
7236 @item -ftree-pre
7237 @opindex ftree-pre
7238 Perform partial redundancy elimination (PRE) on trees.  This flag is
7239 enabled by default at @option{-O2} and @option{-O3}.
7241 @item -ftree-partial-pre
7242 @opindex ftree-partial-pre
7243 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7244 enabled by default at @option{-O3}.
7246 @item -ftree-forwprop
7247 @opindex ftree-forwprop
7248 Perform forward propagation on trees.  This flag is enabled by default
7249 at @option{-O} and higher.
7251 @item -ftree-fre
7252 @opindex ftree-fre
7253 Perform full redundancy elimination (FRE) on trees.  The difference
7254 between FRE and PRE is that FRE only considers expressions
7255 that are computed on all paths leading to the redundant computation.
7256 This analysis is faster than PRE, though it exposes fewer redundancies.
7257 This flag is enabled by default at @option{-O} and higher.
7259 @item -ftree-phiprop
7260 @opindex ftree-phiprop
7261 Perform hoisting of loads from conditional pointers on trees.  This
7262 pass is enabled by default at @option{-O} and higher.
7264 @item -fhoist-adjacent-loads
7265 @opindex fhoist-adjacent-loads
7266 Speculatively hoist loads from both branches of an if-then-else if the
7267 loads are from adjacent locations in the same structure and the target
7268 architecture has a conditional move instruction.  This flag is enabled
7269 by default at @option{-O2} and higher.
7271 @item -ftree-copy-prop
7272 @opindex ftree-copy-prop
7273 Perform copy propagation on trees.  This pass eliminates unnecessary
7274 copy operations.  This flag is enabled by default at @option{-O} and
7275 higher.
7277 @item -fipa-pure-const
7278 @opindex fipa-pure-const
7279 Discover which functions are pure or constant.
7280 Enabled by default at @option{-O} and higher.
7282 @item -fipa-reference
7283 @opindex fipa-reference
7284 Discover which static variables do not escape the
7285 compilation unit.
7286 Enabled by default at @option{-O} and higher.
7288 @item -fipa-pta
7289 @opindex fipa-pta
7290 Perform interprocedural pointer analysis and interprocedural modification
7291 and reference analysis.  This option can cause excessive memory and
7292 compile-time usage on large compilation units.  It is not enabled by
7293 default at any optimization level.
7295 @item -fipa-profile
7296 @opindex fipa-profile
7297 Perform interprocedural profile propagation.  The functions called only from
7298 cold functions are marked as cold. Also functions executed once (such as
7299 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7300 functions and loop less parts of functions executed once are then optimized for
7301 size.
7302 Enabled by default at @option{-O} and higher.
7304 @item -fipa-cp
7305 @opindex fipa-cp
7306 Perform interprocedural constant propagation.
7307 This optimization analyzes the program to determine when values passed
7308 to functions are constants and then optimizes accordingly.
7309 This optimization can substantially increase performance
7310 if the application has constants passed to functions.
7311 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7313 @item -fipa-cp-clone
7314 @opindex fipa-cp-clone
7315 Perform function cloning to make interprocedural constant propagation stronger.
7316 When enabled, interprocedural constant propagation performs function cloning
7317 when externally visible function can be called with constant arguments.
7318 Because this optimization can create multiple copies of functions,
7319 it may significantly increase code size
7320 (see @option{--param ipcp-unit-growth=@var{value}}).
7321 This flag is enabled by default at @option{-O3}.
7323 @item -fipa-cp-alignment
7324 @opindex -fipa-cp-alignment
7325 When enabled, this optimization propagates alignment of function
7326 parameters to support better vectorization and string operations.
7328 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
7329 requires that @option{-fipa-cp} is enabled.
7331 @item -fipa-icf
7332 @opindex fipa-icf
7333 Perform Identical Code Folding for functions and read-only variables.
7334 The optimization reduces code size and may disturb unwind stacks by replacing
7335 a function by equivalent one with a different name. The optimization works
7336 more effectively with link time optimization enabled.
7338 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
7339 works on different levels and thus the optimizations are not same - there are
7340 equivalences that are found only by GCC and equivalences found only by Gold.
7342 This flag is enabled by default at @option{-O2} and @option{-Os}.
7344 @item -fisolate-erroneous-paths-dereference
7345 @opindex fisolate-erroneous-paths-dereference
7346 Detect paths that trigger erroneous or undefined behavior due to
7347 dereferencing a null pointer.  Isolate those paths from the main control
7348 flow and turn the statement with erroneous or undefined behavior into a trap.
7349 This flag is enabled by default at @option{-O2} and higher and depends on
7350 @option{-fdelete-null-pointer-checks} also being enabled.
7352 @item -fisolate-erroneous-paths-attribute
7353 @opindex fisolate-erroneous-paths-attribute
7354 Detect paths that trigger erroneous or undefined behavior due a null value
7355 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
7356 attribute.  Isolate those paths from the main control flow and turn the
7357 statement with erroneous or undefined behavior into a trap.  This is not
7358 currently enabled, but may be enabled by @option{-O2} in the future.
7360 @item -ftree-sink
7361 @opindex ftree-sink
7362 Perform forward store motion on trees.  This flag is
7363 enabled by default at @option{-O} and higher.
7365 @item -ftree-bit-ccp
7366 @opindex ftree-bit-ccp
7367 Perform sparse conditional bit constant propagation on trees and propagate
7368 pointer alignment information.
7369 This pass only operates on local scalar variables and is enabled by default
7370 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7372 @item -ftree-ccp
7373 @opindex ftree-ccp
7374 Perform sparse conditional constant propagation (CCP) on trees.  This
7375 pass only operates on local scalar variables and is enabled by default
7376 at @option{-O} and higher.
7378 @item -fssa-backprop
7379 @opindex fssa-backprop
7380 Propagate information about uses of a value up the definition chain
7381 in order to simplify the definitions.  For example, this pass strips
7382 sign operations if the sign of a value never matters.  The flag is
7383 enabled by default at @option{-O} and higher.
7385 @item -fssa-phiopt
7386 @opindex fssa-phiopt
7387 Perform pattern matching on SSA PHI nodes to optimize conditional
7388 code.  This pass is enabled by default at @option{-O} and higher.
7390 @item -ftree-switch-conversion
7391 @opindex ftree-switch-conversion
7392 Perform conversion of simple initializations in a switch to
7393 initializations from a scalar array.  This flag is enabled by default
7394 at @option{-O2} and higher.
7396 @item -ftree-tail-merge
7397 @opindex ftree-tail-merge
7398 Look for identical code sequences.  When found, replace one with a jump to the
7399 other.  This optimization is known as tail merging or cross jumping.  This flag
7400 is enabled by default at @option{-O2} and higher.  The compilation time
7401 in this pass can
7402 be limited using @option{max-tail-merge-comparisons} parameter and
7403 @option{max-tail-merge-iterations} parameter.
7405 @item -ftree-dce
7406 @opindex ftree-dce
7407 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7408 default at @option{-O} and higher.
7410 @item -ftree-builtin-call-dce
7411 @opindex ftree-builtin-call-dce
7412 Perform conditional dead code elimination (DCE) for calls to built-in functions
7413 that may set @code{errno} but are otherwise side-effect free.  This flag is
7414 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7415 specified.
7417 @item -ftree-dominator-opts
7418 @opindex ftree-dominator-opts
7419 Perform a variety of simple scalar cleanups (constant/copy
7420 propagation, redundancy elimination, range propagation and expression
7421 simplification) based on a dominator tree traversal.  This also
7422 performs jump threading (to reduce jumps to jumps). This flag is
7423 enabled by default at @option{-O} and higher.
7425 @item -ftree-dse
7426 @opindex ftree-dse
7427 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7428 a memory location that is later overwritten by another store without
7429 any intervening loads.  In this case the earlier store can be deleted.  This
7430 flag is enabled by default at @option{-O} and higher.
7432 @item -ftree-ch
7433 @opindex ftree-ch
7434 Perform loop header copying on trees.  This is beneficial since it increases
7435 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7436 is enabled by default at @option{-O} and higher.  It is not enabled
7437 for @option{-Os}, since it usually increases code size.
7439 @item -ftree-loop-optimize
7440 @opindex ftree-loop-optimize
7441 Perform loop optimizations on trees.  This flag is enabled by default
7442 at @option{-O} and higher.
7444 @item -ftree-loop-linear
7445 @itemx -floop-interchange
7446 @itemx -floop-strip-mine
7447 @itemx -floop-block
7448 @itemx -floop-unroll-and-jam
7449 @opindex ftree-loop-linear
7450 @opindex floop-interchange
7451 @opindex floop-strip-mine
7452 @opindex floop-block
7453 @opindex floop-unroll-and-jam
7454 Perform loop nest optimizations.  Same as
7455 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
7456 to be configured with @option{--with-isl} to enable the Graphite loop
7457 transformation infrastructure.
7459 @item -fgraphite-identity
7460 @opindex fgraphite-identity
7461 Enable the identity transformation for graphite.  For every SCoP we generate
7462 the polyhedral representation and transform it back to gimple.  Using
7463 @option{-fgraphite-identity} we can check the costs or benefits of the
7464 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7465 are also performed by the code generator isl, like index splitting and
7466 dead code elimination in loops.
7468 @item -floop-nest-optimize
7469 @opindex floop-nest-optimize
7470 Enable the isl based loop nest optimizer.  This is a generic loop nest
7471 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7472 structure optimized for data-locality and parallelism.  This option
7473 is experimental.
7475 @item -floop-parallelize-all
7476 @opindex floop-parallelize-all
7477 Use the Graphite data dependence analysis to identify loops that can
7478 be parallelized.  Parallelize all the loops that can be analyzed to
7479 not contain loop carried dependences without checking that it is
7480 profitable to parallelize the loops.
7482 @item -ftree-coalesce-vars
7483 @opindex ftree-coalesce-vars
7484 While transforming the program out of the SSA representation, attempt to
7485 reduce copying by coalescing versions of different user-defined
7486 variables, instead of just compiler temporaries.  This may severely
7487 limit the ability to debug an optimized program compiled with
7488 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
7489 prevents SSA coalescing of user variables.  This option is enabled by
7490 default if optimization is enabled, and it does very little otherwise.
7492 @item -ftree-loop-if-convert
7493 @opindex ftree-loop-if-convert
7494 Attempt to transform conditional jumps in the innermost loops to
7495 branch-less equivalents.  The intent is to remove control-flow from
7496 the innermost loops in order to improve the ability of the
7497 vectorization pass to handle these loops.  This is enabled by default
7498 if vectorization is enabled.
7500 @item -ftree-loop-if-convert-stores
7501 @opindex ftree-loop-if-convert-stores
7502 Attempt to also if-convert conditional jumps containing memory writes.
7503 This transformation can be unsafe for multi-threaded programs as it
7504 transforms conditional memory writes into unconditional memory writes.
7505 For example,
7506 @smallexample
7507 for (i = 0; i < N; i++)
7508   if (cond)
7509     A[i] = expr;
7510 @end smallexample
7511 is transformed to
7512 @smallexample
7513 for (i = 0; i < N; i++)
7514   A[i] = cond ? expr : A[i];
7515 @end smallexample
7516 potentially producing data races.
7518 @item -ftree-loop-distribution
7519 @opindex ftree-loop-distribution
7520 Perform loop distribution.  This flag can improve cache performance on
7521 big loop bodies and allow further loop optimizations, like
7522 parallelization or vectorization, to take place.  For example, the loop
7523 @smallexample
7524 DO I = 1, N
7525   A(I) = B(I) + C
7526   D(I) = E(I) * F
7527 ENDDO
7528 @end smallexample
7529 is transformed to
7530 @smallexample
7531 DO I = 1, N
7532    A(I) = B(I) + C
7533 ENDDO
7534 DO I = 1, N
7535    D(I) = E(I) * F
7536 ENDDO
7537 @end smallexample
7539 @item -ftree-loop-distribute-patterns
7540 @opindex ftree-loop-distribute-patterns
7541 Perform loop distribution of patterns that can be code generated with
7542 calls to a library.  This flag is enabled by default at @option{-O3}.
7544 This pass distributes the initialization loops and generates a call to
7545 memset zero.  For example, the loop
7546 @smallexample
7547 DO I = 1, N
7548   A(I) = 0
7549   B(I) = A(I) + I
7550 ENDDO
7551 @end smallexample
7552 is transformed to
7553 @smallexample
7554 DO I = 1, N
7555    A(I) = 0
7556 ENDDO
7557 DO I = 1, N
7558    B(I) = A(I) + I
7559 ENDDO
7560 @end smallexample
7561 and the initialization loop is transformed into a call to memset zero.
7563 @item -ftree-loop-im
7564 @opindex ftree-loop-im
7565 Perform loop invariant motion on trees.  This pass moves only invariants that
7566 are hard to handle at RTL level (function calls, operations that expand to
7567 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7568 operands of conditions that are invariant out of the loop, so that we can use
7569 just trivial invariantness analysis in loop unswitching.  The pass also includes
7570 store motion.
7572 @item -ftree-loop-ivcanon
7573 @opindex ftree-loop-ivcanon
7574 Create a canonical counter for number of iterations in loops for which
7575 determining number of iterations requires complicated analysis.  Later
7576 optimizations then may determine the number easily.  Useful especially
7577 in connection with unrolling.
7579 @item -fivopts
7580 @opindex fivopts
7581 Perform induction variable optimizations (strength reduction, induction
7582 variable merging and induction variable elimination) on trees.
7584 @item -ftree-parallelize-loops=n
7585 @opindex ftree-parallelize-loops
7586 Parallelize loops, i.e., split their iteration space to run in n threads.
7587 This is only possible for loops whose iterations are independent
7588 and can be arbitrarily reordered.  The optimization is only
7589 profitable on multiprocessor machines, for loops that are CPU-intensive,
7590 rather than constrained e.g.@: by memory bandwidth.  This option
7591 implies @option{-pthread}, and thus is only supported on targets
7592 that have support for @option{-pthread}.
7594 @item -ftree-pta
7595 @opindex ftree-pta
7596 Perform function-local points-to analysis on trees.  This flag is
7597 enabled by default at @option{-O} and higher.
7599 @item -ftree-sra
7600 @opindex ftree-sra
7601 Perform scalar replacement of aggregates.  This pass replaces structure
7602 references with scalars to prevent committing structures to memory too
7603 early.  This flag is enabled by default at @option{-O} and higher.
7605 @item -ftree-ter
7606 @opindex ftree-ter
7607 Perform temporary expression replacement during the SSA->normal phase.  Single
7608 use/single def temporaries are replaced at their use location with their
7609 defining expression.  This results in non-GIMPLE code, but gives the expanders
7610 much more complex trees to work on resulting in better RTL generation.  This is
7611 enabled by default at @option{-O} and higher.
7613 @item -ftree-slsr
7614 @opindex ftree-slsr
7615 Perform straight-line strength reduction on trees.  This recognizes related
7616 expressions involving multiplications and replaces them by less expensive
7617 calculations when possible.  This is enabled by default at @option{-O} and
7618 higher.
7620 @item -ftree-vectorize
7621 @opindex ftree-vectorize
7622 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
7623 and @option{-ftree-slp-vectorize} if not explicitly specified.
7625 @item -ftree-loop-vectorize
7626 @opindex ftree-loop-vectorize
7627 Perform loop vectorization on trees. This flag is enabled by default at
7628 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7630 @item -ftree-slp-vectorize
7631 @opindex ftree-slp-vectorize
7632 Perform basic block vectorization on trees. This flag is enabled by default at
7633 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7635 @item -fvect-cost-model=@var{model}
7636 @opindex fvect-cost-model
7637 Alter the cost model used for vectorization.  The @var{model} argument
7638 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
7639 With the @samp{unlimited} model the vectorized code-path is assumed
7640 to be profitable while with the @samp{dynamic} model a runtime check
7641 guards the vectorized code-path to enable it only for iteration
7642 counts that will likely execute faster than when executing the original
7643 scalar loop.  The @samp{cheap} model disables vectorization of
7644 loops where doing so would be cost prohibitive for example due to
7645 required runtime checks for data dependence or alignment but otherwise
7646 is equal to the @samp{dynamic} model.
7647 The default cost model depends on other optimization flags and is
7648 either @samp{dynamic} or @samp{cheap}.
7650 @item -fsimd-cost-model=@var{model}
7651 @opindex fsimd-cost-model
7652 Alter the cost model used for vectorization of loops marked with the OpenMP
7653 or Cilk Plus simd directive.  The @var{model} argument should be one of
7654 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
7655 have the same meaning as described in @option{-fvect-cost-model} and by
7656 default a cost model defined with @option{-fvect-cost-model} is used.
7658 @item -ftree-vrp
7659 @opindex ftree-vrp
7660 Perform Value Range Propagation on trees.  This is similar to the
7661 constant propagation pass, but instead of values, ranges of values are
7662 propagated.  This allows the optimizers to remove unnecessary range
7663 checks like array bound checks and null pointer checks.  This is
7664 enabled by default at @option{-O2} and higher.  Null pointer check
7665 elimination is only done if @option{-fdelete-null-pointer-checks} is
7666 enabled.
7668 @item -fsplit-paths
7669 @opindex fsplit-paths
7670 Split paths leading to loop backedges.  This can improve dead code
7671 elimination and common subexpression elimination.  This is enabled by
7672 default at @option{-O2} and above.
7674 @item -fsplit-ivs-in-unroller
7675 @opindex fsplit-ivs-in-unroller
7676 Enables expression of values of induction variables in later iterations
7677 of the unrolled loop using the value in the first iteration.  This breaks
7678 long dependency chains, thus improving efficiency of the scheduling passes.
7680 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7681 same effect.  However, that is not reliable in cases where the loop body
7682 is more complicated than a single basic block.  It also does not work at all
7683 on some architectures due to restrictions in the CSE pass.
7685 This optimization is enabled by default.
7687 @item -fvariable-expansion-in-unroller
7688 @opindex fvariable-expansion-in-unroller
7689 With this option, the compiler creates multiple copies of some
7690 local variables when unrolling a loop, which can result in superior code.
7692 @item -fpartial-inlining
7693 @opindex fpartial-inlining
7694 Inline parts of functions.  This option has any effect only
7695 when inlining itself is turned on by the @option{-finline-functions}
7696 or @option{-finline-small-functions} options.
7698 Enabled at level @option{-O2}.
7700 @item -fpredictive-commoning
7701 @opindex fpredictive-commoning
7702 Perform predictive commoning optimization, i.e., reusing computations
7703 (especially memory loads and stores) performed in previous
7704 iterations of loops.
7706 This option is enabled at level @option{-O3}.
7708 @item -fprefetch-loop-arrays
7709 @opindex fprefetch-loop-arrays
7710 If supported by the target machine, generate instructions to prefetch
7711 memory to improve the performance of loops that access large arrays.
7713 This option may generate better or worse code; results are highly
7714 dependent on the structure of loops within the source code.
7716 Disabled at level @option{-Os}.
7718 @item -fno-peephole
7719 @itemx -fno-peephole2
7720 @opindex fno-peephole
7721 @opindex fno-peephole2
7722 Disable any machine-specific peephole optimizations.  The difference
7723 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7724 are implemented in the compiler; some targets use one, some use the
7725 other, a few use both.
7727 @option{-fpeephole} is enabled by default.
7728 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7730 @item -fno-guess-branch-probability
7731 @opindex fno-guess-branch-probability
7732 Do not guess branch probabilities using heuristics.
7734 GCC uses heuristics to guess branch probabilities if they are
7735 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7736 heuristics are based on the control flow graph.  If some branch probabilities
7737 are specified by @code{__builtin_expect}, then the heuristics are
7738 used to guess branch probabilities for the rest of the control flow graph,
7739 taking the @code{__builtin_expect} info into account.  The interactions
7740 between the heuristics and @code{__builtin_expect} can be complex, and in
7741 some cases, it may be useful to disable the heuristics so that the effects
7742 of @code{__builtin_expect} are easier to understand.
7744 The default is @option{-fguess-branch-probability} at levels
7745 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7747 @item -freorder-blocks
7748 @opindex freorder-blocks
7749 Reorder basic blocks in the compiled function in order to reduce number of
7750 taken branches and improve code locality.
7752 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7754 @item -freorder-blocks-algorithm=@var{algorithm}
7755 @opindex freorder-blocks-algorithm
7756 Use the specified algorithm for basic block reordering.  The
7757 @var{algorithm} argument can be @samp{simple}, which does not increase
7758 code size (except sometimes due to secondary effects like alignment),
7759 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
7760 put all often executed code together, minimizing the number of branches
7761 executed by making extra copies of code.
7763 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
7764 @samp{stc} at levels @option{-O2}, @option{-O3}.
7766 @item -freorder-blocks-and-partition
7767 @opindex freorder-blocks-and-partition
7768 In addition to reordering basic blocks in the compiled function, in order
7769 to reduce number of taken branches, partitions hot and cold basic blocks
7770 into separate sections of the assembly and @file{.o} files, to improve
7771 paging and cache locality performance.
7773 This optimization is automatically turned off in the presence of
7774 exception handling, for linkonce sections, for functions with a user-defined
7775 section attribute and on any architecture that does not support named
7776 sections.
7778 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7780 @item -freorder-functions
7781 @opindex freorder-functions
7782 Reorder functions in the object file in order to
7783 improve code locality.  This is implemented by using special
7784 subsections @code{.text.hot} for most frequently executed functions and
7785 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7786 the linker so object file format must support named sections and linker must
7787 place them in a reasonable way.
7789 Also profile feedback must be available to make this option effective.  See
7790 @option{-fprofile-arcs} for details.
7792 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7794 @item -fstrict-aliasing
7795 @opindex fstrict-aliasing
7796 Allow the compiler to assume the strictest aliasing rules applicable to
7797 the language being compiled.  For C (and C++), this activates
7798 optimizations based on the type of expressions.  In particular, an
7799 object of one type is assumed never to reside at the same address as an
7800 object of a different type, unless the types are almost the same.  For
7801 example, an @code{unsigned int} can alias an @code{int}, but not a
7802 @code{void*} or a @code{double}.  A character type may alias any other
7803 type.
7805 @anchor{Type-punning}Pay special attention to code like this:
7806 @smallexample
7807 union a_union @{
7808   int i;
7809   double d;
7812 int f() @{
7813   union a_union t;
7814   t.d = 3.0;
7815   return t.i;
7817 @end smallexample
7818 The practice of reading from a different union member than the one most
7819 recently written to (called ``type-punning'') is common.  Even with
7820 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7821 is accessed through the union type.  So, the code above works as
7822 expected.  @xref{Structures unions enumerations and bit-fields
7823 implementation}.  However, this code might not:
7824 @smallexample
7825 int f() @{
7826   union a_union t;
7827   int* ip;
7828   t.d = 3.0;
7829   ip = &t.i;
7830   return *ip;
7832 @end smallexample
7834 Similarly, access by taking the address, casting the resulting pointer
7835 and dereferencing the result has undefined behavior, even if the cast
7836 uses a union type, e.g.:
7837 @smallexample
7838 int f() @{
7839   double d = 3.0;
7840   return ((union a_union *) &d)->i;
7842 @end smallexample
7844 The @option{-fstrict-aliasing} option is enabled at levels
7845 @option{-O2}, @option{-O3}, @option{-Os}.
7847 @item -fstrict-overflow
7848 @opindex fstrict-overflow
7849 Allow the compiler to assume strict signed overflow rules, depending
7850 on the language being compiled.  For C (and C++) this means that
7851 overflow when doing arithmetic with signed numbers is undefined, which
7852 means that the compiler may assume that it does not happen.  This
7853 permits various optimizations.  For example, the compiler assumes
7854 that an expression like @code{i + 10 > i} is always true for
7855 signed @code{i}.  This assumption is only valid if signed overflow is
7856 undefined, as the expression is false if @code{i + 10} overflows when
7857 using twos complement arithmetic.  When this option is in effect any
7858 attempt to determine whether an operation on signed numbers 
7859 overflows must be written carefully to not actually involve overflow.
7861 This option also allows the compiler to assume strict pointer
7862 semantics: given a pointer to an object, if adding an offset to that
7863 pointer does not produce a pointer to the same object, the addition is
7864 undefined.  This permits the compiler to conclude that @code{p + u >
7865 p} is always true for a pointer @code{p} and unsigned integer
7866 @code{u}.  This assumption is only valid because pointer wraparound is
7867 undefined, as the expression is false if @code{p + u} overflows using
7868 twos complement arithmetic.
7870 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7871 that integer signed overflow is fully defined: it wraps.  When
7872 @option{-fwrapv} is used, there is no difference between
7873 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7874 integers.  With @option{-fwrapv} certain types of overflow are
7875 permitted.  For example, if the compiler gets an overflow when doing
7876 arithmetic on constants, the overflowed value can still be used with
7877 @option{-fwrapv}, but not otherwise.
7879 The @option{-fstrict-overflow} option is enabled at levels
7880 @option{-O2}, @option{-O3}, @option{-Os}.
7882 @item -falign-functions
7883 @itemx -falign-functions=@var{n}
7884 @opindex falign-functions
7885 Align the start of functions to the next power-of-two greater than
7886 @var{n}, skipping up to @var{n} bytes.  For instance,
7887 @option{-falign-functions=32} aligns functions to the next 32-byte
7888 boundary, but @option{-falign-functions=24} aligns to the next
7889 32-byte boundary only if this can be done by skipping 23 bytes or less.
7891 @option{-fno-align-functions} and @option{-falign-functions=1} are
7892 equivalent and mean that functions are not aligned.
7894 Some assemblers only support this flag when @var{n} is a power of two;
7895 in that case, it is rounded up.
7897 If @var{n} is not specified or is zero, use a machine-dependent default.
7899 Enabled at levels @option{-O2}, @option{-O3}.
7901 @item -falign-labels
7902 @itemx -falign-labels=@var{n}
7903 @opindex falign-labels
7904 Align all branch targets to a power-of-two boundary, skipping up to
7905 @var{n} bytes like @option{-falign-functions}.  This option can easily
7906 make code slower, because it must insert dummy operations for when the
7907 branch target is reached in the usual flow of the code.
7909 @option{-fno-align-labels} and @option{-falign-labels=1} are
7910 equivalent and mean that labels are not aligned.
7912 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7913 are greater than this value, then their values are used instead.
7915 If @var{n} is not specified or is zero, use a machine-dependent default
7916 which is very likely to be @samp{1}, meaning no alignment.
7918 Enabled at levels @option{-O2}, @option{-O3}.
7920 @item -falign-loops
7921 @itemx -falign-loops=@var{n}
7922 @opindex falign-loops
7923 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7924 like @option{-falign-functions}.  If the loops are
7925 executed many times, this makes up for any execution of the dummy
7926 operations.
7928 @option{-fno-align-loops} and @option{-falign-loops=1} are
7929 equivalent and mean that loops are not aligned.
7931 If @var{n} is not specified or is zero, use a machine-dependent default.
7933 Enabled at levels @option{-O2}, @option{-O3}.
7935 @item -falign-jumps
7936 @itemx -falign-jumps=@var{n}
7937 @opindex falign-jumps
7938 Align branch targets to a power-of-two boundary, for branch targets
7939 where the targets can only be reached by jumping, skipping up to @var{n}
7940 bytes like @option{-falign-functions}.  In this case, no dummy operations
7941 need be executed.
7943 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7944 equivalent and mean that loops are not aligned.
7946 If @var{n} is not specified or is zero, use a machine-dependent default.
7948 Enabled at levels @option{-O2}, @option{-O3}.
7950 @item -funit-at-a-time
7951 @opindex funit-at-a-time
7952 This option is left for compatibility reasons. @option{-funit-at-a-time}
7953 has no effect, while @option{-fno-unit-at-a-time} implies
7954 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7956 Enabled by default.
7958 @item -fno-toplevel-reorder
7959 @opindex fno-toplevel-reorder
7960 Do not reorder top-level functions, variables, and @code{asm}
7961 statements.  Output them in the same order that they appear in the
7962 input file.  When this option is used, unreferenced static variables
7963 are not removed.  This option is intended to support existing code
7964 that relies on a particular ordering.  For new code, it is better to
7965 use attributes when possible.
7967 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
7968 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
7969 targets.
7971 @item -fweb
7972 @opindex fweb
7973 Constructs webs as commonly used for register allocation purposes and assign
7974 each web individual pseudo register.  This allows the register allocation pass
7975 to operate on pseudos directly, but also strengthens several other optimization
7976 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7977 however, make debugging impossible, since variables no longer stay in a
7978 ``home register''.
7980 Enabled by default with @option{-funroll-loops}.
7982 @item -fwhole-program
7983 @opindex fwhole-program
7984 Assume that the current compilation unit represents the whole program being
7985 compiled.  All public functions and variables with the exception of @code{main}
7986 and those merged by attribute @code{externally_visible} become static functions
7987 and in effect are optimized more aggressively by interprocedural optimizers.
7989 This option should not be used in combination with @option{-flto}.
7990 Instead relying on a linker plugin should provide safer and more precise
7991 information.
7993 @item -flto[=@var{n}]
7994 @opindex flto
7995 This option runs the standard link-time optimizer.  When invoked
7996 with source code, it generates GIMPLE (one of GCC's internal
7997 representations) and writes it to special ELF sections in the object
7998 file.  When the object files are linked together, all the function
7999 bodies are read from these ELF sections and instantiated as if they
8000 had been part of the same translation unit.
8002 To use the link-time optimizer, @option{-flto} and optimization
8003 options should be specified at compile time and during the final link.
8004 It is recommended that you compile all the files participating in the
8005 same link with the same options and also specify those options at
8006 link time.  
8007 For example:
8009 @smallexample
8010 gcc -c -O2 -flto foo.c
8011 gcc -c -O2 -flto bar.c
8012 gcc -o myprog -flto -O2 foo.o bar.o
8013 @end smallexample
8015 The first two invocations to GCC save a bytecode representation
8016 of GIMPLE into special ELF sections inside @file{foo.o} and
8017 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8018 @file{foo.o} and @file{bar.o}, merges the two files into a single
8019 internal image, and compiles the result as usual.  Since both
8020 @file{foo.o} and @file{bar.o} are merged into a single image, this
8021 causes all the interprocedural analyses and optimizations in GCC to
8022 work across the two files as if they were a single one.  This means,
8023 for example, that the inliner is able to inline functions in
8024 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8026 Another (simpler) way to enable link-time optimization is:
8028 @smallexample
8029 gcc -o myprog -flto -O2 foo.c bar.c
8030 @end smallexample
8032 The above generates bytecode for @file{foo.c} and @file{bar.c},
8033 merges them together into a single GIMPLE representation and optimizes
8034 them as usual to produce @file{myprog}.
8036 The only important thing to keep in mind is that to enable link-time
8037 optimizations you need to use the GCC driver to perform the link step.
8038 GCC then automatically performs link-time optimization if any of the
8039 objects involved were compiled with the @option{-flto} command-line option.  
8040 You generally
8041 should specify the optimization options to be used for link-time
8042 optimization though GCC tries to be clever at guessing an
8043 optimization level to use from the options used at compile time
8044 if you fail to specify one at link time.  You can always override
8045 the automatic decision to do link-time optimization at link time
8046 by passing @option{-fno-lto} to the link command.
8048 To make whole program optimization effective, it is necessary to make
8049 certain whole program assumptions.  The compiler needs to know
8050 what functions and variables can be accessed by libraries and runtime
8051 outside of the link-time optimized unit.  When supported by the linker,
8052 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8053 to the compiler about used and externally visible symbols.  When
8054 the linker plugin is not available, @option{-fwhole-program} should be
8055 used to allow the compiler to make these assumptions, which leads
8056 to more aggressive optimization decisions.
8058 When @option{-fuse-linker-plugin} is not enabled, when a file is
8059 compiled with @option{-flto}, the generated object file is larger than
8060 a regular object file because it contains GIMPLE bytecodes and the usual
8061 final code (see @option{-ffat-lto-objects}.  This means that
8062 object files with LTO information can be linked as normal object
8063 files; if @option{-fno-lto} is passed to the linker, no
8064 interprocedural optimizations are applied.  Note that when
8065 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
8066 but you cannot perform a regular, non-LTO link on them.
8068 Additionally, the optimization flags used to compile individual files
8069 are not necessarily related to those used at link time.  For instance,
8071 @smallexample
8072 gcc -c -O0 -ffat-lto-objects -flto foo.c
8073 gcc -c -O0 -ffat-lto-objects -flto bar.c
8074 gcc -o myprog -O3 foo.o bar.o
8075 @end smallexample
8077 This produces individual object files with unoptimized assembler
8078 code, but the resulting binary @file{myprog} is optimized at
8079 @option{-O3}.  If, instead, the final binary is generated with
8080 @option{-fno-lto}, then @file{myprog} is not optimized.
8082 When producing the final binary, GCC only
8083 applies link-time optimizations to those files that contain bytecode.
8084 Therefore, you can mix and match object files and libraries with
8085 GIMPLE bytecodes and final object code.  GCC automatically selects
8086 which files to optimize in LTO mode and which files to link without
8087 further processing.
8089 There are some code generation flags preserved by GCC when
8090 generating bytecodes, as they need to be used during the final link
8091 stage.  Generally options specified at link time override those
8092 specified at compile time.
8094 If you do not specify an optimization level option @option{-O} at
8095 link time, then GCC uses the highest optimization level 
8096 used when compiling the object files.
8098 Currently, the following options and their settings are taken from
8099 the first object file that explicitly specifies them: 
8100 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8101 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8102 and all the @option{-m} target flags.
8104 Certain ABI-changing flags are required to match in all compilation units,
8105 and trying to override this at link time with a conflicting value
8106 is ignored.  This includes options such as @option{-freg-struct-return}
8107 and @option{-fpcc-struct-return}. 
8109 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8110 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8111 are passed through to the link stage and merged conservatively for
8112 conflicting translation units.  Specifically
8113 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8114 precedence; and for example @option{-ffp-contract=off} takes precedence
8115 over @option{-ffp-contract=fast}.  You can override them at link time.
8117 If LTO encounters objects with C linkage declared with incompatible
8118 types in separate translation units to be linked together (undefined
8119 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8120 issued.  The behavior is still undefined at run time.  Similar
8121 diagnostics may be raised for other languages.
8123 Another feature of LTO is that it is possible to apply interprocedural
8124 optimizations on files written in different languages:
8126 @smallexample
8127 gcc -c -flto foo.c
8128 g++ -c -flto bar.cc
8129 gfortran -c -flto baz.f90
8130 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8131 @end smallexample
8133 Notice that the final link is done with @command{g++} to get the C++
8134 runtime libraries and @option{-lgfortran} is added to get the Fortran
8135 runtime libraries.  In general, when mixing languages in LTO mode, you
8136 should use the same link command options as when mixing languages in a
8137 regular (non-LTO) compilation.
8139 If object files containing GIMPLE bytecode are stored in a library archive, say
8140 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8141 are using a linker with plugin support.  To create static libraries suitable
8142 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8143 and @command{ranlib}; 
8144 to show the symbols of object files with GIMPLE bytecode, use
8145 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8146 and @command{nm} have been compiled with plugin support.  At link time, use the the
8147 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8148 the LTO optimization process:
8150 @smallexample
8151 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8152 @end smallexample
8154 With the linker plugin enabled, the linker extracts the needed
8155 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8156 to make them part of the aggregated GIMPLE image to be optimized.
8158 If you are not using a linker with plugin support and/or do not
8159 enable the linker plugin, then the objects inside @file{libfoo.a}
8160 are extracted and linked as usual, but they do not participate
8161 in the LTO optimization process.  In order to make a static library suitable
8162 for both LTO optimization and usual linkage, compile its object files with
8163 @option{-flto} @option{-ffat-lto-objects}.
8165 Link-time optimizations do not require the presence of the whole program to
8166 operate.  If the program does not require any symbols to be exported, it is
8167 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8168 the interprocedural optimizers to use more aggressive assumptions which may
8169 lead to improved optimization opportunities.
8170 Use of @option{-fwhole-program} is not needed when linker plugin is
8171 active (see @option{-fuse-linker-plugin}).
8173 The current implementation of LTO makes no
8174 attempt to generate bytecode that is portable between different
8175 types of hosts.  The bytecode files are versioned and there is a
8176 strict version check, so bytecode files generated in one version of
8177 GCC do not work with an older or newer version of GCC.
8179 Link-time optimization does not work well with generation of debugging
8180 information.  Combining @option{-flto} with
8181 @option{-g} is currently experimental and expected to produce unexpected
8182 results.
8184 If you specify the optional @var{n}, the optimization and code
8185 generation done at link time is executed in parallel using @var{n}
8186 parallel jobs by utilizing an installed @command{make} program.  The
8187 environment variable @env{MAKE} may be used to override the program
8188 used.  The default value for @var{n} is 1.
8190 You can also specify @option{-flto=jobserver} to use GNU make's
8191 job server mode to determine the number of parallel jobs. This
8192 is useful when the Makefile calling GCC is already executing in parallel.
8193 You must prepend a @samp{+} to the command recipe in the parent Makefile
8194 for this to work.  This option likely only works if @env{MAKE} is
8195 GNU make.
8197 @item -flto-partition=@var{alg}
8198 @opindex flto-partition
8199 Specify the partitioning algorithm used by the link-time optimizer.
8200 The value is either @samp{1to1} to specify a partitioning mirroring
8201 the original source files or @samp{balanced} to specify partitioning
8202 into equally sized chunks (whenever possible) or @samp{max} to create
8203 new partition for every symbol where possible.  Specifying @samp{none}
8204 as an algorithm disables partitioning and streaming completely. 
8205 The default value is @samp{balanced}. While @samp{1to1} can be used
8206 as an workaround for various code ordering issues, the @samp{max}
8207 partitioning is intended for internal testing only.
8208 The value @samp{one} specifies that exactly one partition should be
8209 used while the value @samp{none} bypasses partitioning and executes
8210 the link-time optimization step directly from the WPA phase.
8212 @item -flto-odr-type-merging
8213 @opindex flto-odr-type-merging
8214 Enable streaming of mangled types names of C++ types and their unification
8215 at link time.  This increases size of LTO object files, but enables
8216 diagnostics about One Definition Rule violations.
8218 @item -flto-compression-level=@var{n}
8219 @opindex flto-compression-level
8220 This option specifies the level of compression used for intermediate
8221 language written to LTO object files, and is only meaningful in
8222 conjunction with LTO mode (@option{-flto}).  Valid
8223 values are 0 (no compression) to 9 (maximum compression).  Values
8224 outside this range are clamped to either 0 or 9.  If the option is not
8225 given, a default balanced compression setting is used.
8227 @item -fuse-linker-plugin
8228 @opindex fuse-linker-plugin
8229 Enables the use of a linker plugin during link-time optimization.  This
8230 option relies on plugin support in the linker, which is available in gold
8231 or in GNU ld 2.21 or newer.
8233 This option enables the extraction of object files with GIMPLE bytecode out
8234 of library archives. This improves the quality of optimization by exposing
8235 more code to the link-time optimizer.  This information specifies what
8236 symbols can be accessed externally (by non-LTO object or during dynamic
8237 linking).  Resulting code quality improvements on binaries (and shared
8238 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
8239 See @option{-flto} for a description of the effect of this flag and how to
8240 use it.
8242 This option is enabled by default when LTO support in GCC is enabled
8243 and GCC was configured for use with
8244 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8246 @item -ffat-lto-objects
8247 @opindex ffat-lto-objects
8248 Fat LTO objects are object files that contain both the intermediate language
8249 and the object code. This makes them usable for both LTO linking and normal
8250 linking. This option is effective only when compiling with @option{-flto}
8251 and is ignored at link time.
8253 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8254 requires the complete toolchain to be aware of LTO. It requires a linker with
8255 linker plugin support for basic functionality.  Additionally,
8256 @command{nm}, @command{ar} and @command{ranlib}
8257 need to support linker plugins to allow a full-featured build environment
8258 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8259 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8260 to these tools. With non fat LTO makefiles need to be modified to use them.
8262 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
8263 support.
8265 @item -fcompare-elim
8266 @opindex fcompare-elim
8267 After register allocation and post-register allocation instruction splitting,
8268 identify arithmetic instructions that compute processor flags similar to a
8269 comparison operation based on that arithmetic.  If possible, eliminate the
8270 explicit comparison operation.
8272 This pass only applies to certain targets that cannot explicitly represent
8273 the comparison operation before register allocation is complete.
8275 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8277 @item -fcprop-registers
8278 @opindex fcprop-registers
8279 After register allocation and post-register allocation instruction splitting,
8280 perform a copy-propagation pass to try to reduce scheduling dependencies
8281 and occasionally eliminate the copy.
8283 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8285 @item -fprofile-correction
8286 @opindex fprofile-correction
8287 Profiles collected using an instrumented binary for multi-threaded programs may
8288 be inconsistent due to missed counter updates. When this option is specified,
8289 GCC uses heuristics to correct or smooth out such inconsistencies. By
8290 default, GCC emits an error message when an inconsistent profile is detected.
8292 @item -fprofile-use
8293 @itemx -fprofile-use=@var{path}
8294 @opindex fprofile-use
8295 Enable profile feedback-directed optimizations, 
8296 and the following optimizations
8297 which are generally profitable only with profile feedback available:
8298 @option{-fbranch-probabilities}, @option{-fvpt},
8299 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8300 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
8302 Before you can use this option, you must first generate profiling information.
8303 @xref{Optimize Options}, for information about the @option{-fprofile-generate}
8304 option.
8306 By default, GCC emits an error message if the feedback profiles do not
8307 match the source code.  This error can be turned into a warning by using
8308 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8309 code.
8311 If @var{path} is specified, GCC looks at the @var{path} to find
8312 the profile feedback data files. See @option{-fprofile-dir}.
8314 @item -fauto-profile
8315 @itemx -fauto-profile=@var{path}
8316 @opindex fauto-profile
8317 Enable sampling-based feedback-directed optimizations, 
8318 and the following optimizations
8319 which are generally profitable only with profile feedback available:
8320 @option{-fbranch-probabilities}, @option{-fvpt},
8321 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8322 @option{-ftree-vectorize},
8323 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
8324 @option{-fpredictive-commoning}, @option{-funswitch-loops},
8325 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
8327 @var{path} is the name of a file containing AutoFDO profile information.
8328 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
8330 Producing an AutoFDO profile data file requires running your program
8331 with the @command{perf} utility on a supported GNU/Linux target system.
8332 For more information, see @uref{https://perf.wiki.kernel.org/}.
8334 E.g.
8335 @smallexample
8336 perf record -e br_inst_retired:near_taken -b -o perf.data \
8337     -- your_program
8338 @end smallexample
8340 Then use the @command{create_gcov} tool to convert the raw profile data
8341 to a format that can be used by GCC.@  You must also supply the 
8342 unstripped binary for your program to this tool.  
8343 See @uref{https://github.com/google/autofdo}.
8345 E.g.
8346 @smallexample
8347 create_gcov --binary=your_program.unstripped --profile=perf.data \
8348     --gcov=profile.afdo
8349 @end smallexample
8350 @end table
8352 The following options control compiler behavior regarding floating-point 
8353 arithmetic.  These options trade off between speed and
8354 correctness.  All must be specifically enabled.
8356 @table @gcctabopt
8357 @item -ffloat-store
8358 @opindex ffloat-store
8359 Do not store floating-point variables in registers, and inhibit other
8360 options that might change whether a floating-point value is taken from a
8361 register or memory.
8363 @cindex floating-point precision
8364 This option prevents undesirable excess precision on machines such as
8365 the 68000 where the floating registers (of the 68881) keep more
8366 precision than a @code{double} is supposed to have.  Similarly for the
8367 x86 architecture.  For most programs, the excess precision does only
8368 good, but a few programs rely on the precise definition of IEEE floating
8369 point.  Use @option{-ffloat-store} for such programs, after modifying
8370 them to store all pertinent intermediate computations into variables.
8372 @item -fexcess-precision=@var{style}
8373 @opindex fexcess-precision
8374 This option allows further control over excess precision on machines
8375 where floating-point registers have more precision than the IEEE
8376 @code{float} and @code{double} types and the processor does not
8377 support operations rounding to those types.  By default,
8378 @option{-fexcess-precision=fast} is in effect; this means that
8379 operations are carried out in the precision of the registers and that
8380 it is unpredictable when rounding to the types specified in the source
8381 code takes place.  When compiling C, if
8382 @option{-fexcess-precision=standard} is specified then excess
8383 precision follows the rules specified in ISO C99; in particular,
8384 both casts and assignments cause values to be rounded to their
8385 semantic types (whereas @option{-ffloat-store} only affects
8386 assignments).  This option is enabled by default for C if a strict
8387 conformance option such as @option{-std=c99} is used.
8389 @opindex mfpmath
8390 @option{-fexcess-precision=standard} is not implemented for languages
8391 other than C, and has no effect if
8392 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8393 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8394 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8395 semantics apply without excess precision, and in the latter, rounding
8396 is unpredictable.
8398 @item -ffast-math
8399 @opindex ffast-math
8400 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8401 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8402 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8404 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8406 This option is not turned on by any @option{-O} option besides
8407 @option{-Ofast} since it can result in incorrect output for programs
8408 that depend on an exact implementation of IEEE or ISO rules/specifications
8409 for math functions. It may, however, yield faster code for programs
8410 that do not require the guarantees of these specifications.
8412 @item -fno-math-errno
8413 @opindex fno-math-errno
8414 Do not set @code{errno} after calling math functions that are executed
8415 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8416 IEEE exceptions for math error handling may want to use this flag
8417 for speed while maintaining IEEE arithmetic compatibility.
8419 This option is not turned on by any @option{-O} option since
8420 it can result in incorrect output for programs that depend on
8421 an exact implementation of IEEE or ISO rules/specifications for
8422 math functions. It may, however, yield faster code for programs
8423 that do not require the guarantees of these specifications.
8425 The default is @option{-fmath-errno}.
8427 On Darwin systems, the math library never sets @code{errno}.  There is
8428 therefore no reason for the compiler to consider the possibility that
8429 it might, and @option{-fno-math-errno} is the default.
8431 @item -funsafe-math-optimizations
8432 @opindex funsafe-math-optimizations
8434 Allow optimizations for floating-point arithmetic that (a) assume
8435 that arguments and results are valid and (b) may violate IEEE or
8436 ANSI standards.  When used at link time, it may include libraries
8437 or startup files that change the default FPU control word or other
8438 similar optimizations.
8440 This option is not turned on by any @option{-O} option since
8441 it can result in incorrect output for programs that depend on
8442 an exact implementation of IEEE or ISO rules/specifications for
8443 math functions. It may, however, yield faster code for programs
8444 that do not require the guarantees of these specifications.
8445 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8446 @option{-fassociative-math} and @option{-freciprocal-math}.
8448 The default is @option{-fno-unsafe-math-optimizations}.
8450 @item -fassociative-math
8451 @opindex fassociative-math
8453 Allow re-association of operands in series of floating-point operations.
8454 This violates the ISO C and C++ language standard by possibly changing
8455 computation result.  NOTE: re-ordering may change the sign of zero as
8456 well as ignore NaNs and inhibit or create underflow or overflow (and
8457 thus cannot be used on code that relies on rounding behavior like
8458 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8459 and thus may not be used when ordered comparisons are required.
8460 This option requires that both @option{-fno-signed-zeros} and
8461 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8462 much sense with @option{-frounding-math}. For Fortran the option
8463 is automatically enabled when both @option{-fno-signed-zeros} and
8464 @option{-fno-trapping-math} are in effect.
8466 The default is @option{-fno-associative-math}.
8468 @item -freciprocal-math
8469 @opindex freciprocal-math
8471 Allow the reciprocal of a value to be used instead of dividing by
8472 the value if this enables optimizations.  For example @code{x / y}
8473 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8474 is subject to common subexpression elimination.  Note that this loses
8475 precision and increases the number of flops operating on the value.
8477 The default is @option{-fno-reciprocal-math}.
8479 @item -ffinite-math-only
8480 @opindex ffinite-math-only
8481 Allow optimizations for floating-point arithmetic that assume
8482 that arguments and results are not NaNs or +-Infs.
8484 This option is not turned on by any @option{-O} option since
8485 it can result in incorrect output for programs that depend on
8486 an exact implementation of IEEE or ISO rules/specifications for
8487 math functions. It may, however, yield faster code for programs
8488 that do not require the guarantees of these specifications.
8490 The default is @option{-fno-finite-math-only}.
8492 @item -fno-signed-zeros
8493 @opindex fno-signed-zeros
8494 Allow optimizations for floating-point arithmetic that ignore the
8495 signedness of zero.  IEEE arithmetic specifies the behavior of
8496 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8497 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8498 This option implies that the sign of a zero result isn't significant.
8500 The default is @option{-fsigned-zeros}.
8502 @item -fno-trapping-math
8503 @opindex fno-trapping-math
8504 Compile code assuming that floating-point operations cannot generate
8505 user-visible traps.  These traps include division by zero, overflow,
8506 underflow, inexact result and invalid operation.  This option requires
8507 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8508 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8510 This option should never be turned on by any @option{-O} option since
8511 it can result in incorrect output for programs that depend on
8512 an exact implementation of IEEE or ISO rules/specifications for
8513 math functions.
8515 The default is @option{-ftrapping-math}.
8517 @item -frounding-math
8518 @opindex frounding-math
8519 Disable transformations and optimizations that assume default floating-point
8520 rounding behavior.  This is round-to-zero for all floating point
8521 to integer conversions, and round-to-nearest for all other arithmetic
8522 truncations.  This option should be specified for programs that change
8523 the FP rounding mode dynamically, or that may be executed with a
8524 non-default rounding mode.  This option disables constant folding of
8525 floating-point expressions at compile time (which may be affected by
8526 rounding mode) and arithmetic transformations that are unsafe in the
8527 presence of sign-dependent rounding modes.
8529 The default is @option{-fno-rounding-math}.
8531 This option is experimental and does not currently guarantee to
8532 disable all GCC optimizations that are affected by rounding mode.
8533 Future versions of GCC may provide finer control of this setting
8534 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8535 will be used to specify the default state for @code{FENV_ACCESS}.
8537 @item -fsignaling-nans
8538 @opindex fsignaling-nans
8539 Compile code assuming that IEEE signaling NaNs may generate user-visible
8540 traps during floating-point operations.  Setting this option disables
8541 optimizations that may change the number of exceptions visible with
8542 signaling NaNs.  This option implies @option{-ftrapping-math}.
8544 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8545 be defined.
8547 The default is @option{-fno-signaling-nans}.
8549 This option is experimental and does not currently guarantee to
8550 disable all GCC optimizations that affect signaling NaN behavior.
8552 @item -fno-fp-int-builtin-inexact
8553 @opindex fno-fp-int-builtin-inexact
8554 Do not allow the built-in functions @code{ceil}, @code{floor},
8555 @code{round} and @code{trunc}, and their @code{float} and @code{long
8556 double} variants, to generate code that raises the ``inexact''
8557 floating-point exception for noninteger arguments.  ISO C99 and C11
8558 allow these functions to raise the ``inexact'' exception, but ISO/IEC
8559 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
8560 functions to do so.
8562 The default is @option{-ffp-int-builtin-inexact}, allowing the
8563 exception to be raised.  This option does nothing unless
8564 @option{-ftrapping-math} is in effect.
8566 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
8567 generate a call to a library function then the ``inexact'' exception
8568 may be raised if the library implementation does not follow TS 18661.
8570 @item -fsingle-precision-constant
8571 @opindex fsingle-precision-constant
8572 Treat floating-point constants as single precision instead of
8573 implicitly converting them to double-precision constants.
8575 @item -fcx-limited-range
8576 @opindex fcx-limited-range
8577 When enabled, this option states that a range reduction step is not
8578 needed when performing complex division.  Also, there is no checking
8579 whether the result of a complex multiplication or division is @code{NaN
8580 + I*NaN}, with an attempt to rescue the situation in that case.  The
8581 default is @option{-fno-cx-limited-range}, but is enabled by
8582 @option{-ffast-math}.
8584 This option controls the default setting of the ISO C99
8585 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8586 all languages.
8588 @item -fcx-fortran-rules
8589 @opindex fcx-fortran-rules
8590 Complex multiplication and division follow Fortran rules.  Range
8591 reduction is done as part of complex division, but there is no checking
8592 whether the result of a complex multiplication or division is @code{NaN
8593 + I*NaN}, with an attempt to rescue the situation in that case.
8595 The default is @option{-fno-cx-fortran-rules}.
8597 @end table
8599 The following options control optimizations that may improve
8600 performance, but are not enabled by any @option{-O} options.  This
8601 section includes experimental options that may produce broken code.
8603 @table @gcctabopt
8604 @item -fbranch-probabilities
8605 @opindex fbranch-probabilities
8606 After running a program compiled with @option{-fprofile-arcs}
8607 (@pxref{Instrumentation Options}),
8608 you can compile it a second time using
8609 @option{-fbranch-probabilities}, to improve optimizations based on
8610 the number of times each branch was taken.  When a program
8611 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8612 counts to a file called @file{@var{sourcename}.gcda} for each source
8613 file.  The information in this data file is very dependent on the
8614 structure of the generated code, so you must use the same source code
8615 and the same optimization options for both compilations.
8617 With @option{-fbranch-probabilities}, GCC puts a
8618 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8619 These can be used to improve optimization.  Currently, they are only
8620 used in one place: in @file{reorg.c}, instead of guessing which path a
8621 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8622 exactly determine which path is taken more often.
8624 @item -fprofile-values
8625 @opindex fprofile-values
8626 If combined with @option{-fprofile-arcs}, it adds code so that some
8627 data about values of expressions in the program is gathered.
8629 With @option{-fbranch-probabilities}, it reads back the data gathered
8630 from profiling values of expressions for usage in optimizations.
8632 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8634 @item -fprofile-reorder-functions
8635 @opindex fprofile-reorder-functions
8636 Function reordering based on profile instrumentation collects
8637 first time of execution of a function and orders these functions
8638 in ascending order.
8640 Enabled with @option{-fprofile-use}.
8642 @item -fvpt
8643 @opindex fvpt
8644 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8645 to add code to gather information about values of expressions.
8647 With @option{-fbranch-probabilities}, it reads back the data gathered
8648 and actually performs the optimizations based on them.
8649 Currently the optimizations include specialization of division operations
8650 using the knowledge about the value of the denominator.
8652 @item -frename-registers
8653 @opindex frename-registers
8654 Attempt to avoid false dependencies in scheduled code by making use
8655 of registers left over after register allocation.  This optimization
8656 most benefits processors with lots of registers.  Depending on the
8657 debug information format adopted by the target, however, it can
8658 make debugging impossible, since variables no longer stay in
8659 a ``home register''.
8661 Enabled by default with @option{-funroll-loops}.
8663 @item -fschedule-fusion
8664 @opindex fschedule-fusion
8665 Performs a target dependent pass over the instruction stream to schedule
8666 instructions of same type together because target machine can execute them
8667 more efficiently if they are adjacent to each other in the instruction flow.
8669 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8671 @item -ftracer
8672 @opindex ftracer
8673 Perform tail duplication to enlarge superblock size.  This transformation
8674 simplifies the control flow of the function allowing other optimizations to do
8675 a better job.
8677 Enabled with @option{-fprofile-use}.
8679 @item -funroll-loops
8680 @opindex funroll-loops
8681 Unroll loops whose number of iterations can be determined at compile time or
8682 upon entry to the loop.  @option{-funroll-loops} implies
8683 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8684 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8685 a small constant number of iterations).  This option makes code larger, and may
8686 or may not make it run faster.
8688 Enabled with @option{-fprofile-use}.
8690 @item -funroll-all-loops
8691 @opindex funroll-all-loops
8692 Unroll all loops, even if their number of iterations is uncertain when
8693 the loop is entered.  This usually makes programs run more slowly.
8694 @option{-funroll-all-loops} implies the same options as
8695 @option{-funroll-loops}.
8697 @item -fpeel-loops
8698 @opindex fpeel-loops
8699 Peels loops for which there is enough information that they do not
8700 roll much (from profile feedback or static analysis).  It also turns on
8701 complete loop peeling (i.e.@: complete removal of loops with small constant
8702 number of iterations).
8704 Enabled with @option{-O3} and/or @option{-fprofile-use}.
8706 @item -fmove-loop-invariants
8707 @opindex fmove-loop-invariants
8708 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8709 at level @option{-O1}
8711 @item -funswitch-loops
8712 @opindex funswitch-loops
8713 Move branches with loop invariant conditions out of the loop, with duplicates
8714 of the loop on both branches (modified according to result of the condition).
8716 @item -ffunction-sections
8717 @itemx -fdata-sections
8718 @opindex ffunction-sections
8719 @opindex fdata-sections
8720 Place each function or data item into its own section in the output
8721 file if the target supports arbitrary sections.  The name of the
8722 function or the name of the data item determines the section's name
8723 in the output file.
8725 Use these options on systems where the linker can perform optimizations
8726 to improve locality of reference in the instruction space.  Most systems
8727 using the ELF object format and SPARC processors running Solaris 2 have
8728 linkers with such optimizations.  AIX may have these optimizations in
8729 the future.
8731 Only use these options when there are significant benefits from doing
8732 so.  When you specify these options, the assembler and linker
8733 create larger object and executable files and are also slower.
8734 You cannot use @command{gprof} on all systems if you
8735 specify this option, and you may have problems with debugging if
8736 you specify both this option and @option{-g}.
8738 @item -fbranch-target-load-optimize
8739 @opindex fbranch-target-load-optimize
8740 Perform branch target register load optimization before prologue / epilogue
8741 threading.
8742 The use of target registers can typically be exposed only during reload,
8743 thus hoisting loads out of loops and doing inter-block scheduling needs
8744 a separate optimization pass.
8746 @item -fbranch-target-load-optimize2
8747 @opindex fbranch-target-load-optimize2
8748 Perform branch target register load optimization after prologue / epilogue
8749 threading.
8751 @item -fbtr-bb-exclusive
8752 @opindex fbtr-bb-exclusive
8753 When performing branch target register load optimization, don't reuse
8754 branch target registers within any basic block.
8756 @item -fstdarg-opt
8757 @opindex fstdarg-opt
8758 Optimize the prologue of variadic argument functions with respect to usage of
8759 those arguments.
8761 @item -fsection-anchors
8762 @opindex fsection-anchors
8763 Try to reduce the number of symbolic address calculations by using
8764 shared ``anchor'' symbols to address nearby objects.  This transformation
8765 can help to reduce the number of GOT entries and GOT accesses on some
8766 targets.
8768 For example, the implementation of the following function @code{foo}:
8770 @smallexample
8771 static int a, b, c;
8772 int foo (void) @{ return a + b + c; @}
8773 @end smallexample
8775 @noindent
8776 usually calculates the addresses of all three variables, but if you
8777 compile it with @option{-fsection-anchors}, it accesses the variables
8778 from a common anchor point instead.  The effect is similar to the
8779 following pseudocode (which isn't valid C):
8781 @smallexample
8782 int foo (void)
8784   register int *xr = &x;
8785   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8787 @end smallexample
8789 Not all targets support this option.
8791 @item --param @var{name}=@var{value}
8792 @opindex param
8793 In some places, GCC uses various constants to control the amount of
8794 optimization that is done.  For example, GCC does not inline functions
8795 that contain more than a certain number of instructions.  You can
8796 control some of these constants on the command line using the
8797 @option{--param} option.
8799 The names of specific parameters, and the meaning of the values, are
8800 tied to the internals of the compiler, and are subject to change
8801 without notice in future releases.
8803 In each case, the @var{value} is an integer.  The allowable choices for
8804 @var{name} are:
8806 @table @gcctabopt
8807 @item predictable-branch-outcome
8808 When branch is predicted to be taken with probability lower than this threshold
8809 (in percent), then it is considered well predictable. The default is 10.
8811 @item max-rtl-if-conversion-insns
8812 RTL if-conversion tries to remove conditional branches around a block and
8813 replace them with conditionally executed instructions.  This parameter
8814 gives the maximum number of instructions in a block which should be
8815 considered for if-conversion.  The default is 10, though the compiler will
8816 also use other heuristics to decide whether if-conversion is likely to be
8817 profitable.
8819 @item max-crossjump-edges
8820 The maximum number of incoming edges to consider for cross-jumping.
8821 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8822 the number of edges incoming to each block.  Increasing values mean
8823 more aggressive optimization, making the compilation time increase with
8824 probably small improvement in executable size.
8826 @item min-crossjump-insns
8827 The minimum number of instructions that must be matched at the end
8828 of two blocks before cross-jumping is performed on them.  This
8829 value is ignored in the case where all instructions in the block being
8830 cross-jumped from are matched.  The default value is 5.
8832 @item max-grow-copy-bb-insns
8833 The maximum code size expansion factor when copying basic blocks
8834 instead of jumping.  The expansion is relative to a jump instruction.
8835 The default value is 8.
8837 @item max-goto-duplication-insns
8838 The maximum number of instructions to duplicate to a block that jumps
8839 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8840 passes, GCC factors computed gotos early in the compilation process,
8841 and unfactors them as late as possible.  Only computed jumps at the
8842 end of a basic blocks with no more than max-goto-duplication-insns are
8843 unfactored.  The default value is 8.
8845 @item max-delay-slot-insn-search
8846 The maximum number of instructions to consider when looking for an
8847 instruction to fill a delay slot.  If more than this arbitrary number of
8848 instructions are searched, the time savings from filling the delay slot
8849 are minimal, so stop searching.  Increasing values mean more
8850 aggressive optimization, making the compilation time increase with probably
8851 small improvement in execution time.
8853 @item max-delay-slot-live-search
8854 When trying to fill delay slots, the maximum number of instructions to
8855 consider when searching for a block with valid live register
8856 information.  Increasing this arbitrarily chosen value means more
8857 aggressive optimization, increasing the compilation time.  This parameter
8858 should be removed when the delay slot code is rewritten to maintain the
8859 control-flow graph.
8861 @item max-gcse-memory
8862 The approximate maximum amount of memory that can be allocated in
8863 order to perform the global common subexpression elimination
8864 optimization.  If more memory than specified is required, the
8865 optimization is not done.
8867 @item max-gcse-insertion-ratio
8868 If the ratio of expression insertions to deletions is larger than this value
8869 for any expression, then RTL PRE inserts or removes the expression and thus
8870 leaves partially redundant computations in the instruction stream.  The default value is 20.
8872 @item max-pending-list-length
8873 The maximum number of pending dependencies scheduling allows
8874 before flushing the current state and starting over.  Large functions
8875 with few branches or calls can create excessively large lists which
8876 needlessly consume memory and resources.
8878 @item max-modulo-backtrack-attempts
8879 The maximum number of backtrack attempts the scheduler should make
8880 when modulo scheduling a loop.  Larger values can exponentially increase
8881 compilation time.
8883 @item max-inline-insns-single
8884 Several parameters control the tree inliner used in GCC@.
8885 This number sets the maximum number of instructions (counted in GCC's
8886 internal representation) in a single function that the tree inliner
8887 considers for inlining.  This only affects functions declared
8888 inline and methods implemented in a class declaration (C++).
8889 The default value is 400.
8891 @item max-inline-insns-auto
8892 When you use @option{-finline-functions} (included in @option{-O3}),
8893 a lot of functions that would otherwise not be considered for inlining
8894 by the compiler are investigated.  To those functions, a different
8895 (more restrictive) limit compared to functions declared inline can
8896 be applied.
8897 The default value is 40.
8899 @item inline-min-speedup
8900 When estimated performance improvement of caller + callee runtime exceeds this
8901 threshold (in precent), the function can be inlined regardless the limit on
8902 @option{--param max-inline-insns-single} and @option{--param
8903 max-inline-insns-auto}.
8905 @item large-function-insns
8906 The limit specifying really large functions.  For functions larger than this
8907 limit after inlining, inlining is constrained by
8908 @option{--param large-function-growth}.  This parameter is useful primarily
8909 to avoid extreme compilation time caused by non-linear algorithms used by the
8910 back end.
8911 The default value is 2700.
8913 @item large-function-growth
8914 Specifies maximal growth of large function caused by inlining in percents.
8915 The default value is 100 which limits large function growth to 2.0 times
8916 the original size.
8918 @item large-unit-insns
8919 The limit specifying large translation unit.  Growth caused by inlining of
8920 units larger than this limit is limited by @option{--param inline-unit-growth}.
8921 For small units this might be too tight.
8922 For example, consider a unit consisting of function A
8923 that is inline and B that just calls A three times.  If B is small relative to
8924 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8925 large units consisting of small inlineable functions, however, the overall unit
8926 growth limit is needed to avoid exponential explosion of code size.  Thus for
8927 smaller units, the size is increased to @option{--param large-unit-insns}
8928 before applying @option{--param inline-unit-growth}.  The default is 10000.
8930 @item inline-unit-growth
8931 Specifies maximal overall growth of the compilation unit caused by inlining.
8932 The default value is 20 which limits unit growth to 1.2 times the original
8933 size. Cold functions (either marked cold via an attribute or by profile
8934 feedback) are not accounted into the unit size.
8936 @item ipcp-unit-growth
8937 Specifies maximal overall growth of the compilation unit caused by
8938 interprocedural constant propagation.  The default value is 10 which limits
8939 unit growth to 1.1 times the original size.
8941 @item large-stack-frame
8942 The limit specifying large stack frames.  While inlining the algorithm is trying
8943 to not grow past this limit too much.  The default value is 256 bytes.
8945 @item large-stack-frame-growth
8946 Specifies maximal growth of large stack frames caused by inlining in percents.
8947 The default value is 1000 which limits large stack frame growth to 11 times
8948 the original size.
8950 @item max-inline-insns-recursive
8951 @itemx max-inline-insns-recursive-auto
8952 Specifies the maximum number of instructions an out-of-line copy of a
8953 self-recursive inline
8954 function can grow into by performing recursive inlining.
8956 @option{--param max-inline-insns-recursive} applies to functions
8957 declared inline.
8958 For functions not declared inline, recursive inlining
8959 happens only when @option{-finline-functions} (included in @option{-O3}) is
8960 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
8961 default value is 450.
8963 @item max-inline-recursive-depth
8964 @itemx max-inline-recursive-depth-auto
8965 Specifies the maximum recursion depth used for recursive inlining.
8967 @option{--param max-inline-recursive-depth} applies to functions
8968 declared inline.  For functions not declared inline, recursive inlining
8969 happens only when @option{-finline-functions} (included in @option{-O3}) is
8970 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
8971 default value is 8.
8973 @item min-inline-recursive-probability
8974 Recursive inlining is profitable only for function having deep recursion
8975 in average and can hurt for function having little recursion depth by
8976 increasing the prologue size or complexity of function body to other
8977 optimizers.
8979 When profile feedback is available (see @option{-fprofile-generate}) the actual
8980 recursion depth can be guessed from probability that function recurses via a
8981 given call expression.  This parameter limits inlining only to call expressions
8982 whose probability exceeds the given threshold (in percents).
8983 The default value is 10.
8985 @item early-inlining-insns
8986 Specify growth that the early inliner can make.  In effect it increases
8987 the amount of inlining for code having a large abstraction penalty.
8988 The default value is 14.
8990 @item max-early-inliner-iterations
8991 Limit of iterations of the early inliner.  This basically bounds
8992 the number of nested indirect calls the early inliner can resolve.
8993 Deeper chains are still handled by late inlining.
8995 @item comdat-sharing-probability
8996 Probability (in percent) that C++ inline function with comdat visibility
8997 are shared across multiple compilation units.  The default value is 20.
8999 @item profile-func-internal-id
9000 A parameter to control whether to use function internal id in profile
9001 database lookup. If the value is 0, the compiler uses an id that
9002 is based on function assembler name and filename, which makes old profile
9003 data more tolerant to source changes such as function reordering etc.
9004 The default value is 0.
9006 @item min-vect-loop-bound
9007 The minimum number of iterations under which loops are not vectorized
9008 when @option{-ftree-vectorize} is used.  The number of iterations after
9009 vectorization needs to be greater than the value specified by this option
9010 to allow vectorization.  The default value is 0.
9012 @item gcse-cost-distance-ratio
9013 Scaling factor in calculation of maximum distance an expression
9014 can be moved by GCSE optimizations.  This is currently supported only in the
9015 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9016 is with simple expressions, i.e., the expressions that have cost
9017 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9018 hoisting of simple expressions.  The default value is 10.
9020 @item gcse-unrestricted-cost
9021 Cost, roughly measured as the cost of a single typical machine
9022 instruction, at which GCSE optimizations do not constrain
9023 the distance an expression can travel.  This is currently
9024 supported only in the code hoisting pass.  The lesser the cost,
9025 the more aggressive code hoisting is.  Specifying 0 
9026 allows all expressions to travel unrestricted distances.
9027 The default value is 3.
9029 @item max-hoist-depth
9030 The depth of search in the dominator tree for expressions to hoist.
9031 This is used to avoid quadratic behavior in hoisting algorithm.
9032 The value of 0 does not limit on the search, but may slow down compilation
9033 of huge functions.  The default value is 30.
9035 @item max-tail-merge-comparisons
9036 The maximum amount of similar bbs to compare a bb with.  This is used to
9037 avoid quadratic behavior in tree tail merging.  The default value is 10.
9039 @item max-tail-merge-iterations
9040 The maximum amount of iterations of the pass over the function.  This is used to
9041 limit compilation time in tree tail merging.  The default value is 2.
9043 @item max-unrolled-insns
9044 The maximum number of instructions that a loop may have to be unrolled.
9045 If a loop is unrolled, this parameter also determines how many times
9046 the loop code is unrolled.
9048 @item max-average-unrolled-insns
9049 The maximum number of instructions biased by probabilities of their execution
9050 that a loop may have to be unrolled.  If a loop is unrolled,
9051 this parameter also determines how many times the loop code is unrolled.
9053 @item max-unroll-times
9054 The maximum number of unrollings of a single loop.
9056 @item max-peeled-insns
9057 The maximum number of instructions that a loop may have to be peeled.
9058 If a loop is peeled, this parameter also determines how many times
9059 the loop code is peeled.
9061 @item max-peel-times
9062 The maximum number of peelings of a single loop.
9064 @item max-peel-branches
9065 The maximum number of branches on the hot path through the peeled sequence.
9067 @item max-completely-peeled-insns
9068 The maximum number of insns of a completely peeled loop.
9070 @item max-completely-peel-times
9071 The maximum number of iterations of a loop to be suitable for complete peeling.
9073 @item max-completely-peel-loop-nest-depth
9074 The maximum depth of a loop nest suitable for complete peeling.
9076 @item max-unswitch-insns
9077 The maximum number of insns of an unswitched loop.
9079 @item max-unswitch-level
9080 The maximum number of branches unswitched in a single loop.
9082 @item max-loop-headers-insns
9083 The maximum number of insns in loop header duplicated by he copy loop headers
9084 pass.
9086 @item lim-expensive
9087 The minimum cost of an expensive expression in the loop invariant motion.
9089 @item iv-consider-all-candidates-bound
9090 Bound on number of candidates for induction variables, below which
9091 all candidates are considered for each use in induction variable
9092 optimizations.  If there are more candidates than this,
9093 only the most relevant ones are considered to avoid quadratic time complexity.
9095 @item iv-max-considered-uses
9096 The induction variable optimizations give up on loops that contain more
9097 induction variable uses.
9099 @item iv-always-prune-cand-set-bound
9100 If the number of candidates in the set is smaller than this value,
9101 always try to remove unnecessary ivs from the set
9102 when adding a new one.
9104 @item scev-max-expr-size
9105 Bound on size of expressions used in the scalar evolutions analyzer.
9106 Large expressions slow the analyzer.
9108 @item scev-max-expr-complexity
9109 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9110 Complex expressions slow the analyzer.
9112 @item max-tree-if-conversion-phi-args
9113 Maximum number of arguments in a PHI supported by TREE if conversion
9114 unless the loop is marked with simd pragma.
9116 @item vect-max-version-for-alignment-checks
9117 The maximum number of run-time checks that can be performed when
9118 doing loop versioning for alignment in the vectorizer.
9120 @item vect-max-version-for-alias-checks
9121 The maximum number of run-time checks that can be performed when
9122 doing loop versioning for alias in the vectorizer.
9124 @item vect-max-peeling-for-alignment
9125 The maximum number of loop peels to enhance access alignment
9126 for vectorizer. Value -1 means no limit.
9128 @item max-iterations-to-track
9129 The maximum number of iterations of a loop the brute-force algorithm
9130 for analysis of the number of iterations of the loop tries to evaluate.
9132 @item hot-bb-count-ws-permille
9133 A basic block profile count is considered hot if it contributes to 
9134 the given permillage (i.e. 0...1000) of the entire profiled execution.
9136 @item hot-bb-frequency-fraction
9137 Select fraction of the entry block frequency of executions of basic block in
9138 function given basic block needs to have to be considered hot.
9140 @item max-predicted-iterations
9141 The maximum number of loop iterations we predict statically.  This is useful
9142 in cases where a function contains a single loop with known bound and
9143 another loop with unknown bound.
9144 The known number of iterations is predicted correctly, while
9145 the unknown number of iterations average to roughly 10.  This means that the
9146 loop without bounds appears artificially cold relative to the other one.
9148 @item builtin-expect-probability
9149 Control the probability of the expression having the specified value. This
9150 parameter takes a percentage (i.e. 0 ... 100) as input.
9151 The default probability of 90 is obtained empirically.
9153 @item align-threshold
9155 Select fraction of the maximal frequency of executions of a basic block in
9156 a function to align the basic block.
9158 @item align-loop-iterations
9160 A loop expected to iterate at least the selected number of iterations is
9161 aligned.
9163 @item tracer-dynamic-coverage
9164 @itemx tracer-dynamic-coverage-feedback
9166 This value is used to limit superblock formation once the given percentage of
9167 executed instructions is covered.  This limits unnecessary code size
9168 expansion.
9170 The @option{tracer-dynamic-coverage-feedback} parameter
9171 is used only when profile
9172 feedback is available.  The real profiles (as opposed to statically estimated
9173 ones) are much less balanced allowing the threshold to be larger value.
9175 @item tracer-max-code-growth
9176 Stop tail duplication once code growth has reached given percentage.  This is
9177 a rather artificial limit, as most of the duplicates are eliminated later in
9178 cross jumping, so it may be set to much higher values than is the desired code
9179 growth.
9181 @item tracer-min-branch-ratio
9183 Stop reverse growth when the reverse probability of best edge is less than this
9184 threshold (in percent).
9186 @item tracer-min-branch-probability
9187 @itemx tracer-min-branch-probability-feedback
9189 Stop forward growth if the best edge has probability lower than this
9190 threshold.
9192 Similarly to @option{tracer-dynamic-coverage} two parameters are
9193 provided.  @option{tracer-min-branch-probability-feedback} is used for
9194 compilation with profile feedback and @option{tracer-min-branch-probability}
9195 compilation without.  The value for compilation with profile feedback
9196 needs to be more conservative (higher) in order to make tracer
9197 effective.
9199 @item max-cse-path-length
9201 The maximum number of basic blocks on path that CSE considers.
9202 The default is 10.
9204 @item max-cse-insns
9205 The maximum number of instructions CSE processes before flushing.
9206 The default is 1000.
9208 @item ggc-min-expand
9210 GCC uses a garbage collector to manage its own memory allocation.  This
9211 parameter specifies the minimum percentage by which the garbage
9212 collector's heap should be allowed to expand between collections.
9213 Tuning this may improve compilation speed; it has no effect on code
9214 generation.
9216 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9217 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9218 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9219 GCC is not able to calculate RAM on a particular platform, the lower
9220 bound of 30% is used.  Setting this parameter and
9221 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9222 every opportunity.  This is extremely slow, but can be useful for
9223 debugging.
9225 @item ggc-min-heapsize
9227 Minimum size of the garbage collector's heap before it begins bothering
9228 to collect garbage.  The first collection occurs after the heap expands
9229 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9230 tuning this may improve compilation speed, and has no effect on code
9231 generation.
9233 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9234 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9235 with a lower bound of 4096 (four megabytes) and an upper bound of
9236 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9237 particular platform, the lower bound is used.  Setting this parameter
9238 very large effectively disables garbage collection.  Setting this
9239 parameter and @option{ggc-min-expand} to zero causes a full collection
9240 to occur at every opportunity.
9242 @item max-reload-search-insns
9243 The maximum number of instruction reload should look backward for equivalent
9244 register.  Increasing values mean more aggressive optimization, making the
9245 compilation time increase with probably slightly better performance.
9246 The default value is 100.
9248 @item max-cselib-memory-locations
9249 The maximum number of memory locations cselib should take into account.
9250 Increasing values mean more aggressive optimization, making the compilation time
9251 increase with probably slightly better performance.  The default value is 500.
9253 @item max-sched-ready-insns
9254 The maximum number of instructions ready to be issued the scheduler should
9255 consider at any given time during the first scheduling pass.  Increasing
9256 values mean more thorough searches, making the compilation time increase
9257 with probably little benefit.  The default value is 100.
9259 @item max-sched-region-blocks
9260 The maximum number of blocks in a region to be considered for
9261 interblock scheduling.  The default value is 10.
9263 @item max-pipeline-region-blocks
9264 The maximum number of blocks in a region to be considered for
9265 pipelining in the selective scheduler.  The default value is 15.
9267 @item max-sched-region-insns
9268 The maximum number of insns in a region to be considered for
9269 interblock scheduling.  The default value is 100.
9271 @item max-pipeline-region-insns
9272 The maximum number of insns in a region to be considered for
9273 pipelining in the selective scheduler.  The default value is 200.
9275 @item min-spec-prob
9276 The minimum probability (in percents) of reaching a source block
9277 for interblock speculative scheduling.  The default value is 40.
9279 @item max-sched-extend-regions-iters
9280 The maximum number of iterations through CFG to extend regions.
9281 A value of 0 (the default) disables region extensions.
9283 @item max-sched-insn-conflict-delay
9284 The maximum conflict delay for an insn to be considered for speculative motion.
9285 The default value is 3.
9287 @item sched-spec-prob-cutoff
9288 The minimal probability of speculation success (in percents), so that
9289 speculative insns are scheduled.
9290 The default value is 40.
9292 @item sched-state-edge-prob-cutoff
9293 The minimum probability an edge must have for the scheduler to save its
9294 state across it.
9295 The default value is 10.
9297 @item sched-mem-true-dep-cost
9298 Minimal distance (in CPU cycles) between store and load targeting same
9299 memory locations.  The default value is 1.
9301 @item selsched-max-lookahead
9302 The maximum size of the lookahead window of selective scheduling.  It is a
9303 depth of search for available instructions.
9304 The default value is 50.
9306 @item selsched-max-sched-times
9307 The maximum number of times that an instruction is scheduled during
9308 selective scheduling.  This is the limit on the number of iterations
9309 through which the instruction may be pipelined.  The default value is 2.
9311 @item selsched-insns-to-rename
9312 The maximum number of best instructions in the ready list that are considered
9313 for renaming in the selective scheduler.  The default value is 2.
9315 @item sms-min-sc
9316 The minimum value of stage count that swing modulo scheduler
9317 generates.  The default value is 2.
9319 @item max-last-value-rtl
9320 The maximum size measured as number of RTLs that can be recorded in an expression
9321 in combiner for a pseudo register as last known value of that register.  The default
9322 is 10000.
9324 @item max-combine-insns
9325 The maximum number of instructions the RTL combiner tries to combine.
9326 The default value is 2 at @option{-Og} and 4 otherwise.
9328 @item integer-share-limit
9329 Small integer constants can use a shared data structure, reducing the
9330 compiler's memory usage and increasing its speed.  This sets the maximum
9331 value of a shared integer constant.  The default value is 256.
9333 @item ssp-buffer-size
9334 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9335 protection when @option{-fstack-protection} is used.
9337 @item min-size-for-stack-sharing
9338 The minimum size of variables taking part in stack slot sharing when not
9339 optimizing. The default value is 32.
9341 @item max-jump-thread-duplication-stmts
9342 Maximum number of statements allowed in a block that needs to be
9343 duplicated when threading jumps.
9345 @item max-fields-for-field-sensitive
9346 Maximum number of fields in a structure treated in
9347 a field sensitive manner during pointer analysis.  The default is zero
9348 for @option{-O0} and @option{-O1},
9349 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9351 @item prefetch-latency
9352 Estimate on average number of instructions that are executed before
9353 prefetch finishes.  The distance prefetched ahead is proportional
9354 to this constant.  Increasing this number may also lead to less
9355 streams being prefetched (see @option{simultaneous-prefetches}).
9357 @item simultaneous-prefetches
9358 Maximum number of prefetches that can run at the same time.
9360 @item l1-cache-line-size
9361 The size of cache line in L1 cache, in bytes.
9363 @item l1-cache-size
9364 The size of L1 cache, in kilobytes.
9366 @item l2-cache-size
9367 The size of L2 cache, in kilobytes.
9369 @item min-insn-to-prefetch-ratio
9370 The minimum ratio between the number of instructions and the
9371 number of prefetches to enable prefetching in a loop.
9373 @item prefetch-min-insn-to-mem-ratio
9374 The minimum ratio between the number of instructions and the
9375 number of memory references to enable prefetching in a loop.
9377 @item use-canonical-types
9378 Whether the compiler should use the ``canonical'' type system.  By
9379 default, this should always be 1, which uses a more efficient internal
9380 mechanism for comparing types in C++ and Objective-C++.  However, if
9381 bugs in the canonical type system are causing compilation failures,
9382 set this value to 0 to disable canonical types.
9384 @item switch-conversion-max-branch-ratio
9385 Switch initialization conversion refuses to create arrays that are
9386 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9387 branches in the switch.
9389 @item max-partial-antic-length
9390 Maximum length of the partial antic set computed during the tree
9391 partial redundancy elimination optimization (@option{-ftree-pre}) when
9392 optimizing at @option{-O3} and above.  For some sorts of source code
9393 the enhanced partial redundancy elimination optimization can run away,
9394 consuming all of the memory available on the host machine.  This
9395 parameter sets a limit on the length of the sets that are computed,
9396 which prevents the runaway behavior.  Setting a value of 0 for
9397 this parameter allows an unlimited set length.
9399 @item sccvn-max-scc-size
9400 Maximum size of a strongly connected component (SCC) during SCCVN
9401 processing.  If this limit is hit, SCCVN processing for the whole
9402 function is not done and optimizations depending on it are
9403 disabled.  The default maximum SCC size is 10000.
9405 @item sccvn-max-alias-queries-per-access
9406 Maximum number of alias-oracle queries we perform when looking for
9407 redundancies for loads and stores.  If this limit is hit the search
9408 is aborted and the load or store is not considered redundant.  The
9409 number of queries is algorithmically limited to the number of
9410 stores on all paths from the load to the function entry.
9411 The default maximum number of queries is 1000.
9413 @item ira-max-loops-num
9414 IRA uses regional register allocation by default.  If a function
9415 contains more loops than the number given by this parameter, only at most
9416 the given number of the most frequently-executed loops form regions
9417 for regional register allocation.  The default value of the
9418 parameter is 100.
9420 @item ira-max-conflict-table-size 
9421 Although IRA uses a sophisticated algorithm to compress the conflict
9422 table, the table can still require excessive amounts of memory for
9423 huge functions.  If the conflict table for a function could be more
9424 than the size in MB given by this parameter, the register allocator
9425 instead uses a faster, simpler, and lower-quality
9426 algorithm that does not require building a pseudo-register conflict table.  
9427 The default value of the parameter is 2000.
9429 @item ira-loop-reserved-regs
9430 IRA can be used to evaluate more accurate register pressure in loops
9431 for decisions to move loop invariants (see @option{-O3}).  The number
9432 of available registers reserved for some other purposes is given
9433 by this parameter.  The default value of the parameter is 2, which is
9434 the minimal number of registers needed by typical instructions.
9435 This value is the best found from numerous experiments.
9437 @item lra-inheritance-ebb-probability-cutoff
9438 LRA tries to reuse values reloaded in registers in subsequent insns.
9439 This optimization is called inheritance.  EBB is used as a region to
9440 do this optimization.  The parameter defines a minimal fall-through
9441 edge probability in percentage used to add BB to inheritance EBB in
9442 LRA.  The default value of the parameter is 40.  The value was chosen
9443 from numerous runs of SPEC2000 on x86-64.
9445 @item loop-invariant-max-bbs-in-loop
9446 Loop invariant motion can be very expensive, both in compilation time and
9447 in amount of needed compile-time memory, with very large loops.  Loops
9448 with more basic blocks than this parameter won't have loop invariant
9449 motion optimization performed on them.  The default value of the
9450 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9452 @item loop-max-datarefs-for-datadeps
9453 Building data dependencies is expensive for very large loops.  This
9454 parameter limits the number of data references in loops that are
9455 considered for data dependence analysis.  These large loops are no
9456 handled by the optimizations using loop data dependencies.
9457 The default value is 1000.
9459 @item max-vartrack-size
9460 Sets a maximum number of hash table slots to use during variable
9461 tracking dataflow analysis of any function.  If this limit is exceeded
9462 with variable tracking at assignments enabled, analysis for that
9463 function is retried without it, after removing all debug insns from
9464 the function.  If the limit is exceeded even without debug insns, var
9465 tracking analysis is completely disabled for the function.  Setting
9466 the parameter to zero makes it unlimited.
9468 @item max-vartrack-expr-depth
9469 Sets a maximum number of recursion levels when attempting to map
9470 variable names or debug temporaries to value expressions.  This trades
9471 compilation time for more complete debug information.  If this is set too
9472 low, value expressions that are available and could be represented in
9473 debug information may end up not being used; setting this higher may
9474 enable the compiler to find more complex debug expressions, but compile
9475 time and memory use may grow.  The default is 12.
9477 @item min-nondebug-insn-uid
9478 Use uids starting at this parameter for nondebug insns.  The range below
9479 the parameter is reserved exclusively for debug insns created by
9480 @option{-fvar-tracking-assignments}, but debug insns may get
9481 (non-overlapping) uids above it if the reserved range is exhausted.
9483 @item ipa-sra-ptr-growth-factor
9484 IPA-SRA replaces a pointer to an aggregate with one or more new
9485 parameters only when their cumulative size is less or equal to
9486 @option{ipa-sra-ptr-growth-factor} times the size of the original
9487 pointer parameter.
9489 @item sra-max-scalarization-size-Ospeed
9490 @item sra-max-scalarization-size-Osize
9491 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
9492 replace scalar parts of aggregates with uses of independent scalar
9493 variables.  These parameters control the maximum size, in storage units,
9494 of aggregate which is considered for replacement when compiling for
9495 speed
9496 (@option{sra-max-scalarization-size-Ospeed}) or size
9497 (@option{sra-max-scalarization-size-Osize}) respectively.
9499 @item tm-max-aggregate-size
9500 When making copies of thread-local variables in a transaction, this
9501 parameter specifies the size in bytes after which variables are
9502 saved with the logging functions as opposed to save/restore code
9503 sequence pairs.  This option only applies when using
9504 @option{-fgnu-tm}.
9506 @item graphite-max-nb-scop-params
9507 To avoid exponential effects in the Graphite loop transforms, the
9508 number of parameters in a Static Control Part (SCoP) is bounded.  The
9509 default value is 10 parameters.  A variable whose value is unknown at
9510 compilation time and defined outside a SCoP is a parameter of the SCoP.
9512 @item graphite-max-bbs-per-function
9513 To avoid exponential effects in the detection of SCoPs, the size of
9514 the functions analyzed by Graphite is bounded.  The default value is
9515 100 basic blocks.
9517 @item loop-block-tile-size
9518 Loop blocking or strip mining transforms, enabled with
9519 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9520 loop in the loop nest by a given number of iterations.  The strip
9521 length can be changed using the @option{loop-block-tile-size}
9522 parameter.  The default value is 51 iterations.
9524 @item loop-unroll-jam-size
9525 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
9526 default value is 4.
9528 @item loop-unroll-jam-depth
9529 Specify the dimension to be unrolled (counting from the most inner loop)
9530 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
9532 @item ipa-cp-value-list-size
9533 IPA-CP attempts to track all possible values and types passed to a function's
9534 parameter in order to propagate them and perform devirtualization.
9535 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9536 stores per one formal parameter of a function.
9538 @item ipa-cp-eval-threshold
9539 IPA-CP calculates its own score of cloning profitability heuristics
9540 and performs those cloning opportunities with scores that exceed
9541 @option{ipa-cp-eval-threshold}.
9543 @item ipa-cp-recursion-penalty
9544 Percentage penalty the recursive functions will receive when they
9545 are evaluated for cloning.
9547 @item ipa-cp-single-call-penalty
9548 Percentage penalty functions containg a single call to another
9549 function will receive when they are evaluated for cloning.
9552 @item ipa-max-agg-items
9553 IPA-CP is also capable to propagate a number of scalar values passed
9554 in an aggregate. @option{ipa-max-agg-items} controls the maximum
9555 number of such values per one parameter.
9557 @item ipa-cp-loop-hint-bonus
9558 When IPA-CP determines that a cloning candidate would make the number
9559 of iterations of a loop known, it adds a bonus of
9560 @option{ipa-cp-loop-hint-bonus} to the profitability score of
9561 the candidate.
9563 @item ipa-cp-array-index-hint-bonus
9564 When IPA-CP determines that a cloning candidate would make the index of
9565 an array access known, it adds a bonus of
9566 @option{ipa-cp-array-index-hint-bonus} to the profitability
9567 score of the candidate.
9569 @item ipa-max-aa-steps
9570 During its analysis of function bodies, IPA-CP employs alias analysis
9571 in order to track values pointed to by function parameters.  In order
9572 not spend too much time analyzing huge functions, it gives up and
9573 consider all memory clobbered after examining
9574 @option{ipa-max-aa-steps} statements modifying memory.
9576 @item lto-partitions
9577 Specify desired number of partitions produced during WHOPR compilation.
9578 The number of partitions should exceed the number of CPUs used for compilation.
9579 The default value is 32.
9581 @item lto-min-partition
9582 Size of minimal partition for WHOPR (in estimated instructions).
9583 This prevents expenses of splitting very small programs into too many
9584 partitions.
9586 @item lto-max-partition
9587 Size of max partition for WHOPR (in estimated instructions).
9588 to provide an upper bound for individual size of partition.
9589 Meant to be used only with balanced partitioning.
9591 @item cxx-max-namespaces-for-diagnostic-help
9592 The maximum number of namespaces to consult for suggestions when C++
9593 name lookup fails for an identifier.  The default is 1000.
9595 @item sink-frequency-threshold
9596 The maximum relative execution frequency (in percents) of the target block
9597 relative to a statement's original block to allow statement sinking of a
9598 statement.  Larger numbers result in more aggressive statement sinking.
9599 The default value is 75.  A small positive adjustment is applied for
9600 statements with memory operands as those are even more profitable so sink.
9602 @item max-stores-to-sink
9603 The maximum number of conditional store pairs that can be sunk.  Set to 0
9604 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9605 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9607 @item allow-store-data-races
9608 Allow optimizers to introduce new data races on stores.
9609 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9610 at optimization level @option{-Ofast}.
9612 @item case-values-threshold
9613 The smallest number of different values for which it is best to use a
9614 jump-table instead of a tree of conditional branches.  If the value is
9615 0, use the default for the machine.  The default is 0.
9617 @item tree-reassoc-width
9618 Set the maximum number of instructions executed in parallel in
9619 reassociated tree. This parameter overrides target dependent
9620 heuristics used by default if has non zero value.
9622 @item sched-pressure-algorithm
9623 Choose between the two available implementations of
9624 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9625 and is the more likely to prevent instructions from being reordered.
9626 Algorithm 2 was designed to be a compromise between the relatively
9627 conservative approach taken by algorithm 1 and the rather aggressive
9628 approach taken by the default scheduler.  It relies more heavily on
9629 having a regular register file and accurate register pressure classes.
9630 See @file{haifa-sched.c} in the GCC sources for more details.
9632 The default choice depends on the target.
9634 @item max-slsr-cand-scan
9635 Set the maximum number of existing candidates that are considered when
9636 seeking a basis for a new straight-line strength reduction candidate.
9638 @item asan-globals
9639 Enable buffer overflow detection for global objects.  This kind
9640 of protection is enabled by default if you are using
9641 @option{-fsanitize=address} option.
9642 To disable global objects protection use @option{--param asan-globals=0}.
9644 @item asan-stack
9645 Enable buffer overflow detection for stack objects.  This kind of
9646 protection is enabled by default when using @option{-fsanitize=address}.
9647 To disable stack protection use @option{--param asan-stack=0} option.
9649 @item asan-instrument-reads
9650 Enable buffer overflow detection for memory reads.  This kind of
9651 protection is enabled by default when using @option{-fsanitize=address}.
9652 To disable memory reads protection use
9653 @option{--param asan-instrument-reads=0}.
9655 @item asan-instrument-writes
9656 Enable buffer overflow detection for memory writes.  This kind of
9657 protection is enabled by default when using @option{-fsanitize=address}.
9658 To disable memory writes protection use
9659 @option{--param asan-instrument-writes=0} option.
9661 @item asan-memintrin
9662 Enable detection for built-in functions.  This kind of protection
9663 is enabled by default when using @option{-fsanitize=address}.
9664 To disable built-in functions protection use
9665 @option{--param asan-memintrin=0}.
9667 @item asan-use-after-return
9668 Enable detection of use-after-return.  This kind of protection
9669 is enabled by default when using @option{-fsanitize=address} option.
9670 To disable use-after-return detection use 
9671 @option{--param asan-use-after-return=0}.
9673 @item asan-instrumentation-with-call-threshold
9674 If number of memory accesses in function being instrumented
9675 is greater or equal to this number, use callbacks instead of inline checks.
9676 E.g. to disable inline code use
9677 @option{--param asan-instrumentation-with-call-threshold=0}.
9679 @item chkp-max-ctor-size
9680 Static constructors generated by Pointer Bounds Checker may become very
9681 large and significantly increase compile time at optimization level
9682 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
9683 in a single generated constructor.  Default value is 5000.
9685 @item max-fsm-thread-path-insns
9686 Maximum number of instructions to copy when duplicating blocks on a
9687 finite state automaton jump thread path.  The default is 100.
9689 @item max-fsm-thread-length
9690 Maximum number of basic blocks on a finite state automaton jump thread
9691 path.  The default is 10.
9693 @item max-fsm-thread-paths
9694 Maximum number of new jump thread paths to create for a finite state
9695 automaton.  The default is 50.
9697 @item parloops-chunk-size
9698 Chunk size of omp schedule for loops parallelized by parloops.  The default
9699 is 0.
9701 @item parloops-schedule
9702 Schedule type of omp schedule for loops parallelized by parloops (static,
9703 dynamic, guided, auto, runtime).  The default is static.
9705 @item max-ssa-name-query-depth
9706 Maximum depth of recursion when querying properties of SSA names in things
9707 like fold routines.  One level of recursion corresponds to following a
9708 use-def chain.
9710 @item hsa-gen-debug-stores
9711 Enable emission of special debug stores within HSA kernels which are
9712 then read and reported by libgomp plugin.  Generation of these stores
9713 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
9714 enable it.
9716 @item max-speculative-devirt-maydefs
9717 The maximum number of may-defs we analyze when looking for a must-def
9718 specifying the dynamic type of an object that invokes a virtual call
9719 we may be able to devirtualize speculatively.
9720 @end table
9721 @end table
9723 @node Instrumentation Options
9724 @section Program Instrumentation Options
9725 @cindex instrumentation options
9726 @cindex program instrumentation options
9727 @cindex run-time error checking options
9728 @cindex profiling options
9729 @cindex options, program instrumentation
9730 @cindex options, run-time error checking
9731 @cindex options, profiling
9733 GCC supports a number of command-line options that control adding
9734 run-time instrumentation to the code it normally generates.  
9735 For example, one purpose of instrumentation is collect profiling
9736 statistics for use in finding program hot spots, code coverage
9737 analysis, or profile-guided optimizations.
9738 Another class of program instrumentation is adding run-time checking 
9739 to detect programming errors like invalid pointer
9740 dereferences or out-of-bounds array accesses, as well as deliberately
9741 hostile attacks such as stack smashing or C++ vtable hijacking.
9742 There is also a general hook which can be used to implement other
9743 forms of tracing or function-level instrumentation for debug or
9744 program analysis purposes.
9746 @table @gcctabopt
9747 @cindex @command{prof}
9748 @item -p
9749 @opindex p
9750 Generate extra code to write profile information suitable for the
9751 analysis program @command{prof}.  You must use this option when compiling
9752 the source files you want data about, and you must also use it when
9753 linking.
9755 @cindex @command{gprof}
9756 @item -pg
9757 @opindex pg
9758 Generate extra code to write profile information suitable for the
9759 analysis program @command{gprof}.  You must use this option when compiling
9760 the source files you want data about, and you must also use it when
9761 linking.
9763 @item -fprofile-arcs
9764 @opindex fprofile-arcs
9765 Add code so that program flow @dfn{arcs} are instrumented.  During
9766 execution the program records how many times each branch and call is
9767 executed and how many times it is taken or returns.  When the compiled
9768 program exits it saves this data to a file called
9769 @file{@var{auxname}.gcda} for each source file.  The data may be used for
9770 profile-directed optimizations (@option{-fbranch-probabilities}), or for
9771 test coverage analysis (@option{-ftest-coverage}).  Each object file's
9772 @var{auxname} is generated from the name of the output file, if
9773 explicitly specified and it is not the final executable, otherwise it is
9774 the basename of the source file.  In both cases any suffix is removed
9775 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
9776 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
9777 @xref{Cross-profiling}.
9779 @cindex @command{gcov}
9780 @item --coverage
9781 @opindex coverage
9783 This option is used to compile and link code instrumented for coverage
9784 analysis.  The option is a synonym for @option{-fprofile-arcs}
9785 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
9786 linking).  See the documentation for those options for more details.
9788 @itemize
9790 @item
9791 Compile the source files with @option{-fprofile-arcs} plus optimization
9792 and code generation options.  For test coverage analysis, use the
9793 additional @option{-ftest-coverage} option.  You do not need to profile
9794 every source file in a program.
9796 @item
9797 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
9798 (the latter implies the former).
9800 @item
9801 Run the program on a representative workload to generate the arc profile
9802 information.  This may be repeated any number of times.  You can run
9803 concurrent instances of your program, and provided that the file system
9804 supports locking, the data files will be correctly updated.  Also
9805 @code{fork} calls are detected and correctly handled (double counting
9806 will not happen).
9808 @item
9809 For profile-directed optimizations, compile the source files again with
9810 the same optimization and code generation options plus
9811 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
9812 Control Optimization}).
9814 @item
9815 For test coverage analysis, use @command{gcov} to produce human readable
9816 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
9817 @command{gcov} documentation for further information.
9819 @end itemize
9821 With @option{-fprofile-arcs}, for each function of your program GCC
9822 creates a program flow graph, then finds a spanning tree for the graph.
9823 Only arcs that are not on the spanning tree have to be instrumented: the
9824 compiler adds code to count the number of times that these arcs are
9825 executed.  When an arc is the only exit or only entrance to a block, the
9826 instrumentation code can be added to the block; otherwise, a new basic
9827 block must be created to hold the instrumentation code.
9829 @need 2000
9830 @item -ftest-coverage
9831 @opindex ftest-coverage
9832 Produce a notes file that the @command{gcov} code-coverage utility
9833 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
9834 show program coverage.  Each source file's note file is called
9835 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
9836 above for a description of @var{auxname} and instructions on how to
9837 generate test coverage data.  Coverage data matches the source files
9838 more closely if you do not optimize.
9840 @item -fprofile-dir=@var{path}
9841 @opindex fprofile-dir
9843 Set the directory to search for the profile data files in to @var{path}.
9844 This option affects only the profile data generated by
9845 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9846 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9847 and its related options.  Both absolute and relative paths can be used.
9848 By default, GCC uses the current directory as @var{path}, thus the
9849 profile data file appears in the same directory as the object file.
9851 @item -fprofile-generate
9852 @itemx -fprofile-generate=@var{path}
9853 @opindex fprofile-generate
9855 Enable options usually used for instrumenting application to produce
9856 profile useful for later recompilation with profile feedback based
9857 optimization.  You must use @option{-fprofile-generate} both when
9858 compiling and when linking your program.
9860 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
9862 If @var{path} is specified, GCC looks at the @var{path} to find
9863 the profile feedback data files. See @option{-fprofile-dir}.
9865 To optimize the program based on the collected profile information, use
9866 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
9868 @item -fsanitize=address
9869 @opindex fsanitize=address
9870 Enable AddressSanitizer, a fast memory error detector.
9871 Memory access instructions are instrumented to detect
9872 out-of-bounds and use-after-free bugs.
9873 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
9874 more details.  The run-time behavior can be influenced using the
9875 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
9876 the available options are shown at startup of the instrumented program.  See
9877 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
9878 for a list of supported options.
9880 @item -fsanitize=kernel-address
9881 @opindex fsanitize=kernel-address
9882 Enable AddressSanitizer for Linux kernel.
9883 See @uref{https://github.com/google/kasan/wiki} for more details.
9885 @item -fsanitize=thread
9886 @opindex fsanitize=thread
9887 Enable ThreadSanitizer, a fast data race detector.
9888 Memory access instructions are instrumented to detect
9889 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
9890 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
9891 environment variable; see
9892 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
9893 supported options.
9895 @item -fsanitize=leak
9896 @opindex fsanitize=leak
9897 Enable LeakSanitizer, a memory leak detector.
9898 This option only matters for linking of executables and if neither
9899 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
9900 case the executable is linked against a library that overrides @code{malloc}
9901 and other allocator functions.  See
9902 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
9903 details.  The run-time behavior can be influenced using the
9904 @env{LSAN_OPTIONS} environment variable.
9906 @item -fsanitize=undefined
9907 @opindex fsanitize=undefined
9908 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
9909 Various computations are instrumented to detect undefined behavior
9910 at runtime.  Current suboptions are:
9912 @table @gcctabopt
9914 @item -fsanitize=shift
9915 @opindex fsanitize=shift
9916 This option enables checking that the result of a shift operation is
9917 not undefined.  Note that what exactly is considered undefined differs
9918 slightly between C and C++, as well as between ISO C90 and C99, etc.
9920 @item -fsanitize=integer-divide-by-zero
9921 @opindex fsanitize=integer-divide-by-zero
9922 Detect integer division by zero as well as @code{INT_MIN / -1} division.
9924 @item -fsanitize=unreachable
9925 @opindex fsanitize=unreachable
9926 With this option, the compiler turns the @code{__builtin_unreachable}
9927 call into a diagnostics message call instead.  When reaching the
9928 @code{__builtin_unreachable} call, the behavior is undefined.
9930 @item -fsanitize=vla-bound
9931 @opindex fsanitize=vla-bound
9932 This option instructs the compiler to check that the size of a variable
9933 length array is positive.
9935 @item -fsanitize=null
9936 @opindex fsanitize=null
9937 This option enables pointer checking.  Particularly, the application
9938 built with this option turned on will issue an error message when it
9939 tries to dereference a NULL pointer, or if a reference (possibly an
9940 rvalue reference) is bound to a NULL pointer, or if a method is invoked
9941 on an object pointed by a NULL pointer.
9943 @item -fsanitize=return
9944 @opindex fsanitize=return
9945 This option enables return statement checking.  Programs
9946 built with this option turned on will issue an error message
9947 when the end of a non-void function is reached without actually
9948 returning a value.  This option works in C++ only.
9950 @item -fsanitize=signed-integer-overflow
9951 @opindex fsanitize=signed-integer-overflow
9952 This option enables signed integer overflow checking.  We check that
9953 the result of @code{+}, @code{*}, and both unary and binary @code{-}
9954 does not overflow in the signed arithmetics.  Note, integer promotion
9955 rules must be taken into account.  That is, the following is not an
9956 overflow:
9957 @smallexample
9958 signed char a = SCHAR_MAX;
9959 a++;
9960 @end smallexample
9962 @item -fsanitize=bounds
9963 @opindex fsanitize=bounds
9964 This option enables instrumentation of array bounds.  Various out of bounds
9965 accesses are detected.  Flexible array members, flexible array member-like
9966 arrays, and initializers of variables with static storage are not instrumented.
9968 @item -fsanitize=bounds-strict
9969 @opindex fsanitize=bounds-strict
9970 This option enables strict instrumentation of array bounds.  Most out of bounds
9971 accesses are detected, including flexible array members and flexible array
9972 member-like arrays.  Initializers of variables with static storage are not
9973 instrumented.
9975 @item -fsanitize=alignment
9976 @opindex fsanitize=alignment
9978 This option enables checking of alignment of pointers when they are
9979 dereferenced, or when a reference is bound to insufficiently aligned target,
9980 or when a method or constructor is invoked on insufficiently aligned object.
9982 @item -fsanitize=object-size
9983 @opindex fsanitize=object-size
9984 This option enables instrumentation of memory references using the
9985 @code{__builtin_object_size} function.  Various out of bounds pointer
9986 accesses are detected.
9988 @item -fsanitize=float-divide-by-zero
9989 @opindex fsanitize=float-divide-by-zero
9990 Detect floating-point division by zero.  Unlike other similar options,
9991 @option{-fsanitize=float-divide-by-zero} is not enabled by
9992 @option{-fsanitize=undefined}, since floating-point division by zero can
9993 be a legitimate way of obtaining infinities and NaNs.
9995 @item -fsanitize=float-cast-overflow
9996 @opindex fsanitize=float-cast-overflow
9997 This option enables floating-point type to integer conversion checking.
9998 We check that the result of the conversion does not overflow.
9999 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
10000 not enabled by @option{-fsanitize=undefined}.
10001 This option does not work well with @code{FE_INVALID} exceptions enabled.
10003 @item -fsanitize=nonnull-attribute
10004 @opindex fsanitize=nonnull-attribute
10006 This option enables instrumentation of calls, checking whether null values
10007 are not passed to arguments marked as requiring a non-null value by the
10008 @code{nonnull} function attribute.
10010 @item -fsanitize=returns-nonnull-attribute
10011 @opindex fsanitize=returns-nonnull-attribute
10013 This option enables instrumentation of return statements in functions
10014 marked with @code{returns_nonnull} function attribute, to detect returning
10015 of null values from such functions.
10017 @item -fsanitize=bool
10018 @opindex fsanitize=bool
10020 This option enables instrumentation of loads from bool.  If a value other
10021 than 0/1 is loaded, a run-time error is issued.
10023 @item -fsanitize=enum
10024 @opindex fsanitize=enum
10026 This option enables instrumentation of loads from an enum type.  If
10027 a value outside the range of values for the enum type is loaded,
10028 a run-time error is issued.
10030 @item -fsanitize=vptr
10031 @opindex fsanitize=vptr
10033 This option enables instrumentation of C++ member function calls, member
10034 accesses and some conversions between pointers to base and derived classes,
10035 to verify the referenced object has the correct dynamic type.
10037 @end table
10039 While @option{-ftrapv} causes traps for signed overflows to be emitted,
10040 @option{-fsanitize=undefined} gives a diagnostic message.
10041 This currently works only for the C family of languages.
10043 @item -fno-sanitize=all
10044 @opindex fno-sanitize=all
10046 This option disables all previously enabled sanitizers.
10047 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
10048 together.
10050 @item -fasan-shadow-offset=@var{number}
10051 @opindex fasan-shadow-offset
10052 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
10053 It is useful for experimenting with different shadow memory layouts in
10054 Kernel AddressSanitizer.
10056 @item -fsanitize-sections=@var{s1},@var{s2},...
10057 @opindex fsanitize-sections
10058 Sanitize global variables in selected user-defined sections.  @var{si} may
10059 contain wildcards.
10061 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
10062 @opindex fsanitize-recover
10063 @opindex fno-sanitize-recover
10064 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
10065 mentioned in comma-separated list of @var{opts}.  Enabling this option
10066 for a sanitizer component causes it to attempt to continue
10067 running the program as if no error happened.  This means multiple
10068 runtime errors can be reported in a single program run, and the exit
10069 code of the program may indicate success even when errors
10070 have been reported.  The @option{-fno-sanitize-recover=} option
10071 can be used to alter
10072 this behavior: only the first detected error is reported
10073 and program then exits with a non-zero exit code.
10075 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
10076 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
10077 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
10078 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
10079 For these sanitizers error recovery is turned on by default, except @option{-fsanitize=address},
10080 for which this feature is experimental.
10081 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
10082 accepted, the former enables recovery for all sanitizers that support it,
10083 the latter disables recovery for all sanitizers that support it.
10085 Even if a recovery mode is turned on the compiler side, it needs to be also
10086 enabled on the runtime library side, otherwise the failures are still fatal.
10087 The runtime library defaults to @code{halt_on_error=0} for
10088 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
10089 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
10090 setting the @code{halt_on_error} flag in the corresponding environment variable.
10092 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
10093 @smallexample
10094 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
10095 @end smallexample
10096 @noindent
10097 Similarly @option{-fno-sanitize-recover} is equivalent to
10098 @smallexample
10099 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
10100 @end smallexample
10102 @item -fsanitize-undefined-trap-on-error
10103 @opindex fsanitize-undefined-trap-on-error
10104 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
10105 report undefined behavior using @code{__builtin_trap} rather than
10106 a @code{libubsan} library routine.  The advantage of this is that the
10107 @code{libubsan} library is not needed and is not linked in, so this
10108 is usable even in freestanding environments.
10110 @item -fsanitize-coverage=trace-pc
10111 @opindex fsanitize-coverage=trace-pc
10112 Enable coverage-guided fuzzing code instrumentation.
10113 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
10115 @item -fbounds-check
10116 @opindex fbounds-check
10117 For front ends that support it, generate additional code to check that
10118 indices used to access arrays are within the declared range.  This is
10119 currently only supported by the Java and Fortran front ends, where
10120 this option defaults to true and false respectively.
10122 @item -fcheck-pointer-bounds
10123 @opindex fcheck-pointer-bounds
10124 @opindex fno-check-pointer-bounds
10125 @cindex Pointer Bounds Checker options
10126 Enable Pointer Bounds Checker instrumentation.  Each memory reference
10127 is instrumented with checks of the pointer used for memory access against
10128 bounds associated with that pointer.  
10130 Currently there
10131 is only an implementation for Intel MPX available, thus x86 GNU/Linux target
10132 and @option{-mmpx} are required to enable this feature.  
10133 MPX-based instrumentation requires
10134 a runtime library to enable MPX in hardware and handle bounds
10135 violation signals.  By default when @option{-fcheck-pointer-bounds}
10136 and @option{-mmpx} options are used to link a program, the GCC driver
10137 links against the @file{libmpx} and @file{libmpxwrappers} libraries.
10138 Bounds checking on calls to dynamic libraries requires a linker
10139 with @option{-z bndplt} support; if GCC was configured with a linker
10140 without support for this option (including the Gold linker and older
10141 versions of ld), a warning is given if you link with @option{-mmpx}
10142 without also specifying @option{-static}, since the overall effectiveness
10143 of the bounds checking protection is reduced.
10144 See also @option{-static-libmpxwrappers}.
10146 MPX-based instrumentation
10147 may be used for debugging and also may be included in production code
10148 to increase program security.  Depending on usage, you may
10149 have different requirements for the runtime library.  The current version
10150 of the MPX runtime library is more oriented for use as a debugging
10151 tool.  MPX runtime library usage implies @option{-lpthread}.  See
10152 also @option{-static-libmpx}.  The runtime library  behavior can be
10153 influenced using various @env{CHKP_RT_*} environment variables.  See
10154 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
10155 for more details.
10157 Generated instrumentation may be controlled by various
10158 @option{-fchkp-*} options and by the @code{bnd_variable_size}
10159 structure field attribute (@pxref{Type Attributes}) and
10160 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
10161 (@pxref{Function Attributes}).  GCC also provides a number of built-in
10162 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
10163 Bounds Checker builtins}, for more information.
10165 @item -fchkp-check-incomplete-type
10166 @opindex fchkp-check-incomplete-type
10167 @opindex fno-chkp-check-incomplete-type
10168 Generate pointer bounds checks for variables with incomplete type.
10169 Enabled by default.
10171 @item -fchkp-narrow-bounds
10172 @opindex fchkp-narrow-bounds
10173 @opindex fno-chkp-narrow-bounds
10174 Controls bounds used by Pointer Bounds Checker for pointers to object
10175 fields.  If narrowing is enabled then field bounds are used.  Otherwise
10176 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
10177 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
10179 @item -fchkp-first-field-has-own-bounds
10180 @opindex fchkp-first-field-has-own-bounds
10181 @opindex fno-chkp-first-field-has-own-bounds
10182 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
10183 first field in the structure.  By default a pointer to the first field has
10184 the same bounds as a pointer to the whole structure.
10186 @item -fchkp-narrow-to-innermost-array
10187 @opindex fchkp-narrow-to-innermost-array
10188 @opindex fno-chkp-narrow-to-innermost-array
10189 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
10190 case of nested static array access.  By default this option is disabled and
10191 bounds of the outermost array are used.
10193 @item -fchkp-optimize
10194 @opindex fchkp-optimize
10195 @opindex fno-chkp-optimize
10196 Enables Pointer Bounds Checker optimizations.  Enabled by default at
10197 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
10199 @item -fchkp-use-fast-string-functions
10200 @opindex fchkp-use-fast-string-functions
10201 @opindex fno-chkp-use-fast-string-functions
10202 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
10203 by Pointer Bounds Checker.  Disabled by default.
10205 @item -fchkp-use-nochk-string-functions
10206 @opindex fchkp-use-nochk-string-functions
10207 @opindex fno-chkp-use-nochk-string-functions
10208 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
10209 by Pointer Bounds Checker.  Disabled by default.
10211 @item -fchkp-use-static-bounds
10212 @opindex fchkp-use-static-bounds
10213 @opindex fno-chkp-use-static-bounds
10214 Allow Pointer Bounds Checker to generate static bounds holding
10215 bounds of static variables.  Enabled by default.
10217 @item -fchkp-use-static-const-bounds
10218 @opindex fchkp-use-static-const-bounds
10219 @opindex fno-chkp-use-static-const-bounds
10220 Use statically-initialized bounds for constant bounds instead of
10221 generating them each time they are required.  By default enabled when
10222 @option{-fchkp-use-static-bounds} is enabled.
10224 @item -fchkp-treat-zero-dynamic-size-as-infinite
10225 @opindex fchkp-treat-zero-dynamic-size-as-infinite
10226 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
10227 With this option, objects with incomplete type whose
10228 dynamically-obtained size is zero are treated as having infinite size
10229 instead by Pointer Bounds
10230 Checker.  This option may be helpful if a program is linked with a library
10231 missing size information for some symbols.  Disabled by default.
10233 @item -fchkp-check-read
10234 @opindex fchkp-check-read
10235 @opindex fno-chkp-check-read
10236 Instructs Pointer Bounds Checker to generate checks for all read
10237 accesses to memory.  Enabled by default.
10239 @item -fchkp-check-write
10240 @opindex fchkp-check-write
10241 @opindex fno-chkp-check-write
10242 Instructs Pointer Bounds Checker to generate checks for all write
10243 accesses to memory.  Enabled by default.
10245 @item -fchkp-store-bounds
10246 @opindex fchkp-store-bounds
10247 @opindex fno-chkp-store-bounds
10248 Instructs Pointer Bounds Checker to generate bounds stores for
10249 pointer writes.  Enabled by default.
10251 @item -fchkp-instrument-calls
10252 @opindex fchkp-instrument-calls
10253 @opindex fno-chkp-instrument-calls
10254 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
10255 Enabled by default.
10257 @item -fchkp-instrument-marked-only
10258 @opindex fchkp-instrument-marked-only
10259 @opindex fno-chkp-instrument-marked-only
10260 Instructs Pointer Bounds Checker to instrument only functions
10261 marked with the @code{bnd_instrument} attribute
10262 (@pxref{Function Attributes}).  Disabled by default.
10264 @item -fchkp-use-wrappers
10265 @opindex fchkp-use-wrappers
10266 @opindex fno-chkp-use-wrappers
10267 Allows Pointer Bounds Checker to replace calls to built-in functions
10268 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
10269 is used to link a program, the GCC driver automatically links
10270 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
10271 Enabled by default.
10273 @item -fstack-protector
10274 @opindex fstack-protector
10275 Emit extra code to check for buffer overflows, such as stack smashing
10276 attacks.  This is done by adding a guard variable to functions with
10277 vulnerable objects.  This includes functions that call @code{alloca}, and
10278 functions with buffers larger than 8 bytes.  The guards are initialized
10279 when a function is entered and then checked when the function exits.
10280 If a guard check fails, an error message is printed and the program exits.
10282 @item -fstack-protector-all
10283 @opindex fstack-protector-all
10284 Like @option{-fstack-protector} except that all functions are protected.
10286 @item -fstack-protector-strong
10287 @opindex fstack-protector-strong
10288 Like @option{-fstack-protector} but includes additional functions to
10289 be protected --- those that have local array definitions, or have
10290 references to local frame addresses.
10292 @item -fstack-protector-explicit
10293 @opindex fstack-protector-explicit
10294 Like @option{-fstack-protector} but only protects those functions which
10295 have the @code{stack_protect} attribute.
10297 @item -fstack-check
10298 @opindex fstack-check
10299 Generate code to verify that you do not go beyond the boundary of the
10300 stack.  You should specify this flag if you are running in an
10301 environment with multiple threads, but you only rarely need to specify it in
10302 a single-threaded environment since stack overflow is automatically
10303 detected on nearly all systems if there is only one stack.
10305 Note that this switch does not actually cause checking to be done; the
10306 operating system or the language runtime must do that.  The switch causes
10307 generation of code to ensure that they see the stack being extended.
10309 You can additionally specify a string parameter: @samp{no} means no
10310 checking, @samp{generic} means force the use of old-style checking,
10311 @samp{specific} means use the best checking method and is equivalent
10312 to bare @option{-fstack-check}.
10314 Old-style checking is a generic mechanism that requires no specific
10315 target support in the compiler but comes with the following drawbacks:
10317 @enumerate
10318 @item
10319 Modified allocation strategy for large objects: they are always
10320 allocated dynamically if their size exceeds a fixed threshold.
10322 @item
10323 Fixed limit on the size of the static frame of functions: when it is
10324 topped by a particular function, stack checking is not reliable and
10325 a warning is issued by the compiler.
10327 @item
10328 Inefficiency: because of both the modified allocation strategy and the
10329 generic implementation, code performance is hampered.
10330 @end enumerate
10332 Note that old-style stack checking is also the fallback method for
10333 @samp{specific} if no target support has been added in the compiler.
10335 @item -fstack-limit-register=@var{reg}
10336 @itemx -fstack-limit-symbol=@var{sym}
10337 @itemx -fno-stack-limit
10338 @opindex fstack-limit-register
10339 @opindex fstack-limit-symbol
10340 @opindex fno-stack-limit
10341 Generate code to ensure that the stack does not grow beyond a certain value,
10342 either the value of a register or the address of a symbol.  If a larger
10343 stack is required, a signal is raised at run time.  For most targets,
10344 the signal is raised before the stack overruns the boundary, so
10345 it is possible to catch the signal without taking special precautions.
10347 For instance, if the stack starts at absolute address @samp{0x80000000}
10348 and grows downwards, you can use the flags
10349 @option{-fstack-limit-symbol=__stack_limit} and
10350 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
10351 of 128KB@.  Note that this may only work with the GNU linker.
10353 You can locally override stack limit checking by using the
10354 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
10356 @item -fsplit-stack
10357 @opindex fsplit-stack
10358 Generate code to automatically split the stack before it overflows.
10359 The resulting program has a discontiguous stack which can only
10360 overflow if the program is unable to allocate any more memory.  This
10361 is most useful when running threaded programs, as it is no longer
10362 necessary to calculate a good stack size to use for each thread.  This
10363 is currently only implemented for the x86 targets running
10364 GNU/Linux.
10366 When code compiled with @option{-fsplit-stack} calls code compiled
10367 without @option{-fsplit-stack}, there may not be much stack space
10368 available for the latter code to run.  If compiling all code,
10369 including library code, with @option{-fsplit-stack} is not an option,
10370 then the linker can fix up these calls so that the code compiled
10371 without @option{-fsplit-stack} always has a large stack.  Support for
10372 this is implemented in the gold linker in GNU binutils release 2.21
10373 and later.
10375 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
10376 @opindex fvtable-verify
10377 This option is only available when compiling C++ code.
10378 It turns on (or off, if using @option{-fvtable-verify=none}) the security
10379 feature that verifies at run time, for every virtual call, that
10380 the vtable pointer through which the call is made is valid for the type of
10381 the object, and has not been corrupted or overwritten.  If an invalid vtable
10382 pointer is detected at run time, an error is reported and execution of the
10383 program is immediately halted.
10385 This option causes run-time data structures to be built at program startup,
10386 which are used for verifying the vtable pointers.  
10387 The options @samp{std} and @samp{preinit}
10388 control the timing of when these data structures are built.  In both cases the
10389 data structures are built before execution reaches @code{main}.  Using
10390 @option{-fvtable-verify=std} causes the data structures to be built after
10391 shared libraries have been loaded and initialized.
10392 @option{-fvtable-verify=preinit} causes them to be built before shared
10393 libraries have been loaded and initialized.
10395 If this option appears multiple times in the command line with different
10396 values specified, @samp{none} takes highest priority over both @samp{std} and
10397 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
10399 @item -fvtv-debug
10400 @opindex fvtv-debug
10401 When used in conjunction with @option{-fvtable-verify=std} or 
10402 @option{-fvtable-verify=preinit}, causes debug versions of the 
10403 runtime functions for the vtable verification feature to be called.  
10404 This flag also causes the compiler to log information about which 
10405 vtable pointers it finds for each class.
10406 This information is written to a file named @file{vtv_set_ptr_data.log} 
10407 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
10408 if that is defined or the current working directory otherwise.
10410 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
10411 file, be sure to delete any existing one.
10413 @item -fvtv-counts
10414 @opindex fvtv-counts
10415 This is a debugging flag.  When used in conjunction with
10416 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
10417 causes the compiler to keep track of the total number of virtual calls
10418 it encounters and the number of verifications it inserts.  It also
10419 counts the number of calls to certain run-time library functions
10420 that it inserts and logs this information for each compilation unit.
10421 The compiler writes this information to a file named
10422 @file{vtv_count_data.log} in the directory named by the environment
10423 variable @env{VTV_LOGS_DIR} if that is defined or the current working
10424 directory otherwise.  It also counts the size of the vtable pointer sets
10425 for each class, and writes this information to @file{vtv_class_set_sizes.log}
10426 in the same directory.
10428 Note:  This feature @emph{appends} data to the log files.  To get fresh log
10429 files, be sure to delete any existing ones.
10431 @item -finstrument-functions
10432 @opindex finstrument-functions
10433 Generate instrumentation calls for entry and exit to functions.  Just
10434 after function entry and just before function exit, the following
10435 profiling functions are called with the address of the current
10436 function and its call site.  (On some platforms,
10437 @code{__builtin_return_address} does not work beyond the current
10438 function, so the call site information may not be available to the
10439 profiling functions otherwise.)
10441 @smallexample
10442 void __cyg_profile_func_enter (void *this_fn,
10443                                void *call_site);
10444 void __cyg_profile_func_exit  (void *this_fn,
10445                                void *call_site);
10446 @end smallexample
10448 The first argument is the address of the start of the current function,
10449 which may be looked up exactly in the symbol table.
10451 This instrumentation is also done for functions expanded inline in other
10452 functions.  The profiling calls indicate where, conceptually, the
10453 inline function is entered and exited.  This means that addressable
10454 versions of such functions must be available.  If all your uses of a
10455 function are expanded inline, this may mean an additional expansion of
10456 code size.  If you use @code{extern inline} in your C code, an
10457 addressable version of such functions must be provided.  (This is
10458 normally the case anyway, but if you get lucky and the optimizer always
10459 expands the functions inline, you might have gotten away without
10460 providing static copies.)
10462 A function may be given the attribute @code{no_instrument_function}, in
10463 which case this instrumentation is not done.  This can be used, for
10464 example, for the profiling functions listed above, high-priority
10465 interrupt routines, and any functions from which the profiling functions
10466 cannot safely be called (perhaps signal handlers, if the profiling
10467 routines generate output or allocate memory).
10469 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
10470 @opindex finstrument-functions-exclude-file-list
10472 Set the list of functions that are excluded from instrumentation (see
10473 the description of @option{-finstrument-functions}).  If the file that
10474 contains a function definition matches with one of @var{file}, then
10475 that function is not instrumented.  The match is done on substrings:
10476 if the @var{file} parameter is a substring of the file name, it is
10477 considered to be a match.
10479 For example:
10481 @smallexample
10482 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
10483 @end smallexample
10485 @noindent
10486 excludes any inline function defined in files whose pathnames
10487 contain @file{/bits/stl} or @file{include/sys}.
10489 If, for some reason, you want to include letter @samp{,} in one of
10490 @var{sym}, write @samp{\,}. For example,
10491 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
10492 (note the single quote surrounding the option).
10494 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
10495 @opindex finstrument-functions-exclude-function-list
10497 This is similar to @option{-finstrument-functions-exclude-file-list},
10498 but this option sets the list of function names to be excluded from
10499 instrumentation.  The function name to be matched is its user-visible
10500 name, such as @code{vector<int> blah(const vector<int> &)}, not the
10501 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
10502 match is done on substrings: if the @var{sym} parameter is a substring
10503 of the function name, it is considered to be a match.  For C99 and C++
10504 extended identifiers, the function name must be given in UTF-8, not
10505 using universal character names.
10507 @end table
10510 @node Preprocessor Options
10511 @section Options Controlling the Preprocessor
10512 @cindex preprocessor options
10513 @cindex options, preprocessor
10515 These options control the C preprocessor, which is run on each C source
10516 file before actual compilation.
10518 If you use the @option{-E} option, nothing is done except preprocessing.
10519 Some of these options make sense only together with @option{-E} because
10520 they cause the preprocessor output to be unsuitable for actual
10521 compilation.
10523 @table @gcctabopt
10524 @item -Wp,@var{option}
10525 @opindex Wp
10526 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10527 and pass @var{option} directly through to the preprocessor.  If
10528 @var{option} contains commas, it is split into multiple options at the
10529 commas.  However, many options are modified, translated or interpreted
10530 by the compiler driver before being passed to the preprocessor, and
10531 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10532 interface is undocumented and subject to change, so whenever possible
10533 you should avoid using @option{-Wp} and let the driver handle the
10534 options instead.
10536 @item -Xpreprocessor @var{option}
10537 @opindex Xpreprocessor
10538 Pass @var{option} as an option to the preprocessor.  You can use this to
10539 supply system-specific preprocessor options that GCC does not 
10540 recognize.
10542 If you want to pass an option that takes an argument, you must use
10543 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10545 @item -no-integrated-cpp
10546 @opindex no-integrated-cpp
10547 Perform preprocessing as a separate pass before compilation.
10548 By default, GCC performs preprocessing as an integrated part of
10549 input tokenization and parsing.
10550 If this option is provided, the appropriate language front end
10551 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10552 and Objective-C, respectively) is instead invoked twice,
10553 once for preprocessing only and once for actual compilation
10554 of the preprocessed input.
10555 This option may be useful in conjunction with the @option{-B} or
10556 @option{-wrapper} options to specify an alternate preprocessor or
10557 perform additional processing of the program source between
10558 normal preprocessing and compilation.
10559 @end table
10561 @include cppopts.texi
10563 @node Assembler Options
10564 @section Passing Options to the Assembler
10566 @c prevent bad page break with this line
10567 You can pass options to the assembler.
10569 @table @gcctabopt
10570 @item -Wa,@var{option}
10571 @opindex Wa
10572 Pass @var{option} as an option to the assembler.  If @var{option}
10573 contains commas, it is split into multiple options at the commas.
10575 @item -Xassembler @var{option}
10576 @opindex Xassembler
10577 Pass @var{option} as an option to the assembler.  You can use this to
10578 supply system-specific assembler options that GCC does not
10579 recognize.
10581 If you want to pass an option that takes an argument, you must use
10582 @option{-Xassembler} twice, once for the option and once for the argument.
10584 @end table
10586 @node Link Options
10587 @section Options for Linking
10588 @cindex link options
10589 @cindex options, linking
10591 These options come into play when the compiler links object files into
10592 an executable output file.  They are meaningless if the compiler is
10593 not doing a link step.
10595 @table @gcctabopt
10596 @cindex file names
10597 @item @var{object-file-name}
10598 A file name that does not end in a special recognized suffix is
10599 considered to name an object file or library.  (Object files are
10600 distinguished from libraries by the linker according to the file
10601 contents.)  If linking is done, these object files are used as input
10602 to the linker.
10604 @item -c
10605 @itemx -S
10606 @itemx -E
10607 @opindex c
10608 @opindex S
10609 @opindex E
10610 If any of these options is used, then the linker is not run, and
10611 object file names should not be used as arguments.  @xref{Overall
10612 Options}.
10614 @item -fuse-ld=bfd
10615 @opindex fuse-ld=bfd
10616 Use the @command{bfd} linker instead of the default linker.
10618 @item -fuse-ld=gold
10619 @opindex fuse-ld=gold
10620 Use the @command{gold} linker instead of the default linker.
10622 @cindex Libraries
10623 @item -l@var{library}
10624 @itemx -l @var{library}
10625 @opindex l
10626 Search the library named @var{library} when linking.  (The second
10627 alternative with the library as a separate argument is only for
10628 POSIX compliance and is not recommended.)
10630 It makes a difference where in the command you write this option; the
10631 linker searches and processes libraries and object files in the order they
10632 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10633 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10634 to functions in @samp{z}, those functions may not be loaded.
10636 The linker searches a standard list of directories for the library,
10637 which is actually a file named @file{lib@var{library}.a}.  The linker
10638 then uses this file as if it had been specified precisely by name.
10640 The directories searched include several standard system directories
10641 plus any that you specify with @option{-L}.
10643 Normally the files found this way are library files---archive files
10644 whose members are object files.  The linker handles an archive file by
10645 scanning through it for members which define symbols that have so far
10646 been referenced but not defined.  But if the file that is found is an
10647 ordinary object file, it is linked in the usual fashion.  The only
10648 difference between using an @option{-l} option and specifying a file name
10649 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10650 and searches several directories.
10652 @item -lobjc
10653 @opindex lobjc
10654 You need this special case of the @option{-l} option in order to
10655 link an Objective-C or Objective-C++ program.
10657 @item -nostartfiles
10658 @opindex nostartfiles
10659 Do not use the standard system startup files when linking.
10660 The standard system libraries are used normally, unless @option{-nostdlib}
10661 or @option{-nodefaultlibs} is used.
10663 @item -nodefaultlibs
10664 @opindex nodefaultlibs
10665 Do not use the standard system libraries when linking.
10666 Only the libraries you specify are passed to the linker, and options
10667 specifying linkage of the system libraries, such as @option{-static-libgcc}
10668 or @option{-shared-libgcc}, are ignored.  
10669 The standard startup files are used normally, unless @option{-nostartfiles}
10670 is used.  
10672 The compiler may generate calls to @code{memcmp},
10673 @code{memset}, @code{memcpy} and @code{memmove}.
10674 These entries are usually resolved by entries in
10675 libc.  These entry points should be supplied through some other
10676 mechanism when this option is specified.
10678 @item -nostdlib
10679 @opindex nostdlib
10680 Do not use the standard system startup files or libraries when linking.
10681 No startup files and only the libraries you specify are passed to
10682 the linker, and options specifying linkage of the system libraries, such as
10683 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
10685 The compiler may generate calls to @code{memcmp}, @code{memset},
10686 @code{memcpy} and @code{memmove}.
10687 These entries are usually resolved by entries in
10688 libc.  These entry points should be supplied through some other
10689 mechanism when this option is specified.
10691 @cindex @option{-lgcc}, use with @option{-nostdlib}
10692 @cindex @option{-nostdlib} and unresolved references
10693 @cindex unresolved references and @option{-nostdlib}
10694 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10695 @cindex @option{-nodefaultlibs} and unresolved references
10696 @cindex unresolved references and @option{-nodefaultlibs}
10697 One of the standard libraries bypassed by @option{-nostdlib} and
10698 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10699 which GCC uses to overcome shortcomings of particular machines, or special
10700 needs for some languages.
10701 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10702 Collection (GCC) Internals},
10703 for more discussion of @file{libgcc.a}.)
10704 In most cases, you need @file{libgcc.a} even when you want to avoid
10705 other standard libraries.  In other words, when you specify @option{-nostdlib}
10706 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10707 This ensures that you have no unresolved references to internal GCC
10708 library subroutines.
10709 (An example of such an internal subroutine is @code{__main}, used to ensure C++
10710 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10711 GNU Compiler Collection (GCC) Internals}.)
10713 @item -pie
10714 @opindex pie
10715 Produce a position independent executable on targets that support it.
10716 For predictable results, you must also specify the same set of options
10717 used for compilation (@option{-fpie}, @option{-fPIE},
10718 or model suboptions) when you specify this linker option.
10720 @item -no-pie
10721 @opindex no-pie
10722 Don't produce a position independent executable.
10724 @item -rdynamic
10725 @opindex rdynamic
10726 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10727 that support it. This instructs the linker to add all symbols, not
10728 only used ones, to the dynamic symbol table. This option is needed
10729 for some uses of @code{dlopen} or to allow obtaining backtraces
10730 from within a program.
10732 @item -s
10733 @opindex s
10734 Remove all symbol table and relocation information from the executable.
10736 @item -static
10737 @opindex static
10738 On systems that support dynamic linking, this prevents linking with the shared
10739 libraries.  On other systems, this option has no effect.
10741 @item -shared
10742 @opindex shared
10743 Produce a shared object which can then be linked with other objects to
10744 form an executable.  Not all systems support this option.  For predictable
10745 results, you must also specify the same set of options used for compilation
10746 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10747 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10748 needs to build supplementary stub code for constructors to work.  On
10749 multi-libbed systems, @samp{gcc -shared} must select the correct support
10750 libraries to link against.  Failing to supply the correct flags may lead
10751 to subtle defects.  Supplying them in cases where they are not necessary
10752 is innocuous.}
10754 @item -shared-libgcc
10755 @itemx -static-libgcc
10756 @opindex shared-libgcc
10757 @opindex static-libgcc
10758 On systems that provide @file{libgcc} as a shared library, these options
10759 force the use of either the shared or static version, respectively.
10760 If no shared version of @file{libgcc} was built when the compiler was
10761 configured, these options have no effect.
10763 There are several situations in which an application should use the
10764 shared @file{libgcc} instead of the static version.  The most common
10765 of these is when the application wishes to throw and catch exceptions
10766 across different shared libraries.  In that case, each of the libraries
10767 as well as the application itself should use the shared @file{libgcc}.
10769 Therefore, the G++ and GCJ drivers automatically add
10770 @option{-shared-libgcc} whenever you build a shared library or a main
10771 executable, because C++ and Java programs typically use exceptions, so
10772 this is the right thing to do.
10774 If, instead, you use the GCC driver to create shared libraries, you may
10775 find that they are not always linked with the shared @file{libgcc}.
10776 If GCC finds, at its configuration time, that you have a non-GNU linker
10777 or a GNU linker that does not support option @option{--eh-frame-hdr},
10778 it links the shared version of @file{libgcc} into shared libraries
10779 by default.  Otherwise, it takes advantage of the linker and optimizes
10780 away the linking with the shared version of @file{libgcc}, linking with
10781 the static version of libgcc by default.  This allows exceptions to
10782 propagate through such shared libraries, without incurring relocation
10783 costs at library load time.
10785 However, if a library or main executable is supposed to throw or catch
10786 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10787 for the languages used in the program, or using the option
10788 @option{-shared-libgcc}, such that it is linked with the shared
10789 @file{libgcc}.
10791 @item -static-libasan
10792 @opindex static-libasan
10793 When the @option{-fsanitize=address} option is used to link a program,
10794 the GCC driver automatically links against @option{libasan}.  If
10795 @file{libasan} is available as a shared library, and the @option{-static}
10796 option is not used, then this links against the shared version of
10797 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10798 driver to link @file{libasan} statically, without necessarily linking
10799 other libraries statically.
10801 @item -static-libtsan
10802 @opindex static-libtsan
10803 When the @option{-fsanitize=thread} option is used to link a program,
10804 the GCC driver automatically links against @option{libtsan}.  If
10805 @file{libtsan} is available as a shared library, and the @option{-static}
10806 option is not used, then this links against the shared version of
10807 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10808 driver to link @file{libtsan} statically, without necessarily linking
10809 other libraries statically.
10811 @item -static-liblsan
10812 @opindex static-liblsan
10813 When the @option{-fsanitize=leak} option is used to link a program,
10814 the GCC driver automatically links against @option{liblsan}.  If
10815 @file{liblsan} is available as a shared library, and the @option{-static}
10816 option is not used, then this links against the shared version of
10817 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10818 driver to link @file{liblsan} statically, without necessarily linking
10819 other libraries statically.
10821 @item -static-libubsan
10822 @opindex static-libubsan
10823 When the @option{-fsanitize=undefined} option is used to link a program,
10824 the GCC driver automatically links against @option{libubsan}.  If
10825 @file{libubsan} is available as a shared library, and the @option{-static}
10826 option is not used, then this links against the shared version of
10827 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10828 driver to link @file{libubsan} statically, without necessarily linking
10829 other libraries statically.
10831 @item -static-libmpx
10832 @opindex static-libmpx
10833 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
10834 used to link a program, the GCC driver automatically links against
10835 @file{libmpx}.  If @file{libmpx} is available as a shared library,
10836 and the @option{-static} option is not used, then this links against
10837 the shared version of @file{libmpx}.  The @option{-static-libmpx}
10838 option directs the GCC driver to link @file{libmpx} statically,
10839 without necessarily linking other libraries statically.
10841 @item -static-libmpxwrappers
10842 @opindex static-libmpxwrappers
10843 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
10844 to link a program without also using @option{-fno-chkp-use-wrappers}, the
10845 GCC driver automatically links against @file{libmpxwrappers}.  If
10846 @file{libmpxwrappers} is available as a shared library, and the
10847 @option{-static} option is not used, then this links against the shared
10848 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
10849 option directs the GCC driver to link @file{libmpxwrappers} statically,
10850 without necessarily linking other libraries statically.
10852 @item -static-libstdc++
10853 @opindex static-libstdc++
10854 When the @command{g++} program is used to link a C++ program, it
10855 normally automatically links against @option{libstdc++}.  If
10856 @file{libstdc++} is available as a shared library, and the
10857 @option{-static} option is not used, then this links against the
10858 shared version of @file{libstdc++}.  That is normally fine.  However, it
10859 is sometimes useful to freeze the version of @file{libstdc++} used by
10860 the program without going all the way to a fully static link.  The
10861 @option{-static-libstdc++} option directs the @command{g++} driver to
10862 link @file{libstdc++} statically, without necessarily linking other
10863 libraries statically.
10865 @item -symbolic
10866 @opindex symbolic
10867 Bind references to global symbols when building a shared object.  Warn
10868 about any unresolved references (unless overridden by the link editor
10869 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10870 this option.
10872 @item -T @var{script}
10873 @opindex T
10874 @cindex linker script
10875 Use @var{script} as the linker script.  This option is supported by most
10876 systems using the GNU linker.  On some targets, such as bare-board
10877 targets without an operating system, the @option{-T} option may be required
10878 when linking to avoid references to undefined symbols.
10880 @item -Xlinker @var{option}
10881 @opindex Xlinker
10882 Pass @var{option} as an option to the linker.  You can use this to
10883 supply system-specific linker options that GCC does not recognize.
10885 If you want to pass an option that takes a separate argument, you must use
10886 @option{-Xlinker} twice, once for the option and once for the argument.
10887 For example, to pass @option{-assert definitions}, you must write
10888 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10889 @option{-Xlinker "-assert definitions"}, because this passes the entire
10890 string as a single argument, which is not what the linker expects.
10892 When using the GNU linker, it is usually more convenient to pass
10893 arguments to linker options using the @option{@var{option}=@var{value}}
10894 syntax than as separate arguments.  For example, you can specify
10895 @option{-Xlinker -Map=output.map} rather than
10896 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10897 this syntax for command-line options.
10899 @item -Wl,@var{option}
10900 @opindex Wl
10901 Pass @var{option} as an option to the linker.  If @var{option} contains
10902 commas, it is split into multiple options at the commas.  You can use this
10903 syntax to pass an argument to the option.
10904 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10905 linker.  When using the GNU linker, you can also get the same effect with
10906 @option{-Wl,-Map=output.map}.
10908 @item -u @var{symbol}
10909 @opindex u
10910 Pretend the symbol @var{symbol} is undefined, to force linking of
10911 library modules to define it.  You can use @option{-u} multiple times with
10912 different symbols to force loading of additional library modules.
10914 @item -z @var{keyword}
10915 @opindex z
10916 @option{-z} is passed directly on to the linker along with the keyword
10917 @var{keyword}. See the section in the documentation of your linker for
10918 permitted values and their meanings.
10919 @end table
10921 @node Directory Options
10922 @section Options for Directory Search
10923 @cindex directory options
10924 @cindex options, directory search
10925 @cindex search path
10927 These options specify directories to search for header files, for
10928 libraries and for parts of the compiler:
10930 @table @gcctabopt
10931 @item -I@var{dir}
10932 @opindex I
10933 Add the directory @var{dir} to the head of the list of directories to be
10934 searched for header files.  This can be used to override a system header
10935 file, substituting your own version, since these directories are
10936 searched before the system header file directories.  However, you should
10937 not use this option to add directories that contain vendor-supplied
10938 system header files (use @option{-isystem} for that).  If you use more than
10939 one @option{-I} option, the directories are scanned in left-to-right
10940 order; the standard system directories come after.
10942 If a standard system include directory, or a directory specified with
10943 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10944 option is ignored.  The directory is still searched but as a
10945 system directory at its normal position in the system include chain.
10946 This is to ensure that GCC's procedure to fix buggy system headers and
10947 the ordering for the @code{include_next} directive are not inadvertently changed.
10948 If you really need to change the search order for system directories,
10949 use the @option{-nostdinc} and/or @option{-isystem} options.
10951 @item -iplugindir=@var{dir}
10952 @opindex iplugindir=
10953 Set the directory to search for plugins that are passed
10954 by @option{-fplugin=@var{name}} instead of
10955 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10956 to be used by the user, but only passed by the driver.
10958 @item -iquote@var{dir}
10959 @opindex iquote
10960 Add the directory @var{dir} to the head of the list of directories to
10961 be searched for header files only for the case of @code{#include
10962 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
10963 otherwise just like @option{-I}.
10965 @item -L@var{dir}
10966 @opindex L
10967 Add directory @var{dir} to the list of directories to be searched
10968 for @option{-l}.
10970 @item -B@var{prefix}
10971 @opindex B
10972 This option specifies where to find the executables, libraries,
10973 include files, and data files of the compiler itself.
10975 The compiler driver program runs one or more of the subprograms
10976 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10977 @var{prefix} as a prefix for each program it tries to run, both with and
10978 without @samp{@var{machine}/@var{version}/} for the corresponding target
10979 machine and compiler version.
10981 For each subprogram to be run, the compiler driver first tries the
10982 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10983 is not specified, the driver tries two standard prefixes, 
10984 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10985 those results in a file name that is found, the unmodified program
10986 name is searched for using the directories specified in your
10987 @env{PATH} environment variable.
10989 The compiler checks to see if the path provided by @option{-B}
10990 refers to a directory, and if necessary it adds a directory
10991 separator character at the end of the path.
10993 @option{-B} prefixes that effectively specify directory names also apply
10994 to libraries in the linker, because the compiler translates these
10995 options into @option{-L} options for the linker.  They also apply to
10996 include files in the preprocessor, because the compiler translates these
10997 options into @option{-isystem} options for the preprocessor.  In this case,
10998 the compiler appends @samp{include} to the prefix.
11000 The runtime support file @file{libgcc.a} can also be searched for using
11001 the @option{-B} prefix, if needed.  If it is not found there, the two
11002 standard prefixes above are tried, and that is all.  The file is left
11003 out of the link if it is not found by those means.
11005 Another way to specify a prefix much like the @option{-B} prefix is to use
11006 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
11007 Variables}.
11009 As a special kludge, if the path provided by @option{-B} is
11010 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
11011 9, then it is replaced by @file{[dir/]include}.  This is to help
11012 with boot-strapping the compiler.
11014 @item -no-canonical-prefixes
11015 @opindex no-canonical-prefixes
11016 Do not expand any symbolic links, resolve references to @samp{/../}
11017 or @samp{/./}, or make the path absolute when generating a relative
11018 prefix.
11020 @item --sysroot=@var{dir}
11021 @opindex sysroot
11022 Use @var{dir} as the logical root directory for headers and libraries.
11023 For example, if the compiler normally searches for headers in
11024 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11025 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11027 If you use both this option and the @option{-isysroot} option, then
11028 the @option{--sysroot} option applies to libraries, but the
11029 @option{-isysroot} option applies to header files.
11031 The GNU linker (beginning with version 2.16) has the necessary support
11032 for this option.  If your linker does not support this option, the
11033 header file aspect of @option{--sysroot} still works, but the
11034 library aspect does not.
11036 @item --no-sysroot-suffix
11037 @opindex no-sysroot-suffix
11038 For some targets, a suffix is added to the root directory specified
11039 with @option{--sysroot}, depending on the other options used, so that
11040 headers may for example be found in
11041 @file{@var{dir}/@var{suffix}/usr/include} instead of
11042 @file{@var{dir}/usr/include}.  This option disables the addition of
11043 such a suffix.
11045 @item -I-
11046 @opindex I-
11047 This option has been deprecated.  Please use @option{-iquote} instead for
11048 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
11049 option.
11050 Any directories you specify with @option{-I} options before the @option{-I-}
11051 option are searched only for the case of @code{#include "@var{file}"};
11052 they are not searched for @code{#include <@var{file}>}.
11054 If additional directories are specified with @option{-I} options after
11055 the @option{-I-} option, these directories are searched for all @code{#include}
11056 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11057 this way.)
11059 In addition, the @option{-I-} option inhibits the use of the current
11060 directory (where the current input file came from) as the first search
11061 directory for @code{#include "@var{file}"}.  There is no way to
11062 override this effect of @option{-I-}.  With @option{-I.} you can specify
11063 searching the directory that is current when the compiler is
11064 invoked.  That is not exactly the same as what the preprocessor does
11065 by default, but it is often satisfactory.
11067 @option{-I-} does not inhibit the use of the standard system directories
11068 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11069 independent.
11070 @end table
11072 @node Code Gen Options
11073 @section Options for Code Generation Conventions
11074 @cindex code generation conventions
11075 @cindex options, code generation
11076 @cindex run-time options
11078 These machine-independent options control the interface conventions
11079 used in code generation.
11081 Most of them have both positive and negative forms; the negative form
11082 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
11083 one of the forms is listed---the one that is not the default.  You
11084 can figure out the other form by either removing @samp{no-} or adding
11087 @table @gcctabopt
11088 @item -fstack-reuse=@var{reuse-level}
11089 @opindex fstack_reuse
11090 This option controls stack space reuse for user declared local/auto variables
11091 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
11092 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
11093 local variables and temporaries, @samp{named_vars} enables the reuse only for
11094 user defined local variables with names, and @samp{none} disables stack reuse
11095 completely. The default value is @samp{all}. The option is needed when the
11096 program extends the lifetime of a scoped local variable or a compiler generated
11097 temporary beyond the end point defined by the language.  When a lifetime of
11098 a variable ends, and if the variable lives in memory, the optimizing compiler
11099 has the freedom to reuse its stack space with other temporaries or scoped
11100 local variables whose live range does not overlap with it. Legacy code extending
11101 local lifetime is likely to break with the stack reuse optimization.
11103 For example,
11105 @smallexample
11106    int *p;
11107    @{
11108      int local1;
11110      p = &local1;
11111      local1 = 10;
11112      ....
11113    @}
11114    @{
11115       int local2;
11116       local2 = 20;
11117       ...
11118    @}
11120    if (*p == 10)  // out of scope use of local1
11121      @{
11123      @}
11124 @end smallexample
11126 Another example:
11127 @smallexample
11129    struct A
11130    @{
11131        A(int k) : i(k), j(k) @{ @}
11132        int i;
11133        int j;
11134    @};
11136    A *ap;
11138    void foo(const A& ar)
11139    @{
11140       ap = &ar;
11141    @}
11143    void bar()
11144    @{
11145       foo(A(10)); // temp object's lifetime ends when foo returns
11147       @{
11148         A a(20);
11149         ....
11150       @}
11151       ap->i+= 10;  // ap references out of scope temp whose space
11152                    // is reused with a. What is the value of ap->i?
11153    @}
11155 @end smallexample
11157 The lifetime of a compiler generated temporary is well defined by the C++
11158 standard. When a lifetime of a temporary ends, and if the temporary lives
11159 in memory, the optimizing compiler has the freedom to reuse its stack
11160 space with other temporaries or scoped local variables whose live range
11161 does not overlap with it. However some of the legacy code relies on
11162 the behavior of older compilers in which temporaries' stack space is
11163 not reused, the aggressive stack reuse can lead to runtime errors. This
11164 option is used to control the temporary stack reuse optimization.
11166 @item -ftrapv
11167 @opindex ftrapv
11168 This option generates traps for signed overflow on addition, subtraction,
11169 multiplication operations.
11170 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11171 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11172 @option{-fwrapv} being effective.  Note that only active options override, so
11173 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11174 results in @option{-ftrapv} being effective.
11176 @item -fwrapv
11177 @opindex fwrapv
11178 This option instructs the compiler to assume that signed arithmetic
11179 overflow of addition, subtraction and multiplication wraps around
11180 using twos-complement representation.  This flag enables some optimizations
11181 and disables others.  This option is enabled by default for the Java
11182 front end, as required by the Java language specification.
11183 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11184 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11185 @option{-fwrapv} being effective.  Note that only active options override, so
11186 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11187 results in @option{-ftrapv} being effective.
11189 @item -fexceptions
11190 @opindex fexceptions
11191 Enable exception handling.  Generates extra code needed to propagate
11192 exceptions.  For some targets, this implies GCC generates frame
11193 unwind information for all functions, which can produce significant data
11194 size overhead, although it does not affect execution.  If you do not
11195 specify this option, GCC enables it by default for languages like
11196 C++ that normally require exception handling, and disables it for
11197 languages like C that do not normally require it.  However, you may need
11198 to enable this option when compiling C code that needs to interoperate
11199 properly with exception handlers written in C++.  You may also wish to
11200 disable this option if you are compiling older C++ programs that don't
11201 use exception handling.
11203 @item -fnon-call-exceptions
11204 @opindex fnon-call-exceptions
11205 Generate code that allows trapping instructions to throw exceptions.
11206 Note that this requires platform-specific runtime support that does
11207 not exist everywhere.  Moreover, it only allows @emph{trapping}
11208 instructions to throw exceptions, i.e.@: memory references or floating-point
11209 instructions.  It does not allow exceptions to be thrown from
11210 arbitrary signal handlers such as @code{SIGALRM}.
11212 @item -fdelete-dead-exceptions
11213 @opindex fdelete-dead-exceptions
11214 Consider that instructions that may throw exceptions but don't otherwise
11215 contribute to the execution of the program can be optimized away.
11216 This option is enabled by default for the Ada front end, as permitted by
11217 the Ada language specification.
11218 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
11220 @item -funwind-tables
11221 @opindex funwind-tables
11222 Similar to @option{-fexceptions}, except that it just generates any needed
11223 static data, but does not affect the generated code in any other way.
11224 You normally do not need to enable this option; instead, a language processor
11225 that needs this handling enables it on your behalf.
11227 @item -fasynchronous-unwind-tables
11228 @opindex fasynchronous-unwind-tables
11229 Generate unwind table in DWARF format, if supported by target machine.  The
11230 table is exact at each instruction boundary, so it can be used for stack
11231 unwinding from asynchronous events (such as debugger or garbage collector).
11233 @item -fno-gnu-unique
11234 @opindex fno-gnu-unique
11235 On systems with recent GNU assembler and C library, the C++ compiler
11236 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
11237 of template static data members and static local variables in inline
11238 functions are unique even in the presence of @code{RTLD_LOCAL}; this
11239 is necessary to avoid problems with a library used by two different
11240 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
11241 therefore disagreeing with the other one about the binding of the
11242 symbol.  But this causes @code{dlclose} to be ignored for affected
11243 DSOs; if your program relies on reinitialization of a DSO via
11244 @code{dlclose} and @code{dlopen}, you can use
11245 @option{-fno-gnu-unique}.
11247 @item -fpcc-struct-return
11248 @opindex fpcc-struct-return
11249 Return ``short'' @code{struct} and @code{union} values in memory like
11250 longer ones, rather than in registers.  This convention is less
11251 efficient, but it has the advantage of allowing intercallability between
11252 GCC-compiled files and files compiled with other compilers, particularly
11253 the Portable C Compiler (pcc).
11255 The precise convention for returning structures in memory depends
11256 on the target configuration macros.
11258 Short structures and unions are those whose size and alignment match
11259 that of some integer type.
11261 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
11262 switch is not binary compatible with code compiled with the
11263 @option{-freg-struct-return} switch.
11264 Use it to conform to a non-default application binary interface.
11266 @item -freg-struct-return
11267 @opindex freg-struct-return
11268 Return @code{struct} and @code{union} values in registers when possible.
11269 This is more efficient for small structures than
11270 @option{-fpcc-struct-return}.
11272 If you specify neither @option{-fpcc-struct-return} nor
11273 @option{-freg-struct-return}, GCC defaults to whichever convention is
11274 standard for the target.  If there is no standard convention, GCC
11275 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
11276 the principal compiler.  In those cases, we can choose the standard, and
11277 we chose the more efficient register return alternative.
11279 @strong{Warning:} code compiled with the @option{-freg-struct-return}
11280 switch is not binary compatible with code compiled with the
11281 @option{-fpcc-struct-return} switch.
11282 Use it to conform to a non-default application binary interface.
11284 @item -fshort-enums
11285 @opindex fshort-enums
11286 Allocate to an @code{enum} type only as many bytes as it needs for the
11287 declared range of possible values.  Specifically, the @code{enum} type
11288 is equivalent to the smallest integer type that has enough room.
11290 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
11291 code that is not binary compatible with code generated without that switch.
11292 Use it to conform to a non-default application binary interface.
11294 @item -fshort-wchar
11295 @opindex fshort-wchar
11296 Override the underlying type for @code{wchar_t} to be @code{short
11297 unsigned int} instead of the default for the target.  This option is
11298 useful for building programs to run under WINE@.
11300 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
11301 code that is not binary compatible with code generated without that switch.
11302 Use it to conform to a non-default application binary interface.
11304 @item -fno-common
11305 @opindex fno-common
11306 In C code, controls the placement of uninitialized global variables.
11307 Unix C compilers have traditionally permitted multiple definitions of
11308 such variables in different compilation units by placing the variables
11309 in a common block.
11310 This is the behavior specified by @option{-fcommon}, and is the default
11311 for GCC on most targets.
11312 On the other hand, this behavior is not required by ISO C, and on some
11313 targets may carry a speed or code size penalty on variable references.
11314 The @option{-fno-common} option specifies that the compiler should place
11315 uninitialized global variables in the data section of the object file,
11316 rather than generating them as common blocks.
11317 This has the effect that if the same variable is declared
11318 (without @code{extern}) in two different compilations,
11319 you get a multiple-definition error when you link them.
11320 In this case, you must compile with @option{-fcommon} instead.
11321 Compiling with @option{-fno-common} is useful on targets for which
11322 it provides better performance, or if you wish to verify that the
11323 program will work on other systems that always treat uninitialized
11324 variable declarations this way.
11326 @item -fno-ident
11327 @opindex fno-ident
11328 Ignore the @code{#ident} directive.
11330 @item -finhibit-size-directive
11331 @opindex finhibit-size-directive
11332 Don't output a @code{.size} assembler directive, or anything else that
11333 would cause trouble if the function is split in the middle, and the
11334 two halves are placed at locations far apart in memory.  This option is
11335 used when compiling @file{crtstuff.c}; you should not need to use it
11336 for anything else.
11338 @item -fverbose-asm
11339 @opindex fverbose-asm
11340 Put extra commentary information in the generated assembly code to
11341 make it more readable.  This option is generally only of use to those
11342 who actually need to read the generated assembly code (perhaps while
11343 debugging the compiler itself).
11345 @option{-fno-verbose-asm}, the default, causes the
11346 extra information to be omitted and is useful when comparing two assembler
11347 files.
11349 @item -frecord-gcc-switches
11350 @opindex frecord-gcc-switches
11351 This switch causes the command line used to invoke the
11352 compiler to be recorded into the object file that is being created.
11353 This switch is only implemented on some targets and the exact format
11354 of the recording is target and binary file format dependent, but it
11355 usually takes the form of a section containing ASCII text.  This
11356 switch is related to the @option{-fverbose-asm} switch, but that
11357 switch only records information in the assembler output file as
11358 comments, so it never reaches the object file.
11359 See also @option{-grecord-gcc-switches} for another
11360 way of storing compiler options into the object file.
11362 @item -fpic
11363 @opindex fpic
11364 @cindex global offset table
11365 @cindex PIC
11366 Generate position-independent code (PIC) suitable for use in a shared
11367 library, if supported for the target machine.  Such code accesses all
11368 constant addresses through a global offset table (GOT)@.  The dynamic
11369 loader resolves the GOT entries when the program starts (the dynamic
11370 loader is not part of GCC; it is part of the operating system).  If
11371 the GOT size for the linked executable exceeds a machine-specific
11372 maximum size, you get an error message from the linker indicating that
11373 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
11374 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
11375 on the m68k and RS/6000.  The x86 has no such limit.)
11377 Position-independent code requires special support, and therefore works
11378 only on certain machines.  For the x86, GCC supports PIC for System V
11379 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
11380 position-independent.
11382 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
11383 are defined to 1.
11385 @item -fPIC
11386 @opindex fPIC
11387 If supported for the target machine, emit position-independent code,
11388 suitable for dynamic linking and avoiding any limit on the size of the
11389 global offset table.  This option makes a difference on AArch64, m68k,
11390 PowerPC and SPARC@.
11392 Position-independent code requires special support, and therefore works
11393 only on certain machines.
11395 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
11396 are defined to 2.
11398 @item -fpie
11399 @itemx -fPIE
11400 @opindex fpie
11401 @opindex fPIE
11402 These options are similar to @option{-fpic} and @option{-fPIC}, but
11403 generated position independent code can be only linked into executables.
11404 Usually these options are used when @option{-pie} GCC option is
11405 used during linking.
11407 @option{-fpie} and @option{-fPIE} both define the macros
11408 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
11409 for @option{-fpie} and 2 for @option{-fPIE}.
11411 @item -fno-plt
11412 @opindex fno-plt
11413 Do not use the PLT for external function calls in position-independent code.
11414 Instead, load the callee address at call sites from the GOT and branch to it.
11415 This leads to more efficient code by eliminating PLT stubs and exposing
11416 GOT loads to optimizations.  On architectures such as 32-bit x86 where
11417 PLT stubs expect the GOT pointer in a specific register, this gives more
11418 register allocation freedom to the compiler.
11419 Lazy binding requires use of the PLT; 
11420 with @option{-fno-plt} all external symbols are resolved at load time.
11422 Alternatively, the function attribute @code{noplt} can be used to avoid calls
11423 through the PLT for specific external functions.
11425 In position-dependent code, a few targets also convert calls to
11426 functions that are marked to not use the PLT to use the GOT instead.
11428 @item -fno-jump-tables
11429 @opindex fno-jump-tables
11430 Do not use jump tables for switch statements even where it would be
11431 more efficient than other code generation strategies.  This option is
11432 of use in conjunction with @option{-fpic} or @option{-fPIC} for
11433 building code that forms part of a dynamic linker and cannot
11434 reference the address of a jump table.  On some targets, jump tables
11435 do not require a GOT and this option is not needed.
11437 @item -ffixed-@var{reg}
11438 @opindex ffixed
11439 Treat the register named @var{reg} as a fixed register; generated code
11440 should never refer to it (except perhaps as a stack pointer, frame
11441 pointer or in some other fixed role).
11443 @var{reg} must be the name of a register.  The register names accepted
11444 are machine-specific and are defined in the @code{REGISTER_NAMES}
11445 macro in the machine description macro file.
11447 This flag does not have a negative form, because it specifies a
11448 three-way choice.
11450 @item -fcall-used-@var{reg}
11451 @opindex fcall-used
11452 Treat the register named @var{reg} as an allocable register that is
11453 clobbered by function calls.  It may be allocated for temporaries or
11454 variables that do not live across a call.  Functions compiled this way
11455 do not save and restore the register @var{reg}.
11457 It is an error to use this flag with the frame pointer or stack pointer.
11458 Use of this flag for other registers that have fixed pervasive roles in
11459 the machine's execution model produces disastrous results.
11461 This flag does not have a negative form, because it specifies a
11462 three-way choice.
11464 @item -fcall-saved-@var{reg}
11465 @opindex fcall-saved
11466 Treat the register named @var{reg} as an allocable register saved by
11467 functions.  It may be allocated even for temporaries or variables that
11468 live across a call.  Functions compiled this way save and restore
11469 the register @var{reg} if they use it.
11471 It is an error to use this flag with the frame pointer or stack pointer.
11472 Use of this flag for other registers that have fixed pervasive roles in
11473 the machine's execution model produces disastrous results.
11475 A different sort of disaster results from the use of this flag for
11476 a register in which function values may be returned.
11478 This flag does not have a negative form, because it specifies a
11479 three-way choice.
11481 @item -fpack-struct[=@var{n}]
11482 @opindex fpack-struct
11483 Without a value specified, pack all structure members together without
11484 holes.  When a value is specified (which must be a small power of two), pack
11485 structure members according to this value, representing the maximum
11486 alignment (that is, objects with default alignment requirements larger than
11487 this are output potentially unaligned at the next fitting location.
11489 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
11490 code that is not binary compatible with code generated without that switch.
11491 Additionally, it makes the code suboptimal.
11492 Use it to conform to a non-default application binary interface.
11494 @item -fleading-underscore
11495 @opindex fleading-underscore
11496 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
11497 change the way C symbols are represented in the object file.  One use
11498 is to help link with legacy assembly code.
11500 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
11501 generate code that is not binary compatible with code generated without that
11502 switch.  Use it to conform to a non-default application binary interface.
11503 Not all targets provide complete support for this switch.
11505 @item -ftls-model=@var{model}
11506 @opindex ftls-model
11507 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
11508 The @var{model} argument should be one of @samp{global-dynamic},
11509 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
11510 Note that the choice is subject to optimization: the compiler may use
11511 a more efficient model for symbols not visible outside of the translation
11512 unit, or if @option{-fpic} is not given on the command line.
11514 The default without @option{-fpic} is @samp{initial-exec}; with
11515 @option{-fpic} the default is @samp{global-dynamic}.
11517 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
11518 @opindex fvisibility
11519 Set the default ELF image symbol visibility to the specified option---all
11520 symbols are marked with this unless overridden within the code.
11521 Using this feature can very substantially improve linking and
11522 load times of shared object libraries, produce more optimized
11523 code, provide near-perfect API export and prevent symbol clashes.
11524 It is @strong{strongly} recommended that you use this in any shared objects
11525 you distribute.
11527 Despite the nomenclature, @samp{default} always means public; i.e.,
11528 available to be linked against from outside the shared object.
11529 @samp{protected} and @samp{internal} are pretty useless in real-world
11530 usage so the only other commonly used option is @samp{hidden}.
11531 The default if @option{-fvisibility} isn't specified is
11532 @samp{default}, i.e., make every symbol public.
11534 A good explanation of the benefits offered by ensuring ELF
11535 symbols have the correct visibility is given by ``How To Write
11536 Shared Libraries'' by Ulrich Drepper (which can be found at
11537 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
11538 solution made possible by this option to marking things hidden when
11539 the default is public is to make the default hidden and mark things
11540 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
11541 and @code{__attribute__ ((visibility("default")))} instead of
11542 @code{__declspec(dllexport)} you get almost identical semantics with
11543 identical syntax.  This is a great boon to those working with
11544 cross-platform projects.
11546 For those adding visibility support to existing code, you may find
11547 @code{#pragma GCC visibility} of use.  This works by you enclosing
11548 the declarations you wish to set visibility for with (for example)
11549 @code{#pragma GCC visibility push(hidden)} and
11550 @code{#pragma GCC visibility pop}.
11551 Bear in mind that symbol visibility should be viewed @strong{as
11552 part of the API interface contract} and thus all new code should
11553 always specify visibility when it is not the default; i.e., declarations
11554 only for use within the local DSO should @strong{always} be marked explicitly
11555 as hidden as so to avoid PLT indirection overheads---making this
11556 abundantly clear also aids readability and self-documentation of the code.
11557 Note that due to ISO C++ specification requirements, @code{operator new} and
11558 @code{operator delete} must always be of default visibility.
11560 Be aware that headers from outside your project, in particular system
11561 headers and headers from any other library you use, may not be
11562 expecting to be compiled with visibility other than the default.  You
11563 may need to explicitly say @code{#pragma GCC visibility push(default)}
11564 before including any such headers.
11566 @code{extern} declarations are not affected by @option{-fvisibility}, so
11567 a lot of code can be recompiled with @option{-fvisibility=hidden} with
11568 no modifications.  However, this means that calls to @code{extern}
11569 functions with no explicit visibility use the PLT, so it is more
11570 effective to use @code{__attribute ((visibility))} and/or
11571 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
11572 declarations should be treated as hidden.
11574 Note that @option{-fvisibility} does affect C++ vague linkage
11575 entities. This means that, for instance, an exception class that is
11576 be thrown between DSOs must be explicitly marked with default
11577 visibility so that the @samp{type_info} nodes are unified between
11578 the DSOs.
11580 An overview of these techniques, their benefits and how to use them
11581 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
11583 @item -fstrict-volatile-bitfields
11584 @opindex fstrict-volatile-bitfields
11585 This option should be used if accesses to volatile bit-fields (or other
11586 structure fields, although the compiler usually honors those types
11587 anyway) should use a single access of the width of the
11588 field's type, aligned to a natural alignment if possible.  For
11589 example, targets with memory-mapped peripheral registers might require
11590 all such accesses to be 16 bits wide; with this flag you can
11591 declare all peripheral bit-fields as @code{unsigned short} (assuming short
11592 is 16 bits on these targets) to force GCC to use 16-bit accesses
11593 instead of, perhaps, a more efficient 32-bit access.
11595 If this option is disabled, the compiler uses the most efficient
11596 instruction.  In the previous example, that might be a 32-bit load
11597 instruction, even though that accesses bytes that do not contain
11598 any portion of the bit-field, or memory-mapped registers unrelated to
11599 the one being updated.
11601 In some cases, such as when the @code{packed} attribute is applied to a 
11602 structure field, it may not be possible to access the field with a single
11603 read or write that is correctly aligned for the target machine.  In this
11604 case GCC falls back to generating multiple accesses rather than code that 
11605 will fault or truncate the result at run time.
11607 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
11608 not allowed to touch non bit-field members.  It is therefore recommended
11609 to define all bits of the field's type as bit-field members.
11611 The default value of this option is determined by the application binary
11612 interface for the target processor.
11614 @item -fsync-libcalls
11615 @opindex fsync-libcalls
11616 This option controls whether any out-of-line instance of the @code{__sync}
11617 family of functions may be used to implement the C++11 @code{__atomic}
11618 family of functions.
11620 The default value of this option is enabled, thus the only useful form
11621 of the option is @option{-fno-sync-libcalls}.  This option is used in
11622 the implementation of the @file{libatomic} runtime library.
11624 @end table
11626 @node Developer Options
11627 @section GCC Developer Options
11628 @cindex developer options
11629 @cindex debugging GCC
11630 @cindex debug dump options
11631 @cindex dump options
11632 @cindex compilation statistics
11634 This section describes command-line options that are primarily of
11635 interest to GCC developers, including options to support compiler
11636 testing and investigation of compiler bugs and compile-time
11637 performance problems.  This includes options that produce debug dumps
11638 at various points in the compilation; that print statistics such as
11639 memory use and execution time; and that print information about GCC's
11640 configuration, such as where it searches for libraries.  You should
11641 rarely need to use any of these options for ordinary compilation and
11642 linking tasks.
11644 @table @gcctabopt
11646 @item -d@var{letters}
11647 @itemx -fdump-rtl-@var{pass}
11648 @itemx -fdump-rtl-@var{pass}=@var{filename}
11649 @opindex d
11650 @opindex fdump-rtl-@var{pass}
11651 Says to make debugging dumps during compilation at times specified by
11652 @var{letters}.  This is used for debugging the RTL-based passes of the
11653 compiler.  The file names for most of the dumps are made by appending
11654 a pass number and a word to the @var{dumpname}, and the files are
11655 created in the directory of the output file.  In case of
11656 @option{=@var{filename}} option, the dump is output on the given file
11657 instead of the pass numbered dump files.  Note that the pass number is
11658 assigned as passes are registered into the pass manager.  Most passes
11659 are registered in the order that they will execute and for these passes
11660 the number corresponds to the pass execution order.  However, passes
11661 registered by plugins, passes specific to compilation targets, or
11662 passes that are otherwise registered after all the other passes are
11663 numbered higher than a pass named "final", even if they are executed
11664 earlier.  @var{dumpname} is generated from the name of the output
11665 file if explicitly specified and not an executable, otherwise it is
11666 the basename of the source file.  These switches may have different
11667 effects when @option{-E} is used for preprocessing.
11669 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
11670 @option{-d} option @var{letters}.  Here are the possible
11671 letters for use in @var{pass} and @var{letters}, and their meanings:
11673 @table @gcctabopt
11675 @item -fdump-rtl-alignments
11676 @opindex fdump-rtl-alignments
11677 Dump after branch alignments have been computed.
11679 @item -fdump-rtl-asmcons
11680 @opindex fdump-rtl-asmcons
11681 Dump after fixing rtl statements that have unsatisfied in/out constraints.
11683 @item -fdump-rtl-auto_inc_dec
11684 @opindex fdump-rtl-auto_inc_dec
11685 Dump after auto-inc-dec discovery.  This pass is only run on
11686 architectures that have auto inc or auto dec instructions.
11688 @item -fdump-rtl-barriers
11689 @opindex fdump-rtl-barriers
11690 Dump after cleaning up the barrier instructions.
11692 @item -fdump-rtl-bbpart
11693 @opindex fdump-rtl-bbpart
11694 Dump after partitioning hot and cold basic blocks.
11696 @item -fdump-rtl-bbro
11697 @opindex fdump-rtl-bbro
11698 Dump after block reordering.
11700 @item -fdump-rtl-btl1
11701 @itemx -fdump-rtl-btl2
11702 @opindex fdump-rtl-btl2
11703 @opindex fdump-rtl-btl2
11704 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
11705 after the two branch
11706 target load optimization passes.
11708 @item -fdump-rtl-bypass
11709 @opindex fdump-rtl-bypass
11710 Dump after jump bypassing and control flow optimizations.
11712 @item -fdump-rtl-combine
11713 @opindex fdump-rtl-combine
11714 Dump after the RTL instruction combination pass.
11716 @item -fdump-rtl-compgotos
11717 @opindex fdump-rtl-compgotos
11718 Dump after duplicating the computed gotos.
11720 @item -fdump-rtl-ce1
11721 @itemx -fdump-rtl-ce2
11722 @itemx -fdump-rtl-ce3
11723 @opindex fdump-rtl-ce1
11724 @opindex fdump-rtl-ce2
11725 @opindex fdump-rtl-ce3
11726 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
11727 @option{-fdump-rtl-ce3} enable dumping after the three
11728 if conversion passes.
11730 @item -fdump-rtl-cprop_hardreg
11731 @opindex fdump-rtl-cprop_hardreg
11732 Dump after hard register copy propagation.
11734 @item -fdump-rtl-csa
11735 @opindex fdump-rtl-csa
11736 Dump after combining stack adjustments.
11738 @item -fdump-rtl-cse1
11739 @itemx -fdump-rtl-cse2
11740 @opindex fdump-rtl-cse1
11741 @opindex fdump-rtl-cse2
11742 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
11743 the two common subexpression elimination passes.
11745 @item -fdump-rtl-dce
11746 @opindex fdump-rtl-dce
11747 Dump after the standalone dead code elimination passes.
11749 @item -fdump-rtl-dbr
11750 @opindex fdump-rtl-dbr
11751 Dump after delayed branch scheduling.
11753 @item -fdump-rtl-dce1
11754 @itemx -fdump-rtl-dce2
11755 @opindex fdump-rtl-dce1
11756 @opindex fdump-rtl-dce2
11757 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
11758 the two dead store elimination passes.
11760 @item -fdump-rtl-eh
11761 @opindex fdump-rtl-eh
11762 Dump after finalization of EH handling code.
11764 @item -fdump-rtl-eh_ranges
11765 @opindex fdump-rtl-eh_ranges
11766 Dump after conversion of EH handling range regions.
11768 @item -fdump-rtl-expand
11769 @opindex fdump-rtl-expand
11770 Dump after RTL generation.
11772 @item -fdump-rtl-fwprop1
11773 @itemx -fdump-rtl-fwprop2
11774 @opindex fdump-rtl-fwprop1
11775 @opindex fdump-rtl-fwprop2
11776 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
11777 dumping after the two forward propagation passes.
11779 @item -fdump-rtl-gcse1
11780 @itemx -fdump-rtl-gcse2
11781 @opindex fdump-rtl-gcse1
11782 @opindex fdump-rtl-gcse2
11783 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
11784 after global common subexpression elimination.
11786 @item -fdump-rtl-init-regs
11787 @opindex fdump-rtl-init-regs
11788 Dump after the initialization of the registers.
11790 @item -fdump-rtl-initvals
11791 @opindex fdump-rtl-initvals
11792 Dump after the computation of the initial value sets.
11794 @item -fdump-rtl-into_cfglayout
11795 @opindex fdump-rtl-into_cfglayout
11796 Dump after converting to cfglayout mode.
11798 @item -fdump-rtl-ira
11799 @opindex fdump-rtl-ira
11800 Dump after iterated register allocation.
11802 @item -fdump-rtl-jump
11803 @opindex fdump-rtl-jump
11804 Dump after the second jump optimization.
11806 @item -fdump-rtl-loop2
11807 @opindex fdump-rtl-loop2
11808 @option{-fdump-rtl-loop2} enables dumping after the rtl
11809 loop optimization passes.
11811 @item -fdump-rtl-mach
11812 @opindex fdump-rtl-mach
11813 Dump after performing the machine dependent reorganization pass, if that
11814 pass exists.
11816 @item -fdump-rtl-mode_sw
11817 @opindex fdump-rtl-mode_sw
11818 Dump after removing redundant mode switches.
11820 @item -fdump-rtl-rnreg
11821 @opindex fdump-rtl-rnreg
11822 Dump after register renumbering.
11824 @item -fdump-rtl-outof_cfglayout
11825 @opindex fdump-rtl-outof_cfglayout
11826 Dump after converting from cfglayout mode.
11828 @item -fdump-rtl-peephole2
11829 @opindex fdump-rtl-peephole2
11830 Dump after the peephole pass.
11832 @item -fdump-rtl-postreload
11833 @opindex fdump-rtl-postreload
11834 Dump after post-reload optimizations.
11836 @item -fdump-rtl-pro_and_epilogue
11837 @opindex fdump-rtl-pro_and_epilogue
11838 Dump after generating the function prologues and epilogues.
11840 @item -fdump-rtl-sched1
11841 @itemx -fdump-rtl-sched2
11842 @opindex fdump-rtl-sched1
11843 @opindex fdump-rtl-sched2
11844 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
11845 after the basic block scheduling passes.
11847 @item -fdump-rtl-ree
11848 @opindex fdump-rtl-ree
11849 Dump after sign/zero extension elimination.
11851 @item -fdump-rtl-seqabstr
11852 @opindex fdump-rtl-seqabstr
11853 Dump after common sequence discovery.
11855 @item -fdump-rtl-shorten
11856 @opindex fdump-rtl-shorten
11857 Dump after shortening branches.
11859 @item -fdump-rtl-sibling
11860 @opindex fdump-rtl-sibling
11861 Dump after sibling call optimizations.
11863 @item -fdump-rtl-split1
11864 @itemx -fdump-rtl-split2
11865 @itemx -fdump-rtl-split3
11866 @itemx -fdump-rtl-split4
11867 @itemx -fdump-rtl-split5
11868 @opindex fdump-rtl-split1
11869 @opindex fdump-rtl-split2
11870 @opindex fdump-rtl-split3
11871 @opindex fdump-rtl-split4
11872 @opindex fdump-rtl-split5
11873 These options enable dumping after five rounds of
11874 instruction splitting.
11876 @item -fdump-rtl-sms
11877 @opindex fdump-rtl-sms
11878 Dump after modulo scheduling.  This pass is only run on some
11879 architectures.
11881 @item -fdump-rtl-stack
11882 @opindex fdump-rtl-stack
11883 Dump after conversion from GCC's ``flat register file'' registers to the
11884 x87's stack-like registers.  This pass is only run on x86 variants.
11886 @item -fdump-rtl-subreg1
11887 @itemx -fdump-rtl-subreg2
11888 @opindex fdump-rtl-subreg1
11889 @opindex fdump-rtl-subreg2
11890 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
11891 the two subreg expansion passes.
11893 @item -fdump-rtl-unshare
11894 @opindex fdump-rtl-unshare
11895 Dump after all rtl has been unshared.
11897 @item -fdump-rtl-vartrack
11898 @opindex fdump-rtl-vartrack
11899 Dump after variable tracking.
11901 @item -fdump-rtl-vregs
11902 @opindex fdump-rtl-vregs
11903 Dump after converting virtual registers to hard registers.
11905 @item -fdump-rtl-web
11906 @opindex fdump-rtl-web
11907 Dump after live range splitting.
11909 @item -fdump-rtl-regclass
11910 @itemx -fdump-rtl-subregs_of_mode_init
11911 @itemx -fdump-rtl-subregs_of_mode_finish
11912 @itemx -fdump-rtl-dfinit
11913 @itemx -fdump-rtl-dfinish
11914 @opindex fdump-rtl-regclass
11915 @opindex fdump-rtl-subregs_of_mode_init
11916 @opindex fdump-rtl-subregs_of_mode_finish
11917 @opindex fdump-rtl-dfinit
11918 @opindex fdump-rtl-dfinish
11919 These dumps are defined but always produce empty files.
11921 @item -da
11922 @itemx -fdump-rtl-all
11923 @opindex da
11924 @opindex fdump-rtl-all
11925 Produce all the dumps listed above.
11927 @item -dA
11928 @opindex dA
11929 Annotate the assembler output with miscellaneous debugging information.
11931 @item -dD
11932 @opindex dD
11933 Dump all macro definitions, at the end of preprocessing, in addition to
11934 normal output.
11936 @item -dH
11937 @opindex dH
11938 Produce a core dump whenever an error occurs.
11940 @item -dp
11941 @opindex dp
11942 Annotate the assembler output with a comment indicating which
11943 pattern and alternative is used.  The length of each instruction is
11944 also printed.
11946 @item -dP
11947 @opindex dP
11948 Dump the RTL in the assembler output as a comment before each instruction.
11949 Also turns on @option{-dp} annotation.
11951 @item -dx
11952 @opindex dx
11953 Just generate RTL for a function instead of compiling it.  Usually used
11954 with @option{-fdump-rtl-expand}.
11955 @end table
11957 @item -fdump-noaddr
11958 @opindex fdump-noaddr
11959 When doing debugging dumps, suppress address output.  This makes it more
11960 feasible to use diff on debugging dumps for compiler invocations with
11961 different compiler binaries and/or different
11962 text / bss / data / heap / stack / dso start locations.
11964 @item -freport-bug
11965 @opindex freport-bug
11966 Collect and dump debug information into a temporary file if an
11967 internal compiler error (ICE) occurs.
11969 @item -fdump-unnumbered
11970 @opindex fdump-unnumbered
11971 When doing debugging dumps, suppress instruction numbers and address output.
11972 This makes it more feasible to use diff on debugging dumps for compiler
11973 invocations with different options, in particular with and without
11974 @option{-g}.
11976 @item -fdump-unnumbered-links
11977 @opindex fdump-unnumbered-links
11978 When doing debugging dumps (see @option{-d} option above), suppress
11979 instruction numbers for the links to the previous and next instructions
11980 in a sequence.
11982 @item -fdump-translation-unit @r{(C++ only)}
11983 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
11984 @opindex fdump-translation-unit
11985 Dump a representation of the tree structure for the entire translation
11986 unit to a file.  The file name is made by appending @file{.tu} to the
11987 source file name, and the file is created in the same directory as the
11988 output file.  If the @samp{-@var{options}} form is used, @var{options}
11989 controls the details of the dump as described for the
11990 @option{-fdump-tree} options.
11992 @item -fdump-class-hierarchy @r{(C++ only)}
11993 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
11994 @opindex fdump-class-hierarchy
11995 Dump a representation of each class's hierarchy and virtual function
11996 table layout to a file.  The file name is made by appending
11997 @file{.class} to the source file name, and the file is created in the
11998 same directory as the output file.  If the @samp{-@var{options}} form
11999 is used, @var{options} controls the details of the dump as described
12000 for the @option{-fdump-tree} options.
12002 @item -fdump-ipa-@var{switch}
12003 @opindex fdump-ipa
12004 Control the dumping at various stages of inter-procedural analysis
12005 language tree to a file.  The file name is generated by appending a
12006 switch specific suffix to the source file name, and the file is created
12007 in the same directory as the output file.  The following dumps are
12008 possible:
12010 @table @samp
12011 @item all
12012 Enables all inter-procedural analysis dumps.
12014 @item cgraph
12015 Dumps information about call-graph optimization, unused function removal,
12016 and inlining decisions.
12018 @item inline
12019 Dump after function inlining.
12021 @end table
12023 @item -fdump-passes
12024 @opindex fdump-passes
12025 Dump the list of optimization passes that are turned on and off by
12026 the current command-line options.
12028 @item -fdump-statistics-@var{option}
12029 @opindex fdump-statistics
12030 Enable and control dumping of pass statistics in a separate file.  The
12031 file name is generated by appending a suffix ending in
12032 @samp{.statistics} to the source file name, and the file is created in
12033 the same directory as the output file.  If the @samp{-@var{option}}
12034 form is used, @samp{-stats} causes counters to be summed over the
12035 whole compilation unit while @samp{-details} dumps every event as
12036 the passes generate them.  The default with no option is to sum
12037 counters for each function compiled.
12039 @item -fdump-tree-@var{switch}
12040 @itemx -fdump-tree-@var{switch}-@var{options}
12041 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
12042 @opindex fdump-tree
12043 Control the dumping at various stages of processing the intermediate
12044 language tree to a file.  The file name is generated by appending a
12045 switch-specific suffix to the source file name, and the file is
12046 created in the same directory as the output file. In case of
12047 @option{=@var{filename}} option, the dump is output on the given file
12048 instead of the auto named dump files.  If the @samp{-@var{options}}
12049 form is used, @var{options} is a list of @samp{-} separated options
12050 which control the details of the dump.  Not all options are applicable
12051 to all dumps; those that are not meaningful are ignored.  The
12052 following options are available
12054 @table @samp
12055 @item address
12056 Print the address of each node.  Usually this is not meaningful as it
12057 changes according to the environment and source file.  Its primary use
12058 is for tying up a dump file with a debug environment.
12059 @item asmname
12060 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
12061 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
12062 use working backward from mangled names in the assembly file.
12063 @item slim
12064 When dumping front-end intermediate representations, inhibit dumping
12065 of members of a scope or body of a function merely because that scope
12066 has been reached.  Only dump such items when they are directly reachable
12067 by some other path.
12069 When dumping pretty-printed trees, this option inhibits dumping the
12070 bodies of control structures.
12072 When dumping RTL, print the RTL in slim (condensed) form instead of
12073 the default LISP-like representation.
12074 @item raw
12075 Print a raw representation of the tree.  By default, trees are
12076 pretty-printed into a C-like representation.
12077 @item details
12078 Enable more detailed dumps (not honored by every dump option). Also
12079 include information from the optimization passes.
12080 @item stats
12081 Enable dumping various statistics about the pass (not honored by every dump
12082 option).
12083 @item blocks
12084 Enable showing basic block boundaries (disabled in raw dumps).
12085 @item graph
12086 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
12087 dump a representation of the control flow graph suitable for viewing with
12088 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
12089 the file is pretty-printed as a subgraph, so that GraphViz can render them
12090 all in a single plot.
12092 This option currently only works for RTL dumps, and the RTL is always
12093 dumped in slim form.
12094 @item vops
12095 Enable showing virtual operands for every statement.
12096 @item lineno
12097 Enable showing line numbers for statements.
12098 @item uid
12099 Enable showing the unique ID (@code{DECL_UID}) for each variable.
12100 @item verbose
12101 Enable showing the tree dump for each statement.
12102 @item eh
12103 Enable showing the EH region number holding each statement.
12104 @item scev
12105 Enable showing scalar evolution analysis details.
12106 @item optimized
12107 Enable showing optimization information (only available in certain
12108 passes).
12109 @item missed
12110 Enable showing missed optimization information (only available in certain
12111 passes).
12112 @item note
12113 Enable other detailed optimization information (only available in
12114 certain passes).
12115 @item =@var{filename}
12116 Instead of an auto named dump file, output into the given file
12117 name. The file names @file{stdout} and @file{stderr} are treated
12118 specially and are considered already open standard streams. For
12119 example,
12121 @smallexample
12122 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
12123      -fdump-tree-pre=stderr file.c
12124 @end smallexample
12126 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
12127 output on to @file{stderr}. If two conflicting dump filenames are
12128 given for the same pass, then the latter option overrides the earlier
12129 one.
12131 @item split-paths
12132 @opindex fdump-tree-split-paths
12133 Dump each function after splitting paths to loop backedges.  The file
12134 name is made by appending @file{.split-paths} to the source file name.
12136 @item all
12137 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
12138 and @option{lineno}.
12140 @item optall
12141 Turn on all optimization options, i.e., @option{optimized},
12142 @option{missed}, and @option{note}.
12143 @end table
12145 The following tree dumps are possible:
12146 @table @samp
12148 @item original
12149 @opindex fdump-tree-original
12150 Dump before any tree based optimization, to @file{@var{file}.original}.
12152 @item optimized
12153 @opindex fdump-tree-optimized
12154 Dump after all tree based optimization, to @file{@var{file}.optimized}.
12156 @item gimple
12157 @opindex fdump-tree-gimple
12158 Dump each function before and after the gimplification pass to a file.  The
12159 file name is made by appending @file{.gimple} to the source file name.
12161 @item cfg
12162 @opindex fdump-tree-cfg
12163 Dump the control flow graph of each function to a file.  The file name is
12164 made by appending @file{.cfg} to the source file name.
12166 @item ch
12167 @opindex fdump-tree-ch
12168 Dump each function after copying loop headers.  The file name is made by
12169 appending @file{.ch} to the source file name.
12171 @item ssa
12172 @opindex fdump-tree-ssa
12173 Dump SSA related information to a file.  The file name is made by appending
12174 @file{.ssa} to the source file name.
12176 @item alias
12177 @opindex fdump-tree-alias
12178 Dump aliasing information for each function.  The file name is made by
12179 appending @file{.alias} to the source file name.
12181 @item ccp
12182 @opindex fdump-tree-ccp
12183 Dump each function after CCP@.  The file name is made by appending
12184 @file{.ccp} to the source file name.
12186 @item storeccp
12187 @opindex fdump-tree-storeccp
12188 Dump each function after STORE-CCP@.  The file name is made by appending
12189 @file{.storeccp} to the source file name.
12191 @item pre
12192 @opindex fdump-tree-pre
12193 Dump trees after partial redundancy elimination.  The file name is made
12194 by appending @file{.pre} to the source file name.
12196 @item fre
12197 @opindex fdump-tree-fre
12198 Dump trees after full redundancy elimination.  The file name is made
12199 by appending @file{.fre} to the source file name.
12201 @item copyprop
12202 @opindex fdump-tree-copyprop
12203 Dump trees after copy propagation.  The file name is made
12204 by appending @file{.copyprop} to the source file name.
12206 @item store_copyprop
12207 @opindex fdump-tree-store_copyprop
12208 Dump trees after store copy-propagation.  The file name is made
12209 by appending @file{.store_copyprop} to the source file name.
12211 @item dce
12212 @opindex fdump-tree-dce
12213 Dump each function after dead code elimination.  The file name is made by
12214 appending @file{.dce} to the source file name.
12216 @item sra
12217 @opindex fdump-tree-sra
12218 Dump each function after performing scalar replacement of aggregates.  The
12219 file name is made by appending @file{.sra} to the source file name.
12221 @item sink
12222 @opindex fdump-tree-sink
12223 Dump each function after performing code sinking.  The file name is made
12224 by appending @file{.sink} to the source file name.
12226 @item dom
12227 @opindex fdump-tree-dom
12228 Dump each function after applying dominator tree optimizations.  The file
12229 name is made by appending @file{.dom} to the source file name.
12231 @item dse
12232 @opindex fdump-tree-dse
12233 Dump each function after applying dead store elimination.  The file
12234 name is made by appending @file{.dse} to the source file name.
12236 @item phiopt
12237 @opindex fdump-tree-phiopt
12238 Dump each function after optimizing PHI nodes into straightline code.  The file
12239 name is made by appending @file{.phiopt} to the source file name.
12241 @item backprop
12242 @opindex fdump-tree-backprop
12243 Dump each function after back-propagating use information up the definition
12244 chain.  The file name is made by appending @file{.backprop} to the
12245 source file name.
12247 @item forwprop
12248 @opindex fdump-tree-forwprop
12249 Dump each function after forward propagating single use variables.  The file
12250 name is made by appending @file{.forwprop} to the source file name.
12252 @item nrv
12253 @opindex fdump-tree-nrv
12254 Dump each function after applying the named return value optimization on
12255 generic trees.  The file name is made by appending @file{.nrv} to the source
12256 file name.
12258 @item vect
12259 @opindex fdump-tree-vect
12260 Dump each function after applying vectorization of loops.  The file name is
12261 made by appending @file{.vect} to the source file name.
12263 @item slp
12264 @opindex fdump-tree-slp
12265 Dump each function after applying vectorization of basic blocks.  The file name
12266 is made by appending @file{.slp} to the source file name.
12268 @item vrp
12269 @opindex fdump-tree-vrp
12270 Dump each function after Value Range Propagation (VRP).  The file name
12271 is made by appending @file{.vrp} to the source file name.
12273 @item oaccdevlow
12274 @opindex fdump-tree-oaccdevlow
12275 Dump each function after applying device-specific OpenACC transformations.
12276 The file name is made by appending @file{.oaccdevlow} to the source file name.
12278 @item all
12279 @opindex fdump-tree-all
12280 Enable all the available tree dumps with the flags provided in this option.
12281 @end table
12283 @item -fopt-info
12284 @itemx -fopt-info-@var{options}
12285 @itemx -fopt-info-@var{options}=@var{filename}
12286 @opindex fopt-info
12287 Controls optimization dumps from various optimization passes. If the
12288 @samp{-@var{options}} form is used, @var{options} is a list of
12289 @samp{-} separated option keywords to select the dump details and
12290 optimizations.  
12292 The @var{options} can be divided into two groups: options describing the
12293 verbosity of the dump, and options describing which optimizations
12294 should be included. The options from both the groups can be freely
12295 mixed as they are non-overlapping. However, in case of any conflicts,
12296 the later options override the earlier options on the command
12297 line. 
12299 The following options control the dump verbosity:
12301 @table @samp
12302 @item optimized
12303 Print information when an optimization is successfully applied. It is
12304 up to a pass to decide which information is relevant. For example, the
12305 vectorizer passes print the source location of loops which are
12306 successfully vectorized.
12307 @item missed
12308 Print information about missed optimizations. Individual passes
12309 control which information to include in the output. 
12310 @item note
12311 Print verbose information about optimizations, such as certain
12312 transformations, more detailed messages about decisions etc.
12313 @item all
12314 Print detailed optimization information. This includes
12315 @samp{optimized}, @samp{missed}, and @samp{note}.
12316 @end table
12318 One or more of the following option keywords can be used to describe a
12319 group of optimizations:
12321 @table @samp
12322 @item ipa
12323 Enable dumps from all interprocedural optimizations.
12324 @item loop
12325 Enable dumps from all loop optimizations.
12326 @item inline
12327 Enable dumps from all inlining optimizations.
12328 @item vec
12329 Enable dumps from all vectorization optimizations.
12330 @item optall
12331 Enable dumps from all optimizations. This is a superset of
12332 the optimization groups listed above.
12333 @end table
12335 If @var{options} is
12336 omitted, it defaults to @samp{optimized-optall}, which means to dump all
12337 info about successful optimizations from all the passes.  
12339 If the @var{filename} is provided, then the dumps from all the
12340 applicable optimizations are concatenated into the @var{filename}.
12341 Otherwise the dump is output onto @file{stderr}. Though multiple
12342 @option{-fopt-info} options are accepted, only one of them can include
12343 a @var{filename}. If other filenames are provided then all but the
12344 first such option are ignored.
12346 Note that the output @var{filename} is overwritten
12347 in case of multiple translation units. If a combined output from
12348 multiple translation units is desired, @file{stderr} should be used
12349 instead.
12351 In the following example, the optimization info is output to
12352 @file{stderr}:
12354 @smallexample
12355 gcc -O3 -fopt-info
12356 @end smallexample
12358 This example:
12359 @smallexample
12360 gcc -O3 -fopt-info-missed=missed.all
12361 @end smallexample
12363 @noindent
12364 outputs missed optimization report from all the passes into
12365 @file{missed.all}, and this one:
12367 @smallexample
12368 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
12369 @end smallexample
12371 @noindent
12372 prints information about missed optimization opportunities from
12373 vectorization passes on @file{stderr}.  
12374 Note that @option{-fopt-info-vec-missed} is equivalent to 
12375 @option{-fopt-info-missed-vec}.
12377 As another example,
12378 @smallexample
12379 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
12380 @end smallexample
12382 @noindent
12383 outputs information about missed optimizations as well as
12384 optimized locations from all the inlining passes into
12385 @file{inline.txt}.
12387 Finally, consider:
12389 @smallexample
12390 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
12391 @end smallexample
12393 @noindent
12394 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
12395 in conflict since only one output file is allowed. In this case, only
12396 the first option takes effect and the subsequent options are
12397 ignored. Thus only @file{vec.miss} is produced which contains
12398 dumps from the vectorizer about missed opportunities.
12400 @item -fsched-verbose=@var{n}
12401 @opindex fsched-verbose
12402 On targets that use instruction scheduling, this option controls the
12403 amount of debugging output the scheduler prints to the dump files.
12405 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
12406 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
12407 For @var{n} greater than one, it also output basic block probabilities,
12408 detailed ready list information and unit/insn info.  For @var{n} greater
12409 than two, it includes RTL at abort point, control-flow and regions info.
12410 And for @var{n} over four, @option{-fsched-verbose} also includes
12411 dependence info.
12415 @item -fenable-@var{kind}-@var{pass}
12416 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
12417 @opindex fdisable-
12418 @opindex fenable-
12420 This is a set of options that are used to explicitly disable/enable
12421 optimization passes.  These options are intended for use for debugging GCC.
12422 Compiler users should use regular options for enabling/disabling
12423 passes instead.
12425 @table @gcctabopt
12427 @item -fdisable-ipa-@var{pass}
12428 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
12429 statically invoked in the compiler multiple times, the pass name should be
12430 appended with a sequential number starting from 1.
12432 @item -fdisable-rtl-@var{pass}
12433 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
12434 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
12435 statically invoked in the compiler multiple times, the pass name should be
12436 appended with a sequential number starting from 1.  @var{range-list} is a 
12437 comma-separated list of function ranges or assembler names.  Each range is a number
12438 pair separated by a colon.  The range is inclusive in both ends.  If the range
12439 is trivial, the number pair can be simplified as a single number.  If the
12440 function's call graph node's @var{uid} falls within one of the specified ranges,
12441 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
12442 function header of a dump file, and the pass names can be dumped by using
12443 option @option{-fdump-passes}.
12445 @item -fdisable-tree-@var{pass}
12446 @itemx -fdisable-tree-@var{pass}=@var{range-list}
12447 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
12448 option arguments.
12450 @item -fenable-ipa-@var{pass}
12451 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
12452 statically invoked in the compiler multiple times, the pass name should be
12453 appended with a sequential number starting from 1.
12455 @item -fenable-rtl-@var{pass}
12456 @itemx -fenable-rtl-@var{pass}=@var{range-list}
12457 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
12458 description and examples.
12460 @item -fenable-tree-@var{pass}
12461 @itemx -fenable-tree-@var{pass}=@var{range-list}
12462 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
12463 of option arguments.
12465 @end table
12467 Here are some examples showing uses of these options.
12469 @smallexample
12471 # disable ccp1 for all functions
12472    -fdisable-tree-ccp1
12473 # disable complete unroll for function whose cgraph node uid is 1
12474    -fenable-tree-cunroll=1
12475 # disable gcse2 for functions at the following ranges [1,1],
12476 # [300,400], and [400,1000]
12477 # disable gcse2 for functions foo and foo2
12478    -fdisable-rtl-gcse2=foo,foo2
12479 # disable early inlining
12480    -fdisable-tree-einline
12481 # disable ipa inlining
12482    -fdisable-ipa-inline
12483 # enable tree full unroll
12484    -fenable-tree-unroll
12486 @end smallexample
12488 @item -fchecking
12489 @itemx -fchecking=@var{n}
12490 @opindex fchecking
12491 @opindex fno-checking
12492 Enable internal consistency checking.  The default depends on
12493 the compiler configuration.  @option{-fchecking=2} enables further
12494 internal consistency checking that might affect code generation.
12496 @item -frandom-seed=@var{string}
12497 @opindex frandom-seed
12498 This option provides a seed that GCC uses in place of
12499 random numbers in generating certain symbol names
12500 that have to be different in every compiled file.  It is also used to
12501 place unique stamps in coverage data files and the object files that
12502 produce them.  You can use the @option{-frandom-seed} option to produce
12503 reproducibly identical object files.
12505 The @var{string} can either be a number (decimal, octal or hex) or an
12506 arbitrary string (in which case it's converted to a number by
12507 computing CRC32).
12509 The @var{string} should be different for every file you compile.
12511 @item -save-temps
12512 @itemx -save-temps=cwd
12513 @opindex save-temps
12514 Store the usual ``temporary'' intermediate files permanently; place them
12515 in the current directory and name them based on the source file.  Thus,
12516 compiling @file{foo.c} with @option{-c -save-temps} produces files
12517 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
12518 preprocessed @file{foo.i} output file even though the compiler now
12519 normally uses an integrated preprocessor.
12521 When used in combination with the @option{-x} command-line option,
12522 @option{-save-temps} is sensible enough to avoid over writing an
12523 input source file with the same extension as an intermediate file.
12524 The corresponding intermediate file may be obtained by renaming the
12525 source file before using @option{-save-temps}.
12527 If you invoke GCC in parallel, compiling several different source
12528 files that share a common base name in different subdirectories or the
12529 same source file compiled for multiple output destinations, it is
12530 likely that the different parallel compilers will interfere with each
12531 other, and overwrite the temporary files.  For instance:
12533 @smallexample
12534 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
12535 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
12536 @end smallexample
12538 may result in @file{foo.i} and @file{foo.o} being written to
12539 simultaneously by both compilers.
12541 @item -save-temps=obj
12542 @opindex save-temps=obj
12543 Store the usual ``temporary'' intermediate files permanently.  If the
12544 @option{-o} option is used, the temporary files are based on the
12545 object file.  If the @option{-o} option is not used, the
12546 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
12548 For example:
12550 @smallexample
12551 gcc -save-temps=obj -c foo.c
12552 gcc -save-temps=obj -c bar.c -o dir/xbar.o
12553 gcc -save-temps=obj foobar.c -o dir2/yfoobar
12554 @end smallexample
12556 @noindent
12557 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
12558 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
12559 @file{dir2/yfoobar.o}.
12561 @item -time@r{[}=@var{file}@r{]}
12562 @opindex time
12563 Report the CPU time taken by each subprocess in the compilation
12564 sequence.  For C source files, this is the compiler proper and assembler
12565 (plus the linker if linking is done).
12567 Without the specification of an output file, the output looks like this:
12569 @smallexample
12570 # cc1 0.12 0.01
12571 # as 0.00 0.01
12572 @end smallexample
12574 The first number on each line is the ``user time'', that is time spent
12575 executing the program itself.  The second number is ``system time'',
12576 time spent executing operating system routines on behalf of the program.
12577 Both numbers are in seconds.
12579 With the specification of an output file, the output is appended to the
12580 named file, and it looks like this:
12582 @smallexample
12583 0.12 0.01 cc1 @var{options}
12584 0.00 0.01 as @var{options}
12585 @end smallexample
12587 The ``user time'' and the ``system time'' are moved before the program
12588 name, and the options passed to the program are displayed, so that one
12589 can later tell what file was being compiled, and with which options.
12591 @item -fdump-final-insns@r{[}=@var{file}@r{]}
12592 @opindex fdump-final-insns
12593 Dump the final internal representation (RTL) to @var{file}.  If the
12594 optional argument is omitted (or if @var{file} is @code{.}), the name
12595 of the dump file is determined by appending @code{.gkd} to the
12596 compilation output file name.
12598 @item -fcompare-debug@r{[}=@var{opts}@r{]}
12599 @opindex fcompare-debug
12600 @opindex fno-compare-debug
12601 If no error occurs during compilation, run the compiler a second time,
12602 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
12603 passed to the second compilation.  Dump the final internal
12604 representation in both compilations, and print an error if they differ.
12606 If the equal sign is omitted, the default @option{-gtoggle} is used.
12608 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
12609 and nonzero, implicitly enables @option{-fcompare-debug}.  If
12610 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
12611 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
12612 is used.
12614 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
12615 is equivalent to @option{-fno-compare-debug}, which disables the dumping
12616 of the final representation and the second compilation, preventing even
12617 @env{GCC_COMPARE_DEBUG} from taking effect.
12619 To verify full coverage during @option{-fcompare-debug} testing, set
12620 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
12621 which GCC rejects as an invalid option in any actual compilation
12622 (rather than preprocessing, assembly or linking).  To get just a
12623 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
12624 not overridden} will do.
12626 @item -fcompare-debug-second
12627 @opindex fcompare-debug-second
12628 This option is implicitly passed to the compiler for the second
12629 compilation requested by @option{-fcompare-debug}, along with options to
12630 silence warnings, and omitting other options that would cause
12631 side-effect compiler outputs to files or to the standard output.  Dump
12632 files and preserved temporary files are renamed so as to contain the
12633 @code{.gk} additional extension during the second compilation, to avoid
12634 overwriting those generated by the first.
12636 When this option is passed to the compiler driver, it causes the
12637 @emph{first} compilation to be skipped, which makes it useful for little
12638 other than debugging the compiler proper.
12640 @item -gtoggle
12641 @opindex gtoggle
12642 Turn off generation of debug info, if leaving out this option
12643 generates it, or turn it on at level 2 otherwise.  The position of this
12644 argument in the command line does not matter; it takes effect after all
12645 other options are processed, and it does so only once, no matter how
12646 many times it is given.  This is mainly intended to be used with
12647 @option{-fcompare-debug}.
12649 @item -fvar-tracking-assignments-toggle
12650 @opindex fvar-tracking-assignments-toggle
12651 @opindex fno-var-tracking-assignments-toggle
12652 Toggle @option{-fvar-tracking-assignments}, in the same way that
12653 @option{-gtoggle} toggles @option{-g}.
12655 @item -Q
12656 @opindex Q
12657 Makes the compiler print out each function name as it is compiled, and
12658 print some statistics about each pass when it finishes.
12660 @item -ftime-report
12661 @opindex ftime-report
12662 Makes the compiler print some statistics about the time consumed by each
12663 pass when it finishes.
12665 @item -fira-verbose=@var{n}
12666 @opindex fira-verbose
12667 Control the verbosity of the dump file for the integrated register allocator.
12668 The default value is 5.  If the value @var{n} is greater or equal to 10,
12669 the dump output is sent to stderr using the same format as @var{n} minus 10.
12671 @item -flto-report
12672 @opindex flto-report
12673 Prints a report with internal details on the workings of the link-time
12674 optimizer.  The contents of this report vary from version to version.
12675 It is meant to be useful to GCC developers when processing object
12676 files in LTO mode (via @option{-flto}).
12678 Disabled by default.
12680 @item -flto-report-wpa
12681 @opindex flto-report-wpa
12682 Like @option{-flto-report}, but only print for the WPA phase of Link
12683 Time Optimization.
12685 @item -fmem-report
12686 @opindex fmem-report
12687 Makes the compiler print some statistics about permanent memory
12688 allocation when it finishes.
12690 @item -fmem-report-wpa
12691 @opindex fmem-report-wpa
12692 Makes the compiler print some statistics about permanent memory
12693 allocation for the WPA phase only.
12695 @item -fpre-ipa-mem-report
12696 @opindex fpre-ipa-mem-report
12697 @item -fpost-ipa-mem-report
12698 @opindex fpost-ipa-mem-report
12699 Makes the compiler print some statistics about permanent memory
12700 allocation before or after interprocedural optimization.
12702 @item -fprofile-report
12703 @opindex fprofile-report
12704 Makes the compiler print some statistics about consistency of the
12705 (estimated) profile and effect of individual passes.
12707 @item -fstack-usage
12708 @opindex fstack-usage
12709 Makes the compiler output stack usage information for the program, on a
12710 per-function basis.  The filename for the dump is made by appending
12711 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
12712 the output file, if explicitly specified and it is not an executable,
12713 otherwise it is the basename of the source file.  An entry is made up
12714 of three fields:
12716 @itemize
12717 @item
12718 The name of the function.
12719 @item
12720 A number of bytes.
12721 @item
12722 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
12723 @end itemize
12725 The qualifier @code{static} means that the function manipulates the stack
12726 statically: a fixed number of bytes are allocated for the frame on function
12727 entry and released on function exit; no stack adjustments are otherwise made
12728 in the function.  The second field is this fixed number of bytes.
12730 The qualifier @code{dynamic} means that the function manipulates the stack
12731 dynamically: in addition to the static allocation described above, stack
12732 adjustments are made in the body of the function, for example to push/pop
12733 arguments around function calls.  If the qualifier @code{bounded} is also
12734 present, the amount of these adjustments is bounded at compile time and
12735 the second field is an upper bound of the total amount of stack used by
12736 the function.  If it is not present, the amount of these adjustments is
12737 not bounded at compile time and the second field only represents the
12738 bounded part.
12740 @item -fstats
12741 @opindex fstats
12742 Emit statistics about front-end processing at the end of the compilation.
12743 This option is supported only by the C++ front end, and
12744 the information is generally only useful to the G++ development team.
12746 @item -fdbg-cnt-list
12747 @opindex fdbg-cnt-list
12748 Print the name and the counter upper bound for all debug counters.
12751 @item -fdbg-cnt=@var{counter-value-list}
12752 @opindex fdbg-cnt
12753 Set the internal debug counter upper bound.  @var{counter-value-list}
12754 is a comma-separated list of @var{name}:@var{value} pairs
12755 which sets the upper bound of each debug counter @var{name} to @var{value}.
12756 All debug counters have the initial upper bound of @code{UINT_MAX};
12757 thus @code{dbg_cnt} returns true always unless the upper bound
12758 is set by this option.
12759 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
12760 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
12762 @item -print-file-name=@var{library}
12763 @opindex print-file-name
12764 Print the full absolute name of the library file @var{library} that
12765 would be used when linking---and don't do anything else.  With this
12766 option, GCC does not compile or link anything; it just prints the
12767 file name.
12769 @item -print-multi-directory
12770 @opindex print-multi-directory
12771 Print the directory name corresponding to the multilib selected by any
12772 other switches present in the command line.  This directory is supposed
12773 to exist in @env{GCC_EXEC_PREFIX}.
12775 @item -print-multi-lib
12776 @opindex print-multi-lib
12777 Print the mapping from multilib directory names to compiler switches
12778 that enable them.  The directory name is separated from the switches by
12779 @samp{;}, and each switch starts with an @samp{@@} instead of the
12780 @samp{-}, without spaces between multiple switches.  This is supposed to
12781 ease shell processing.
12783 @item -print-multi-os-directory
12784 @opindex print-multi-os-directory
12785 Print the path to OS libraries for the selected
12786 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
12787 present in the @file{lib} subdirectory and no multilibs are used, this is
12788 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
12789 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
12790 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
12791 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
12793 @item -print-multiarch
12794 @opindex print-multiarch
12795 Print the path to OS libraries for the selected multiarch,
12796 relative to some @file{lib} subdirectory.
12798 @item -print-prog-name=@var{program}
12799 @opindex print-prog-name
12800 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
12802 @item -print-libgcc-file-name
12803 @opindex print-libgcc-file-name
12804 Same as @option{-print-file-name=libgcc.a}.
12806 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
12807 but you do want to link with @file{libgcc.a}.  You can do:
12809 @smallexample
12810 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
12811 @end smallexample
12813 @item -print-search-dirs
12814 @opindex print-search-dirs
12815 Print the name of the configured installation directory and a list of
12816 program and library directories @command{gcc} searches---and don't do anything else.
12818 This is useful when @command{gcc} prints the error message
12819 @samp{installation problem, cannot exec cpp0: No such file or directory}.
12820 To resolve this you either need to put @file{cpp0} and the other compiler
12821 components where @command{gcc} expects to find them, or you can set the environment
12822 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
12823 Don't forget the trailing @samp{/}.
12824 @xref{Environment Variables}.
12826 @item -print-sysroot
12827 @opindex print-sysroot
12828 Print the target sysroot directory that is used during
12829 compilation.  This is the target sysroot specified either at configure
12830 time or using the @option{--sysroot} option, possibly with an extra
12831 suffix that depends on compilation options.  If no target sysroot is
12832 specified, the option prints nothing.
12834 @item -print-sysroot-headers-suffix
12835 @opindex print-sysroot-headers-suffix
12836 Print the suffix added to the target sysroot when searching for
12837 headers, or give an error if the compiler is not configured with such
12838 a suffix---and don't do anything else.
12840 @item -dumpmachine
12841 @opindex dumpmachine
12842 Print the compiler's target machine (for example,
12843 @samp{i686-pc-linux-gnu})---and don't do anything else.
12845 @item -dumpversion
12846 @opindex dumpversion
12847 Print the compiler version (for example, @code{3.0})---and don't do
12848 anything else.
12850 @item -dumpspecs
12851 @opindex dumpspecs
12852 Print the compiler's built-in specs---and don't do anything else.  (This
12853 is used when GCC itself is being built.)  @xref{Spec Files}.
12854 @end table
12856 @node Submodel Options
12857 @section Machine-Dependent Options
12858 @cindex submodel options
12859 @cindex specifying hardware config
12860 @cindex hardware models and configurations, specifying
12861 @cindex target-dependent options
12862 @cindex machine-dependent options
12864 Each target machine supported by GCC can have its own options---for
12865 example, to allow you to compile for a particular processor variant or
12866 ABI, or to control optimizations specific to that machine.  By
12867 convention, the names of machine-specific options start with
12868 @samp{-m}.
12870 Some configurations of the compiler also support additional target-specific
12871 options, usually for compatibility with other compilers on the same
12872 platform.
12874 @c This list is ordered alphanumerically by subsection name.
12875 @c It should be the same order and spelling as these options are listed
12876 @c in Machine Dependent Options
12878 @menu
12879 * AArch64 Options::
12880 * Adapteva Epiphany Options::
12881 * ARC Options::
12882 * ARM Options::
12883 * AVR Options::
12884 * Blackfin Options::
12885 * C6X Options::
12886 * CRIS Options::
12887 * CR16 Options::
12888 * Darwin Options::
12889 * DEC Alpha Options::
12890 * FR30 Options::
12891 * FT32 Options::
12892 * FRV Options::
12893 * GNU/Linux Options::
12894 * H8/300 Options::
12895 * HPPA Options::
12896 * IA-64 Options::
12897 * LM32 Options::
12898 * M32C Options::
12899 * M32R/D Options::
12900 * M680x0 Options::
12901 * MCore Options::
12902 * MeP Options::
12903 * MicroBlaze Options::
12904 * MIPS Options::
12905 * MMIX Options::
12906 * MN10300 Options::
12907 * Moxie Options::
12908 * MSP430 Options::
12909 * NDS32 Options::
12910 * Nios II Options::
12911 * Nvidia PTX Options::
12912 * PDP-11 Options::
12913 * picoChip Options::
12914 * PowerPC Options::
12915 * RL78 Options::
12916 * RS/6000 and PowerPC Options::
12917 * RX Options::
12918 * S/390 and zSeries Options::
12919 * Score Options::
12920 * SH Options::
12921 * Solaris 2 Options::
12922 * SPARC Options::
12923 * SPU Options::
12924 * System V Options::
12925 * TILE-Gx Options::
12926 * TILEPro Options::
12927 * V850 Options::
12928 * VAX Options::
12929 * Visium Options::
12930 * VMS Options::
12931 * VxWorks Options::
12932 * x86 Options::
12933 * x86 Windows Options::
12934 * Xstormy16 Options::
12935 * Xtensa Options::
12936 * zSeries Options::
12937 @end menu
12939 @node AArch64 Options
12940 @subsection AArch64 Options
12941 @cindex AArch64 Options
12943 These options are defined for AArch64 implementations:
12945 @table @gcctabopt
12947 @item -mabi=@var{name}
12948 @opindex mabi
12949 Generate code for the specified data model.  Permissible values
12950 are @samp{ilp32} for SysV-like data model where int, long int and pointers
12951 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
12952 but long int and pointers are 64 bits.
12954 The default depends on the specific target configuration.  Note that
12955 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
12956 entire program with the same ABI, and link with a compatible set of libraries.
12958 @item -mbig-endian
12959 @opindex mbig-endian
12960 Generate big-endian code.  This is the default when GCC is configured for an
12961 @samp{aarch64_be-*-*} target.
12963 @item -mgeneral-regs-only
12964 @opindex mgeneral-regs-only
12965 Generate code which uses only the general-purpose registers.  This will prevent
12966 the compiler from using floating-point and Advanced SIMD registers but will not
12967 impose any restrictions on the assembler.
12969 @item -mlittle-endian
12970 @opindex mlittle-endian
12971 Generate little-endian code.  This is the default when GCC is configured for an
12972 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
12974 @item -mcmodel=tiny
12975 @opindex mcmodel=tiny
12976 Generate code for the tiny code model.  The program and its statically defined
12977 symbols must be within 1MB of each other.  Programs can be statically or
12978 dynamically linked.
12980 @item -mcmodel=small
12981 @opindex mcmodel=small
12982 Generate code for the small code model.  The program and its statically defined
12983 symbols must be within 4GB of each other.  Programs can be statically or
12984 dynamically linked.  This is the default code model.
12986 @item -mcmodel=large
12987 @opindex mcmodel=large
12988 Generate code for the large code model.  This makes no assumptions about
12989 addresses and sizes of sections.  Programs can be statically linked only.
12991 @item -mstrict-align
12992 @opindex mstrict-align
12993 Avoid generating memory accesses that may not be aligned on a natural object
12994 boundary as described in the architecture specification.
12996 @item -momit-leaf-frame-pointer
12997 @itemx -mno-omit-leaf-frame-pointer
12998 @opindex momit-leaf-frame-pointer
12999 @opindex mno-omit-leaf-frame-pointer
13000 Omit or keep the frame pointer in leaf functions.  The former behavior is the
13001 default.
13003 @item -mtls-dialect=desc
13004 @opindex mtls-dialect=desc
13005 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
13006 of TLS variables.  This is the default.
13008 @item -mtls-dialect=traditional
13009 @opindex mtls-dialect=traditional
13010 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
13011 of TLS variables.
13013 @item -mtls-size=@var{size}
13014 @opindex mtls-size
13015 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
13016 This option requires binutils 2.26 or newer.
13018 @item -mfix-cortex-a53-835769
13019 @itemx -mno-fix-cortex-a53-835769
13020 @opindex mfix-cortex-a53-835769
13021 @opindex mno-fix-cortex-a53-835769
13022 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
13023 This involves inserting a NOP instruction between memory instructions and
13024 64-bit integer multiply-accumulate instructions.
13026 @item -mfix-cortex-a53-843419
13027 @itemx -mno-fix-cortex-a53-843419
13028 @opindex mfix-cortex-a53-843419
13029 @opindex mno-fix-cortex-a53-843419
13030 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
13031 This erratum workaround is made at link time and this will only pass the
13032 corresponding flag to the linker.
13034 @item -mlow-precision-recip-sqrt
13035 @item -mno-low-precision-recip-sqrt
13036 @opindex mlow-precision-recip-sqrt
13037 @opindex mno-low-precision-recip-sqrt
13038 Enable or disable the reciprocal square root approximation.
13039 This option only has an effect if @option{-ffast-math} or
13040 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13041 precision of reciprocal square root results to about 16 bits for
13042 single precision and to 32 bits for double precision.
13044 @item -mlow-precision-sqrt
13045 @item -mno-low-precision-sqrt
13046 @opindex -mlow-precision-sqrt
13047 @opindex -mno-low-precision-sqrt
13048 Enable or disable the square root approximation.
13049 This option only has an effect if @option{-ffast-math} or
13050 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13051 precision of square root results to about 16 bits for
13052 single precision and to 32 bits for double precision.
13053 If enabled, it implies @option{-mlow-precision-recip-sqrt}.
13055 @item -mlow-precision-div
13056 @item -mno-low-precision-div
13057 @opindex -mlow-precision-div
13058 @opindex -mno-low-precision-div
13059 Enable or disable the division approximation.
13060 This option only has an effect if @option{-ffast-math} or
13061 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13062 precision of division results to about 16 bits for
13063 single precision and to 32 bits for double precision.
13065 @item -march=@var{name}
13066 @opindex march
13067 Specify the name of the target architecture and, optionally, one or
13068 more feature modifiers.  This option has the form
13069 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
13071 The permissible values for @var{arch} are @samp{armv8-a},
13072 @samp{armv8.1-a} or @var{native}.
13074 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
13075 support for the ARMv8.1 architecture extension.  In particular, it
13076 enables the @samp{+crc} and @samp{+lse} features.
13078 The value @samp{native} is available on native AArch64 GNU/Linux and
13079 causes the compiler to pick the architecture of the host system.  This
13080 option has no effect if the compiler is unable to recognize the
13081 architecture of the host system,
13083 The permissible values for @var{feature} are listed in the sub-section
13084 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13085 Feature Modifiers}.  Where conflicting feature modifiers are
13086 specified, the right-most feature is used.
13088 GCC uses @var{name} to determine what kind of instructions it can emit
13089 when generating assembly code.  If @option{-march} is specified
13090 without either of @option{-mtune} or @option{-mcpu} also being
13091 specified, the code is tuned to perform well across a range of target
13092 processors implementing the target architecture.
13094 @item -mtune=@var{name}
13095 @opindex mtune
13096 Specify the name of the target processor for which GCC should tune the
13097 performance of the code.  Permissible values for this option are:
13098 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
13099 @samp{cortex-a72}, @samp{cortex-a73}, @samp{exynos-m1}, @samp{qdf24xx},
13100 @samp{thunderx}, @samp{xgene1}, @samp{vulcan}, @samp{cortex-a57.cortex-a53},
13101 @samp{cortex-a72.cortex-a53}, @samp{cortex-a73.cortex-a35},
13102 @samp{cortex-a73.cortex-a53}, @samp{native}.
13104 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
13105 @samp{cortex-a73.cortex-a35}, @samp{cortex-a73.cortex-a53}
13106 specify that GCC should tune for a big.LITTLE system.
13108 Additionally on native AArch64 GNU/Linux systems the value
13109 @samp{native} tunes performance to the host system.  This option has no effect
13110 if the compiler is unable to recognize the processor of the host system.
13112 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
13113 are specified, the code is tuned to perform well across a range
13114 of target processors.
13116 This option cannot be suffixed by feature modifiers.
13118 @item -mcpu=@var{name}
13119 @opindex mcpu
13120 Specify the name of the target processor, optionally suffixed by one
13121 or more feature modifiers.  This option has the form
13122 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
13123 the permissible values for @var{cpu} are the same as those available
13124 for @option{-mtune}.  The permissible values for @var{feature} are
13125 documented in the sub-section on
13126 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13127 Feature Modifiers}.  Where conflicting feature modifiers are
13128 specified, the right-most feature is used.
13130 GCC uses @var{name} to determine what kind of instructions it can emit when
13131 generating assembly code (as if by @option{-march}) and to determine
13132 the target processor for which to tune for performance (as if
13133 by @option{-mtune}).  Where this option is used in conjunction
13134 with @option{-march} or @option{-mtune}, those options take precedence
13135 over the appropriate part of this option.
13137 @item -moverride=@var{string}
13138 @opindex moverride
13139 Override tuning decisions made by the back-end in response to a
13140 @option{-mtune=} switch.  The syntax, semantics, and accepted values
13141 for @var{string} in this option are not guaranteed to be consistent
13142 across releases.
13144 This option is only intended to be useful when developing GCC.
13146 @item -mpc-relative-literal-loads
13147 @opindex mpc-relative-literal-loads
13148 Enable PC-relative literal loads.  With this option literal pools are
13149 accessed using a single instruction and emitted after each function.  This
13150 limits the maximum size of functions to 1MB.  This is enabled by default for
13151 @option{-mcmodel=tiny}.
13153 @end table
13155 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
13156 @anchor{aarch64-feature-modifiers}
13157 @cindex @option{-march} feature modifiers
13158 @cindex @option{-mcpu} feature modifiers
13159 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
13160 the following and their inverses @option{no@var{feature}}:
13162 @table @samp
13163 @item crc
13164 Enable CRC extension.  This is on by default for
13165 @option{-march=armv8.1-a}.
13166 @item crypto
13167 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
13168 instructions.
13169 @item fp
13170 Enable floating-point instructions.  This is on by default for all possible
13171 values for options @option{-march} and @option{-mcpu}.
13172 @item simd
13173 Enable Advanced SIMD instructions.  This also enables floating-point
13174 instructions.  This is on by default for all possible values for options
13175 @option{-march} and @option{-mcpu}.
13176 @item lse
13177 Enable Large System Extension instructions.  This is on by default for
13178 @option{-march=armv8.1-a}.
13180 @end table
13182 Feature @option{crypto} implies @option{simd}, which implies @option{fp}.
13183 Conversely, @option{nofp} implies @option{nosimd}, which implies
13184 @option{nocrypto}.
13186 @node Adapteva Epiphany Options
13187 @subsection Adapteva Epiphany Options
13189 These @samp{-m} options are defined for Adapteva Epiphany:
13191 @table @gcctabopt
13192 @item -mhalf-reg-file
13193 @opindex mhalf-reg-file
13194 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
13195 That allows code to run on hardware variants that lack these registers.
13197 @item -mprefer-short-insn-regs
13198 @opindex mprefer-short-insn-regs
13199 Preferentially allocate registers that allow short instruction generation.
13200 This can result in increased instruction count, so this may either reduce or
13201 increase overall code size.
13203 @item -mbranch-cost=@var{num}
13204 @opindex mbranch-cost
13205 Set the cost of branches to roughly @var{num} ``simple'' instructions.
13206 This cost is only a heuristic and is not guaranteed to produce
13207 consistent results across releases.
13209 @item -mcmove
13210 @opindex mcmove
13211 Enable the generation of conditional moves.
13213 @item -mnops=@var{num}
13214 @opindex mnops
13215 Emit @var{num} NOPs before every other generated instruction.
13217 @item -mno-soft-cmpsf
13218 @opindex mno-soft-cmpsf
13219 For single-precision floating-point comparisons, emit an @code{fsub} instruction
13220 and test the flags.  This is faster than a software comparison, but can
13221 get incorrect results in the presence of NaNs, or when two different small
13222 numbers are compared such that their difference is calculated as zero.
13223 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
13224 software comparisons.
13226 @item -mstack-offset=@var{num}
13227 @opindex mstack-offset
13228 Set the offset between the top of the stack and the stack pointer.
13229 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
13230 can be used by leaf functions without stack allocation.
13231 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
13232 Note also that this option changes the ABI; compiling a program with a
13233 different stack offset than the libraries have been compiled with
13234 generally does not work.
13235 This option can be useful if you want to evaluate if a different stack
13236 offset would give you better code, but to actually use a different stack
13237 offset to build working programs, it is recommended to configure the
13238 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
13240 @item -mno-round-nearest
13241 @opindex mno-round-nearest
13242 Make the scheduler assume that the rounding mode has been set to
13243 truncating.  The default is @option{-mround-nearest}.
13245 @item -mlong-calls
13246 @opindex mlong-calls
13247 If not otherwise specified by an attribute, assume all calls might be beyond
13248 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
13249 function address into a register before performing a (otherwise direct) call.
13250 This is the default.
13252 @item -mshort-calls
13253 @opindex short-calls
13254 If not otherwise specified by an attribute, assume all direct calls are
13255 in the range of the @code{b} / @code{bl} instructions, so use these instructions
13256 for direct calls.  The default is @option{-mlong-calls}.
13258 @item -msmall16
13259 @opindex msmall16
13260 Assume addresses can be loaded as 16-bit unsigned values.  This does not
13261 apply to function addresses for which @option{-mlong-calls} semantics
13262 are in effect.
13264 @item -mfp-mode=@var{mode}
13265 @opindex mfp-mode
13266 Set the prevailing mode of the floating-point unit.
13267 This determines the floating-point mode that is provided and expected
13268 at function call and return time.  Making this mode match the mode you
13269 predominantly need at function start can make your programs smaller and
13270 faster by avoiding unnecessary mode switches.
13272 @var{mode} can be set to one the following values:
13274 @table @samp
13275 @item caller
13276 Any mode at function entry is valid, and retained or restored when
13277 the function returns, and when it calls other functions.
13278 This mode is useful for compiling libraries or other compilation units
13279 you might want to incorporate into different programs with different
13280 prevailing FPU modes, and the convenience of being able to use a single
13281 object file outweighs the size and speed overhead for any extra
13282 mode switching that might be needed, compared with what would be needed
13283 with a more specific choice of prevailing FPU mode.
13285 @item truncate
13286 This is the mode used for floating-point calculations with
13287 truncating (i.e.@: round towards zero) rounding mode.  That includes
13288 conversion from floating point to integer.
13290 @item round-nearest
13291 This is the mode used for floating-point calculations with
13292 round-to-nearest-or-even rounding mode.
13294 @item int
13295 This is the mode used to perform integer calculations in the FPU, e.g.@:
13296 integer multiply, or integer multiply-and-accumulate.
13297 @end table
13299 The default is @option{-mfp-mode=caller}
13301 @item -mnosplit-lohi
13302 @itemx -mno-postinc
13303 @itemx -mno-postmodify
13304 @opindex mnosplit-lohi
13305 @opindex mno-postinc
13306 @opindex mno-postmodify
13307 Code generation tweaks that disable, respectively, splitting of 32-bit
13308 loads, generation of post-increment addresses, and generation of
13309 post-modify addresses.  The defaults are @option{msplit-lohi},
13310 @option{-mpost-inc}, and @option{-mpost-modify}.
13312 @item -mnovect-double
13313 @opindex mno-vect-double
13314 Change the preferred SIMD mode to SImode.  The default is
13315 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
13317 @item -max-vect-align=@var{num}
13318 @opindex max-vect-align
13319 The maximum alignment for SIMD vector mode types.
13320 @var{num} may be 4 or 8.  The default is 8.
13321 Note that this is an ABI change, even though many library function
13322 interfaces are unaffected if they don't use SIMD vector modes
13323 in places that affect size and/or alignment of relevant types.
13325 @item -msplit-vecmove-early
13326 @opindex msplit-vecmove-early
13327 Split vector moves into single word moves before reload.  In theory this
13328 can give better register allocation, but so far the reverse seems to be
13329 generally the case.
13331 @item -m1reg-@var{reg}
13332 @opindex m1reg-
13333 Specify a register to hold the constant @minus{}1, which makes loading small negative
13334 constants and certain bitmasks faster.
13335 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
13336 which specify use of that register as a fixed register,
13337 and @samp{none}, which means that no register is used for this
13338 purpose.  The default is @option{-m1reg-none}.
13340 @end table
13342 @node ARC Options
13343 @subsection ARC Options
13344 @cindex ARC options
13346 The following options control the architecture variant for which code
13347 is being compiled:
13349 @c architecture variants
13350 @table @gcctabopt
13352 @item -mbarrel-shifter
13353 @opindex mbarrel-shifter
13354 Generate instructions supported by barrel shifter.  This is the default
13355 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
13357 @item -mcpu=@var{cpu}
13358 @opindex mcpu
13359 Set architecture type, register usage, and instruction scheduling
13360 parameters for @var{cpu}.  There are also shortcut alias options
13361 available for backward compatibility and convenience.  Supported
13362 values for @var{cpu} are
13364 @table @samp
13365 @opindex mA6
13366 @opindex mARC600
13367 @item ARC600
13368 @item arc600
13369 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
13371 @item ARC601
13372 @item arc601
13373 @opindex mARC601
13374 Compile for ARC601.  Alias: @option{-mARC601}.
13376 @item ARC700
13377 @item arc700
13378 @opindex mA7
13379 @opindex mARC700
13380 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
13381 This is the default when configured with @option{--with-cpu=arc700}@.
13383 @item ARCEM
13384 @item arcem
13385 Compile for ARC EM.
13387 @item ARCHS
13388 @item archs
13389 Compile for ARC HS.
13390 @end table
13392 @item -mdpfp
13393 @opindex mdpfp
13394 @itemx -mdpfp-compact
13395 @opindex mdpfp-compact
13396 FPX: Generate Double Precision FPX instructions, tuned for the compact
13397 implementation.
13399 @item -mdpfp-fast
13400 @opindex mdpfp-fast
13401 FPX: Generate Double Precision FPX instructions, tuned for the fast
13402 implementation.
13404 @item -mno-dpfp-lrsr
13405 @opindex mno-dpfp-lrsr
13406 Disable LR and SR instructions from using FPX extension aux registers.
13408 @item -mea
13409 @opindex mea
13410 Generate Extended arithmetic instructions.  Currently only
13411 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
13412 supported.  This is always enabled for @option{-mcpu=ARC700}.
13414 @item -mno-mpy
13415 @opindex mno-mpy
13416 Do not generate mpy instructions for ARC700.
13418 @item -mmul32x16
13419 @opindex mmul32x16
13420 Generate 32x16 bit multiply and mac instructions.
13422 @item -mmul64
13423 @opindex mmul64
13424 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
13426 @item -mnorm
13427 @opindex mnorm
13428 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
13429 is in effect.
13431 @item -mspfp
13432 @opindex mspfp
13433 @itemx -mspfp-compact
13434 @opindex mspfp-compact
13435 FPX: Generate Single Precision FPX instructions, tuned for the compact
13436 implementation.
13438 @item -mspfp-fast
13439 @opindex mspfp-fast
13440 FPX: Generate Single Precision FPX instructions, tuned for the fast
13441 implementation.
13443 @item -msimd
13444 @opindex msimd
13445 Enable generation of ARC SIMD instructions via target-specific
13446 builtins.  Only valid for @option{-mcpu=ARC700}.
13448 @item -msoft-float
13449 @opindex msoft-float
13450 This option ignored; it is provided for compatibility purposes only.
13451 Software floating point code is emitted by default, and this default
13452 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
13453 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
13454 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
13456 @item -mswap
13457 @opindex mswap
13458 Generate swap instructions.
13460 @item -matomic
13461 @opindex matomic
13462 This enables Locked Load/Store Conditional extension to implement
13463 atomic memopry built-in functions.  Not available for ARC 6xx or ARC
13464 EM cores.
13466 @item -mdiv-rem
13467 @opindex mdiv-rem
13468 Enable DIV/REM instructions for ARCv2 cores.
13470 @item -mcode-density
13471 @opindex mcode-density
13472 Enable code density instructions for ARC EM, default on for ARC HS.
13474 @item -mll64
13475 @opindex mll64
13476 Enable double load/store operations for ARC HS cores.
13478 @item -mtp-regno=@var{regno}
13479 @opindex mtp-regno
13480 Specify thread pointer register number.
13482 @item -mmpy-option=@var{multo}
13483 @opindex mmpy-option
13484 Compile ARCv2 code with a multiplier design option.  @samp{wlh1} is
13485 the default value.  The recognized values for @var{multo} are:
13487 @table @samp
13488 @item 0
13489 No multiplier available.
13491 @item 1
13492 @opindex w
13493 The multiply option is set to w: 16x16 multiplier, fully pipelined.
13494 The following instructions are enabled: MPYW, and MPYUW.
13496 @item 2
13497 @opindex wlh1
13498 The multiply option is set to wlh1: 32x32 multiplier, fully
13499 pipelined (1 stage).  The following instructions are additionally
13500 enabled: MPY, MPYU, MPYM, MPYMU, and MPY_S.
13502 @item 3
13503 @opindex wlh2
13504 The multiply option is set to wlh2: 32x32 multiplier, fully pipelined
13505 (2 stages).  The following instructions are additionally enabled: MPY,
13506 MPYU, MPYM, MPYMU, and MPY_S.
13508 @item 4
13509 @opindex wlh3
13510 The multiply option is set to wlh3: Two 16x16 multiplier, blocking,
13511 sequential.  The following instructions are additionally enabled: MPY,
13512 MPYU, MPYM, MPYMU, and MPY_S.
13514 @item 5
13515 @opindex wlh4
13516 The multiply option is set to wlh4: One 16x16 multiplier, blocking,
13517 sequential.  The following instructions are additionally enabled: MPY,
13518 MPYU, MPYM, MPYMU, and MPY_S.
13520 @item 6
13521 @opindex wlh5
13522 The multiply option is set to wlh5: One 32x4 multiplier, blocking,
13523 sequential.  The following instructions are additionally enabled: MPY,
13524 MPYU, MPYM, MPYMU, and MPY_S.
13526 @end table
13528 This option is only available for ARCv2 cores@.
13530 @item -mfpu=@var{fpu}
13531 @opindex mfpu
13532 Enables specific floating-point hardware extension for ARCv2
13533 core.  Supported values for @var{fpu} are:
13535 @table @samp
13537 @item fpus
13538 @opindex fpus
13539 Enables support for single precision floating point hardware
13540 extensions@.
13542 @item fpud
13543 @opindex fpud
13544 Enables support for double precision floating point hardware
13545 extensions.  The single precision floating point extension is also
13546 enabled.  Not available for ARC EM@.
13548 @item fpuda
13549 @opindex fpuda
13550 Enables support for double precision floating point hardware
13551 extensions using double precision assist instructions.  The single
13552 precision floating point extension is also enabled.  This option is
13553 only available for ARC EM@.
13555 @item fpuda_div
13556 @opindex fpuda_div
13557 Enables support for double precision floating point hardware
13558 extensions using double precision assist instructions, and simple
13559 precision square-root and divide hardware extensions.  The single
13560 precision floating point extension is also enabled.  This option is
13561 only available for ARC EM@.
13563 @item fpuda_fma
13564 @opindex fpuda_fma
13565 Enables support for double precision floating point hardware
13566 extensions using double precision assist instructions, and simple
13567 precision fused multiple and add hardware extension.  The single
13568 precision floating point extension is also enabled.  This option is
13569 only available for ARC EM@.
13571 @item fpuda_all
13572 @opindex fpuda_all
13573 Enables support for double precision floating point hardware
13574 extensions using double precision assist instructions, and all simple
13575 precision hardware extensions.  The single precision floating point
13576 extension is also enabled.  This option is only available for ARC EM@.
13578 @item fpus_div
13579 @opindex fpus_div
13580 Enables support for single precision floating point, and single
13581 precision square-root and divide hardware extensions@.
13583 @item fpud_div
13584 @opindex fpud_div
13585 Enables support for double precision floating point, and double
13586 precision square-root and divide hardware extensions.  This option
13587 includes option @samp{fpus_div}. Not available for ARC EM@.
13589 @item fpus_fma
13590 @opindex fpus_fma
13591 Enables support for single precision floating point, and single
13592 precision fused multiple and add hardware extensions@.
13594 @item fpud_fma
13595 @opindex fpud_fma
13596 Enables support for double precision floating point, and double
13597 precision fused multiple and add hardware extensions.  This option
13598 includes option @samp{fpus_fma}.  Not available for ARC EM@.
13600 @item fpus_all
13601 @opindex fpus_all
13602 Enables support for all single precision floating point hardware
13603 extensions@.
13605 @item fpud_all
13606 @opindex fpud_all
13607 Enables support for all single and double precision floating point
13608 hardware extensions.  Not available for ARC EM@.
13610 @end table
13612 @end table
13614 The following options are passed through to the assembler, and also
13615 define preprocessor macro symbols.
13617 @c Flags used by the assembler, but for which we define preprocessor
13618 @c macro symbols as well.
13619 @table @gcctabopt
13620 @item -mdsp-packa
13621 @opindex mdsp-packa
13622 Passed down to the assembler to enable the DSP Pack A extensions.
13623 Also sets the preprocessor symbol @code{__Xdsp_packa}.
13625 @item -mdvbf
13626 @opindex mdvbf
13627 Passed down to the assembler to enable the dual viterbi butterfly
13628 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
13630 @c ARC700 4.10 extension instruction
13631 @item -mlock
13632 @opindex mlock
13633 Passed down to the assembler to enable the Locked Load/Store
13634 Conditional extension.  Also sets the preprocessor symbol
13635 @code{__Xlock}.
13637 @item -mmac-d16
13638 @opindex mmac-d16
13639 Passed down to the assembler.  Also sets the preprocessor symbol
13640 @code{__Xxmac_d16}.
13642 @item -mmac-24
13643 @opindex mmac-24
13644 Passed down to the assembler.  Also sets the preprocessor symbol
13645 @code{__Xxmac_24}.
13647 @c ARC700 4.10 extension instruction
13648 @item -mrtsc
13649 @opindex mrtsc
13650 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
13651 extension instruction.  Also sets the preprocessor symbol
13652 @code{__Xrtsc}.
13654 @c ARC700 4.10 extension instruction
13655 @item -mswape
13656 @opindex mswape
13657 Passed down to the assembler to enable the swap byte ordering
13658 extension instruction.  Also sets the preprocessor symbol
13659 @code{__Xswape}.
13661 @item -mtelephony
13662 @opindex mtelephony
13663 Passed down to the assembler to enable dual and single operand
13664 instructions for telephony.  Also sets the preprocessor symbol
13665 @code{__Xtelephony}.
13667 @item -mxy
13668 @opindex mxy
13669 Passed down to the assembler to enable the XY Memory extension.  Also
13670 sets the preprocessor symbol @code{__Xxy}.
13672 @end table
13674 The following options control how the assembly code is annotated:
13676 @c Assembly annotation options
13677 @table @gcctabopt
13678 @item -misize
13679 @opindex misize
13680 Annotate assembler instructions with estimated addresses.
13682 @item -mannotate-align
13683 @opindex mannotate-align
13684 Explain what alignment considerations lead to the decision to make an
13685 instruction short or long.
13687 @end table
13689 The following options are passed through to the linker:
13691 @c options passed through to the linker
13692 @table @gcctabopt
13693 @item -marclinux
13694 @opindex marclinux
13695 Passed through to the linker, to specify use of the @code{arclinux} emulation.
13696 This option is enabled by default in tool chains built for
13697 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
13698 when profiling is not requested.
13700 @item -marclinux_prof
13701 @opindex marclinux_prof
13702 Passed through to the linker, to specify use of the
13703 @code{arclinux_prof} emulation.  This option is enabled by default in
13704 tool chains built for @w{@code{arc-linux-uclibc}} and
13705 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
13707 @end table
13709 The following options control the semantics of generated code:
13711 @c semantically relevant code generation options
13712 @table @gcctabopt
13713 @item -mlong-calls
13714 @opindex mlong-calls
13715 Generate call insns as register indirect calls, thus providing access
13716 to the full 32-bit address range.
13718 @item -mmedium-calls
13719 @opindex mmedium-calls
13720 Don't use less than 25 bit addressing range for calls, which is the
13721 offset available for an unconditional branch-and-link
13722 instruction.  Conditional execution of function calls is suppressed, to
13723 allow use of the 25-bit range, rather than the 21-bit range with
13724 conditional branch-and-link.  This is the default for tool chains built
13725 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
13727 @item -mno-sdata
13728 @opindex mno-sdata
13729 Do not generate sdata references.  This is the default for tool chains
13730 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
13731 targets.
13733 @item -mucb-mcount
13734 @opindex mucb-mcount
13735 Instrument with mcount calls as used in UCB code.  I.e. do the
13736 counting in the callee, not the caller.  By default ARC instrumentation
13737 counts in the caller.
13739 @item -mvolatile-cache
13740 @opindex mvolatile-cache
13741 Use ordinarily cached memory accesses for volatile references.  This is the
13742 default.
13744 @item -mno-volatile-cache
13745 @opindex mno-volatile-cache
13746 Enable cache bypass for volatile references.
13748 @end table
13750 The following options fine tune code generation:
13751 @c code generation tuning options
13752 @table @gcctabopt
13753 @item -malign-call
13754 @opindex malign-call
13755 Do alignment optimizations for call instructions.
13757 @item -mauto-modify-reg
13758 @opindex mauto-modify-reg
13759 Enable the use of pre/post modify with register displacement.
13761 @item -mbbit-peephole
13762 @opindex mbbit-peephole
13763 Enable bbit peephole2.
13765 @item -mno-brcc
13766 @opindex mno-brcc
13767 This option disables a target-specific pass in @file{arc_reorg} to
13768 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
13769 generation driven by the combiner pass.
13771 @item -mcase-vector-pcrel
13772 @opindex mcase-vector-pcrel
13773 Use pc-relative switch case tables - this enables case table shortening.
13774 This is the default for @option{-Os}.
13776 @item -mcompact-casesi
13777 @opindex mcompact-casesi
13778 Enable compact casesi pattern.
13779 This is the default for @option{-Os}.
13781 @item -mno-cond-exec
13782 @opindex mno-cond-exec
13783 Disable ARCompact specific pass to generate conditional execution instructions.
13784 Due to delay slot scheduling and interactions between operand numbers,
13785 literal sizes, instruction lengths, and the support for conditional execution,
13786 the target-independent pass to generate conditional execution is often lacking,
13787 so the ARC port has kept a special pass around that tries to find more
13788 conditional execution generating opportunities after register allocation,
13789 branch shortening, and delay slot scheduling have been done.  This pass
13790 generally, but not always, improves performance and code size, at the cost of
13791 extra compilation time, which is why there is an option to switch it off.
13792 If you have a problem with call instructions exceeding their allowable
13793 offset range because they are conditionalized, you should consider using
13794 @option{-mmedium-calls} instead.
13796 @item -mearly-cbranchsi
13797 @opindex mearly-cbranchsi
13798 Enable pre-reload use of the cbranchsi pattern.
13800 @item -mexpand-adddi
13801 @opindex mexpand-adddi
13802 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
13803 @code{add.f}, @code{adc} etc.
13805 @item -mindexed-loads
13806 @opindex mindexed-loads
13807 Enable the use of indexed loads.  This can be problematic because some
13808 optimizers then assume that indexed stores exist, which is not
13809 the case.
13811 @opindex mlra
13812 Enable Local Register Allocation.  This is still experimental for ARC,
13813 so by default the compiler uses standard reload
13814 (i.e. @option{-mno-lra}).
13816 @item -mlra-priority-none
13817 @opindex mlra-priority-none
13818 Don't indicate any priority for target registers.
13820 @item -mlra-priority-compact
13821 @opindex mlra-priority-compact
13822 Indicate target register priority for r0..r3 / r12..r15.
13824 @item -mlra-priority-noncompact
13825 @opindex mlra-priority-noncompact
13826 Reduce target register priority for r0..r3 / r12..r15.
13828 @item -mno-millicode
13829 @opindex mno-millicode
13830 When optimizing for size (using @option{-Os}), prologues and epilogues
13831 that have to save or restore a large number of registers are often
13832 shortened by using call to a special function in libgcc; this is
13833 referred to as a @emph{millicode} call.  As these calls can pose
13834 performance issues, and/or cause linking issues when linking in a
13835 nonstandard way, this option is provided to turn off millicode call
13836 generation.
13838 @item -mmixed-code
13839 @opindex mmixed-code
13840 Tweak register allocation to help 16-bit instruction generation.
13841 This generally has the effect of decreasing the average instruction size
13842 while increasing the instruction count.
13844 @item -mq-class
13845 @opindex mq-class
13846 Enable 'q' instruction alternatives.
13847 This is the default for @option{-Os}.
13849 @item -mRcq
13850 @opindex mRcq
13851 Enable Rcq constraint handling - most short code generation depends on this.
13852 This is the default.
13854 @item -mRcw
13855 @opindex mRcw
13856 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
13857 This is the default.
13859 @item -msize-level=@var{level}
13860 @opindex msize-level
13861 Fine-tune size optimization with regards to instruction lengths and alignment.
13862 The recognized values for @var{level} are:
13863 @table @samp
13864 @item 0
13865 No size optimization.  This level is deprecated and treated like @samp{1}.
13867 @item 1
13868 Short instructions are used opportunistically.
13870 @item 2
13871 In addition, alignment of loops and of code after barriers are dropped.
13873 @item 3
13874 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
13876 @end table
13878 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
13879 the behavior when this is not set is equivalent to level @samp{1}.
13881 @item -mtune=@var{cpu}
13882 @opindex mtune
13883 Set instruction scheduling parameters for @var{cpu}, overriding any implied
13884 by @option{-mcpu=}.
13886 Supported values for @var{cpu} are
13888 @table @samp
13889 @item ARC600
13890 Tune for ARC600 cpu.
13892 @item ARC601
13893 Tune for ARC601 cpu.
13895 @item ARC700
13896 Tune for ARC700 cpu with standard multiplier block.
13898 @item ARC700-xmac
13899 Tune for ARC700 cpu with XMAC block.
13901 @item ARC725D
13902 Tune for ARC725D cpu.
13904 @item ARC750D
13905 Tune for ARC750D cpu.
13907 @end table
13909 @item -mmultcost=@var{num}
13910 @opindex mmultcost
13911 Cost to assume for a multiply instruction, with @samp{4} being equal to a
13912 normal instruction.
13914 @item -munalign-prob-threshold=@var{probability}
13915 @opindex munalign-prob-threshold
13916 Set probability threshold for unaligning branches.
13917 When tuning for @samp{ARC700} and optimizing for speed, branches without
13918 filled delay slot are preferably emitted unaligned and long, unless
13919 profiling indicates that the probability for the branch to be taken
13920 is below @var{probability}.  @xref{Cross-profiling}.
13921 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
13923 @end table
13925 The following options are maintained for backward compatibility, but
13926 are now deprecated and will be removed in a future release:
13928 @c Deprecated options
13929 @table @gcctabopt
13931 @item -margonaut
13932 @opindex margonaut
13933 Obsolete FPX.
13935 @item -mbig-endian
13936 @opindex mbig-endian
13937 @itemx -EB
13938 @opindex EB
13939 Compile code for big endian targets.  Use of these options is now
13940 deprecated.  Users wanting big-endian code, should use the
13941 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
13942 building the tool chain, for which big-endian is the default.
13944 @item -mlittle-endian
13945 @opindex mlittle-endian
13946 @itemx -EL
13947 @opindex EL
13948 Compile code for little endian targets.  Use of these options is now
13949 deprecated.  Users wanting little-endian code should use the
13950 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
13951 building the tool chain, for which little-endian is the default.
13953 @item -mbarrel_shifter
13954 @opindex mbarrel_shifter
13955 Replaced by @option{-mbarrel-shifter}.
13957 @item -mdpfp_compact
13958 @opindex mdpfp_compact
13959 Replaced by @option{-mdpfp-compact}.
13961 @item -mdpfp_fast
13962 @opindex mdpfp_fast
13963 Replaced by @option{-mdpfp-fast}.
13965 @item -mdsp_packa
13966 @opindex mdsp_packa
13967 Replaced by @option{-mdsp-packa}.
13969 @item -mEA
13970 @opindex mEA
13971 Replaced by @option{-mea}.
13973 @item -mmac_24
13974 @opindex mmac_24
13975 Replaced by @option{-mmac-24}.
13977 @item -mmac_d16
13978 @opindex mmac_d16
13979 Replaced by @option{-mmac-d16}.
13981 @item -mspfp_compact
13982 @opindex mspfp_compact
13983 Replaced by @option{-mspfp-compact}.
13985 @item -mspfp_fast
13986 @opindex mspfp_fast
13987 Replaced by @option{-mspfp-fast}.
13989 @item -mtune=@var{cpu}
13990 @opindex mtune
13991 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
13992 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
13993 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
13995 @item -multcost=@var{num}
13996 @opindex multcost
13997 Replaced by @option{-mmultcost}.
13999 @end table
14001 @node ARM Options
14002 @subsection ARM Options
14003 @cindex ARM options
14005 These @samp{-m} options are defined for the ARM port:
14007 @table @gcctabopt
14008 @item -mabi=@var{name}
14009 @opindex mabi
14010 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
14011 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
14013 @item -mapcs-frame
14014 @opindex mapcs-frame
14015 Generate a stack frame that is compliant with the ARM Procedure Call
14016 Standard for all functions, even if this is not strictly necessary for
14017 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
14018 with this option causes the stack frames not to be generated for
14019 leaf functions.  The default is @option{-mno-apcs-frame}.
14020 This option is deprecated.
14022 @item -mapcs
14023 @opindex mapcs
14024 This is a synonym for @option{-mapcs-frame} and is deprecated.
14026 @ignore
14027 @c not currently implemented
14028 @item -mapcs-stack-check
14029 @opindex mapcs-stack-check
14030 Generate code to check the amount of stack space available upon entry to
14031 every function (that actually uses some stack space).  If there is
14032 insufficient space available then either the function
14033 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
14034 called, depending upon the amount of stack space required.  The runtime
14035 system is required to provide these functions.  The default is
14036 @option{-mno-apcs-stack-check}, since this produces smaller code.
14038 @c not currently implemented
14039 @item -mapcs-float
14040 @opindex mapcs-float
14041 Pass floating-point arguments using the floating-point registers.  This is
14042 one of the variants of the APCS@.  This option is recommended if the
14043 target hardware has a floating-point unit or if a lot of floating-point
14044 arithmetic is going to be performed by the code.  The default is
14045 @option{-mno-apcs-float}, since the size of integer-only code is 
14046 slightly increased if @option{-mapcs-float} is used.
14048 @c not currently implemented
14049 @item -mapcs-reentrant
14050 @opindex mapcs-reentrant
14051 Generate reentrant, position-independent code.  The default is
14052 @option{-mno-apcs-reentrant}.
14053 @end ignore
14055 @item -mthumb-interwork
14056 @opindex mthumb-interwork
14057 Generate code that supports calling between the ARM and Thumb
14058 instruction sets.  Without this option, on pre-v5 architectures, the
14059 two instruction sets cannot be reliably used inside one program.  The
14060 default is @option{-mno-thumb-interwork}, since slightly larger code
14061 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
14062 configurations this option is meaningless.
14064 @item -mno-sched-prolog
14065 @opindex mno-sched-prolog
14066 Prevent the reordering of instructions in the function prologue, or the
14067 merging of those instruction with the instructions in the function's
14068 body.  This means that all functions start with a recognizable set
14069 of instructions (or in fact one of a choice from a small set of
14070 different function prologues), and this information can be used to
14071 locate the start of functions inside an executable piece of code.  The
14072 default is @option{-msched-prolog}.
14074 @item -mfloat-abi=@var{name}
14075 @opindex mfloat-abi
14076 Specifies which floating-point ABI to use.  Permissible values
14077 are: @samp{soft}, @samp{softfp} and @samp{hard}.
14079 Specifying @samp{soft} causes GCC to generate output containing
14080 library calls for floating-point operations.
14081 @samp{softfp} allows the generation of code using hardware floating-point
14082 instructions, but still uses the soft-float calling conventions.
14083 @samp{hard} allows generation of floating-point instructions
14084 and uses FPU-specific calling conventions.
14086 The default depends on the specific target configuration.  Note that
14087 the hard-float and soft-float ABIs are not link-compatible; you must
14088 compile your entire program with the same ABI, and link with a
14089 compatible set of libraries.
14091 @item -mlittle-endian
14092 @opindex mlittle-endian
14093 Generate code for a processor running in little-endian mode.  This is
14094 the default for all standard configurations.
14096 @item -mbig-endian
14097 @opindex mbig-endian
14098 Generate code for a processor running in big-endian mode; the default is
14099 to compile code for a little-endian processor.
14101 @item -march=@var{name}
14102 @opindex march
14103 This specifies the name of the target ARM architecture.  GCC uses this
14104 name to determine what kind of instructions it can emit when generating
14105 assembly code.  This option can be used in conjunction with or instead
14106 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
14107 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
14108 @samp{armv5}, @samp{armv5e}, @samp{armv5t}, @samp{armv5te},
14109 @samp{armv6}, @samp{armv6-m}, @samp{armv6j}, @samp{armv6k},
14110 @samp{armv6kz}, @samp{armv6s-m},
14111 @samp{armv6t2}, @samp{armv6z}, @samp{armv6zk},
14112 @samp{armv7}, @samp{armv7-a}, @samp{armv7-m}, @samp{armv7-r}, @samp{armv7e-m},
14113 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc}, @samp{armv8.1-a},
14114 @samp{armv8.1-a+crc}, @samp{iwmmxt}, @samp{iwmmxt2}.
14116 Architecture revisions older than @samp{armv4t} are deprecated.
14118 @option{-march=armv6s-m} is the @samp{armv6-m} architecture with support for
14119 the (now mandatory) SVC instruction.
14121 @option{-march=armv6zk} is an alias for @samp{armv6kz}, existing for backwards
14122 compatibility.
14124 @option{-march=armv7ve} is the @samp{armv7-a} architecture with virtualization
14125 extensions.
14127 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
14128 architecture together with the optional CRC32 extensions.
14130 @option{-march=native} causes the compiler to auto-detect the architecture
14131 of the build computer.  At present, this feature is only supported on
14132 GNU/Linux, and not all architectures are recognized.  If the auto-detect
14133 is unsuccessful the option has no effect.
14135 @item -mtune=@var{name}
14136 @opindex mtune
14137 This option specifies the name of the target ARM processor for
14138 which GCC should tune the performance of the code.
14139 For some ARM implementations better performance can be obtained by using
14140 this option.
14141 Permissible names are: @samp{arm2}, @samp{arm250},
14142 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
14143 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
14144 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
14145 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
14146 @samp{arm720},
14147 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
14148 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
14149 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
14150 @samp{strongarm1110},
14151 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
14152 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
14153 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
14154 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
14155 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
14156 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
14157 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
14158 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
14159 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
14160 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
14161 @samp{cortex-a72}, @samp{cortex-a73}, @samp{cortex-r4},
14162 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
14163 @samp{cortex-m7},
14164 @samp{cortex-m4},
14165 @samp{cortex-m3},
14166 @samp{cortex-m1},
14167 @samp{cortex-m0},
14168 @samp{cortex-m0plus},
14169 @samp{cortex-m1.small-multiply},
14170 @samp{cortex-m0.small-multiply},
14171 @samp{cortex-m0plus.small-multiply},
14172 @samp{exynos-m1},
14173 @samp{qdf24xx},
14174 @samp{marvell-pj4},
14175 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
14176 @samp{fa526}, @samp{fa626},
14177 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
14178 @samp{xgene1}.
14180 Additionally, this option can specify that GCC should tune the performance
14181 of the code for a big.LITTLE system.  Permissible names are:
14182 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
14183 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
14184 @samp{cortex-a72.cortex-a35}, @samp{cortex-a73.cortex-a53}.
14186 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
14187 performance for a blend of processors within architecture @var{arch}.
14188 The aim is to generate code that run well on the current most popular
14189 processors, balancing between optimizations that benefit some CPUs in the
14190 range, and avoiding performance pitfalls of other CPUs.  The effects of
14191 this option may change in future GCC versions as CPU models come and go.
14193 @option{-mtune=native} causes the compiler to auto-detect the CPU
14194 of the build computer.  At present, this feature is only supported on
14195 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
14196 unsuccessful the option has no effect.
14198 @item -mcpu=@var{name}
14199 @opindex mcpu
14200 This specifies the name of the target ARM processor.  GCC uses this name
14201 to derive the name of the target ARM architecture (as if specified
14202 by @option{-march}) and the ARM processor type for which to tune for
14203 performance (as if specified by @option{-mtune}).  Where this option
14204 is used in conjunction with @option{-march} or @option{-mtune},
14205 those options take precedence over the appropriate part of this option.
14207 Permissible names for this option are the same as those for
14208 @option{-mtune}.
14210 @option{-mcpu=generic-@var{arch}} is also permissible, and is
14211 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
14212 See @option{-mtune} for more information.
14214 @option{-mcpu=native} causes the compiler to auto-detect the CPU
14215 of the build computer.  At present, this feature is only supported on
14216 GNU/Linux, and not all architectures are recognized.  If the auto-detect
14217 is unsuccessful the option has no effect.
14219 @item -mfpu=@var{name}
14220 @opindex mfpu
14221 This specifies what floating-point hardware (or hardware emulation) is
14222 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
14223 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
14224 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
14225 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
14226 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
14227 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
14229 If @option{-msoft-float} is specified this specifies the format of
14230 floating-point values.
14232 If the selected floating-point hardware includes the NEON extension
14233 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
14234 operations are not generated by GCC's auto-vectorization pass unless
14235 @option{-funsafe-math-optimizations} is also specified.  This is
14236 because NEON hardware does not fully implement the IEEE 754 standard for
14237 floating-point arithmetic (in particular denormal values are treated as
14238 zero), so the use of NEON instructions may lead to a loss of precision.
14240 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}).
14242 @item -mfp16-format=@var{name}
14243 @opindex mfp16-format
14244 Specify the format of the @code{__fp16} half-precision floating-point type.
14245 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
14246 the default is @samp{none}, in which case the @code{__fp16} type is not
14247 defined.  @xref{Half-Precision}, for more information.
14249 @item -mstructure-size-boundary=@var{n}
14250 @opindex mstructure-size-boundary
14251 The sizes of all structures and unions are rounded up to a multiple
14252 of the number of bits set by this option.  Permissible values are 8, 32
14253 and 64.  The default value varies for different toolchains.  For the COFF
14254 targeted toolchain the default value is 8.  A value of 64 is only allowed
14255 if the underlying ABI supports it.
14257 Specifying a larger number can produce faster, more efficient code, but
14258 can also increase the size of the program.  Different values are potentially
14259 incompatible.  Code compiled with one value cannot necessarily expect to
14260 work with code or libraries compiled with another value, if they exchange
14261 information using structures or unions.
14263 @item -mabort-on-noreturn
14264 @opindex mabort-on-noreturn
14265 Generate a call to the function @code{abort} at the end of a
14266 @code{noreturn} function.  It is executed if the function tries to
14267 return.
14269 @item -mlong-calls
14270 @itemx -mno-long-calls
14271 @opindex mlong-calls
14272 @opindex mno-long-calls
14273 Tells the compiler to perform function calls by first loading the
14274 address of the function into a register and then performing a subroutine
14275 call on this register.  This switch is needed if the target function
14276 lies outside of the 64-megabyte addressing range of the offset-based
14277 version of subroutine call instruction.
14279 Even if this switch is enabled, not all function calls are turned
14280 into long calls.  The heuristic is that static functions, functions
14281 that have the @code{short_call} attribute, functions that are inside
14282 the scope of a @code{#pragma no_long_calls} directive, and functions whose
14283 definitions have already been compiled within the current compilation
14284 unit are not turned into long calls.  The exceptions to this rule are
14285 that weak function definitions, functions with the @code{long_call}
14286 attribute or the @code{section} attribute, and functions that are within
14287 the scope of a @code{#pragma long_calls} directive are always
14288 turned into long calls.
14290 This feature is not enabled by default.  Specifying
14291 @option{-mno-long-calls} restores the default behavior, as does
14292 placing the function calls within the scope of a @code{#pragma
14293 long_calls_off} directive.  Note these switches have no effect on how
14294 the compiler generates code to handle function calls via function
14295 pointers.
14297 @item -msingle-pic-base
14298 @opindex msingle-pic-base
14299 Treat the register used for PIC addressing as read-only, rather than
14300 loading it in the prologue for each function.  The runtime system is
14301 responsible for initializing this register with an appropriate value
14302 before execution begins.
14304 @item -mpic-register=@var{reg}
14305 @opindex mpic-register
14306 Specify the register to be used for PIC addressing.
14307 For standard PIC base case, the default is any suitable register
14308 determined by compiler.  For single PIC base case, the default is
14309 @samp{R9} if target is EABI based or stack-checking is enabled,
14310 otherwise the default is @samp{R10}.
14312 @item -mpic-data-is-text-relative
14313 @opindex mpic-data-is-text-relative
14314 Assume that each data segments are relative to text segment at load time.
14315 Therefore, it permits addressing data using PC-relative operations.
14316 This option is on by default for targets other than VxWorks RTP.
14318 @item -mpoke-function-name
14319 @opindex mpoke-function-name
14320 Write the name of each function into the text section, directly
14321 preceding the function prologue.  The generated code is similar to this:
14323 @smallexample
14324      t0
14325          .ascii "arm_poke_function_name", 0
14326          .align
14327      t1
14328          .word 0xff000000 + (t1 - t0)
14329      arm_poke_function_name
14330          mov     ip, sp
14331          stmfd   sp!, @{fp, ip, lr, pc@}
14332          sub     fp, ip, #4
14333 @end smallexample
14335 When performing a stack backtrace, code can inspect the value of
14336 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
14337 location @code{pc - 12} and the top 8 bits are set, then we know that
14338 there is a function name embedded immediately preceding this location
14339 and has length @code{((pc[-3]) & 0xff000000)}.
14341 @item -mthumb
14342 @itemx -marm
14343 @opindex marm
14344 @opindex mthumb
14346 Select between generating code that executes in ARM and Thumb
14347 states.  The default for most configurations is to generate code
14348 that executes in ARM state, but the default can be changed by
14349 configuring GCC with the @option{--with-mode=}@var{state}
14350 configure option.
14352 You can also override the ARM and Thumb mode for each function
14353 by using the @code{target("thumb")} and @code{target("arm")} function attributes
14354 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
14356 @item -mtpcs-frame
14357 @opindex mtpcs-frame
14358 Generate a stack frame that is compliant with the Thumb Procedure Call
14359 Standard for all non-leaf functions.  (A leaf function is one that does
14360 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
14362 @item -mtpcs-leaf-frame
14363 @opindex mtpcs-leaf-frame
14364 Generate a stack frame that is compliant with the Thumb Procedure Call
14365 Standard for all leaf functions.  (A leaf function is one that does
14366 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
14368 @item -mcallee-super-interworking
14369 @opindex mcallee-super-interworking
14370 Gives all externally visible functions in the file being compiled an ARM
14371 instruction set header which switches to Thumb mode before executing the
14372 rest of the function.  This allows these functions to be called from
14373 non-interworking code.  This option is not valid in AAPCS configurations
14374 because interworking is enabled by default.
14376 @item -mcaller-super-interworking
14377 @opindex mcaller-super-interworking
14378 Allows calls via function pointers (including virtual functions) to
14379 execute correctly regardless of whether the target code has been
14380 compiled for interworking or not.  There is a small overhead in the cost
14381 of executing a function pointer if this option is enabled.  This option
14382 is not valid in AAPCS configurations because interworking is enabled
14383 by default.
14385 @item -mtp=@var{name}
14386 @opindex mtp
14387 Specify the access model for the thread local storage pointer.  The valid
14388 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
14389 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
14390 (supported in the arm6k architecture), and @samp{auto}, which uses the
14391 best available method for the selected processor.  The default setting is
14392 @samp{auto}.
14394 @item -mtls-dialect=@var{dialect}
14395 @opindex mtls-dialect
14396 Specify the dialect to use for accessing thread local storage.  Two
14397 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
14398 @samp{gnu} dialect selects the original GNU scheme for supporting
14399 local and global dynamic TLS models.  The @samp{gnu2} dialect
14400 selects the GNU descriptor scheme, which provides better performance
14401 for shared libraries.  The GNU descriptor scheme is compatible with
14402 the original scheme, but does require new assembler, linker and
14403 library support.  Initial and local exec TLS models are unaffected by
14404 this option and always use the original scheme.
14406 @item -mword-relocations
14407 @opindex mword-relocations
14408 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
14409 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
14410 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
14411 is specified.
14413 @item -mfix-cortex-m3-ldrd
14414 @opindex mfix-cortex-m3-ldrd
14415 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
14416 with overlapping destination and base registers are used.  This option avoids
14417 generating these instructions.  This option is enabled by default when
14418 @option{-mcpu=cortex-m3} is specified.
14420 @item -munaligned-access
14421 @itemx -mno-unaligned-access
14422 @opindex munaligned-access
14423 @opindex mno-unaligned-access
14424 Enables (or disables) reading and writing of 16- and 32- bit values
14425 from addresses that are not 16- or 32- bit aligned.  By default
14426 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
14427 architectures, and enabled for all other architectures.  If unaligned
14428 access is not enabled then words in packed data structures are
14429 accessed a byte at a time.
14431 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
14432 generated object file to either true or false, depending upon the
14433 setting of this option.  If unaligned access is enabled then the
14434 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
14435 defined.
14437 @item -mneon-for-64bits
14438 @opindex mneon-for-64bits
14439 Enables using Neon to handle scalar 64-bits operations. This is
14440 disabled by default since the cost of moving data from core registers
14441 to Neon is high.
14443 @item -mslow-flash-data
14444 @opindex mslow-flash-data
14445 Assume loading data from flash is slower than fetching instruction.
14446 Therefore literal load is minimized for better performance.
14447 This option is only supported when compiling for ARMv7 M-profile and
14448 off by default.
14450 @item -masm-syntax-unified
14451 @opindex masm-syntax-unified
14452 Assume inline assembler is using unified asm syntax.  The default is
14453 currently off which implies divided syntax.  This option has no impact
14454 on Thumb2. However, this may change in future releases of GCC.
14455 Divided syntax should be considered deprecated.
14457 @item -mrestrict-it
14458 @opindex mrestrict-it
14459 Restricts generation of IT blocks to conform to the rules of ARMv8.
14460 IT blocks can only contain a single 16-bit instruction from a select
14461 set of instructions. This option is on by default for ARMv8 Thumb mode.
14463 @item -mprint-tune-info
14464 @opindex mprint-tune-info
14465 Print CPU tuning information as comment in assembler file.  This is
14466 an option used only for regression testing of the compiler and not
14467 intended for ordinary use in compiling code.  This option is disabled
14468 by default.
14469 @end table
14471 @node AVR Options
14472 @subsection AVR Options
14473 @cindex AVR Options
14475 These options are defined for AVR implementations:
14477 @table @gcctabopt
14478 @item -mmcu=@var{mcu}
14479 @opindex mmcu
14480 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
14482 The default for this option is@tie{}@samp{avr2}.
14484 GCC supports the following AVR devices and ISAs:
14486 @include avr-mmcu.texi
14488 @item -maccumulate-args
14489 @opindex maccumulate-args
14490 Accumulate outgoing function arguments and acquire/release the needed
14491 stack space for outgoing function arguments once in function
14492 prologue/epilogue.  Without this option, outgoing arguments are pushed
14493 before calling a function and popped afterwards.
14495 Popping the arguments after the function call can be expensive on
14496 AVR so that accumulating the stack space might lead to smaller
14497 executables because arguments need not to be removed from the
14498 stack after such a function call.
14500 This option can lead to reduced code size for functions that perform
14501 several calls to functions that get their arguments on the stack like
14502 calls to printf-like functions.
14504 @item -mbranch-cost=@var{cost}
14505 @opindex mbranch-cost
14506 Set the branch costs for conditional branch instructions to
14507 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
14508 integers. The default branch cost is 0.
14510 @item -mcall-prologues
14511 @opindex mcall-prologues
14512 Functions prologues/epilogues are expanded as calls to appropriate
14513 subroutines.  Code size is smaller.
14515 @item -mint8
14516 @opindex mint8
14517 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
14518 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
14519 and @code{long long} is 4 bytes.  Please note that this option does not
14520 conform to the C standards, but it results in smaller code
14521 size.
14523 @item -mn-flash=@var{num}
14524 @opindex mn-flash
14525 Assume that the flash memory has a size of 
14526 @var{num} times 64@tie{}KiB.
14528 @item -mno-interrupts
14529 @opindex mno-interrupts
14530 Generated code is not compatible with hardware interrupts.
14531 Code size is smaller.
14533 @item -mrelax
14534 @opindex mrelax
14535 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
14536 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
14537 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
14538 the assembler's command line and the @option{--relax} option to the
14539 linker's command line.
14541 Jump relaxing is performed by the linker because jump offsets are not
14542 known before code is located. Therefore, the assembler code generated by the
14543 compiler is the same, but the instructions in the executable may
14544 differ from instructions in the assembler code.
14546 Relaxing must be turned on if linker stubs are needed, see the
14547 section on @code{EIND} and linker stubs below.
14549 @item -mrmw
14550 @opindex mrmw
14551 Assume that the device supports the Read-Modify-Write
14552 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
14554 @item -msp8
14555 @opindex msp8
14556 Treat the stack pointer register as an 8-bit register,
14557 i.e.@: assume the high byte of the stack pointer is zero.
14558 In general, you don't need to set this option by hand.
14560 This option is used internally by the compiler to select and
14561 build multilibs for architectures @code{avr2} and @code{avr25}.
14562 These architectures mix devices with and without @code{SPH}.
14563 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
14564 the compiler driver adds or removes this option from the compiler
14565 proper's command line, because the compiler then knows if the device
14566 or architecture has an 8-bit stack pointer and thus no @code{SPH}
14567 register or not.
14569 @item -mstrict-X
14570 @opindex mstrict-X
14571 Use address register @code{X} in a way proposed by the hardware.  This means
14572 that @code{X} is only used in indirect, post-increment or
14573 pre-decrement addressing.
14575 Without this option, the @code{X} register may be used in the same way
14576 as @code{Y} or @code{Z} which then is emulated by additional
14577 instructions.  
14578 For example, loading a value with @code{X+const} addressing with a
14579 small non-negative @code{const < 64} to a register @var{Rn} is
14580 performed as
14582 @example
14583 adiw r26, const   ; X += const
14584 ld   @var{Rn}, X        ; @var{Rn} = *X
14585 sbiw r26, const   ; X -= const
14586 @end example
14588 @item -mtiny-stack
14589 @opindex mtiny-stack
14590 Only change the lower 8@tie{}bits of the stack pointer.
14592 @item -nodevicelib
14593 @opindex nodevicelib
14594 Don't link against AVR-LibC's device specific library @code{lib<mcu>.a}.
14596 @item -Waddr-space-convert
14597 @opindex Waddr-space-convert
14598 Warn about conversions between address spaces in the case where the
14599 resulting address space is not contained in the incoming address space.
14601 @item -Wmisspelled-isr
14602 @opindex Wmisspelled-isr
14603 Warn if the ISR is misspelled, i.e. without __vector prefix.
14604 Enabled by default.
14605 @end table
14607 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
14608 @cindex @code{EIND}
14609 Pointers in the implementation are 16@tie{}bits wide.
14610 The address of a function or label is represented as word address so
14611 that indirect jumps and calls can target any code address in the
14612 range of 64@tie{}Ki words.
14614 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
14615 bytes of program memory space, there is a special function register called
14616 @code{EIND} that serves as most significant part of the target address
14617 when @code{EICALL} or @code{EIJMP} instructions are used.
14619 Indirect jumps and calls on these devices are handled as follows by
14620 the compiler and are subject to some limitations:
14622 @itemize @bullet
14624 @item
14625 The compiler never sets @code{EIND}.
14627 @item
14628 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
14629 instructions or might read @code{EIND} directly in order to emulate an
14630 indirect call/jump by means of a @code{RET} instruction.
14632 @item
14633 The compiler assumes that @code{EIND} never changes during the startup
14634 code or during the application. In particular, @code{EIND} is not
14635 saved/restored in function or interrupt service routine
14636 prologue/epilogue.
14638 @item
14639 For indirect calls to functions and computed goto, the linker
14640 generates @emph{stubs}. Stubs are jump pads sometimes also called
14641 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
14642 The stub contains a direct jump to the desired address.
14644 @item
14645 Linker relaxation must be turned on so that the linker generates
14646 the stubs correctly in all situations. See the compiler option
14647 @option{-mrelax} and the linker option @option{--relax}.
14648 There are corner cases where the linker is supposed to generate stubs
14649 but aborts without relaxation and without a helpful error message.
14651 @item
14652 The default linker script is arranged for code with @code{EIND = 0}.
14653 If code is supposed to work for a setup with @code{EIND != 0}, a custom
14654 linker script has to be used in order to place the sections whose
14655 name start with @code{.trampolines} into the segment where @code{EIND}
14656 points to.
14658 @item
14659 The startup code from libgcc never sets @code{EIND}.
14660 Notice that startup code is a blend of code from libgcc and AVR-LibC.
14661 For the impact of AVR-LibC on @code{EIND}, see the
14662 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
14664 @item
14665 It is legitimate for user-specific startup code to set up @code{EIND}
14666 early, for example by means of initialization code located in
14667 section @code{.init3}. Such code runs prior to general startup code
14668 that initializes RAM and calls constructors, but after the bit
14669 of startup code from AVR-LibC that sets @code{EIND} to the segment
14670 where the vector table is located.
14671 @example
14672 #include <avr/io.h>
14674 static void
14675 __attribute__((section(".init3"),naked,used,no_instrument_function))
14676 init3_set_eind (void)
14678   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
14679                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
14681 @end example
14683 @noindent
14684 The @code{__trampolines_start} symbol is defined in the linker script.
14686 @item
14687 Stubs are generated automatically by the linker if
14688 the following two conditions are met:
14689 @itemize @minus
14691 @item The address of a label is taken by means of the @code{gs} modifier
14692 (short for @emph{generate stubs}) like so:
14693 @example
14694 LDI r24, lo8(gs(@var{func}))
14695 LDI r25, hi8(gs(@var{func}))
14696 @end example
14697 @item The final location of that label is in a code segment
14698 @emph{outside} the segment where the stubs are located.
14699 @end itemize
14701 @item
14702 The compiler emits such @code{gs} modifiers for code labels in the
14703 following situations:
14704 @itemize @minus
14705 @item Taking address of a function or code label.
14706 @item Computed goto.
14707 @item If prologue-save function is used, see @option{-mcall-prologues}
14708 command-line option.
14709 @item Switch/case dispatch tables. If you do not want such dispatch
14710 tables you can specify the @option{-fno-jump-tables} command-line option.
14711 @item C and C++ constructors/destructors called during startup/shutdown.
14712 @item If the tools hit a @code{gs()} modifier explained above.
14713 @end itemize
14715 @item
14716 Jumping to non-symbolic addresses like so is @emph{not} supported:
14718 @example
14719 int main (void)
14721     /* Call function at word address 0x2 */
14722     return ((int(*)(void)) 0x2)();
14724 @end example
14726 Instead, a stub has to be set up, i.e.@: the function has to be called
14727 through a symbol (@code{func_4} in the example):
14729 @example
14730 int main (void)
14732     extern int func_4 (void);
14734     /* Call function at byte address 0x4 */
14735     return func_4();
14737 @end example
14739 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
14740 Alternatively, @code{func_4} can be defined in the linker script.
14741 @end itemize
14743 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
14744 @cindex @code{RAMPD}
14745 @cindex @code{RAMPX}
14746 @cindex @code{RAMPY}
14747 @cindex @code{RAMPZ}
14748 Some AVR devices support memories larger than the 64@tie{}KiB range
14749 that can be accessed with 16-bit pointers.  To access memory locations
14750 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
14751 register is used as high part of the address:
14752 The @code{X}, @code{Y}, @code{Z} address register is concatenated
14753 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
14754 register, respectively, to get a wide address. Similarly,
14755 @code{RAMPD} is used together with direct addressing.
14757 @itemize
14758 @item
14759 The startup code initializes the @code{RAMP} special function
14760 registers with zero.
14762 @item
14763 If a @ref{AVR Named Address Spaces,named address space} other than
14764 generic or @code{__flash} is used, then @code{RAMPZ} is set
14765 as needed before the operation.
14767 @item
14768 If the device supports RAM larger than 64@tie{}KiB and the compiler
14769 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
14770 is reset to zero after the operation.
14772 @item
14773 If the device comes with a specific @code{RAMP} register, the ISR
14774 prologue/epilogue saves/restores that SFR and initializes it with
14775 zero in case the ISR code might (implicitly) use it.
14777 @item
14778 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
14779 If you use inline assembler to read from locations outside the
14780 16-bit address range and change one of the @code{RAMP} registers,
14781 you must reset it to zero after the access.
14783 @end itemize
14785 @subsubsection AVR Built-in Macros
14787 GCC defines several built-in macros so that the user code can test
14788 for the presence or absence of features.  Almost any of the following
14789 built-in macros are deduced from device capabilities and thus
14790 triggered by the @option{-mmcu=} command-line option.
14792 For even more AVR-specific built-in macros see
14793 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
14795 @table @code
14797 @item __AVR_ARCH__
14798 Build-in macro that resolves to a decimal number that identifies the
14799 architecture and depends on the @option{-mmcu=@var{mcu}} option.
14800 Possible values are:
14802 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
14803 @code{4}, @code{5}, @code{51}, @code{6}
14805 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
14806 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
14808 respectively and
14810 @code{100}, @code{102}, @code{104},
14811 @code{105}, @code{106}, @code{107}
14813 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
14814 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
14815 If @var{mcu} specifies a device, this built-in macro is set
14816 accordingly. For example, with @option{-mmcu=atmega8} the macro is
14817 defined to @code{4}.
14819 @item __AVR_@var{Device}__
14820 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
14821 the device's name. For example, @option{-mmcu=atmega8} defines the
14822 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
14823 @code{__AVR_ATtiny261A__}, etc.
14825 The built-in macros' names follow
14826 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
14827 the device name as from the AVR user manual. The difference between
14828 @var{Device} in the built-in macro and @var{device} in
14829 @option{-mmcu=@var{device}} is that the latter is always lowercase.
14831 If @var{device} is not a device but only a core architecture like
14832 @samp{avr51}, this macro is not defined.
14834 @item __AVR_DEVICE_NAME__
14835 Setting @option{-mmcu=@var{device}} defines this built-in macro to
14836 the device's name. For example, with @option{-mmcu=atmega8} the macro
14837 is defined to @code{atmega8}.
14839 If @var{device} is not a device but only a core architecture like
14840 @samp{avr51}, this macro is not defined.
14842 @item __AVR_XMEGA__
14843 The device / architecture belongs to the XMEGA family of devices.
14845 @item __AVR_HAVE_ELPM__
14846 The device has the @code{ELPM} instruction.
14848 @item __AVR_HAVE_ELPMX__
14849 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
14850 R@var{n},Z+} instructions.
14852 @item __AVR_HAVE_MOVW__
14853 The device has the @code{MOVW} instruction to perform 16-bit
14854 register-register moves.
14856 @item __AVR_HAVE_LPMX__
14857 The device has the @code{LPM R@var{n},Z} and
14858 @code{LPM R@var{n},Z+} instructions.
14860 @item __AVR_HAVE_MUL__
14861 The device has a hardware multiplier. 
14863 @item __AVR_HAVE_JMP_CALL__
14864 The device has the @code{JMP} and @code{CALL} instructions.
14865 This is the case for devices with at least 16@tie{}KiB of program
14866 memory.
14868 @item __AVR_HAVE_EIJMP_EICALL__
14869 @itemx __AVR_3_BYTE_PC__
14870 The device has the @code{EIJMP} and @code{EICALL} instructions.
14871 This is the case for devices with more than 128@tie{}KiB of program memory.
14872 This also means that the program counter
14873 (PC) is 3@tie{}bytes wide.
14875 @item __AVR_2_BYTE_PC__
14876 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
14877 with up to 128@tie{}KiB of program memory.
14879 @item __AVR_HAVE_8BIT_SP__
14880 @itemx __AVR_HAVE_16BIT_SP__
14881 The stack pointer (SP) register is treated as 8-bit respectively
14882 16-bit register by the compiler.
14883 The definition of these macros is affected by @option{-mtiny-stack}.
14885 @item __AVR_HAVE_SPH__
14886 @itemx __AVR_SP8__
14887 The device has the SPH (high part of stack pointer) special function
14888 register or has an 8-bit stack pointer, respectively.
14889 The definition of these macros is affected by @option{-mmcu=} and
14890 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
14891 by @option{-msp8}.
14893 @item __AVR_HAVE_RAMPD__
14894 @itemx __AVR_HAVE_RAMPX__
14895 @itemx __AVR_HAVE_RAMPY__
14896 @itemx __AVR_HAVE_RAMPZ__
14897 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
14898 @code{RAMPZ} special function register, respectively.
14900 @item __NO_INTERRUPTS__
14901 This macro reflects the @option{-mno-interrupts} command-line option.
14903 @item __AVR_ERRATA_SKIP__
14904 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
14905 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
14906 instructions because of a hardware erratum.  Skip instructions are
14907 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
14908 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
14909 set.
14911 @item __AVR_ISA_RMW__
14912 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
14914 @item __AVR_SFR_OFFSET__=@var{offset}
14915 Instructions that can address I/O special function registers directly
14916 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
14917 address as if addressed by an instruction to access RAM like @code{LD}
14918 or @code{STS}. This offset depends on the device architecture and has
14919 to be subtracted from the RAM address in order to get the
14920 respective I/O@tie{}address.
14922 @item __WITH_AVRLIBC__
14923 The compiler is configured to be used together with AVR-Libc.
14924 See the @option{--with-avrlibc} configure option.
14926 @end table
14928 @node Blackfin Options
14929 @subsection Blackfin Options
14930 @cindex Blackfin Options
14932 @table @gcctabopt
14933 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
14934 @opindex mcpu=
14935 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
14936 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
14937 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
14938 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
14939 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
14940 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
14941 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
14942 @samp{bf561}, @samp{bf592}.
14944 The optional @var{sirevision} specifies the silicon revision of the target
14945 Blackfin processor.  Any workarounds available for the targeted silicon revision
14946 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
14947 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
14948 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
14949 hexadecimal digits representing the major and minor numbers in the silicon
14950 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
14951 is not defined.  If @var{sirevision} is @samp{any}, the
14952 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
14953 If this optional @var{sirevision} is not used, GCC assumes the latest known
14954 silicon revision of the targeted Blackfin processor.
14956 GCC defines a preprocessor macro for the specified @var{cpu}.
14957 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
14958 provided by libgloss to be linked in if @option{-msim} is not given.
14960 Without this option, @samp{bf532} is used as the processor by default.
14962 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
14963 only the preprocessor macro is defined.
14965 @item -msim
14966 @opindex msim
14967 Specifies that the program will be run on the simulator.  This causes
14968 the simulator BSP provided by libgloss to be linked in.  This option
14969 has effect only for @samp{bfin-elf} toolchain.
14970 Certain other options, such as @option{-mid-shared-library} and
14971 @option{-mfdpic}, imply @option{-msim}.
14973 @item -momit-leaf-frame-pointer
14974 @opindex momit-leaf-frame-pointer
14975 Don't keep the frame pointer in a register for leaf functions.  This
14976 avoids the instructions to save, set up and restore frame pointers and
14977 makes an extra register available in leaf functions.  The option
14978 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
14979 which might make debugging harder.
14981 @item -mspecld-anomaly
14982 @opindex mspecld-anomaly
14983 When enabled, the compiler ensures that the generated code does not
14984 contain speculative loads after jump instructions. If this option is used,
14985 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
14987 @item -mno-specld-anomaly
14988 @opindex mno-specld-anomaly
14989 Don't generate extra code to prevent speculative loads from occurring.
14991 @item -mcsync-anomaly
14992 @opindex mcsync-anomaly
14993 When enabled, the compiler ensures that the generated code does not
14994 contain CSYNC or SSYNC instructions too soon after conditional branches.
14995 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
14997 @item -mno-csync-anomaly
14998 @opindex mno-csync-anomaly
14999 Don't generate extra code to prevent CSYNC or SSYNC instructions from
15000 occurring too soon after a conditional branch.
15002 @item -mlow-64k
15003 @opindex mlow-64k
15004 When enabled, the compiler is free to take advantage of the knowledge that
15005 the entire program fits into the low 64k of memory.
15007 @item -mno-low-64k
15008 @opindex mno-low-64k
15009 Assume that the program is arbitrarily large.  This is the default.
15011 @item -mstack-check-l1
15012 @opindex mstack-check-l1
15013 Do stack checking using information placed into L1 scratchpad memory by the
15014 uClinux kernel.
15016 @item -mid-shared-library
15017 @opindex mid-shared-library
15018 Generate code that supports shared libraries via the library ID method.
15019 This allows for execute in place and shared libraries in an environment
15020 without virtual memory management.  This option implies @option{-fPIC}.
15021 With a @samp{bfin-elf} target, this option implies @option{-msim}.
15023 @item -mno-id-shared-library
15024 @opindex mno-id-shared-library
15025 Generate code that doesn't assume ID-based shared libraries are being used.
15026 This is the default.
15028 @item -mleaf-id-shared-library
15029 @opindex mleaf-id-shared-library
15030 Generate code that supports shared libraries via the library ID method,
15031 but assumes that this library or executable won't link against any other
15032 ID shared libraries.  That allows the compiler to use faster code for jumps
15033 and calls.
15035 @item -mno-leaf-id-shared-library
15036 @opindex mno-leaf-id-shared-library
15037 Do not assume that the code being compiled won't link against any ID shared
15038 libraries.  Slower code is generated for jump and call insns.
15040 @item -mshared-library-id=n
15041 @opindex mshared-library-id
15042 Specifies the identification number of the ID-based shared library being
15043 compiled.  Specifying a value of 0 generates more compact code; specifying
15044 other values forces the allocation of that number to the current
15045 library but is no more space- or time-efficient than omitting this option.
15047 @item -msep-data
15048 @opindex msep-data
15049 Generate code that allows the data segment to be located in a different
15050 area of memory from the text segment.  This allows for execute in place in
15051 an environment without virtual memory management by eliminating relocations
15052 against the text section.
15054 @item -mno-sep-data
15055 @opindex mno-sep-data
15056 Generate code that assumes that the data segment follows the text segment.
15057 This is the default.
15059 @item -mlong-calls
15060 @itemx -mno-long-calls
15061 @opindex mlong-calls
15062 @opindex mno-long-calls
15063 Tells the compiler to perform function calls by first loading the
15064 address of the function into a register and then performing a subroutine
15065 call on this register.  This switch is needed if the target function
15066 lies outside of the 24-bit addressing range of the offset-based
15067 version of subroutine call instruction.
15069 This feature is not enabled by default.  Specifying
15070 @option{-mno-long-calls} restores the default behavior.  Note these
15071 switches have no effect on how the compiler generates code to handle
15072 function calls via function pointers.
15074 @item -mfast-fp
15075 @opindex mfast-fp
15076 Link with the fast floating-point library. This library relaxes some of
15077 the IEEE floating-point standard's rules for checking inputs against
15078 Not-a-Number (NAN), in the interest of performance.
15080 @item -minline-plt
15081 @opindex minline-plt
15082 Enable inlining of PLT entries in function calls to functions that are
15083 not known to bind locally.  It has no effect without @option{-mfdpic}.
15085 @item -mmulticore
15086 @opindex mmulticore
15087 Build a standalone application for multicore Blackfin processors. 
15088 This option causes proper start files and link scripts supporting 
15089 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
15090 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
15092 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
15093 selects the one-application-per-core programming model.  Without
15094 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
15095 programming model is used. In this model, the main function of Core B
15096 should be named as @code{coreb_main}.
15098 If this option is not used, the single-core application programming
15099 model is used.
15101 @item -mcorea
15102 @opindex mcorea
15103 Build a standalone application for Core A of BF561 when using
15104 the one-application-per-core programming model. Proper start files
15105 and link scripts are used to support Core A, and the macro
15106 @code{__BFIN_COREA} is defined.
15107 This option can only be used in conjunction with @option{-mmulticore}.
15109 @item -mcoreb
15110 @opindex mcoreb
15111 Build a standalone application for Core B of BF561 when using
15112 the one-application-per-core programming model. Proper start files
15113 and link scripts are used to support Core B, and the macro
15114 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
15115 should be used instead of @code{main}. 
15116 This option can only be used in conjunction with @option{-mmulticore}.
15118 @item -msdram
15119 @opindex msdram
15120 Build a standalone application for SDRAM. Proper start files and
15121 link scripts are used to put the application into SDRAM, and the macro
15122 @code{__BFIN_SDRAM} is defined.
15123 The loader should initialize SDRAM before loading the application.
15125 @item -micplb
15126 @opindex micplb
15127 Assume that ICPLBs are enabled at run time.  This has an effect on certain
15128 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
15129 are enabled; for standalone applications the default is off.
15130 @end table
15132 @node C6X Options
15133 @subsection C6X Options
15134 @cindex C6X Options
15136 @table @gcctabopt
15137 @item -march=@var{name}
15138 @opindex march
15139 This specifies the name of the target architecture.  GCC uses this
15140 name to determine what kind of instructions it can emit when generating
15141 assembly code.  Permissible names are: @samp{c62x},
15142 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
15144 @item -mbig-endian
15145 @opindex mbig-endian
15146 Generate code for a big-endian target.
15148 @item -mlittle-endian
15149 @opindex mlittle-endian
15150 Generate code for a little-endian target.  This is the default.
15152 @item -msim
15153 @opindex msim
15154 Choose startup files and linker script suitable for the simulator.
15156 @item -msdata=default
15157 @opindex msdata=default
15158 Put small global and static data in the @code{.neardata} section,
15159 which is pointed to by register @code{B14}.  Put small uninitialized
15160 global and static data in the @code{.bss} section, which is adjacent
15161 to the @code{.neardata} section.  Put small read-only data into the
15162 @code{.rodata} section.  The corresponding sections used for large
15163 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
15165 @item -msdata=all
15166 @opindex msdata=all
15167 Put all data, not just small objects, into the sections reserved for
15168 small data, and use addressing relative to the @code{B14} register to
15169 access them.
15171 @item -msdata=none
15172 @opindex msdata=none
15173 Make no use of the sections reserved for small data, and use absolute
15174 addresses to access all data.  Put all initialized global and static
15175 data in the @code{.fardata} section, and all uninitialized data in the
15176 @code{.far} section.  Put all constant data into the @code{.const}
15177 section.
15178 @end table
15180 @node CRIS Options
15181 @subsection CRIS Options
15182 @cindex CRIS Options
15184 These options are defined specifically for the CRIS ports.
15186 @table @gcctabopt
15187 @item -march=@var{architecture-type}
15188 @itemx -mcpu=@var{architecture-type}
15189 @opindex march
15190 @opindex mcpu
15191 Generate code for the specified architecture.  The choices for
15192 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
15193 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
15194 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
15195 @samp{v10}.
15197 @item -mtune=@var{architecture-type}
15198 @opindex mtune
15199 Tune to @var{architecture-type} everything applicable about the generated
15200 code, except for the ABI and the set of available instructions.  The
15201 choices for @var{architecture-type} are the same as for
15202 @option{-march=@var{architecture-type}}.
15204 @item -mmax-stack-frame=@var{n}
15205 @opindex mmax-stack-frame
15206 Warn when the stack frame of a function exceeds @var{n} bytes.
15208 @item -metrax4
15209 @itemx -metrax100
15210 @opindex metrax4
15211 @opindex metrax100
15212 The options @option{-metrax4} and @option{-metrax100} are synonyms for
15213 @option{-march=v3} and @option{-march=v8} respectively.
15215 @item -mmul-bug-workaround
15216 @itemx -mno-mul-bug-workaround
15217 @opindex mmul-bug-workaround
15218 @opindex mno-mul-bug-workaround
15219 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
15220 models where it applies.  This option is active by default.
15222 @item -mpdebug
15223 @opindex mpdebug
15224 Enable CRIS-specific verbose debug-related information in the assembly
15225 code.  This option also has the effect of turning off the @samp{#NO_APP}
15226 formatted-code indicator to the assembler at the beginning of the
15227 assembly file.
15229 @item -mcc-init
15230 @opindex mcc-init
15231 Do not use condition-code results from previous instruction; always emit
15232 compare and test instructions before use of condition codes.
15234 @item -mno-side-effects
15235 @opindex mno-side-effects
15236 Do not emit instructions with side effects in addressing modes other than
15237 post-increment.
15239 @item -mstack-align
15240 @itemx -mno-stack-align
15241 @itemx -mdata-align
15242 @itemx -mno-data-align
15243 @itemx -mconst-align
15244 @itemx -mno-const-align
15245 @opindex mstack-align
15246 @opindex mno-stack-align
15247 @opindex mdata-align
15248 @opindex mno-data-align
15249 @opindex mconst-align
15250 @opindex mno-const-align
15251 These options (@samp{no-} options) arrange (eliminate arrangements) for the
15252 stack frame, individual data and constants to be aligned for the maximum
15253 single data access size for the chosen CPU model.  The default is to
15254 arrange for 32-bit alignment.  ABI details such as structure layout are
15255 not affected by these options.
15257 @item -m32-bit
15258 @itemx -m16-bit
15259 @itemx -m8-bit
15260 @opindex m32-bit
15261 @opindex m16-bit
15262 @opindex m8-bit
15263 Similar to the stack- data- and const-align options above, these options
15264 arrange for stack frame, writable data and constants to all be 32-bit,
15265 16-bit or 8-bit aligned.  The default is 32-bit alignment.
15267 @item -mno-prologue-epilogue
15268 @itemx -mprologue-epilogue
15269 @opindex mno-prologue-epilogue
15270 @opindex mprologue-epilogue
15271 With @option{-mno-prologue-epilogue}, the normal function prologue and
15272 epilogue which set up the stack frame are omitted and no return
15273 instructions or return sequences are generated in the code.  Use this
15274 option only together with visual inspection of the compiled code: no
15275 warnings or errors are generated when call-saved registers must be saved,
15276 or storage for local variables needs to be allocated.
15278 @item -mno-gotplt
15279 @itemx -mgotplt
15280 @opindex mno-gotplt
15281 @opindex mgotplt
15282 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
15283 instruction sequences that load addresses for functions from the PLT part
15284 of the GOT rather than (traditional on other architectures) calls to the
15285 PLT@.  The default is @option{-mgotplt}.
15287 @item -melf
15288 @opindex melf
15289 Legacy no-op option only recognized with the cris-axis-elf and
15290 cris-axis-linux-gnu targets.
15292 @item -mlinux
15293 @opindex mlinux
15294 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
15296 @item -sim
15297 @opindex sim
15298 This option, recognized for the cris-axis-elf, arranges
15299 to link with input-output functions from a simulator library.  Code,
15300 initialized data and zero-initialized data are allocated consecutively.
15302 @item -sim2
15303 @opindex sim2
15304 Like @option{-sim}, but pass linker options to locate initialized data at
15305 0x40000000 and zero-initialized data at 0x80000000.
15306 @end table
15308 @node CR16 Options
15309 @subsection CR16 Options
15310 @cindex CR16 Options
15312 These options are defined specifically for the CR16 ports.
15314 @table @gcctabopt
15316 @item -mmac
15317 @opindex mmac
15318 Enable the use of multiply-accumulate instructions. Disabled by default.
15320 @item -mcr16cplus
15321 @itemx -mcr16c
15322 @opindex mcr16cplus
15323 @opindex mcr16c
15324 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
15325 is default.
15327 @item -msim
15328 @opindex msim
15329 Links the library libsim.a which is in compatible with simulator. Applicable
15330 to ELF compiler only.
15332 @item -mint32
15333 @opindex mint32
15334 Choose integer type as 32-bit wide.
15336 @item -mbit-ops
15337 @opindex mbit-ops
15338 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
15340 @item -mdata-model=@var{model}
15341 @opindex mdata-model
15342 Choose a data model. The choices for @var{model} are @samp{near},
15343 @samp{far} or @samp{medium}. @samp{medium} is default.
15344 However, @samp{far} is not valid with @option{-mcr16c}, as the
15345 CR16C architecture does not support the far data model.
15346 @end table
15348 @node Darwin Options
15349 @subsection Darwin Options
15350 @cindex Darwin options
15352 These options are defined for all architectures running the Darwin operating
15353 system.
15355 FSF GCC on Darwin does not create ``fat'' object files; it creates
15356 an object file for the single architecture that GCC was built to
15357 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
15358 @option{-arch} options are used; it does so by running the compiler or
15359 linker multiple times and joining the results together with
15360 @file{lipo}.
15362 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
15363 @samp{i686}) is determined by the flags that specify the ISA
15364 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
15365 @option{-force_cpusubtype_ALL} option can be used to override this.
15367 The Darwin tools vary in their behavior when presented with an ISA
15368 mismatch.  The assembler, @file{as}, only permits instructions to
15369 be used that are valid for the subtype of the file it is generating,
15370 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
15371 The linker for shared libraries, @file{/usr/bin/libtool}, fails
15372 and prints an error if asked to create a shared library with a less
15373 restrictive subtype than its input files (for instance, trying to put
15374 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
15375 for executables, @command{ld}, quietly gives the executable the most
15376 restrictive subtype of any of its input files.
15378 @table @gcctabopt
15379 @item -F@var{dir}
15380 @opindex F
15381 Add the framework directory @var{dir} to the head of the list of
15382 directories to be searched for header files.  These directories are
15383 interleaved with those specified by @option{-I} options and are
15384 scanned in a left-to-right order.
15386 A framework directory is a directory with frameworks in it.  A
15387 framework is a directory with a @file{Headers} and/or
15388 @file{PrivateHeaders} directory contained directly in it that ends
15389 in @file{.framework}.  The name of a framework is the name of this
15390 directory excluding the @file{.framework}.  Headers associated with
15391 the framework are found in one of those two directories, with
15392 @file{Headers} being searched first.  A subframework is a framework
15393 directory that is in a framework's @file{Frameworks} directory.
15394 Includes of subframework headers can only appear in a header of a
15395 framework that contains the subframework, or in a sibling subframework
15396 header.  Two subframeworks are siblings if they occur in the same
15397 framework.  A subframework should not have the same name as a
15398 framework; a warning is issued if this is violated.  Currently a
15399 subframework cannot have subframeworks; in the future, the mechanism
15400 may be extended to support this.  The standard frameworks can be found
15401 in @file{/System/Library/Frameworks} and
15402 @file{/Library/Frameworks}.  An example include looks like
15403 @code{#include <Framework/header.h>}, where @file{Framework} denotes
15404 the name of the framework and @file{header.h} is found in the
15405 @file{PrivateHeaders} or @file{Headers} directory.
15407 @item -iframework@var{dir}
15408 @opindex iframework
15409 Like @option{-F} except the directory is a treated as a system
15410 directory.  The main difference between this @option{-iframework} and
15411 @option{-F} is that with @option{-iframework} the compiler does not
15412 warn about constructs contained within header files found via
15413 @var{dir}.  This option is valid only for the C family of languages.
15415 @item -gused
15416 @opindex gused
15417 Emit debugging information for symbols that are used.  For stabs
15418 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
15419 This is by default ON@.
15421 @item -gfull
15422 @opindex gfull
15423 Emit debugging information for all symbols and types.
15425 @item -mmacosx-version-min=@var{version}
15426 The earliest version of MacOS X that this executable will run on
15427 is @var{version}.  Typical values of @var{version} include @code{10.1},
15428 @code{10.2}, and @code{10.3.9}.
15430 If the compiler was built to use the system's headers by default,
15431 then the default for this option is the system version on which the
15432 compiler is running, otherwise the default is to make choices that
15433 are compatible with as many systems and code bases as possible.
15435 @item -mkernel
15436 @opindex mkernel
15437 Enable kernel development mode.  The @option{-mkernel} option sets
15438 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
15439 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
15440 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
15441 applicable.  This mode also sets @option{-mno-altivec},
15442 @option{-msoft-float}, @option{-fno-builtin} and
15443 @option{-mlong-branch} for PowerPC targets.
15445 @item -mone-byte-bool
15446 @opindex mone-byte-bool
15447 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
15448 By default @code{sizeof(bool)} is @code{4} when compiling for
15449 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
15450 option has no effect on x86.
15452 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
15453 to generate code that is not binary compatible with code generated
15454 without that switch.  Using this switch may require recompiling all
15455 other modules in a program, including system libraries.  Use this
15456 switch to conform to a non-default data model.
15458 @item -mfix-and-continue
15459 @itemx -ffix-and-continue
15460 @itemx -findirect-data
15461 @opindex mfix-and-continue
15462 @opindex ffix-and-continue
15463 @opindex findirect-data
15464 Generate code suitable for fast turnaround development, such as to
15465 allow GDB to dynamically load @file{.o} files into already-running
15466 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
15467 are provided for backwards compatibility.
15469 @item -all_load
15470 @opindex all_load
15471 Loads all members of static archive libraries.
15472 See man ld(1) for more information.
15474 @item -arch_errors_fatal
15475 @opindex arch_errors_fatal
15476 Cause the errors having to do with files that have the wrong architecture
15477 to be fatal.
15479 @item -bind_at_load
15480 @opindex bind_at_load
15481 Causes the output file to be marked such that the dynamic linker will
15482 bind all undefined references when the file is loaded or launched.
15484 @item -bundle
15485 @opindex bundle
15486 Produce a Mach-o bundle format file.
15487 See man ld(1) for more information.
15489 @item -bundle_loader @var{executable}
15490 @opindex bundle_loader
15491 This option specifies the @var{executable} that will load the build
15492 output file being linked.  See man ld(1) for more information.
15494 @item -dynamiclib
15495 @opindex dynamiclib
15496 When passed this option, GCC produces a dynamic library instead of
15497 an executable when linking, using the Darwin @file{libtool} command.
15499 @item -force_cpusubtype_ALL
15500 @opindex force_cpusubtype_ALL
15501 This causes GCC's output file to have the @samp{ALL} subtype, instead of
15502 one controlled by the @option{-mcpu} or @option{-march} option.
15504 @item -allowable_client  @var{client_name}
15505 @itemx -client_name
15506 @itemx -compatibility_version
15507 @itemx -current_version
15508 @itemx -dead_strip
15509 @itemx -dependency-file
15510 @itemx -dylib_file
15511 @itemx -dylinker_install_name
15512 @itemx -dynamic
15513 @itemx -exported_symbols_list
15514 @itemx -filelist
15515 @need 800
15516 @itemx -flat_namespace
15517 @itemx -force_flat_namespace
15518 @itemx -headerpad_max_install_names
15519 @itemx -image_base
15520 @itemx -init
15521 @itemx -install_name
15522 @itemx -keep_private_externs
15523 @itemx -multi_module
15524 @itemx -multiply_defined
15525 @itemx -multiply_defined_unused
15526 @need 800
15527 @itemx -noall_load
15528 @itemx -no_dead_strip_inits_and_terms
15529 @itemx -nofixprebinding
15530 @itemx -nomultidefs
15531 @itemx -noprebind
15532 @itemx -noseglinkedit
15533 @itemx -pagezero_size
15534 @itemx -prebind
15535 @itemx -prebind_all_twolevel_modules
15536 @itemx -private_bundle
15537 @need 800
15538 @itemx -read_only_relocs
15539 @itemx -sectalign
15540 @itemx -sectobjectsymbols
15541 @itemx -whyload
15542 @itemx -seg1addr
15543 @itemx -sectcreate
15544 @itemx -sectobjectsymbols
15545 @itemx -sectorder
15546 @itemx -segaddr
15547 @itemx -segs_read_only_addr
15548 @need 800
15549 @itemx -segs_read_write_addr
15550 @itemx -seg_addr_table
15551 @itemx -seg_addr_table_filename
15552 @itemx -seglinkedit
15553 @itemx -segprot
15554 @itemx -segs_read_only_addr
15555 @itemx -segs_read_write_addr
15556 @itemx -single_module
15557 @itemx -static
15558 @itemx -sub_library
15559 @need 800
15560 @itemx -sub_umbrella
15561 @itemx -twolevel_namespace
15562 @itemx -umbrella
15563 @itemx -undefined
15564 @itemx -unexported_symbols_list
15565 @itemx -weak_reference_mismatches
15566 @itemx -whatsloaded
15567 @opindex allowable_client
15568 @opindex client_name
15569 @opindex compatibility_version
15570 @opindex current_version
15571 @opindex dead_strip
15572 @opindex dependency-file
15573 @opindex dylib_file
15574 @opindex dylinker_install_name
15575 @opindex dynamic
15576 @opindex exported_symbols_list
15577 @opindex filelist
15578 @opindex flat_namespace
15579 @opindex force_flat_namespace
15580 @opindex headerpad_max_install_names
15581 @opindex image_base
15582 @opindex init
15583 @opindex install_name
15584 @opindex keep_private_externs
15585 @opindex multi_module
15586 @opindex multiply_defined
15587 @opindex multiply_defined_unused
15588 @opindex noall_load
15589 @opindex no_dead_strip_inits_and_terms
15590 @opindex nofixprebinding
15591 @opindex nomultidefs
15592 @opindex noprebind
15593 @opindex noseglinkedit
15594 @opindex pagezero_size
15595 @opindex prebind
15596 @opindex prebind_all_twolevel_modules
15597 @opindex private_bundle
15598 @opindex read_only_relocs
15599 @opindex sectalign
15600 @opindex sectobjectsymbols
15601 @opindex whyload
15602 @opindex seg1addr
15603 @opindex sectcreate
15604 @opindex sectobjectsymbols
15605 @opindex sectorder
15606 @opindex segaddr
15607 @opindex segs_read_only_addr
15608 @opindex segs_read_write_addr
15609 @opindex seg_addr_table
15610 @opindex seg_addr_table_filename
15611 @opindex seglinkedit
15612 @opindex segprot
15613 @opindex segs_read_only_addr
15614 @opindex segs_read_write_addr
15615 @opindex single_module
15616 @opindex static
15617 @opindex sub_library
15618 @opindex sub_umbrella
15619 @opindex twolevel_namespace
15620 @opindex umbrella
15621 @opindex undefined
15622 @opindex unexported_symbols_list
15623 @opindex weak_reference_mismatches
15624 @opindex whatsloaded
15625 These options are passed to the Darwin linker.  The Darwin linker man page
15626 describes them in detail.
15627 @end table
15629 @node DEC Alpha Options
15630 @subsection DEC Alpha Options
15632 These @samp{-m} options are defined for the DEC Alpha implementations:
15634 @table @gcctabopt
15635 @item -mno-soft-float
15636 @itemx -msoft-float
15637 @opindex mno-soft-float
15638 @opindex msoft-float
15639 Use (do not use) the hardware floating-point instructions for
15640 floating-point operations.  When @option{-msoft-float} is specified,
15641 functions in @file{libgcc.a} are used to perform floating-point
15642 operations.  Unless they are replaced by routines that emulate the
15643 floating-point operations, or compiled in such a way as to call such
15644 emulations routines, these routines issue floating-point
15645 operations.   If you are compiling for an Alpha without floating-point
15646 operations, you must ensure that the library is built so as not to call
15647 them.
15649 Note that Alpha implementations without floating-point operations are
15650 required to have floating-point registers.
15652 @item -mfp-reg
15653 @itemx -mno-fp-regs
15654 @opindex mfp-reg
15655 @opindex mno-fp-regs
15656 Generate code that uses (does not use) the floating-point register set.
15657 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
15658 register set is not used, floating-point operands are passed in integer
15659 registers as if they were integers and floating-point results are passed
15660 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
15661 so any function with a floating-point argument or return value called by code
15662 compiled with @option{-mno-fp-regs} must also be compiled with that
15663 option.
15665 A typical use of this option is building a kernel that does not use,
15666 and hence need not save and restore, any floating-point registers.
15668 @item -mieee
15669 @opindex mieee
15670 The Alpha architecture implements floating-point hardware optimized for
15671 maximum performance.  It is mostly compliant with the IEEE floating-point
15672 standard.  However, for full compliance, software assistance is
15673 required.  This option generates code fully IEEE-compliant code
15674 @emph{except} that the @var{inexact-flag} is not maintained (see below).
15675 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
15676 defined during compilation.  The resulting code is less efficient but is
15677 able to correctly support denormalized numbers and exceptional IEEE
15678 values such as not-a-number and plus/minus infinity.  Other Alpha
15679 compilers call this option @option{-ieee_with_no_inexact}.
15681 @item -mieee-with-inexact
15682 @opindex mieee-with-inexact
15683 This is like @option{-mieee} except the generated code also maintains
15684 the IEEE @var{inexact-flag}.  Turning on this option causes the
15685 generated code to implement fully-compliant IEEE math.  In addition to
15686 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
15687 macro.  On some Alpha implementations the resulting code may execute
15688 significantly slower than the code generated by default.  Since there is
15689 very little code that depends on the @var{inexact-flag}, you should
15690 normally not specify this option.  Other Alpha compilers call this
15691 option @option{-ieee_with_inexact}.
15693 @item -mfp-trap-mode=@var{trap-mode}
15694 @opindex mfp-trap-mode
15695 This option controls what floating-point related traps are enabled.
15696 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
15697 The trap mode can be set to one of four values:
15699 @table @samp
15700 @item n
15701 This is the default (normal) setting.  The only traps that are enabled
15702 are the ones that cannot be disabled in software (e.g., division by zero
15703 trap).
15705 @item u
15706 In addition to the traps enabled by @samp{n}, underflow traps are enabled
15707 as well.
15709 @item su
15710 Like @samp{u}, but the instructions are marked to be safe for software
15711 completion (see Alpha architecture manual for details).
15713 @item sui
15714 Like @samp{su}, but inexact traps are enabled as well.
15715 @end table
15717 @item -mfp-rounding-mode=@var{rounding-mode}
15718 @opindex mfp-rounding-mode
15719 Selects the IEEE rounding mode.  Other Alpha compilers call this option
15720 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
15723 @table @samp
15724 @item n
15725 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
15726 the nearest machine number or towards the even machine number in case
15727 of a tie.
15729 @item m
15730 Round towards minus infinity.
15732 @item c
15733 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
15735 @item d
15736 Dynamic rounding mode.  A field in the floating-point control register
15737 (@var{fpcr}, see Alpha architecture reference manual) controls the
15738 rounding mode in effect.  The C library initializes this register for
15739 rounding towards plus infinity.  Thus, unless your program modifies the
15740 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
15741 @end table
15743 @item -mtrap-precision=@var{trap-precision}
15744 @opindex mtrap-precision
15745 In the Alpha architecture, floating-point traps are imprecise.  This
15746 means without software assistance it is impossible to recover from a
15747 floating trap and program execution normally needs to be terminated.
15748 GCC can generate code that can assist operating system trap handlers
15749 in determining the exact location that caused a floating-point trap.
15750 Depending on the requirements of an application, different levels of
15751 precisions can be selected:
15753 @table @samp
15754 @item p
15755 Program precision.  This option is the default and means a trap handler
15756 can only identify which program caused a floating-point exception.
15758 @item f
15759 Function precision.  The trap handler can determine the function that
15760 caused a floating-point exception.
15762 @item i
15763 Instruction precision.  The trap handler can determine the exact
15764 instruction that caused a floating-point exception.
15765 @end table
15767 Other Alpha compilers provide the equivalent options called
15768 @option{-scope_safe} and @option{-resumption_safe}.
15770 @item -mieee-conformant
15771 @opindex mieee-conformant
15772 This option marks the generated code as IEEE conformant.  You must not
15773 use this option unless you also specify @option{-mtrap-precision=i} and either
15774 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
15775 is to emit the line @samp{.eflag 48} in the function prologue of the
15776 generated assembly file.
15778 @item -mbuild-constants
15779 @opindex mbuild-constants
15780 Normally GCC examines a 32- or 64-bit integer constant to
15781 see if it can construct it from smaller constants in two or three
15782 instructions.  If it cannot, it outputs the constant as a literal and
15783 generates code to load it from the data segment at run time.
15785 Use this option to require GCC to construct @emph{all} integer constants
15786 using code, even if it takes more instructions (the maximum is six).
15788 You typically use this option to build a shared library dynamic
15789 loader.  Itself a shared library, it must relocate itself in memory
15790 before it can find the variables and constants in its own data segment.
15792 @item -mbwx
15793 @itemx -mno-bwx
15794 @itemx -mcix
15795 @itemx -mno-cix
15796 @itemx -mfix
15797 @itemx -mno-fix
15798 @itemx -mmax
15799 @itemx -mno-max
15800 @opindex mbwx
15801 @opindex mno-bwx
15802 @opindex mcix
15803 @opindex mno-cix
15804 @opindex mfix
15805 @opindex mno-fix
15806 @opindex mmax
15807 @opindex mno-max
15808 Indicate whether GCC should generate code to use the optional BWX,
15809 CIX, FIX and MAX instruction sets.  The default is to use the instruction
15810 sets supported by the CPU type specified via @option{-mcpu=} option or that
15811 of the CPU on which GCC was built if none is specified.
15813 @item -mfloat-vax
15814 @itemx -mfloat-ieee
15815 @opindex mfloat-vax
15816 @opindex mfloat-ieee
15817 Generate code that uses (does not use) VAX F and G floating-point
15818 arithmetic instead of IEEE single and double precision.
15820 @item -mexplicit-relocs
15821 @itemx -mno-explicit-relocs
15822 @opindex mexplicit-relocs
15823 @opindex mno-explicit-relocs
15824 Older Alpha assemblers provided no way to generate symbol relocations
15825 except via assembler macros.  Use of these macros does not allow
15826 optimal instruction scheduling.  GNU binutils as of version 2.12
15827 supports a new syntax that allows the compiler to explicitly mark
15828 which relocations should apply to which instructions.  This option
15829 is mostly useful for debugging, as GCC detects the capabilities of
15830 the assembler when it is built and sets the default accordingly.
15832 @item -msmall-data
15833 @itemx -mlarge-data
15834 @opindex msmall-data
15835 @opindex mlarge-data
15836 When @option{-mexplicit-relocs} is in effect, static data is
15837 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
15838 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
15839 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
15840 16-bit relocations off of the @code{$gp} register.  This limits the
15841 size of the small data area to 64KB, but allows the variables to be
15842 directly accessed via a single instruction.
15844 The default is @option{-mlarge-data}.  With this option the data area
15845 is limited to just below 2GB@.  Programs that require more than 2GB of
15846 data must use @code{malloc} or @code{mmap} to allocate the data in the
15847 heap instead of in the program's data segment.
15849 When generating code for shared libraries, @option{-fpic} implies
15850 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
15852 @item -msmall-text
15853 @itemx -mlarge-text
15854 @opindex msmall-text
15855 @opindex mlarge-text
15856 When @option{-msmall-text} is used, the compiler assumes that the
15857 code of the entire program (or shared library) fits in 4MB, and is
15858 thus reachable with a branch instruction.  When @option{-msmall-data}
15859 is used, the compiler can assume that all local symbols share the
15860 same @code{$gp} value, and thus reduce the number of instructions
15861 required for a function call from 4 to 1.
15863 The default is @option{-mlarge-text}.
15865 @item -mcpu=@var{cpu_type}
15866 @opindex mcpu
15867 Set the instruction set and instruction scheduling parameters for
15868 machine type @var{cpu_type}.  You can specify either the @samp{EV}
15869 style name or the corresponding chip number.  GCC supports scheduling
15870 parameters for the EV4, EV5 and EV6 family of processors and
15871 chooses the default values for the instruction set from the processor
15872 you specify.  If you do not specify a processor type, GCC defaults
15873 to the processor on which the compiler was built.
15875 Supported values for @var{cpu_type} are
15877 @table @samp
15878 @item ev4
15879 @itemx ev45
15880 @itemx 21064
15881 Schedules as an EV4 and has no instruction set extensions.
15883 @item ev5
15884 @itemx 21164
15885 Schedules as an EV5 and has no instruction set extensions.
15887 @item ev56
15888 @itemx 21164a
15889 Schedules as an EV5 and supports the BWX extension.
15891 @item pca56
15892 @itemx 21164pc
15893 @itemx 21164PC
15894 Schedules as an EV5 and supports the BWX and MAX extensions.
15896 @item ev6
15897 @itemx 21264
15898 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
15900 @item ev67
15901 @itemx 21264a
15902 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
15903 @end table
15905 Native toolchains also support the value @samp{native},
15906 which selects the best architecture option for the host processor.
15907 @option{-mcpu=native} has no effect if GCC does not recognize
15908 the processor.
15910 @item -mtune=@var{cpu_type}
15911 @opindex mtune
15912 Set only the instruction scheduling parameters for machine type
15913 @var{cpu_type}.  The instruction set is not changed.
15915 Native toolchains also support the value @samp{native},
15916 which selects the best architecture option for the host processor.
15917 @option{-mtune=native} has no effect if GCC does not recognize
15918 the processor.
15920 @item -mmemory-latency=@var{time}
15921 @opindex mmemory-latency
15922 Sets the latency the scheduler should assume for typical memory
15923 references as seen by the application.  This number is highly
15924 dependent on the memory access patterns used by the application
15925 and the size of the external cache on the machine.
15927 Valid options for @var{time} are
15929 @table @samp
15930 @item @var{number}
15931 A decimal number representing clock cycles.
15933 @item L1
15934 @itemx L2
15935 @itemx L3
15936 @itemx main
15937 The compiler contains estimates of the number of clock cycles for
15938 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
15939 (also called Dcache, Scache, and Bcache), as well as to main memory.
15940 Note that L3 is only valid for EV5.
15942 @end table
15943 @end table
15945 @node FR30 Options
15946 @subsection FR30 Options
15947 @cindex FR30 Options
15949 These options are defined specifically for the FR30 port.
15951 @table @gcctabopt
15953 @item -msmall-model
15954 @opindex msmall-model
15955 Use the small address space model.  This can produce smaller code, but
15956 it does assume that all symbolic values and addresses fit into a
15957 20-bit range.
15959 @item -mno-lsim
15960 @opindex mno-lsim
15961 Assume that runtime support has been provided and so there is no need
15962 to include the simulator library (@file{libsim.a}) on the linker
15963 command line.
15965 @end table
15967 @node FT32 Options
15968 @subsection FT32 Options
15969 @cindex FT32 Options
15971 These options are defined specifically for the FT32 port.
15973 @table @gcctabopt
15975 @item -msim
15976 @opindex msim
15977 Specifies that the program will be run on the simulator.  This causes
15978 an alternate runtime startup and library to be linked.
15979 You must not use this option when generating programs that will run on
15980 real hardware; you must provide your own runtime library for whatever
15981 I/O functions are needed.
15983 @item -mlra
15984 @opindex mlra
15985 Enable Local Register Allocation.  This is still experimental for FT32,
15986 so by default the compiler uses standard reload.
15988 @item -mnodiv
15989 @opindex mnodiv
15990 Do not use div and mod instructions.
15992 @end table
15994 @node FRV Options
15995 @subsection FRV Options
15996 @cindex FRV Options
15998 @table @gcctabopt
15999 @item -mgpr-32
16000 @opindex mgpr-32
16002 Only use the first 32 general-purpose registers.
16004 @item -mgpr-64
16005 @opindex mgpr-64
16007 Use all 64 general-purpose registers.
16009 @item -mfpr-32
16010 @opindex mfpr-32
16012 Use only the first 32 floating-point registers.
16014 @item -mfpr-64
16015 @opindex mfpr-64
16017 Use all 64 floating-point registers.
16019 @item -mhard-float
16020 @opindex mhard-float
16022 Use hardware instructions for floating-point operations.
16024 @item -msoft-float
16025 @opindex msoft-float
16027 Use library routines for floating-point operations.
16029 @item -malloc-cc
16030 @opindex malloc-cc
16032 Dynamically allocate condition code registers.
16034 @item -mfixed-cc
16035 @opindex mfixed-cc
16037 Do not try to dynamically allocate condition code registers, only
16038 use @code{icc0} and @code{fcc0}.
16040 @item -mdword
16041 @opindex mdword
16043 Change ABI to use double word insns.
16045 @item -mno-dword
16046 @opindex mno-dword
16048 Do not use double word instructions.
16050 @item -mdouble
16051 @opindex mdouble
16053 Use floating-point double instructions.
16055 @item -mno-double
16056 @opindex mno-double
16058 Do not use floating-point double instructions.
16060 @item -mmedia
16061 @opindex mmedia
16063 Use media instructions.
16065 @item -mno-media
16066 @opindex mno-media
16068 Do not use media instructions.
16070 @item -mmuladd
16071 @opindex mmuladd
16073 Use multiply and add/subtract instructions.
16075 @item -mno-muladd
16076 @opindex mno-muladd
16078 Do not use multiply and add/subtract instructions.
16080 @item -mfdpic
16081 @opindex mfdpic
16083 Select the FDPIC ABI, which uses function descriptors to represent
16084 pointers to functions.  Without any PIC/PIE-related options, it
16085 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
16086 assumes GOT entries and small data are within a 12-bit range from the
16087 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
16088 are computed with 32 bits.
16089 With a @samp{bfin-elf} target, this option implies @option{-msim}.
16091 @item -minline-plt
16092 @opindex minline-plt
16094 Enable inlining of PLT entries in function calls to functions that are
16095 not known to bind locally.  It has no effect without @option{-mfdpic}.
16096 It's enabled by default if optimizing for speed and compiling for
16097 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
16098 optimization option such as @option{-O3} or above is present in the
16099 command line.
16101 @item -mTLS
16102 @opindex mTLS
16104 Assume a large TLS segment when generating thread-local code.
16106 @item -mtls
16107 @opindex mtls
16109 Do not assume a large TLS segment when generating thread-local code.
16111 @item -mgprel-ro
16112 @opindex mgprel-ro
16114 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
16115 that is known to be in read-only sections.  It's enabled by default,
16116 except for @option{-fpic} or @option{-fpie}: even though it may help
16117 make the global offset table smaller, it trades 1 instruction for 4.
16118 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
16119 one of which may be shared by multiple symbols, and it avoids the need
16120 for a GOT entry for the referenced symbol, so it's more likely to be a
16121 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
16123 @item -multilib-library-pic
16124 @opindex multilib-library-pic
16126 Link with the (library, not FD) pic libraries.  It's implied by
16127 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
16128 @option{-fpic} without @option{-mfdpic}.  You should never have to use
16129 it explicitly.
16131 @item -mlinked-fp
16132 @opindex mlinked-fp
16134 Follow the EABI requirement of always creating a frame pointer whenever
16135 a stack frame is allocated.  This option is enabled by default and can
16136 be disabled with @option{-mno-linked-fp}.
16138 @item -mlong-calls
16139 @opindex mlong-calls
16141 Use indirect addressing to call functions outside the current
16142 compilation unit.  This allows the functions to be placed anywhere
16143 within the 32-bit address space.
16145 @item -malign-labels
16146 @opindex malign-labels
16148 Try to align labels to an 8-byte boundary by inserting NOPs into the
16149 previous packet.  This option only has an effect when VLIW packing
16150 is enabled.  It doesn't create new packets; it merely adds NOPs to
16151 existing ones.
16153 @item -mlibrary-pic
16154 @opindex mlibrary-pic
16156 Generate position-independent EABI code.
16158 @item -macc-4
16159 @opindex macc-4
16161 Use only the first four media accumulator registers.
16163 @item -macc-8
16164 @opindex macc-8
16166 Use all eight media accumulator registers.
16168 @item -mpack
16169 @opindex mpack
16171 Pack VLIW instructions.
16173 @item -mno-pack
16174 @opindex mno-pack
16176 Do not pack VLIW instructions.
16178 @item -mno-eflags
16179 @opindex mno-eflags
16181 Do not mark ABI switches in e_flags.
16183 @item -mcond-move
16184 @opindex mcond-move
16186 Enable the use of conditional-move instructions (default).
16188 This switch is mainly for debugging the compiler and will likely be removed
16189 in a future version.
16191 @item -mno-cond-move
16192 @opindex mno-cond-move
16194 Disable the use of conditional-move instructions.
16196 This switch is mainly for debugging the compiler and will likely be removed
16197 in a future version.
16199 @item -mscc
16200 @opindex mscc
16202 Enable the use of conditional set instructions (default).
16204 This switch is mainly for debugging the compiler and will likely be removed
16205 in a future version.
16207 @item -mno-scc
16208 @opindex mno-scc
16210 Disable the use of conditional set instructions.
16212 This switch is mainly for debugging the compiler and will likely be removed
16213 in a future version.
16215 @item -mcond-exec
16216 @opindex mcond-exec
16218 Enable the use of conditional execution (default).
16220 This switch is mainly for debugging the compiler and will likely be removed
16221 in a future version.
16223 @item -mno-cond-exec
16224 @opindex mno-cond-exec
16226 Disable the use of conditional execution.
16228 This switch is mainly for debugging the compiler and will likely be removed
16229 in a future version.
16231 @item -mvliw-branch
16232 @opindex mvliw-branch
16234 Run a pass to pack branches into VLIW instructions (default).
16236 This switch is mainly for debugging the compiler and will likely be removed
16237 in a future version.
16239 @item -mno-vliw-branch
16240 @opindex mno-vliw-branch
16242 Do not run a pass to pack branches into VLIW instructions.
16244 This switch is mainly for debugging the compiler and will likely be removed
16245 in a future version.
16247 @item -mmulti-cond-exec
16248 @opindex mmulti-cond-exec
16250 Enable optimization of @code{&&} and @code{||} in conditional execution
16251 (default).
16253 This switch is mainly for debugging the compiler and will likely be removed
16254 in a future version.
16256 @item -mno-multi-cond-exec
16257 @opindex mno-multi-cond-exec
16259 Disable optimization of @code{&&} and @code{||} in conditional execution.
16261 This switch is mainly for debugging the compiler and will likely be removed
16262 in a future version.
16264 @item -mnested-cond-exec
16265 @opindex mnested-cond-exec
16267 Enable nested conditional execution optimizations (default).
16269 This switch is mainly for debugging the compiler and will likely be removed
16270 in a future version.
16272 @item -mno-nested-cond-exec
16273 @opindex mno-nested-cond-exec
16275 Disable nested conditional execution optimizations.
16277 This switch is mainly for debugging the compiler and will likely be removed
16278 in a future version.
16280 @item -moptimize-membar
16281 @opindex moptimize-membar
16283 This switch removes redundant @code{membar} instructions from the
16284 compiler-generated code.  It is enabled by default.
16286 @item -mno-optimize-membar
16287 @opindex mno-optimize-membar
16289 This switch disables the automatic removal of redundant @code{membar}
16290 instructions from the generated code.
16292 @item -mtomcat-stats
16293 @opindex mtomcat-stats
16295 Cause gas to print out tomcat statistics.
16297 @item -mcpu=@var{cpu}
16298 @opindex mcpu
16300 Select the processor type for which to generate code.  Possible values are
16301 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
16302 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
16304 @end table
16306 @node GNU/Linux Options
16307 @subsection GNU/Linux Options
16309 These @samp{-m} options are defined for GNU/Linux targets:
16311 @table @gcctabopt
16312 @item -mglibc
16313 @opindex mglibc
16314 Use the GNU C library.  This is the default except
16315 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
16316 @samp{*-*-linux-*android*} targets.
16318 @item -muclibc
16319 @opindex muclibc
16320 Use uClibc C library.  This is the default on
16321 @samp{*-*-linux-*uclibc*} targets.
16323 @item -mmusl
16324 @opindex mmusl
16325 Use the musl C library.  This is the default on
16326 @samp{*-*-linux-*musl*} targets.
16328 @item -mbionic
16329 @opindex mbionic
16330 Use Bionic C library.  This is the default on
16331 @samp{*-*-linux-*android*} targets.
16333 @item -mandroid
16334 @opindex mandroid
16335 Compile code compatible with Android platform.  This is the default on
16336 @samp{*-*-linux-*android*} targets.
16338 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
16339 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
16340 this option makes the GCC driver pass Android-specific options to the linker.
16341 Finally, this option causes the preprocessor macro @code{__ANDROID__}
16342 to be defined.
16344 @item -tno-android-cc
16345 @opindex tno-android-cc
16346 Disable compilation effects of @option{-mandroid}, i.e., do not enable
16347 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
16348 @option{-fno-rtti} by default.
16350 @item -tno-android-ld
16351 @opindex tno-android-ld
16352 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
16353 linking options to the linker.
16355 @end table
16357 @node H8/300 Options
16358 @subsection H8/300 Options
16360 These @samp{-m} options are defined for the H8/300 implementations:
16362 @table @gcctabopt
16363 @item -mrelax
16364 @opindex mrelax
16365 Shorten some address references at link time, when possible; uses the
16366 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
16367 ld, Using ld}, for a fuller description.
16369 @item -mh
16370 @opindex mh
16371 Generate code for the H8/300H@.
16373 @item -ms
16374 @opindex ms
16375 Generate code for the H8S@.
16377 @item -mn
16378 @opindex mn
16379 Generate code for the H8S and H8/300H in the normal mode.  This switch
16380 must be used either with @option{-mh} or @option{-ms}.
16382 @item -ms2600
16383 @opindex ms2600
16384 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
16386 @item -mexr
16387 @opindex mexr
16388 Extended registers are stored on stack before execution of function
16389 with monitor attribute. Default option is @option{-mexr}.
16390 This option is valid only for H8S targets.
16392 @item -mno-exr
16393 @opindex mno-exr
16394 Extended registers are not stored on stack before execution of function 
16395 with monitor attribute. Default option is @option{-mno-exr}. 
16396 This option is valid only for H8S targets.
16398 @item -mint32
16399 @opindex mint32
16400 Make @code{int} data 32 bits by default.
16402 @item -malign-300
16403 @opindex malign-300
16404 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
16405 The default for the H8/300H and H8S is to align longs and floats on
16406 4-byte boundaries.
16407 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
16408 This option has no effect on the H8/300.
16409 @end table
16411 @node HPPA Options
16412 @subsection HPPA Options
16413 @cindex HPPA Options
16415 These @samp{-m} options are defined for the HPPA family of computers:
16417 @table @gcctabopt
16418 @item -march=@var{architecture-type}
16419 @opindex march
16420 Generate code for the specified architecture.  The choices for
16421 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
16422 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
16423 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
16424 architecture option for your machine.  Code compiled for lower numbered
16425 architectures runs on higher numbered architectures, but not the
16426 other way around.
16428 @item -mpa-risc-1-0
16429 @itemx -mpa-risc-1-1
16430 @itemx -mpa-risc-2-0
16431 @opindex mpa-risc-1-0
16432 @opindex mpa-risc-1-1
16433 @opindex mpa-risc-2-0
16434 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
16436 @item -mjump-in-delay
16437 @opindex mjump-in-delay
16438 This option is ignored and provided for compatibility purposes only.
16440 @item -mdisable-fpregs
16441 @opindex mdisable-fpregs
16442 Prevent floating-point registers from being used in any manner.  This is
16443 necessary for compiling kernels that perform lazy context switching of
16444 floating-point registers.  If you use this option and attempt to perform
16445 floating-point operations, the compiler aborts.
16447 @item -mdisable-indexing
16448 @opindex mdisable-indexing
16449 Prevent the compiler from using indexing address modes.  This avoids some
16450 rather obscure problems when compiling MIG generated code under MACH@.
16452 @item -mno-space-regs
16453 @opindex mno-space-regs
16454 Generate code that assumes the target has no space registers.  This allows
16455 GCC to generate faster indirect calls and use unscaled index address modes.
16457 Such code is suitable for level 0 PA systems and kernels.
16459 @item -mfast-indirect-calls
16460 @opindex mfast-indirect-calls
16461 Generate code that assumes calls never cross space boundaries.  This
16462 allows GCC to emit code that performs faster indirect calls.
16464 This option does not work in the presence of shared libraries or nested
16465 functions.
16467 @item -mfixed-range=@var{register-range}
16468 @opindex mfixed-range
16469 Generate code treating the given register range as fixed registers.
16470 A fixed register is one that the register allocator cannot use.  This is
16471 useful when compiling kernel code.  A register range is specified as
16472 two registers separated by a dash.  Multiple register ranges can be
16473 specified separated by a comma.
16475 @item -mlong-load-store
16476 @opindex mlong-load-store
16477 Generate 3-instruction load and store sequences as sometimes required by
16478 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
16479 the HP compilers.
16481 @item -mportable-runtime
16482 @opindex mportable-runtime
16483 Use the portable calling conventions proposed by HP for ELF systems.
16485 @item -mgas
16486 @opindex mgas
16487 Enable the use of assembler directives only GAS understands.
16489 @item -mschedule=@var{cpu-type}
16490 @opindex mschedule
16491 Schedule code according to the constraints for the machine type
16492 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
16493 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
16494 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
16495 proper scheduling option for your machine.  The default scheduling is
16496 @samp{8000}.
16498 @item -mlinker-opt
16499 @opindex mlinker-opt
16500 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
16501 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
16502 linkers in which they give bogus error messages when linking some programs.
16504 @item -msoft-float
16505 @opindex msoft-float
16506 Generate output containing library calls for floating point.
16507 @strong{Warning:} the requisite libraries are not available for all HPPA
16508 targets.  Normally the facilities of the machine's usual C compiler are
16509 used, but this cannot be done directly in cross-compilation.  You must make
16510 your own arrangements to provide suitable library functions for
16511 cross-compilation.
16513 @option{-msoft-float} changes the calling convention in the output file;
16514 therefore, it is only useful if you compile @emph{all} of a program with
16515 this option.  In particular, you need to compile @file{libgcc.a}, the
16516 library that comes with GCC, with @option{-msoft-float} in order for
16517 this to work.
16519 @item -msio
16520 @opindex msio
16521 Generate the predefine, @code{_SIO}, for server IO@.  The default is
16522 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
16523 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
16524 options are available under HP-UX and HI-UX@.
16526 @item -mgnu-ld
16527 @opindex mgnu-ld
16528 Use options specific to GNU @command{ld}.
16529 This passes @option{-shared} to @command{ld} when
16530 building a shared library.  It is the default when GCC is configured,
16531 explicitly or implicitly, with the GNU linker.  This option does not
16532 affect which @command{ld} is called; it only changes what parameters
16533 are passed to that @command{ld}.
16534 The @command{ld} that is called is determined by the
16535 @option{--with-ld} configure option, GCC's program search path, and
16536 finally by the user's @env{PATH}.  The linker used by GCC can be printed
16537 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
16538 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
16540 @item -mhp-ld
16541 @opindex mhp-ld
16542 Use options specific to HP @command{ld}.
16543 This passes @option{-b} to @command{ld} when building
16544 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
16545 links.  It is the default when GCC is configured, explicitly or
16546 implicitly, with the HP linker.  This option does not affect
16547 which @command{ld} is called; it only changes what parameters are passed to that
16548 @command{ld}.
16549 The @command{ld} that is called is determined by the @option{--with-ld}
16550 configure option, GCC's program search path, and finally by the user's
16551 @env{PATH}.  The linker used by GCC can be printed using @samp{which
16552 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
16553 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
16555 @item -mlong-calls
16556 @opindex mno-long-calls
16557 Generate code that uses long call sequences.  This ensures that a call
16558 is always able to reach linker generated stubs.  The default is to generate
16559 long calls only when the distance from the call site to the beginning
16560 of the function or translation unit, as the case may be, exceeds a
16561 predefined limit set by the branch type being used.  The limits for
16562 normal calls are 7,600,000 and 240,000 bytes, respectively for the
16563 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
16564 240,000 bytes.
16566 Distances are measured from the beginning of functions when using the
16567 @option{-ffunction-sections} option, or when using the @option{-mgas}
16568 and @option{-mno-portable-runtime} options together under HP-UX with
16569 the SOM linker.
16571 It is normally not desirable to use this option as it degrades
16572 performance.  However, it may be useful in large applications,
16573 particularly when partial linking is used to build the application.
16575 The types of long calls used depends on the capabilities of the
16576 assembler and linker, and the type of code being generated.  The
16577 impact on systems that support long absolute calls, and long pic
16578 symbol-difference or pc-relative calls should be relatively small.
16579 However, an indirect call is used on 32-bit ELF systems in pic code
16580 and it is quite long.
16582 @item -munix=@var{unix-std}
16583 @opindex march
16584 Generate compiler predefines and select a startfile for the specified
16585 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
16586 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
16587 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
16588 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
16589 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
16590 and later.
16592 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
16593 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
16594 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
16595 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
16596 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
16597 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
16599 It is @emph{important} to note that this option changes the interfaces
16600 for various library routines.  It also affects the operational behavior
16601 of the C library.  Thus, @emph{extreme} care is needed in using this
16602 option.
16604 Library code that is intended to operate with more than one UNIX
16605 standard must test, set and restore the variable @code{__xpg4_extended_mask}
16606 as appropriate.  Most GNU software doesn't provide this capability.
16608 @item -nolibdld
16609 @opindex nolibdld
16610 Suppress the generation of link options to search libdld.sl when the
16611 @option{-static} option is specified on HP-UX 10 and later.
16613 @item -static
16614 @opindex static
16615 The HP-UX implementation of setlocale in libc has a dependency on
16616 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
16617 when the @option{-static} option is specified, special link options
16618 are needed to resolve this dependency.
16620 On HP-UX 10 and later, the GCC driver adds the necessary options to
16621 link with libdld.sl when the @option{-static} option is specified.
16622 This causes the resulting binary to be dynamic.  On the 64-bit port,
16623 the linkers generate dynamic binaries by default in any case.  The
16624 @option{-nolibdld} option can be used to prevent the GCC driver from
16625 adding these link options.
16627 @item -threads
16628 @opindex threads
16629 Add support for multithreading with the @dfn{dce thread} library
16630 under HP-UX@.  This option sets flags for both the preprocessor and
16631 linker.
16632 @end table
16634 @node IA-64 Options
16635 @subsection IA-64 Options
16636 @cindex IA-64 Options
16638 These are the @samp{-m} options defined for the Intel IA-64 architecture.
16640 @table @gcctabopt
16641 @item -mbig-endian
16642 @opindex mbig-endian
16643 Generate code for a big-endian target.  This is the default for HP-UX@.
16645 @item -mlittle-endian
16646 @opindex mlittle-endian
16647 Generate code for a little-endian target.  This is the default for AIX5
16648 and GNU/Linux.
16650 @item -mgnu-as
16651 @itemx -mno-gnu-as
16652 @opindex mgnu-as
16653 @opindex mno-gnu-as
16654 Generate (or don't) code for the GNU assembler.  This is the default.
16655 @c Also, this is the default if the configure option @option{--with-gnu-as}
16656 @c is used.
16658 @item -mgnu-ld
16659 @itemx -mno-gnu-ld
16660 @opindex mgnu-ld
16661 @opindex mno-gnu-ld
16662 Generate (or don't) code for the GNU linker.  This is the default.
16663 @c Also, this is the default if the configure option @option{--with-gnu-ld}
16664 @c is used.
16666 @item -mno-pic
16667 @opindex mno-pic
16668 Generate code that does not use a global pointer register.  The result
16669 is not position independent code, and violates the IA-64 ABI@.
16671 @item -mvolatile-asm-stop
16672 @itemx -mno-volatile-asm-stop
16673 @opindex mvolatile-asm-stop
16674 @opindex mno-volatile-asm-stop
16675 Generate (or don't) a stop bit immediately before and after volatile asm
16676 statements.
16678 @item -mregister-names
16679 @itemx -mno-register-names
16680 @opindex mregister-names
16681 @opindex mno-register-names
16682 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
16683 the stacked registers.  This may make assembler output more readable.
16685 @item -mno-sdata
16686 @itemx -msdata
16687 @opindex mno-sdata
16688 @opindex msdata
16689 Disable (or enable) optimizations that use the small data section.  This may
16690 be useful for working around optimizer bugs.
16692 @item -mconstant-gp
16693 @opindex mconstant-gp
16694 Generate code that uses a single constant global pointer value.  This is
16695 useful when compiling kernel code.
16697 @item -mauto-pic
16698 @opindex mauto-pic
16699 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16700 This is useful when compiling firmware code.
16702 @item -minline-float-divide-min-latency
16703 @opindex minline-float-divide-min-latency
16704 Generate code for inline divides of floating-point values
16705 using the minimum latency algorithm.
16707 @item -minline-float-divide-max-throughput
16708 @opindex minline-float-divide-max-throughput
16709 Generate code for inline divides of floating-point values
16710 using the maximum throughput algorithm.
16712 @item -mno-inline-float-divide
16713 @opindex mno-inline-float-divide
16714 Do not generate inline code for divides of floating-point values.
16716 @item -minline-int-divide-min-latency
16717 @opindex minline-int-divide-min-latency
16718 Generate code for inline divides of integer values
16719 using the minimum latency algorithm.
16721 @item -minline-int-divide-max-throughput
16722 @opindex minline-int-divide-max-throughput
16723 Generate code for inline divides of integer values
16724 using the maximum throughput algorithm.
16726 @item -mno-inline-int-divide
16727 @opindex mno-inline-int-divide
16728 Do not generate inline code for divides of integer values.
16730 @item -minline-sqrt-min-latency
16731 @opindex minline-sqrt-min-latency
16732 Generate code for inline square roots
16733 using the minimum latency algorithm.
16735 @item -minline-sqrt-max-throughput
16736 @opindex minline-sqrt-max-throughput
16737 Generate code for inline square roots
16738 using the maximum throughput algorithm.
16740 @item -mno-inline-sqrt
16741 @opindex mno-inline-sqrt
16742 Do not generate inline code for @code{sqrt}.
16744 @item -mfused-madd
16745 @itemx -mno-fused-madd
16746 @opindex mfused-madd
16747 @opindex mno-fused-madd
16748 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16749 instructions.  The default is to use these instructions.
16751 @item -mno-dwarf2-asm
16752 @itemx -mdwarf2-asm
16753 @opindex mno-dwarf2-asm
16754 @opindex mdwarf2-asm
16755 Don't (or do) generate assembler code for the DWARF line number debugging
16756 info.  This may be useful when not using the GNU assembler.
16758 @item -mearly-stop-bits
16759 @itemx -mno-early-stop-bits
16760 @opindex mearly-stop-bits
16761 @opindex mno-early-stop-bits
16762 Allow stop bits to be placed earlier than immediately preceding the
16763 instruction that triggered the stop bit.  This can improve instruction
16764 scheduling, but does not always do so.
16766 @item -mfixed-range=@var{register-range}
16767 @opindex mfixed-range
16768 Generate code treating the given register range as fixed registers.
16769 A fixed register is one that the register allocator cannot use.  This is
16770 useful when compiling kernel code.  A register range is specified as
16771 two registers separated by a dash.  Multiple register ranges can be
16772 specified separated by a comma.
16774 @item -mtls-size=@var{tls-size}
16775 @opindex mtls-size
16776 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16779 @item -mtune=@var{cpu-type}
16780 @opindex mtune
16781 Tune the instruction scheduling for a particular CPU, Valid values are
16782 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16783 and @samp{mckinley}.
16785 @item -milp32
16786 @itemx -mlp64
16787 @opindex milp32
16788 @opindex mlp64
16789 Generate code for a 32-bit or 64-bit environment.
16790 The 32-bit environment sets int, long and pointer to 32 bits.
16791 The 64-bit environment sets int to 32 bits and long and pointer
16792 to 64 bits.  These are HP-UX specific flags.
16794 @item -mno-sched-br-data-spec
16795 @itemx -msched-br-data-spec
16796 @opindex mno-sched-br-data-spec
16797 @opindex msched-br-data-spec
16798 (Dis/En)able data speculative scheduling before reload.
16799 This results in generation of @code{ld.a} instructions and
16800 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16801 The default setting is disabled.
16803 @item -msched-ar-data-spec
16804 @itemx -mno-sched-ar-data-spec
16805 @opindex msched-ar-data-spec
16806 @opindex mno-sched-ar-data-spec
16807 (En/Dis)able data speculative scheduling after reload.
16808 This results in generation of @code{ld.a} instructions and
16809 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16810 The default setting is enabled.
16812 @item -mno-sched-control-spec
16813 @itemx -msched-control-spec
16814 @opindex mno-sched-control-spec
16815 @opindex msched-control-spec
16816 (Dis/En)able control speculative scheduling.  This feature is
16817 available only during region scheduling (i.e.@: before reload).
16818 This results in generation of the @code{ld.s} instructions and
16819 the corresponding check instructions @code{chk.s}.
16820 The default setting is disabled.
16822 @item -msched-br-in-data-spec
16823 @itemx -mno-sched-br-in-data-spec
16824 @opindex msched-br-in-data-spec
16825 @opindex mno-sched-br-in-data-spec
16826 (En/Dis)able speculative scheduling of the instructions that
16827 are dependent on the data speculative loads before reload.
16828 This is effective only with @option{-msched-br-data-spec} enabled.
16829 The default setting is enabled.
16831 @item -msched-ar-in-data-spec
16832 @itemx -mno-sched-ar-in-data-spec
16833 @opindex msched-ar-in-data-spec
16834 @opindex mno-sched-ar-in-data-spec
16835 (En/Dis)able speculative scheduling of the instructions that
16836 are dependent on the data speculative loads after reload.
16837 This is effective only with @option{-msched-ar-data-spec} enabled.
16838 The default setting is enabled.
16840 @item -msched-in-control-spec
16841 @itemx -mno-sched-in-control-spec
16842 @opindex msched-in-control-spec
16843 @opindex mno-sched-in-control-spec
16844 (En/Dis)able speculative scheduling of the instructions that
16845 are dependent on the control speculative loads.
16846 This is effective only with @option{-msched-control-spec} enabled.
16847 The default setting is enabled.
16849 @item -mno-sched-prefer-non-data-spec-insns
16850 @itemx -msched-prefer-non-data-spec-insns
16851 @opindex mno-sched-prefer-non-data-spec-insns
16852 @opindex msched-prefer-non-data-spec-insns
16853 If enabled, data-speculative instructions are chosen for schedule
16854 only if there are no other choices at the moment.  This makes
16855 the use of the data speculation much more conservative.
16856 The default setting is disabled.
16858 @item -mno-sched-prefer-non-control-spec-insns
16859 @itemx -msched-prefer-non-control-spec-insns
16860 @opindex mno-sched-prefer-non-control-spec-insns
16861 @opindex msched-prefer-non-control-spec-insns
16862 If enabled, control-speculative instructions are chosen for schedule
16863 only if there are no other choices at the moment.  This makes
16864 the use of the control speculation much more conservative.
16865 The default setting is disabled.
16867 @item -mno-sched-count-spec-in-critical-path
16868 @itemx -msched-count-spec-in-critical-path
16869 @opindex mno-sched-count-spec-in-critical-path
16870 @opindex msched-count-spec-in-critical-path
16871 If enabled, speculative dependencies are considered during
16872 computation of the instructions priorities.  This makes the use of the
16873 speculation a bit more conservative.
16874 The default setting is disabled.
16876 @item -msched-spec-ldc
16877 @opindex msched-spec-ldc
16878 Use a simple data speculation check.  This option is on by default.
16880 @item -msched-control-spec-ldc
16881 @opindex msched-spec-ldc
16882 Use a simple check for control speculation.  This option is on by default.
16884 @item -msched-stop-bits-after-every-cycle
16885 @opindex msched-stop-bits-after-every-cycle
16886 Place a stop bit after every cycle when scheduling.  This option is on
16887 by default.
16889 @item -msched-fp-mem-deps-zero-cost
16890 @opindex msched-fp-mem-deps-zero-cost
16891 Assume that floating-point stores and loads are not likely to cause a conflict
16892 when placed into the same instruction group.  This option is disabled by
16893 default.
16895 @item -msel-sched-dont-check-control-spec
16896 @opindex msel-sched-dont-check-control-spec
16897 Generate checks for control speculation in selective scheduling.
16898 This flag is disabled by default.
16900 @item -msched-max-memory-insns=@var{max-insns}
16901 @opindex msched-max-memory-insns
16902 Limit on the number of memory insns per instruction group, giving lower
16903 priority to subsequent memory insns attempting to schedule in the same
16904 instruction group. Frequently useful to prevent cache bank conflicts.
16905 The default value is 1.
16907 @item -msched-max-memory-insns-hard-limit
16908 @opindex msched-max-memory-insns-hard-limit
16909 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16910 disallowing more than that number in an instruction group.
16911 Otherwise, the limit is ``soft'', meaning that non-memory operations
16912 are preferred when the limit is reached, but memory operations may still
16913 be scheduled.
16915 @end table
16917 @node LM32 Options
16918 @subsection LM32 Options
16919 @cindex LM32 options
16921 These @option{-m} options are defined for the LatticeMico32 architecture:
16923 @table @gcctabopt
16924 @item -mbarrel-shift-enabled
16925 @opindex mbarrel-shift-enabled
16926 Enable barrel-shift instructions.
16928 @item -mdivide-enabled
16929 @opindex mdivide-enabled
16930 Enable divide and modulus instructions.
16932 @item -mmultiply-enabled
16933 @opindex multiply-enabled
16934 Enable multiply instructions.
16936 @item -msign-extend-enabled
16937 @opindex msign-extend-enabled
16938 Enable sign extend instructions.
16940 @item -muser-enabled
16941 @opindex muser-enabled
16942 Enable user-defined instructions.
16944 @end table
16946 @node M32C Options
16947 @subsection M32C Options
16948 @cindex M32C options
16950 @table @gcctabopt
16951 @item -mcpu=@var{name}
16952 @opindex mcpu=
16953 Select the CPU for which code is generated.  @var{name} may be one of
16954 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16955 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16956 the M32C/80 series.
16958 @item -msim
16959 @opindex msim
16960 Specifies that the program will be run on the simulator.  This causes
16961 an alternate runtime library to be linked in which supports, for
16962 example, file I/O@.  You must not use this option when generating
16963 programs that will run on real hardware; you must provide your own
16964 runtime library for whatever I/O functions are needed.
16966 @item -memregs=@var{number}
16967 @opindex memregs=
16968 Specifies the number of memory-based pseudo-registers GCC uses
16969 during code generation.  These pseudo-registers are used like real
16970 registers, so there is a tradeoff between GCC's ability to fit the
16971 code into available registers, and the performance penalty of using
16972 memory instead of registers.  Note that all modules in a program must
16973 be compiled with the same value for this option.  Because of that, you
16974 must not use this option with GCC's default runtime libraries.
16976 @end table
16978 @node M32R/D Options
16979 @subsection M32R/D Options
16980 @cindex M32R/D options
16982 These @option{-m} options are defined for Renesas M32R/D architectures:
16984 @table @gcctabopt
16985 @item -m32r2
16986 @opindex m32r2
16987 Generate code for the M32R/2@.
16989 @item -m32rx
16990 @opindex m32rx
16991 Generate code for the M32R/X@.
16993 @item -m32r
16994 @opindex m32r
16995 Generate code for the M32R@.  This is the default.
16997 @item -mmodel=small
16998 @opindex mmodel=small
16999 Assume all objects live in the lower 16MB of memory (so that their addresses
17000 can be loaded with the @code{ld24} instruction), and assume all subroutines
17001 are reachable with the @code{bl} instruction.
17002 This is the default.
17004 The addressability of a particular object can be set with the
17005 @code{model} attribute.
17007 @item -mmodel=medium
17008 @opindex mmodel=medium
17009 Assume objects may be anywhere in the 32-bit address space (the compiler
17010 generates @code{seth/add3} instructions to load their addresses), and
17011 assume all subroutines are reachable with the @code{bl} instruction.
17013 @item -mmodel=large
17014 @opindex mmodel=large
17015 Assume objects may be anywhere in the 32-bit address space (the compiler
17016 generates @code{seth/add3} instructions to load their addresses), and
17017 assume subroutines may not be reachable with the @code{bl} instruction
17018 (the compiler generates the much slower @code{seth/add3/jl}
17019 instruction sequence).
17021 @item -msdata=none
17022 @opindex msdata=none
17023 Disable use of the small data area.  Variables are put into
17024 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
17025 @code{section} attribute has been specified).
17026 This is the default.
17028 The small data area consists of sections @code{.sdata} and @code{.sbss}.
17029 Objects may be explicitly put in the small data area with the
17030 @code{section} attribute using one of these sections.
17032 @item -msdata=sdata
17033 @opindex msdata=sdata
17034 Put small global and static data in the small data area, but do not
17035 generate special code to reference them.
17037 @item -msdata=use
17038 @opindex msdata=use
17039 Put small global and static data in the small data area, and generate
17040 special instructions to reference them.
17042 @item -G @var{num}
17043 @opindex G
17044 @cindex smaller data references
17045 Put global and static objects less than or equal to @var{num} bytes
17046 into the small data or BSS sections instead of the normal data or BSS
17047 sections.  The default value of @var{num} is 8.
17048 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
17049 for this option to have any effect.
17051 All modules should be compiled with the same @option{-G @var{num}} value.
17052 Compiling with different values of @var{num} may or may not work; if it
17053 doesn't the linker gives an error message---incorrect code is not
17054 generated.
17056 @item -mdebug
17057 @opindex mdebug
17058 Makes the M32R-specific code in the compiler display some statistics
17059 that might help in debugging programs.
17061 @item -malign-loops
17062 @opindex malign-loops
17063 Align all loops to a 32-byte boundary.
17065 @item -mno-align-loops
17066 @opindex mno-align-loops
17067 Do not enforce a 32-byte alignment for loops.  This is the default.
17069 @item -missue-rate=@var{number}
17070 @opindex missue-rate=@var{number}
17071 Issue @var{number} instructions per cycle.  @var{number} can only be 1
17072 or 2.
17074 @item -mbranch-cost=@var{number}
17075 @opindex mbranch-cost=@var{number}
17076 @var{number} can only be 1 or 2.  If it is 1 then branches are
17077 preferred over conditional code, if it is 2, then the opposite applies.
17079 @item -mflush-trap=@var{number}
17080 @opindex mflush-trap=@var{number}
17081 Specifies the trap number to use to flush the cache.  The default is
17082 12.  Valid numbers are between 0 and 15 inclusive.
17084 @item -mno-flush-trap
17085 @opindex mno-flush-trap
17086 Specifies that the cache cannot be flushed by using a trap.
17088 @item -mflush-func=@var{name}
17089 @opindex mflush-func=@var{name}
17090 Specifies the name of the operating system function to call to flush
17091 the cache.  The default is @samp{_flush_cache}, but a function call
17092 is only used if a trap is not available.
17094 @item -mno-flush-func
17095 @opindex mno-flush-func
17096 Indicates that there is no OS function for flushing the cache.
17098 @end table
17100 @node M680x0 Options
17101 @subsection M680x0 Options
17102 @cindex M680x0 options
17104 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
17105 The default settings depend on which architecture was selected when
17106 the compiler was configured; the defaults for the most common choices
17107 are given below.
17109 @table @gcctabopt
17110 @item -march=@var{arch}
17111 @opindex march
17112 Generate code for a specific M680x0 or ColdFire instruction set
17113 architecture.  Permissible values of @var{arch} for M680x0
17114 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
17115 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
17116 architectures are selected according to Freescale's ISA classification
17117 and the permissible values are: @samp{isaa}, @samp{isaaplus},
17118 @samp{isab} and @samp{isac}.
17120 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
17121 code for a ColdFire target.  The @var{arch} in this macro is one of the
17122 @option{-march} arguments given above.
17124 When used together, @option{-march} and @option{-mtune} select code
17125 that runs on a family of similar processors but that is optimized
17126 for a particular microarchitecture.
17128 @item -mcpu=@var{cpu}
17129 @opindex mcpu
17130 Generate code for a specific M680x0 or ColdFire processor.
17131 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
17132 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
17133 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
17134 below, which also classifies the CPUs into families:
17136 @multitable @columnfractions 0.20 0.80
17137 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
17138 @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}
17139 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
17140 @item @samp{5206e} @tab @samp{5206e}
17141 @item @samp{5208} @tab @samp{5207} @samp{5208}
17142 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
17143 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
17144 @item @samp{5216} @tab @samp{5214} @samp{5216}
17145 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
17146 @item @samp{5225} @tab @samp{5224} @samp{5225}
17147 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
17148 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
17149 @item @samp{5249} @tab @samp{5249}
17150 @item @samp{5250} @tab @samp{5250}
17151 @item @samp{5271} @tab @samp{5270} @samp{5271}
17152 @item @samp{5272} @tab @samp{5272}
17153 @item @samp{5275} @tab @samp{5274} @samp{5275}
17154 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
17155 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
17156 @item @samp{5307} @tab @samp{5307}
17157 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
17158 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
17159 @item @samp{5407} @tab @samp{5407}
17160 @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}
17161 @end multitable
17163 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
17164 @var{arch} is compatible with @var{cpu}.  Other combinations of
17165 @option{-mcpu} and @option{-march} are rejected.
17167 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
17168 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
17169 where the value of @var{family} is given by the table above.
17171 @item -mtune=@var{tune}
17172 @opindex mtune
17173 Tune the code for a particular microarchitecture within the
17174 constraints set by @option{-march} and @option{-mcpu}.
17175 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
17176 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
17177 and @samp{cpu32}.  The ColdFire microarchitectures
17178 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
17180 You can also use @option{-mtune=68020-40} for code that needs
17181 to run relatively well on 68020, 68030 and 68040 targets.
17182 @option{-mtune=68020-60} is similar but includes 68060 targets
17183 as well.  These two options select the same tuning decisions as
17184 @option{-m68020-40} and @option{-m68020-60} respectively.
17186 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
17187 when tuning for 680x0 architecture @var{arch}.  It also defines
17188 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
17189 option is used.  If GCC is tuning for a range of architectures,
17190 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
17191 it defines the macros for every architecture in the range.
17193 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
17194 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
17195 of the arguments given above.
17197 @item -m68000
17198 @itemx -mc68000
17199 @opindex m68000
17200 @opindex mc68000
17201 Generate output for a 68000.  This is the default
17202 when the compiler is configured for 68000-based systems.
17203 It is equivalent to @option{-march=68000}.
17205 Use this option for microcontrollers with a 68000 or EC000 core,
17206 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
17208 @item -m68010
17209 @opindex m68010
17210 Generate output for a 68010.  This is the default
17211 when the compiler is configured for 68010-based systems.
17212 It is equivalent to @option{-march=68010}.
17214 @item -m68020
17215 @itemx -mc68020
17216 @opindex m68020
17217 @opindex mc68020
17218 Generate output for a 68020.  This is the default
17219 when the compiler is configured for 68020-based systems.
17220 It is equivalent to @option{-march=68020}.
17222 @item -m68030
17223 @opindex m68030
17224 Generate output for a 68030.  This is the default when the compiler is
17225 configured for 68030-based systems.  It is equivalent to
17226 @option{-march=68030}.
17228 @item -m68040
17229 @opindex m68040
17230 Generate output for a 68040.  This is the default when the compiler is
17231 configured for 68040-based systems.  It is equivalent to
17232 @option{-march=68040}.
17234 This option inhibits the use of 68881/68882 instructions that have to be
17235 emulated by software on the 68040.  Use this option if your 68040 does not
17236 have code to emulate those instructions.
17238 @item -m68060
17239 @opindex m68060
17240 Generate output for a 68060.  This is the default when the compiler is
17241 configured for 68060-based systems.  It is equivalent to
17242 @option{-march=68060}.
17244 This option inhibits the use of 68020 and 68881/68882 instructions that
17245 have to be emulated by software on the 68060.  Use this option if your 68060
17246 does not have code to emulate those instructions.
17248 @item -mcpu32
17249 @opindex mcpu32
17250 Generate output for a CPU32.  This is the default
17251 when the compiler is configured for CPU32-based systems.
17252 It is equivalent to @option{-march=cpu32}.
17254 Use this option for microcontrollers with a
17255 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
17256 68336, 68340, 68341, 68349 and 68360.
17258 @item -m5200
17259 @opindex m5200
17260 Generate output for a 520X ColdFire CPU@.  This is the default
17261 when the compiler is configured for 520X-based systems.
17262 It is equivalent to @option{-mcpu=5206}, and is now deprecated
17263 in favor of that option.
17265 Use this option for microcontroller with a 5200 core, including
17266 the MCF5202, MCF5203, MCF5204 and MCF5206.
17268 @item -m5206e
17269 @opindex m5206e
17270 Generate output for a 5206e ColdFire CPU@.  The option is now
17271 deprecated in favor of the equivalent @option{-mcpu=5206e}.
17273 @item -m528x
17274 @opindex m528x
17275 Generate output for a member of the ColdFire 528X family.
17276 The option is now deprecated in favor of the equivalent
17277 @option{-mcpu=528x}.
17279 @item -m5307
17280 @opindex m5307
17281 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
17282 in favor of the equivalent @option{-mcpu=5307}.
17284 @item -m5407
17285 @opindex m5407
17286 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
17287 in favor of the equivalent @option{-mcpu=5407}.
17289 @item -mcfv4e
17290 @opindex mcfv4e
17291 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
17292 This includes use of hardware floating-point instructions.
17293 The option is equivalent to @option{-mcpu=547x}, and is now
17294 deprecated in favor of that option.
17296 @item -m68020-40
17297 @opindex m68020-40
17298 Generate output for a 68040, without using any of the new instructions.
17299 This results in code that can run relatively efficiently on either a
17300 68020/68881 or a 68030 or a 68040.  The generated code does use the
17301 68881 instructions that are emulated on the 68040.
17303 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
17305 @item -m68020-60
17306 @opindex m68020-60
17307 Generate output for a 68060, without using any of the new instructions.
17308 This results in code that can run relatively efficiently on either a
17309 68020/68881 or a 68030 or a 68040.  The generated code does use the
17310 68881 instructions that are emulated on the 68060.
17312 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
17314 @item -mhard-float
17315 @itemx -m68881
17316 @opindex mhard-float
17317 @opindex m68881
17318 Generate floating-point instructions.  This is the default for 68020
17319 and above, and for ColdFire devices that have an FPU@.  It defines the
17320 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
17321 on ColdFire targets.
17323 @item -msoft-float
17324 @opindex msoft-float
17325 Do not generate floating-point instructions; use library calls instead.
17326 This is the default for 68000, 68010, and 68832 targets.  It is also
17327 the default for ColdFire devices that have no FPU.
17329 @item -mdiv
17330 @itemx -mno-div
17331 @opindex mdiv
17332 @opindex mno-div
17333 Generate (do not generate) ColdFire hardware divide and remainder
17334 instructions.  If @option{-march} is used without @option{-mcpu},
17335 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
17336 architectures.  Otherwise, the default is taken from the target CPU
17337 (either the default CPU, or the one specified by @option{-mcpu}).  For
17338 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
17339 @option{-mcpu=5206e}.
17341 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
17343 @item -mshort
17344 @opindex mshort
17345 Consider type @code{int} to be 16 bits wide, like @code{short int}.
17346 Additionally, parameters passed on the stack are also aligned to a
17347 16-bit boundary even on targets whose API mandates promotion to 32-bit.
17349 @item -mno-short
17350 @opindex mno-short
17351 Do not consider type @code{int} to be 16 bits wide.  This is the default.
17353 @item -mnobitfield
17354 @itemx -mno-bitfield
17355 @opindex mnobitfield
17356 @opindex mno-bitfield
17357 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
17358 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
17360 @item -mbitfield
17361 @opindex mbitfield
17362 Do use the bit-field instructions.  The @option{-m68020} option implies
17363 @option{-mbitfield}.  This is the default if you use a configuration
17364 designed for a 68020.
17366 @item -mrtd
17367 @opindex mrtd
17368 Use a different function-calling convention, in which functions
17369 that take a fixed number of arguments return with the @code{rtd}
17370 instruction, which pops their arguments while returning.  This
17371 saves one instruction in the caller since there is no need to pop
17372 the arguments there.
17374 This calling convention is incompatible with the one normally
17375 used on Unix, so you cannot use it if you need to call libraries
17376 compiled with the Unix compiler.
17378 Also, you must provide function prototypes for all functions that
17379 take variable numbers of arguments (including @code{printf});
17380 otherwise incorrect code is generated for calls to those
17381 functions.
17383 In addition, seriously incorrect code results if you call a
17384 function with too many arguments.  (Normally, extra arguments are
17385 harmlessly ignored.)
17387 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
17388 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
17390 @item -mno-rtd
17391 @opindex mno-rtd
17392 Do not use the calling conventions selected by @option{-mrtd}.
17393 This is the default.
17395 @item -malign-int
17396 @itemx -mno-align-int
17397 @opindex malign-int
17398 @opindex mno-align-int
17399 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
17400 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
17401 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
17402 Aligning variables on 32-bit boundaries produces code that runs somewhat
17403 faster on processors with 32-bit busses at the expense of more memory.
17405 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
17406 aligns structures containing the above types differently than
17407 most published application binary interface specifications for the m68k.
17409 @item -mpcrel
17410 @opindex mpcrel
17411 Use the pc-relative addressing mode of the 68000 directly, instead of
17412 using a global offset table.  At present, this option implies @option{-fpic},
17413 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
17414 not presently supported with @option{-mpcrel}, though this could be supported for
17415 68020 and higher processors.
17417 @item -mno-strict-align
17418 @itemx -mstrict-align
17419 @opindex mno-strict-align
17420 @opindex mstrict-align
17421 Do not (do) assume that unaligned memory references are handled by
17422 the system.
17424 @item -msep-data
17425 Generate code that allows the data segment to be located in a different
17426 area of memory from the text segment.  This allows for execute-in-place in
17427 an environment without virtual memory management.  This option implies
17428 @option{-fPIC}.
17430 @item -mno-sep-data
17431 Generate code that assumes that the data segment follows the text segment.
17432 This is the default.
17434 @item -mid-shared-library
17435 Generate code that supports shared libraries via the library ID method.
17436 This allows for execute-in-place and shared libraries in an environment
17437 without virtual memory management.  This option implies @option{-fPIC}.
17439 @item -mno-id-shared-library
17440 Generate code that doesn't assume ID-based shared libraries are being used.
17441 This is the default.
17443 @item -mshared-library-id=n
17444 Specifies the identification number of the ID-based shared library being
17445 compiled.  Specifying a value of 0 generates more compact code; specifying
17446 other values forces the allocation of that number to the current
17447 library, but is no more space- or time-efficient than omitting this option.
17449 @item -mxgot
17450 @itemx -mno-xgot
17451 @opindex mxgot
17452 @opindex mno-xgot
17453 When generating position-independent code for ColdFire, generate code
17454 that works if the GOT has more than 8192 entries.  This code is
17455 larger and slower than code generated without this option.  On M680x0
17456 processors, this option is not needed; @option{-fPIC} suffices.
17458 GCC normally uses a single instruction to load values from the GOT@.
17459 While this is relatively efficient, it only works if the GOT
17460 is smaller than about 64k.  Anything larger causes the linker
17461 to report an error such as:
17463 @cindex relocation truncated to fit (ColdFire)
17464 @smallexample
17465 relocation truncated to fit: R_68K_GOT16O foobar
17466 @end smallexample
17468 If this happens, you should recompile your code with @option{-mxgot}.
17469 It should then work with very large GOTs.  However, code generated with
17470 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
17471 the value of a global symbol.
17473 Note that some linkers, including newer versions of the GNU linker,
17474 can create multiple GOTs and sort GOT entries.  If you have such a linker,
17475 you should only need to use @option{-mxgot} when compiling a single
17476 object file that accesses more than 8192 GOT entries.  Very few do.
17478 These options have no effect unless GCC is generating
17479 position-independent code.
17481 @end table
17483 @node MCore Options
17484 @subsection MCore Options
17485 @cindex MCore options
17487 These are the @samp{-m} options defined for the Motorola M*Core
17488 processors.
17490 @table @gcctabopt
17492 @item -mhardlit
17493 @itemx -mno-hardlit
17494 @opindex mhardlit
17495 @opindex mno-hardlit
17496 Inline constants into the code stream if it can be done in two
17497 instructions or less.
17499 @item -mdiv
17500 @itemx -mno-div
17501 @opindex mdiv
17502 @opindex mno-div
17503 Use the divide instruction.  (Enabled by default).
17505 @item -mrelax-immediate
17506 @itemx -mno-relax-immediate
17507 @opindex mrelax-immediate
17508 @opindex mno-relax-immediate
17509 Allow arbitrary-sized immediates in bit operations.
17511 @item -mwide-bitfields
17512 @itemx -mno-wide-bitfields
17513 @opindex mwide-bitfields
17514 @opindex mno-wide-bitfields
17515 Always treat bit-fields as @code{int}-sized.
17517 @item -m4byte-functions
17518 @itemx -mno-4byte-functions
17519 @opindex m4byte-functions
17520 @opindex mno-4byte-functions
17521 Force all functions to be aligned to a 4-byte boundary.
17523 @item -mcallgraph-data
17524 @itemx -mno-callgraph-data
17525 @opindex mcallgraph-data
17526 @opindex mno-callgraph-data
17527 Emit callgraph information.
17529 @item -mslow-bytes
17530 @itemx -mno-slow-bytes
17531 @opindex mslow-bytes
17532 @opindex mno-slow-bytes
17533 Prefer word access when reading byte quantities.
17535 @item -mlittle-endian
17536 @itemx -mbig-endian
17537 @opindex mlittle-endian
17538 @opindex mbig-endian
17539 Generate code for a little-endian target.
17541 @item -m210
17542 @itemx -m340
17543 @opindex m210
17544 @opindex m340
17545 Generate code for the 210 processor.
17547 @item -mno-lsim
17548 @opindex mno-lsim
17549 Assume that runtime support has been provided and so omit the
17550 simulator library (@file{libsim.a)} from the linker command line.
17552 @item -mstack-increment=@var{size}
17553 @opindex mstack-increment
17554 Set the maximum amount for a single stack increment operation.  Large
17555 values can increase the speed of programs that contain functions
17556 that need a large amount of stack space, but they can also trigger a
17557 segmentation fault if the stack is extended too much.  The default
17558 value is 0x1000.
17560 @end table
17562 @node MeP Options
17563 @subsection MeP Options
17564 @cindex MeP options
17566 @table @gcctabopt
17568 @item -mabsdiff
17569 @opindex mabsdiff
17570 Enables the @code{abs} instruction, which is the absolute difference
17571 between two registers.
17573 @item -mall-opts
17574 @opindex mall-opts
17575 Enables all the optional instructions---average, multiply, divide, bit
17576 operations, leading zero, absolute difference, min/max, clip, and
17577 saturation.
17580 @item -maverage
17581 @opindex maverage
17582 Enables the @code{ave} instruction, which computes the average of two
17583 registers.
17585 @item -mbased=@var{n}
17586 @opindex mbased=
17587 Variables of size @var{n} bytes or smaller are placed in the
17588 @code{.based} section by default.  Based variables use the @code{$tp}
17589 register as a base register, and there is a 128-byte limit to the
17590 @code{.based} section.
17592 @item -mbitops
17593 @opindex mbitops
17594 Enables the bit operation instructions---bit test (@code{btstm}), set
17595 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
17596 test-and-set (@code{tas}).
17598 @item -mc=@var{name}
17599 @opindex mc=
17600 Selects which section constant data is placed in.  @var{name} may
17601 be @samp{tiny}, @samp{near}, or @samp{far}.
17603 @item -mclip
17604 @opindex mclip
17605 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
17606 useful unless you also provide @option{-mminmax}.
17608 @item -mconfig=@var{name}
17609 @opindex mconfig=
17610 Selects one of the built-in core configurations.  Each MeP chip has
17611 one or more modules in it; each module has a core CPU and a variety of
17612 coprocessors, optional instructions, and peripherals.  The
17613 @code{MeP-Integrator} tool, not part of GCC, provides these
17614 configurations through this option; using this option is the same as
17615 using all the corresponding command-line options.  The default
17616 configuration is @samp{default}.
17618 @item -mcop
17619 @opindex mcop
17620 Enables the coprocessor instructions.  By default, this is a 32-bit
17621 coprocessor.  Note that the coprocessor is normally enabled via the
17622 @option{-mconfig=} option.
17624 @item -mcop32
17625 @opindex mcop32
17626 Enables the 32-bit coprocessor's instructions.
17628 @item -mcop64
17629 @opindex mcop64
17630 Enables the 64-bit coprocessor's instructions.
17632 @item -mivc2
17633 @opindex mivc2
17634 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
17636 @item -mdc
17637 @opindex mdc
17638 Causes constant variables to be placed in the @code{.near} section.
17640 @item -mdiv
17641 @opindex mdiv
17642 Enables the @code{div} and @code{divu} instructions.
17644 @item -meb
17645 @opindex meb
17646 Generate big-endian code.
17648 @item -mel
17649 @opindex mel
17650 Generate little-endian code.
17652 @item -mio-volatile
17653 @opindex mio-volatile
17654 Tells the compiler that any variable marked with the @code{io}
17655 attribute is to be considered volatile.
17657 @item -ml
17658 @opindex ml
17659 Causes variables to be assigned to the @code{.far} section by default.
17661 @item -mleadz
17662 @opindex mleadz
17663 Enables the @code{leadz} (leading zero) instruction.
17665 @item -mm
17666 @opindex mm
17667 Causes variables to be assigned to the @code{.near} section by default.
17669 @item -mminmax
17670 @opindex mminmax
17671 Enables the @code{min} and @code{max} instructions.
17673 @item -mmult
17674 @opindex mmult
17675 Enables the multiplication and multiply-accumulate instructions.
17677 @item -mno-opts
17678 @opindex mno-opts
17679 Disables all the optional instructions enabled by @option{-mall-opts}.
17681 @item -mrepeat
17682 @opindex mrepeat
17683 Enables the @code{repeat} and @code{erepeat} instructions, used for
17684 low-overhead looping.
17686 @item -ms
17687 @opindex ms
17688 Causes all variables to default to the @code{.tiny} section.  Note
17689 that there is a 65536-byte limit to this section.  Accesses to these
17690 variables use the @code{%gp} base register.
17692 @item -msatur
17693 @opindex msatur
17694 Enables the saturation instructions.  Note that the compiler does not
17695 currently generate these itself, but this option is included for
17696 compatibility with other tools, like @code{as}.
17698 @item -msdram
17699 @opindex msdram
17700 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17702 @item -msim
17703 @opindex msim
17704 Link the simulator run-time libraries.
17706 @item -msimnovec
17707 @opindex msimnovec
17708 Link the simulator runtime libraries, excluding built-in support
17709 for reset and exception vectors and tables.
17711 @item -mtf
17712 @opindex mtf
17713 Causes all functions to default to the @code{.far} section.  Without
17714 this option, functions default to the @code{.near} section.
17716 @item -mtiny=@var{n}
17717 @opindex mtiny=
17718 Variables that are @var{n} bytes or smaller are allocated to the
17719 @code{.tiny} section.  These variables use the @code{$gp} base
17720 register.  The default for this option is 4, but note that there's a
17721 65536-byte limit to the @code{.tiny} section.
17723 @end table
17725 @node MicroBlaze Options
17726 @subsection MicroBlaze Options
17727 @cindex MicroBlaze Options
17729 @table @gcctabopt
17731 @item -msoft-float
17732 @opindex msoft-float
17733 Use software emulation for floating point (default).
17735 @item -mhard-float
17736 @opindex mhard-float
17737 Use hardware floating-point instructions.
17739 @item -mmemcpy
17740 @opindex mmemcpy
17741 Do not optimize block moves, use @code{memcpy}.
17743 @item -mno-clearbss
17744 @opindex mno-clearbss
17745 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17747 @item -mcpu=@var{cpu-type}
17748 @opindex mcpu=
17749 Use features of, and schedule code for, the given CPU.
17750 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17751 where @var{X} is a major version, @var{YY} is the minor version, and
17752 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17753 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17755 @item -mxl-soft-mul
17756 @opindex mxl-soft-mul
17757 Use software multiply emulation (default).
17759 @item -mxl-soft-div
17760 @opindex mxl-soft-div
17761 Use software emulation for divides (default).
17763 @item -mxl-barrel-shift
17764 @opindex mxl-barrel-shift
17765 Use the hardware barrel shifter.
17767 @item -mxl-pattern-compare
17768 @opindex mxl-pattern-compare
17769 Use pattern compare instructions.
17771 @item -msmall-divides
17772 @opindex msmall-divides
17773 Use table lookup optimization for small signed integer divisions.
17775 @item -mxl-stack-check
17776 @opindex mxl-stack-check
17777 This option is deprecated.  Use @option{-fstack-check} instead.
17779 @item -mxl-gp-opt
17780 @opindex mxl-gp-opt
17781 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17783 @item -mxl-multiply-high
17784 @opindex mxl-multiply-high
17785 Use multiply high instructions for high part of 32x32 multiply.
17787 @item -mxl-float-convert
17788 @opindex mxl-float-convert
17789 Use hardware floating-point conversion instructions.
17791 @item -mxl-float-sqrt
17792 @opindex mxl-float-sqrt
17793 Use hardware floating-point square root instruction.
17795 @item -mbig-endian
17796 @opindex mbig-endian
17797 Generate code for a big-endian target.
17799 @item -mlittle-endian
17800 @opindex mlittle-endian
17801 Generate code for a little-endian target.
17803 @item -mxl-reorder
17804 @opindex mxl-reorder
17805 Use reorder instructions (swap and byte reversed load/store).
17807 @item -mxl-mode-@var{app-model}
17808 Select application model @var{app-model}.  Valid models are
17809 @table @samp
17810 @item executable
17811 normal executable (default), uses startup code @file{crt0.o}.
17813 @item xmdstub
17814 for use with Xilinx Microprocessor Debugger (XMD) based
17815 software intrusive debug agent called xmdstub. This uses startup file
17816 @file{crt1.o} and sets the start address of the program to 0x800.
17818 @item bootstrap
17819 for applications that are loaded using a bootloader.
17820 This model uses startup file @file{crt2.o} which does not contain a processor
17821 reset vector handler. This is suitable for transferring control on a
17822 processor reset to the bootloader rather than the application.
17824 @item novectors
17825 for applications that do not require any of the
17826 MicroBlaze vectors. This option may be useful for applications running
17827 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17828 @end table
17830 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17831 @option{-mxl-mode-@var{app-model}}.
17833 @end table
17835 @node MIPS Options
17836 @subsection MIPS Options
17837 @cindex MIPS options
17839 @table @gcctabopt
17841 @item -EB
17842 @opindex EB
17843 Generate big-endian code.
17845 @item -EL
17846 @opindex EL
17847 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17848 configurations.
17850 @item -march=@var{arch}
17851 @opindex march
17852 Generate code that runs on @var{arch}, which can be the name of a
17853 generic MIPS ISA, or the name of a particular processor.
17854 The ISA names are:
17855 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17856 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
17857 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
17858 @samp{mips64r5} and @samp{mips64r6}.
17859 The processor names are:
17860 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17861 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17862 @samp{5kc}, @samp{5kf},
17863 @samp{20kc},
17864 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17865 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17866 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17867 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17868 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17869 @samp{i6400},
17870 @samp{interaptiv},
17871 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17872 @samp{m4k},
17873 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17874 @samp{m5100}, @samp{m5101},
17875 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
17876 @samp{orion},
17877 @samp{p5600},
17878 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17879 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17880 @samp{rm7000}, @samp{rm9000},
17881 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17882 @samp{sb1},
17883 @samp{sr71000},
17884 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17885 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17886 @samp{xlr} and @samp{xlp}.
17887 The special value @samp{from-abi} selects the
17888 most compatible architecture for the selected ABI (that is,
17889 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17891 The native Linux/GNU toolchain also supports the value @samp{native},
17892 which selects the best architecture option for the host processor.
17893 @option{-march=native} has no effect if GCC does not recognize
17894 the processor.
17896 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17897 (for example, @option{-march=r2k}).  Prefixes are optional, and
17898 @samp{vr} may be written @samp{r}.
17900 Names of the form @samp{@var{n}f2_1} refer to processors with
17901 FPUs clocked at half the rate of the core, names of the form
17902 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17903 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17904 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17905 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17906 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17907 accepted as synonyms for @samp{@var{n}f1_1}.
17909 GCC defines two macros based on the value of this option.  The first
17910 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
17911 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
17912 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
17913 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
17914 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
17916 Note that the @code{_MIPS_ARCH} macro uses the processor names given
17917 above.  In other words, it has the full prefix and does not
17918 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17919 the macro names the resolved architecture (either @code{"mips1"} or
17920 @code{"mips3"}).  It names the default architecture when no
17921 @option{-march} option is given.
17923 @item -mtune=@var{arch}
17924 @opindex mtune
17925 Optimize for @var{arch}.  Among other things, this option controls
17926 the way instructions are scheduled, and the perceived cost of arithmetic
17927 operations.  The list of @var{arch} values is the same as for
17928 @option{-march}.
17930 When this option is not used, GCC optimizes for the processor
17931 specified by @option{-march}.  By using @option{-march} and
17932 @option{-mtune} together, it is possible to generate code that
17933 runs on a family of processors, but optimize the code for one
17934 particular member of that family.
17936 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
17937 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17938 @option{-march} ones described above.
17940 @item -mips1
17941 @opindex mips1
17942 Equivalent to @option{-march=mips1}.
17944 @item -mips2
17945 @opindex mips2
17946 Equivalent to @option{-march=mips2}.
17948 @item -mips3
17949 @opindex mips3
17950 Equivalent to @option{-march=mips3}.
17952 @item -mips4
17953 @opindex mips4
17954 Equivalent to @option{-march=mips4}.
17956 @item -mips32
17957 @opindex mips32
17958 Equivalent to @option{-march=mips32}.
17960 @item -mips32r3
17961 @opindex mips32r3
17962 Equivalent to @option{-march=mips32r3}.
17964 @item -mips32r5
17965 @opindex mips32r5
17966 Equivalent to @option{-march=mips32r5}.
17968 @item -mips32r6
17969 @opindex mips32r6
17970 Equivalent to @option{-march=mips32r6}.
17972 @item -mips64
17973 @opindex mips64
17974 Equivalent to @option{-march=mips64}.
17976 @item -mips64r2
17977 @opindex mips64r2
17978 Equivalent to @option{-march=mips64r2}.
17980 @item -mips64r3
17981 @opindex mips64r3
17982 Equivalent to @option{-march=mips64r3}.
17984 @item -mips64r5
17985 @opindex mips64r5
17986 Equivalent to @option{-march=mips64r5}.
17988 @item -mips64r6
17989 @opindex mips64r6
17990 Equivalent to @option{-march=mips64r6}.
17992 @item -mips16
17993 @itemx -mno-mips16
17994 @opindex mips16
17995 @opindex mno-mips16
17996 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17997 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17999 MIPS16 code generation can also be controlled on a per-function basis
18000 by means of @code{mips16} and @code{nomips16} attributes.
18001 @xref{Function Attributes}, for more information.
18003 @item -mflip-mips16
18004 @opindex mflip-mips16
18005 Generate MIPS16 code on alternating functions.  This option is provided
18006 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
18007 not intended for ordinary use in compiling user code.
18009 @item -minterlink-compressed
18010 @item -mno-interlink-compressed
18011 @opindex minterlink-compressed
18012 @opindex mno-interlink-compressed
18013 Require (do not require) that code using the standard (uncompressed) MIPS ISA
18014 be link-compatible with MIPS16 and microMIPS code, and vice versa.
18016 For example, code using the standard ISA encoding cannot jump directly
18017 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
18018 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
18019 knows that the target of the jump is not compressed.
18021 @item -minterlink-mips16
18022 @itemx -mno-interlink-mips16
18023 @opindex minterlink-mips16
18024 @opindex mno-interlink-mips16
18025 Aliases of @option{-minterlink-compressed} and
18026 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
18027 and are retained for backwards compatibility.
18029 @item -mabi=32
18030 @itemx -mabi=o64
18031 @itemx -mabi=n32
18032 @itemx -mabi=64
18033 @itemx -mabi=eabi
18034 @opindex mabi=32
18035 @opindex mabi=o64
18036 @opindex mabi=n32
18037 @opindex mabi=64
18038 @opindex mabi=eabi
18039 Generate code for the given ABI@.
18041 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
18042 generates 64-bit code when you select a 64-bit architecture, but you
18043 can use @option{-mgp32} to get 32-bit code instead.
18045 For information about the O64 ABI, see
18046 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
18048 GCC supports a variant of the o32 ABI in which floating-point registers
18049 are 64 rather than 32 bits wide.  You can select this combination with
18050 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
18051 and @code{mfhc1} instructions and is therefore only supported for
18052 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
18054 The register assignments for arguments and return values remain the
18055 same, but each scalar value is passed in a single 64-bit register
18056 rather than a pair of 32-bit registers.  For example, scalar
18057 floating-point values are returned in @samp{$f0} only, not a
18058 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
18059 remains the same in that the even-numbered double-precision registers
18060 are saved.
18062 Two additional variants of the o32 ABI are supported to enable
18063 a transition from 32-bit to 64-bit registers.  These are FPXX
18064 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
18065 The FPXX extension mandates that all code must execute correctly
18066 when run using 32-bit or 64-bit registers.  The code can be interlinked
18067 with either FP32 or FP64, but not both.
18068 The FP64A extension is similar to the FP64 extension but forbids the
18069 use of odd-numbered single-precision registers.  This can be used
18070 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
18071 processors and allows both FP32 and FP64A code to interlink and
18072 run in the same process without changing FPU modes.
18074 @item -mabicalls
18075 @itemx -mno-abicalls
18076 @opindex mabicalls
18077 @opindex mno-abicalls
18078 Generate (do not generate) code that is suitable for SVR4-style
18079 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
18080 systems.
18082 @item -mshared
18083 @itemx -mno-shared
18084 Generate (do not generate) code that is fully position-independent,
18085 and that can therefore be linked into shared libraries.  This option
18086 only affects @option{-mabicalls}.
18088 All @option{-mabicalls} code has traditionally been position-independent,
18089 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
18090 as an extension, the GNU toolchain allows executables to use absolute
18091 accesses for locally-binding symbols.  It can also use shorter GP
18092 initialization sequences and generate direct calls to locally-defined
18093 functions.  This mode is selected by @option{-mno-shared}.
18095 @option{-mno-shared} depends on binutils 2.16 or higher and generates
18096 objects that can only be linked by the GNU linker.  However, the option
18097 does not affect the ABI of the final executable; it only affects the ABI
18098 of relocatable objects.  Using @option{-mno-shared} generally makes
18099 executables both smaller and quicker.
18101 @option{-mshared} is the default.
18103 @item -mplt
18104 @itemx -mno-plt
18105 @opindex mplt
18106 @opindex mno-plt
18107 Assume (do not assume) that the static and dynamic linkers
18108 support PLTs and copy relocations.  This option only affects
18109 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
18110 has no effect without @option{-msym32}.
18112 You can make @option{-mplt} the default by configuring
18113 GCC with @option{--with-mips-plt}.  The default is
18114 @option{-mno-plt} otherwise.
18116 @item -mxgot
18117 @itemx -mno-xgot
18118 @opindex mxgot
18119 @opindex mno-xgot
18120 Lift (do not lift) the usual restrictions on the size of the global
18121 offset table.
18123 GCC normally uses a single instruction to load values from the GOT@.
18124 While this is relatively efficient, it only works if the GOT
18125 is smaller than about 64k.  Anything larger causes the linker
18126 to report an error such as:
18128 @cindex relocation truncated to fit (MIPS)
18129 @smallexample
18130 relocation truncated to fit: R_MIPS_GOT16 foobar
18131 @end smallexample
18133 If this happens, you should recompile your code with @option{-mxgot}.
18134 This works with very large GOTs, although the code is also
18135 less efficient, since it takes three instructions to fetch the
18136 value of a global symbol.
18138 Note that some linkers can create multiple GOTs.  If you have such a
18139 linker, you should only need to use @option{-mxgot} when a single object
18140 file accesses more than 64k's worth of GOT entries.  Very few do.
18142 These options have no effect unless GCC is generating position
18143 independent code.
18145 @item -mgp32
18146 @opindex mgp32
18147 Assume that general-purpose registers are 32 bits wide.
18149 @item -mgp64
18150 @opindex mgp64
18151 Assume that general-purpose registers are 64 bits wide.
18153 @item -mfp32
18154 @opindex mfp32
18155 Assume that floating-point registers are 32 bits wide.
18157 @item -mfp64
18158 @opindex mfp64
18159 Assume that floating-point registers are 64 bits wide.
18161 @item -mfpxx
18162 @opindex mfpxx
18163 Do not assume the width of floating-point registers.
18165 @item -mhard-float
18166 @opindex mhard-float
18167 Use floating-point coprocessor instructions.
18169 @item -msoft-float
18170 @opindex msoft-float
18171 Do not use floating-point coprocessor instructions.  Implement
18172 floating-point calculations using library calls instead.
18174 @item -mno-float
18175 @opindex mno-float
18176 Equivalent to @option{-msoft-float}, but additionally asserts that the
18177 program being compiled does not perform any floating-point operations.
18178 This option is presently supported only by some bare-metal MIPS
18179 configurations, where it may select a special set of libraries
18180 that lack all floating-point support (including, for example, the
18181 floating-point @code{printf} formats).  
18182 If code compiled with @option{-mno-float} accidentally contains
18183 floating-point operations, it is likely to suffer a link-time
18184 or run-time failure.
18186 @item -msingle-float
18187 @opindex msingle-float
18188 Assume that the floating-point coprocessor only supports single-precision
18189 operations.
18191 @item -mdouble-float
18192 @opindex mdouble-float
18193 Assume that the floating-point coprocessor supports double-precision
18194 operations.  This is the default.
18196 @item -modd-spreg
18197 @itemx -mno-odd-spreg
18198 @opindex modd-spreg
18199 @opindex mno-odd-spreg
18200 Enable the use of odd-numbered single-precision floating-point registers
18201 for the o32 ABI.  This is the default for processors that are known to
18202 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
18203 is set by default.
18205 @item -mabs=2008
18206 @itemx -mabs=legacy
18207 @opindex mabs=2008
18208 @opindex mabs=legacy
18209 These options control the treatment of the special not-a-number (NaN)
18210 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
18211 @code{neg.@i{fmt}} machine instructions.
18213 By default or when @option{-mabs=legacy} is used the legacy
18214 treatment is selected.  In this case these instructions are considered
18215 arithmetic and avoided where correct operation is required and the
18216 input operand might be a NaN.  A longer sequence of instructions that
18217 manipulate the sign bit of floating-point datum manually is used
18218 instead unless the @option{-ffinite-math-only} option has also been
18219 specified.
18221 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
18222 this case these instructions are considered non-arithmetic and therefore
18223 operating correctly in all cases, including in particular where the
18224 input operand is a NaN.  These instructions are therefore always used
18225 for the respective operations.
18227 @item -mnan=2008
18228 @itemx -mnan=legacy
18229 @opindex mnan=2008
18230 @opindex mnan=legacy
18231 These options control the encoding of the special not-a-number (NaN)
18232 IEEE 754 floating-point data.
18234 The @option{-mnan=legacy} option selects the legacy encoding.  In this
18235 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
18236 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
18237 by the first bit of their trailing significand field being 1.
18239 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
18240 this case qNaNs are denoted by the first bit of their trailing
18241 significand field being 1, whereas sNaNs are denoted by the first bit of
18242 their trailing significand field being 0.
18244 The default is @option{-mnan=legacy} unless GCC has been configured with
18245 @option{--with-nan=2008}.
18247 @item -mllsc
18248 @itemx -mno-llsc
18249 @opindex mllsc
18250 @opindex mno-llsc
18251 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
18252 implement atomic memory built-in functions.  When neither option is
18253 specified, GCC uses the instructions if the target architecture
18254 supports them.
18256 @option{-mllsc} is useful if the runtime environment can emulate the
18257 instructions and @option{-mno-llsc} can be useful when compiling for
18258 nonstandard ISAs.  You can make either option the default by
18259 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
18260 respectively.  @option{--with-llsc} is the default for some
18261 configurations; see the installation documentation for details.
18263 @item -mdsp
18264 @itemx -mno-dsp
18265 @opindex mdsp
18266 @opindex mno-dsp
18267 Use (do not use) revision 1 of the MIPS DSP ASE@.
18268 @xref{MIPS DSP Built-in Functions}.  This option defines the
18269 preprocessor macro @code{__mips_dsp}.  It also defines
18270 @code{__mips_dsp_rev} to 1.
18272 @item -mdspr2
18273 @itemx -mno-dspr2
18274 @opindex mdspr2
18275 @opindex mno-dspr2
18276 Use (do not use) revision 2 of the MIPS DSP ASE@.
18277 @xref{MIPS DSP Built-in Functions}.  This option defines the
18278 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
18279 It also defines @code{__mips_dsp_rev} to 2.
18281 @item -msmartmips
18282 @itemx -mno-smartmips
18283 @opindex msmartmips
18284 @opindex mno-smartmips
18285 Use (do not use) the MIPS SmartMIPS ASE.
18287 @item -mpaired-single
18288 @itemx -mno-paired-single
18289 @opindex mpaired-single
18290 @opindex mno-paired-single
18291 Use (do not use) paired-single floating-point instructions.
18292 @xref{MIPS Paired-Single Support}.  This option requires
18293 hardware floating-point support to be enabled.
18295 @item -mdmx
18296 @itemx -mno-mdmx
18297 @opindex mdmx
18298 @opindex mno-mdmx
18299 Use (do not use) MIPS Digital Media Extension instructions.
18300 This option can only be used when generating 64-bit code and requires
18301 hardware floating-point support to be enabled.
18303 @item -mips3d
18304 @itemx -mno-mips3d
18305 @opindex mips3d
18306 @opindex mno-mips3d
18307 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
18308 The option @option{-mips3d} implies @option{-mpaired-single}.
18310 @item -mmicromips
18311 @itemx -mno-micromips
18312 @opindex mmicromips
18313 @opindex mno-mmicromips
18314 Generate (do not generate) microMIPS code.
18316 MicroMIPS code generation can also be controlled on a per-function basis
18317 by means of @code{micromips} and @code{nomicromips} attributes.
18318 @xref{Function Attributes}, for more information.
18320 @item -mmt
18321 @itemx -mno-mt
18322 @opindex mmt
18323 @opindex mno-mt
18324 Use (do not use) MT Multithreading instructions.
18326 @item -mmcu
18327 @itemx -mno-mcu
18328 @opindex mmcu
18329 @opindex mno-mcu
18330 Use (do not use) the MIPS MCU ASE instructions.
18332 @item -meva
18333 @itemx -mno-eva
18334 @opindex meva
18335 @opindex mno-eva
18336 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
18338 @item -mvirt
18339 @itemx -mno-virt
18340 @opindex mvirt
18341 @opindex mno-virt
18342 Use (do not use) the MIPS Virtualization Application Specific instructions.
18344 @item -mxpa
18345 @itemx -mno-xpa
18346 @opindex mxpa
18347 @opindex mno-xpa
18348 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
18350 @item -mlong64
18351 @opindex mlong64
18352 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
18353 an explanation of the default and the way that the pointer size is
18354 determined.
18356 @item -mlong32
18357 @opindex mlong32
18358 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
18360 The default size of @code{int}s, @code{long}s and pointers depends on
18361 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
18362 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
18363 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
18364 or the same size as integer registers, whichever is smaller.
18366 @item -msym32
18367 @itemx -mno-sym32
18368 @opindex msym32
18369 @opindex mno-sym32
18370 Assume (do not assume) that all symbols have 32-bit values, regardless
18371 of the selected ABI@.  This option is useful in combination with
18372 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
18373 to generate shorter and faster references to symbolic addresses.
18375 @item -G @var{num}
18376 @opindex G
18377 Put definitions of externally-visible data in a small data section
18378 if that data is no bigger than @var{num} bytes.  GCC can then generate
18379 more efficient accesses to the data; see @option{-mgpopt} for details.
18381 The default @option{-G} option depends on the configuration.
18383 @item -mlocal-sdata
18384 @itemx -mno-local-sdata
18385 @opindex mlocal-sdata
18386 @opindex mno-local-sdata
18387 Extend (do not extend) the @option{-G} behavior to local data too,
18388 such as to static variables in C@.  @option{-mlocal-sdata} is the
18389 default for all configurations.
18391 If the linker complains that an application is using too much small data,
18392 you might want to try rebuilding the less performance-critical parts with
18393 @option{-mno-local-sdata}.  You might also want to build large
18394 libraries with @option{-mno-local-sdata}, so that the libraries leave
18395 more room for the main program.
18397 @item -mextern-sdata
18398 @itemx -mno-extern-sdata
18399 @opindex mextern-sdata
18400 @opindex mno-extern-sdata
18401 Assume (do not assume) that externally-defined data is in
18402 a small data section if the size of that data is within the @option{-G} limit.
18403 @option{-mextern-sdata} is the default for all configurations.
18405 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
18406 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
18407 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
18408 is placed in a small data section.  If @var{Var} is defined by another
18409 module, you must either compile that module with a high-enough
18410 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
18411 definition.  If @var{Var} is common, you must link the application
18412 with a high-enough @option{-G} setting.
18414 The easiest way of satisfying these restrictions is to compile
18415 and link every module with the same @option{-G} option.  However,
18416 you may wish to build a library that supports several different
18417 small data limits.  You can do this by compiling the library with
18418 the highest supported @option{-G} setting and additionally using
18419 @option{-mno-extern-sdata} to stop the library from making assumptions
18420 about externally-defined data.
18422 @item -mgpopt
18423 @itemx -mno-gpopt
18424 @opindex mgpopt
18425 @opindex mno-gpopt
18426 Use (do not use) GP-relative accesses for symbols that are known to be
18427 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
18428 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
18429 configurations.
18431 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
18432 might not hold the value of @code{_gp}.  For example, if the code is
18433 part of a library that might be used in a boot monitor, programs that
18434 call boot monitor routines pass an unknown value in @code{$gp}.
18435 (In such situations, the boot monitor itself is usually compiled
18436 with @option{-G0}.)
18438 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
18439 @option{-mno-extern-sdata}.
18441 @item -membedded-data
18442 @itemx -mno-embedded-data
18443 @opindex membedded-data
18444 @opindex mno-embedded-data
18445 Allocate variables to the read-only data section first if possible, then
18446 next in the small data section if possible, otherwise in data.  This gives
18447 slightly slower code than the default, but reduces the amount of RAM required
18448 when executing, and thus may be preferred for some embedded systems.
18450 @item -muninit-const-in-rodata
18451 @itemx -mno-uninit-const-in-rodata
18452 @opindex muninit-const-in-rodata
18453 @opindex mno-uninit-const-in-rodata
18454 Put uninitialized @code{const} variables in the read-only data section.
18455 This option is only meaningful in conjunction with @option{-membedded-data}.
18457 @item -mcode-readable=@var{setting}
18458 @opindex mcode-readable
18459 Specify whether GCC may generate code that reads from executable sections.
18460 There are three possible settings:
18462 @table @gcctabopt
18463 @item -mcode-readable=yes
18464 Instructions may freely access executable sections.  This is the
18465 default setting.
18467 @item -mcode-readable=pcrel
18468 MIPS16 PC-relative load instructions can access executable sections,
18469 but other instructions must not do so.  This option is useful on 4KSc
18470 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
18471 It is also useful on processors that can be configured to have a dual
18472 instruction/data SRAM interface and that, like the M4K, automatically
18473 redirect PC-relative loads to the instruction RAM.
18475 @item -mcode-readable=no
18476 Instructions must not access executable sections.  This option can be
18477 useful on targets that are configured to have a dual instruction/data
18478 SRAM interface but that (unlike the M4K) do not automatically redirect
18479 PC-relative loads to the instruction RAM.
18480 @end table
18482 @item -msplit-addresses
18483 @itemx -mno-split-addresses
18484 @opindex msplit-addresses
18485 @opindex mno-split-addresses
18486 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
18487 relocation operators.  This option has been superseded by
18488 @option{-mexplicit-relocs} but is retained for backwards compatibility.
18490 @item -mexplicit-relocs
18491 @itemx -mno-explicit-relocs
18492 @opindex mexplicit-relocs
18493 @opindex mno-explicit-relocs
18494 Use (do not use) assembler relocation operators when dealing with symbolic
18495 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
18496 is to use assembler macros instead.
18498 @option{-mexplicit-relocs} is the default if GCC was configured
18499 to use an assembler that supports relocation operators.
18501 @item -mcheck-zero-division
18502 @itemx -mno-check-zero-division
18503 @opindex mcheck-zero-division
18504 @opindex mno-check-zero-division
18505 Trap (do not trap) on integer division by zero.
18507 The default is @option{-mcheck-zero-division}.
18509 @item -mdivide-traps
18510 @itemx -mdivide-breaks
18511 @opindex mdivide-traps
18512 @opindex mdivide-breaks
18513 MIPS systems check for division by zero by generating either a
18514 conditional trap or a break instruction.  Using traps results in
18515 smaller code, but is only supported on MIPS II and later.  Also, some
18516 versions of the Linux kernel have a bug that prevents trap from
18517 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
18518 allow conditional traps on architectures that support them and
18519 @option{-mdivide-breaks} to force the use of breaks.
18521 The default is usually @option{-mdivide-traps}, but this can be
18522 overridden at configure time using @option{--with-divide=breaks}.
18523 Divide-by-zero checks can be completely disabled using
18524 @option{-mno-check-zero-division}.
18526 @item -mmemcpy
18527 @itemx -mno-memcpy
18528 @opindex mmemcpy
18529 @opindex mno-memcpy
18530 Force (do not force) the use of @code{memcpy} for non-trivial block
18531 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
18532 most constant-sized copies.
18534 @item -mlong-calls
18535 @itemx -mno-long-calls
18536 @opindex mlong-calls
18537 @opindex mno-long-calls
18538 Disable (do not disable) use of the @code{jal} instruction.  Calling
18539 functions using @code{jal} is more efficient but requires the caller
18540 and callee to be in the same 256 megabyte segment.
18542 This option has no effect on abicalls code.  The default is
18543 @option{-mno-long-calls}.
18545 @item -mmad
18546 @itemx -mno-mad
18547 @opindex mmad
18548 @opindex mno-mad
18549 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
18550 instructions, as provided by the R4650 ISA@.
18552 @item -mimadd
18553 @itemx -mno-imadd
18554 @opindex mimadd
18555 @opindex mno-imadd
18556 Enable (disable) use of the @code{madd} and @code{msub} integer
18557 instructions.  The default is @option{-mimadd} on architectures
18558 that support @code{madd} and @code{msub} except for the 74k 
18559 architecture where it was found to generate slower code.
18561 @item -mfused-madd
18562 @itemx -mno-fused-madd
18563 @opindex mfused-madd
18564 @opindex mno-fused-madd
18565 Enable (disable) use of the floating-point multiply-accumulate
18566 instructions, when they are available.  The default is
18567 @option{-mfused-madd}.
18569 On the R8000 CPU when multiply-accumulate instructions are used,
18570 the intermediate product is calculated to infinite precision
18571 and is not subject to the FCSR Flush to Zero bit.  This may be
18572 undesirable in some circumstances.  On other processors the result
18573 is numerically identical to the equivalent computation using
18574 separate multiply, add, subtract and negate instructions.
18576 @item -nocpp
18577 @opindex nocpp
18578 Tell the MIPS assembler to not run its preprocessor over user
18579 assembler files (with a @samp{.s} suffix) when assembling them.
18581 @item -mfix-24k
18582 @item -mno-fix-24k
18583 @opindex mfix-24k
18584 @opindex mno-fix-24k
18585 Work around the 24K E48 (lost data on stores during refill) errata.
18586 The workarounds are implemented by the assembler rather than by GCC@.
18588 @item -mfix-r4000
18589 @itemx -mno-fix-r4000
18590 @opindex mfix-r4000
18591 @opindex mno-fix-r4000
18592 Work around certain R4000 CPU errata:
18593 @itemize @minus
18594 @item
18595 A double-word or a variable shift may give an incorrect result if executed
18596 immediately after starting an integer division.
18597 @item
18598 A double-word or a variable shift may give an incorrect result if executed
18599 while an integer multiplication is in progress.
18600 @item
18601 An integer division may give an incorrect result if started in a delay slot
18602 of a taken branch or a jump.
18603 @end itemize
18605 @item -mfix-r4400
18606 @itemx -mno-fix-r4400
18607 @opindex mfix-r4400
18608 @opindex mno-fix-r4400
18609 Work around certain R4400 CPU errata:
18610 @itemize @minus
18611 @item
18612 A double-word or a variable shift may give an incorrect result if executed
18613 immediately after starting an integer division.
18614 @end itemize
18616 @item -mfix-r10000
18617 @itemx -mno-fix-r10000
18618 @opindex mfix-r10000
18619 @opindex mno-fix-r10000
18620 Work around certain R10000 errata:
18621 @itemize @minus
18622 @item
18623 @code{ll}/@code{sc} sequences may not behave atomically on revisions
18624 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
18625 @end itemize
18627 This option can only be used if the target architecture supports
18628 branch-likely instructions.  @option{-mfix-r10000} is the default when
18629 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
18630 otherwise.
18632 @item -mfix-rm7000
18633 @itemx -mno-fix-rm7000
18634 @opindex mfix-rm7000
18635 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
18636 workarounds are implemented by the assembler rather than by GCC@.
18638 @item -mfix-vr4120
18639 @itemx -mno-fix-vr4120
18640 @opindex mfix-vr4120
18641 Work around certain VR4120 errata:
18642 @itemize @minus
18643 @item
18644 @code{dmultu} does not always produce the correct result.
18645 @item
18646 @code{div} and @code{ddiv} do not always produce the correct result if one
18647 of the operands is negative.
18648 @end itemize
18649 The workarounds for the division errata rely on special functions in
18650 @file{libgcc.a}.  At present, these functions are only provided by
18651 the @code{mips64vr*-elf} configurations.
18653 Other VR4120 errata require a NOP to be inserted between certain pairs of
18654 instructions.  These errata are handled by the assembler, not by GCC itself.
18656 @item -mfix-vr4130
18657 @opindex mfix-vr4130
18658 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
18659 workarounds are implemented by the assembler rather than by GCC,
18660 although GCC avoids using @code{mflo} and @code{mfhi} if the
18661 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18662 instructions are available instead.
18664 @item -mfix-sb1
18665 @itemx -mno-fix-sb1
18666 @opindex mfix-sb1
18667 Work around certain SB-1 CPU core errata.
18668 (This flag currently works around the SB-1 revision 2
18669 ``F1'' and ``F2'' floating-point errata.)
18671 @item -mr10k-cache-barrier=@var{setting}
18672 @opindex mr10k-cache-barrier
18673 Specify whether GCC should insert cache barriers to avoid the
18674 side-effects of speculation on R10K processors.
18676 In common with many processors, the R10K tries to predict the outcome
18677 of a conditional branch and speculatively executes instructions from
18678 the ``taken'' branch.  It later aborts these instructions if the
18679 predicted outcome is wrong.  However, on the R10K, even aborted
18680 instructions can have side effects.
18682 This problem only affects kernel stores and, depending on the system,
18683 kernel loads.  As an example, a speculatively-executed store may load
18684 the target memory into cache and mark the cache line as dirty, even if
18685 the store itself is later aborted.  If a DMA operation writes to the
18686 same area of memory before the ``dirty'' line is flushed, the cached
18687 data overwrites the DMA-ed data.  See the R10K processor manual
18688 for a full description, including other potential problems.
18690 One workaround is to insert cache barrier instructions before every memory
18691 access that might be speculatively executed and that might have side
18692 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18693 controls GCC's implementation of this workaround.  It assumes that
18694 aborted accesses to any byte in the following regions does not have
18695 side effects:
18697 @enumerate
18698 @item
18699 the memory occupied by the current function's stack frame;
18701 @item
18702 the memory occupied by an incoming stack argument;
18704 @item
18705 the memory occupied by an object with a link-time-constant address.
18706 @end enumerate
18708 It is the kernel's responsibility to ensure that speculative
18709 accesses to these regions are indeed safe.
18711 If the input program contains a function declaration such as:
18713 @smallexample
18714 void foo (void);
18715 @end smallexample
18717 then the implementation of @code{foo} must allow @code{j foo} and
18718 @code{jal foo} to be executed speculatively.  GCC honors this
18719 restriction for functions it compiles itself.  It expects non-GCC
18720 functions (such as hand-written assembly code) to do the same.
18722 The option has three forms:
18724 @table @gcctabopt
18725 @item -mr10k-cache-barrier=load-store
18726 Insert a cache barrier before a load or store that might be
18727 speculatively executed and that might have side effects even
18728 if aborted.
18730 @item -mr10k-cache-barrier=store
18731 Insert a cache barrier before a store that might be speculatively
18732 executed and that might have side effects even if aborted.
18734 @item -mr10k-cache-barrier=none
18735 Disable the insertion of cache barriers.  This is the default setting.
18736 @end table
18738 @item -mflush-func=@var{func}
18739 @itemx -mno-flush-func
18740 @opindex mflush-func
18741 Specifies the function to call to flush the I and D caches, or to not
18742 call any such function.  If called, the function must take the same
18743 arguments as the common @code{_flush_func}, that is, the address of the
18744 memory range for which the cache is being flushed, the size of the
18745 memory range, and the number 3 (to flush both caches).  The default
18746 depends on the target GCC was configured for, but commonly is either
18747 @code{_flush_func} or @code{__cpu_flush}.
18749 @item mbranch-cost=@var{num}
18750 @opindex mbranch-cost
18751 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18752 This cost is only a heuristic and is not guaranteed to produce
18753 consistent results across releases.  A zero cost redundantly selects
18754 the default, which is based on the @option{-mtune} setting.
18756 @item -mbranch-likely
18757 @itemx -mno-branch-likely
18758 @opindex mbranch-likely
18759 @opindex mno-branch-likely
18760 Enable or disable use of Branch Likely instructions, regardless of the
18761 default for the selected architecture.  By default, Branch Likely
18762 instructions may be generated if they are supported by the selected
18763 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18764 and processors that implement those architectures; for those, Branch
18765 Likely instructions are not be generated by default because the MIPS32
18766 and MIPS64 architectures specifically deprecate their use.
18768 @item -mcompact-branches=never
18769 @itemx -mcompact-branches=optimal
18770 @itemx -mcompact-branches=always
18771 @opindex mcompact-branches=never
18772 @opindex mcompact-branches=optimal
18773 @opindex mcompact-branches=always
18774 These options control which form of branches will be generated.  The
18775 default is @option{-mcompact-branches=optimal}.
18777 The @option{-mcompact-branches=never} option ensures that compact branch
18778 instructions will never be generated.
18780 The @option{-mcompact-branches=always} option ensures that a compact
18781 branch instruction will be generated if available.  If a compact branch
18782 instruction is not available, a delay slot form of the branch will be
18783 used instead.
18785 This option is supported from MIPS Release 6 onwards.
18787 The @option{-mcompact-branches=optimal} option will cause a delay slot
18788 branch to be used if one is available in the current ISA and the delay
18789 slot is successfully filled.  If the delay slot is not filled, a compact
18790 branch will be chosen if one is available.
18792 @item -mfp-exceptions
18793 @itemx -mno-fp-exceptions
18794 @opindex mfp-exceptions
18795 Specifies whether FP exceptions are enabled.  This affects how
18796 FP instructions are scheduled for some processors.
18797 The default is that FP exceptions are
18798 enabled.
18800 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18801 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18802 FP pipe.
18804 @item -mvr4130-align
18805 @itemx -mno-vr4130-align
18806 @opindex mvr4130-align
18807 The VR4130 pipeline is two-way superscalar, but can only issue two
18808 instructions together if the first one is 8-byte aligned.  When this
18809 option is enabled, GCC aligns pairs of instructions that it
18810 thinks should execute in parallel.
18812 This option only has an effect when optimizing for the VR4130.
18813 It normally makes code faster, but at the expense of making it bigger.
18814 It is enabled by default at optimization level @option{-O3}.
18816 @item -msynci
18817 @itemx -mno-synci
18818 @opindex msynci
18819 Enable (disable) generation of @code{synci} instructions on
18820 architectures that support it.  The @code{synci} instructions (if
18821 enabled) are generated when @code{__builtin___clear_cache} is
18822 compiled.
18824 This option defaults to @option{-mno-synci}, but the default can be
18825 overridden by configuring GCC with @option{--with-synci}.
18827 When compiling code for single processor systems, it is generally safe
18828 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18829 does not invalidate the instruction caches on all cores and may lead
18830 to undefined behavior.
18832 @item -mrelax-pic-calls
18833 @itemx -mno-relax-pic-calls
18834 @opindex mrelax-pic-calls
18835 Try to turn PIC calls that are normally dispatched via register
18836 @code{$25} into direct calls.  This is only possible if the linker can
18837 resolve the destination at link time and if the destination is within
18838 range for a direct call.
18840 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18841 an assembler and a linker that support the @code{.reloc} assembly
18842 directive and @option{-mexplicit-relocs} is in effect.  With
18843 @option{-mno-explicit-relocs}, this optimization can be performed by the
18844 assembler and the linker alone without help from the compiler.
18846 @item -mmcount-ra-address
18847 @itemx -mno-mcount-ra-address
18848 @opindex mmcount-ra-address
18849 @opindex mno-mcount-ra-address
18850 Emit (do not emit) code that allows @code{_mcount} to modify the
18851 calling function's return address.  When enabled, this option extends
18852 the usual @code{_mcount} interface with a new @var{ra-address}
18853 parameter, which has type @code{intptr_t *} and is passed in register
18854 @code{$12}.  @code{_mcount} can then modify the return address by
18855 doing both of the following:
18856 @itemize
18857 @item
18858 Returning the new address in register @code{$31}.
18859 @item
18860 Storing the new address in @code{*@var{ra-address}},
18861 if @var{ra-address} is nonnull.
18862 @end itemize
18864 The default is @option{-mno-mcount-ra-address}.
18866 @item -mframe-header-opt
18867 @itemx -mno-frame-header-opt
18868 @opindex mframe-header-opt
18869 Enable (disable) frame header optimization in the o32 ABI.  When using the
18870 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
18871 function to write out register arguments.  When enabled, this optimization
18872 will suppress the allocation of the frame header if it can be determined that
18873 it is unused.
18875 This optimization is off by default at all optimization levels.
18877 @end table
18879 @node MMIX Options
18880 @subsection MMIX Options
18881 @cindex MMIX Options
18883 These options are defined for the MMIX:
18885 @table @gcctabopt
18886 @item -mlibfuncs
18887 @itemx -mno-libfuncs
18888 @opindex mlibfuncs
18889 @opindex mno-libfuncs
18890 Specify that intrinsic library functions are being compiled, passing all
18891 values in registers, no matter the size.
18893 @item -mepsilon
18894 @itemx -mno-epsilon
18895 @opindex mepsilon
18896 @opindex mno-epsilon
18897 Generate floating-point comparison instructions that compare with respect
18898 to the @code{rE} epsilon register.
18900 @item -mabi=mmixware
18901 @itemx -mabi=gnu
18902 @opindex mabi=mmixware
18903 @opindex mabi=gnu
18904 Generate code that passes function parameters and return values that (in
18905 the called function) are seen as registers @code{$0} and up, as opposed to
18906 the GNU ABI which uses global registers @code{$231} and up.
18908 @item -mzero-extend
18909 @itemx -mno-zero-extend
18910 @opindex mzero-extend
18911 @opindex mno-zero-extend
18912 When reading data from memory in sizes shorter than 64 bits, use (do not
18913 use) zero-extending load instructions by default, rather than
18914 sign-extending ones.
18916 @item -mknuthdiv
18917 @itemx -mno-knuthdiv
18918 @opindex mknuthdiv
18919 @opindex mno-knuthdiv
18920 Make the result of a division yielding a remainder have the same sign as
18921 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18922 remainder follows the sign of the dividend.  Both methods are
18923 arithmetically valid, the latter being almost exclusively used.
18925 @item -mtoplevel-symbols
18926 @itemx -mno-toplevel-symbols
18927 @opindex mtoplevel-symbols
18928 @opindex mno-toplevel-symbols
18929 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18930 code can be used with the @code{PREFIX} assembly directive.
18932 @item -melf
18933 @opindex melf
18934 Generate an executable in the ELF format, rather than the default
18935 @samp{mmo} format used by the @command{mmix} simulator.
18937 @item -mbranch-predict
18938 @itemx -mno-branch-predict
18939 @opindex mbranch-predict
18940 @opindex mno-branch-predict
18941 Use (do not use) the probable-branch instructions, when static branch
18942 prediction indicates a probable branch.
18944 @item -mbase-addresses
18945 @itemx -mno-base-addresses
18946 @opindex mbase-addresses
18947 @opindex mno-base-addresses
18948 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18949 base address automatically generates a request (handled by the assembler
18950 and the linker) for a constant to be set up in a global register.  The
18951 register is used for one or more base address requests within the range 0
18952 to 255 from the value held in the register.  The generally leads to short
18953 and fast code, but the number of different data items that can be
18954 addressed is limited.  This means that a program that uses lots of static
18955 data may require @option{-mno-base-addresses}.
18957 @item -msingle-exit
18958 @itemx -mno-single-exit
18959 @opindex msingle-exit
18960 @opindex mno-single-exit
18961 Force (do not force) generated code to have a single exit point in each
18962 function.
18963 @end table
18965 @node MN10300 Options
18966 @subsection MN10300 Options
18967 @cindex MN10300 options
18969 These @option{-m} options are defined for Matsushita MN10300 architectures:
18971 @table @gcctabopt
18972 @item -mmult-bug
18973 @opindex mmult-bug
18974 Generate code to avoid bugs in the multiply instructions for the MN10300
18975 processors.  This is the default.
18977 @item -mno-mult-bug
18978 @opindex mno-mult-bug
18979 Do not generate code to avoid bugs in the multiply instructions for the
18980 MN10300 processors.
18982 @item -mam33
18983 @opindex mam33
18984 Generate code using features specific to the AM33 processor.
18986 @item -mno-am33
18987 @opindex mno-am33
18988 Do not generate code using features specific to the AM33 processor.  This
18989 is the default.
18991 @item -mam33-2
18992 @opindex mam33-2
18993 Generate code using features specific to the AM33/2.0 processor.
18995 @item -mam34
18996 @opindex mam34
18997 Generate code using features specific to the AM34 processor.
18999 @item -mtune=@var{cpu-type}
19000 @opindex mtune
19001 Use the timing characteristics of the indicated CPU type when
19002 scheduling instructions.  This does not change the targeted processor
19003 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
19004 @samp{am33-2} or @samp{am34}.
19006 @item -mreturn-pointer-on-d0
19007 @opindex mreturn-pointer-on-d0
19008 When generating a function that returns a pointer, return the pointer
19009 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
19010 only in @code{a0}, and attempts to call such functions without a prototype
19011 result in errors.  Note that this option is on by default; use
19012 @option{-mno-return-pointer-on-d0} to disable it.
19014 @item -mno-crt0
19015 @opindex mno-crt0
19016 Do not link in the C run-time initialization object file.
19018 @item -mrelax
19019 @opindex mrelax
19020 Indicate to the linker that it should perform a relaxation optimization pass
19021 to shorten branches, calls and absolute memory addresses.  This option only
19022 has an effect when used on the command line for the final link step.
19024 This option makes symbolic debugging impossible.
19026 @item -mliw
19027 @opindex mliw
19028 Allow the compiler to generate @emph{Long Instruction Word}
19029 instructions if the target is the @samp{AM33} or later.  This is the
19030 default.  This option defines the preprocessor macro @code{__LIW__}.
19032 @item -mnoliw
19033 @opindex mnoliw
19034 Do not allow the compiler to generate @emph{Long Instruction Word}
19035 instructions.  This option defines the preprocessor macro
19036 @code{__NO_LIW__}.
19038 @item -msetlb
19039 @opindex msetlb
19040 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
19041 instructions if the target is the @samp{AM33} or later.  This is the
19042 default.  This option defines the preprocessor macro @code{__SETLB__}.
19044 @item -mnosetlb
19045 @opindex mnosetlb
19046 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
19047 instructions.  This option defines the preprocessor macro
19048 @code{__NO_SETLB__}.
19050 @end table
19052 @node Moxie Options
19053 @subsection Moxie Options
19054 @cindex Moxie Options
19056 @table @gcctabopt
19058 @item -meb
19059 @opindex meb
19060 Generate big-endian code.  This is the default for @samp{moxie-*-*}
19061 configurations.
19063 @item -mel
19064 @opindex mel
19065 Generate little-endian code.
19067 @item -mmul.x
19068 @opindex mmul.x
19069 Generate mul.x and umul.x instructions.  This is the default for
19070 @samp{moxiebox-*-*} configurations.
19072 @item -mno-crt0
19073 @opindex mno-crt0
19074 Do not link in the C run-time initialization object file.
19076 @end table
19078 @node MSP430 Options
19079 @subsection MSP430 Options
19080 @cindex MSP430 Options
19082 These options are defined for the MSP430:
19084 @table @gcctabopt
19086 @item -masm-hex
19087 @opindex masm-hex
19088 Force assembly output to always use hex constants.  Normally such
19089 constants are signed decimals, but this option is available for
19090 testsuite and/or aesthetic purposes.
19092 @item -mmcu=
19093 @opindex mmcu=
19094 Select the MCU to target.  This is used to create a C preprocessor
19095 symbol based upon the MCU name, converted to upper case and pre- and
19096 post-fixed with @samp{__}.  This in turn is used by the
19097 @file{msp430.h} header file to select an MCU-specific supplementary
19098 header file.
19100 The option also sets the ISA to use.  If the MCU name is one that is
19101 known to only support the 430 ISA then that is selected, otherwise the
19102 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
19103 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
19104 name selects the 430X ISA.
19106 In addition an MCU-specific linker script is added to the linker
19107 command line.  The script's name is the name of the MCU with
19108 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
19109 command line defines the C preprocessor symbol @code{__XXX__} and
19110 cause the linker to search for a script called @file{xxx.ld}.
19112 This option is also passed on to the assembler.
19114 @item -mwarn-mcu
19115 @itemx -mno-warn-mcu
19116 @opindex mwarn-mcu
19117 @opindex mno-warn-mcu
19118 This option enables or disables warnings about conflicts between the
19119 MCU name specified by the @option{-mmcu} option and the ISA set by the
19120 @option{-mcpu} option and/or the hardware multiply support set by the
19121 @option{-mhwmult} option.  It also toggles warnings about unrecognized
19122 MCU names.  This option is on by default.
19124 @item -mcpu=
19125 @opindex mcpu=
19126 Specifies the ISA to use.  Accepted values are @samp{msp430},
19127 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
19128 @option{-mmcu=} option should be used to select the ISA.
19130 @item -msim
19131 @opindex msim
19132 Link to the simulator runtime libraries and linker script.  Overrides
19133 any scripts that would be selected by the @option{-mmcu=} option.
19135 @item -mlarge
19136 @opindex mlarge
19137 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
19139 @item -msmall
19140 @opindex msmall
19141 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
19143 @item -mrelax
19144 @opindex mrelax
19145 This option is passed to the assembler and linker, and allows the
19146 linker to perform certain optimizations that cannot be done until
19147 the final link.
19149 @item mhwmult=
19150 @opindex mhwmult=
19151 Describes the type of hardware multiply supported by the target.
19152 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
19153 for the original 16-bit-only multiply supported by early MCUs.
19154 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
19155 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
19156 A value of @samp{auto} can also be given.  This tells GCC to deduce
19157 the hardware multiply support based upon the MCU name provided by the
19158 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
19159 the MCU name is not recognized then no hardware multiply support is
19160 assumed.  @code{auto} is the default setting.
19162 Hardware multiplies are normally performed by calling a library
19163 routine.  This saves space in the generated code.  When compiling at
19164 @option{-O3} or higher however the hardware multiplier is invoked
19165 inline.  This makes for bigger, but faster code.
19167 The hardware multiply routines disable interrupts whilst running and
19168 restore the previous interrupt state when they finish.  This makes
19169 them safe to use inside interrupt handlers as well as in normal code.
19171 @item -minrt
19172 @opindex minrt
19173 Enable the use of a minimum runtime environment - no static
19174 initializers or constructors.  This is intended for memory-constrained
19175 devices.  The compiler includes special symbols in some objects
19176 that tell the linker and runtime which code fragments are required.
19178 @item -mcode-region=
19179 @itemx -mdata-region=
19180 @opindex mcode-region
19181 @opindex mdata-region
19182 These options tell the compiler where to place functions and data that
19183 do not have one of the @code{lower}, @code{upper}, @code{either} or
19184 @code{section} attributes.  Possible values are @code{lower},
19185 @code{upper}, @code{either} or @code{any}.  The first three behave
19186 like the corresponding attribute.  The fourth possible value -
19187 @code{any} - is the default.  It leaves placement entirely up to the
19188 linker script and how it assigns the standard sections
19189 (@code{.text}, @code{.data}, etc) to the memory regions.
19191 @item -msilicon-errata=
19192 @opindex msilicon-errata
19193 This option passes on a request to assembler to enable the fixes for
19194 the named silicon errata.
19196 @item -msilicon-errata-warn=
19197 @opindex msilicon-errata-warn
19198 This option passes on a request to the assembler to enable warning
19199 messages when a silicon errata might need to be applied.
19201 @end table
19203 @node NDS32 Options
19204 @subsection NDS32 Options
19205 @cindex NDS32 Options
19207 These options are defined for NDS32 implementations:
19209 @table @gcctabopt
19211 @item -mbig-endian
19212 @opindex mbig-endian
19213 Generate code in big-endian mode.
19215 @item -mlittle-endian
19216 @opindex mlittle-endian
19217 Generate code in little-endian mode.
19219 @item -mreduced-regs
19220 @opindex mreduced-regs
19221 Use reduced-set registers for register allocation.
19223 @item -mfull-regs
19224 @opindex mfull-regs
19225 Use full-set registers for register allocation.
19227 @item -mcmov
19228 @opindex mcmov
19229 Generate conditional move instructions.
19231 @item -mno-cmov
19232 @opindex mno-cmov
19233 Do not generate conditional move instructions.
19235 @item -mperf-ext
19236 @opindex mperf-ext
19237 Generate performance extension instructions.
19239 @item -mno-perf-ext
19240 @opindex mno-perf-ext
19241 Do not generate performance extension instructions.
19243 @item -mv3push
19244 @opindex mv3push
19245 Generate v3 push25/pop25 instructions.
19247 @item -mno-v3push
19248 @opindex mno-v3push
19249 Do not generate v3 push25/pop25 instructions.
19251 @item -m16-bit
19252 @opindex m16-bit
19253 Generate 16-bit instructions.
19255 @item -mno-16-bit
19256 @opindex mno-16-bit
19257 Do not generate 16-bit instructions.
19259 @item -misr-vector-size=@var{num}
19260 @opindex misr-vector-size
19261 Specify the size of each interrupt vector, which must be 4 or 16.
19263 @item -mcache-block-size=@var{num}
19264 @opindex mcache-block-size
19265 Specify the size of each cache block,
19266 which must be a power of 2 between 4 and 512.
19268 @item -march=@var{arch}
19269 @opindex march
19270 Specify the name of the target architecture.
19272 @item -mcmodel=@var{code-model}
19273 @opindex mcmodel
19274 Set the code model to one of
19275 @table @asis
19276 @item @samp{small}
19277 All the data and read-only data segments must be within 512KB addressing space.
19278 The text segment must be within 16MB addressing space.
19279 @item @samp{medium}
19280 The data segment must be within 512KB while the read-only data segment can be
19281 within 4GB addressing space.  The text segment should be still within 16MB
19282 addressing space.
19283 @item @samp{large}
19284 All the text and data segments can be within 4GB addressing space.
19285 @end table
19287 @item -mctor-dtor
19288 @opindex mctor-dtor
19289 Enable constructor/destructor feature.
19291 @item -mrelax
19292 @opindex mrelax
19293 Guide linker to relax instructions.
19295 @end table
19297 @node Nios II Options
19298 @subsection Nios II Options
19299 @cindex Nios II options
19300 @cindex Altera Nios II options
19302 These are the options defined for the Altera Nios II processor.
19304 @table @gcctabopt
19306 @item -G @var{num}
19307 @opindex G
19308 @cindex smaller data references
19309 Put global and static objects less than or equal to @var{num} bytes
19310 into the small data or BSS sections instead of the normal data or BSS
19311 sections.  The default value of @var{num} is 8.
19313 @item -mgpopt=@var{option}
19314 @item -mgpopt
19315 @itemx -mno-gpopt
19316 @opindex mgpopt
19317 @opindex mno-gpopt
19318 Generate (do not generate) GP-relative accesses.  The following 
19319 @var{option} names are recognized:
19321 @table @samp
19323 @item none
19324 Do not generate GP-relative accesses.
19326 @item local
19327 Generate GP-relative accesses for small data objects that are not 
19328 external, weak, or uninitialized common symbols.  
19329 Also use GP-relative addressing for objects that
19330 have been explicitly placed in a small data section via a @code{section}
19331 attribute.
19333 @item global
19334 As for @samp{local}, but also generate GP-relative accesses for
19335 small data objects that are external, weak, or common.  If you use this option,
19336 you must ensure that all parts of your program (including libraries) are
19337 compiled with the same @option{-G} setting.
19339 @item data
19340 Generate GP-relative accesses for all data objects in the program.  If you
19341 use this option, the entire data and BSS segments
19342 of your program must fit in 64K of memory and you must use an appropriate
19343 linker script to allocate them within the addressable range of the
19344 global pointer.
19346 @item all
19347 Generate GP-relative addresses for function pointers as well as data
19348 pointers.  If you use this option, the entire text, data, and BSS segments
19349 of your program must fit in 64K of memory and you must use an appropriate
19350 linker script to allocate them within the addressable range of the
19351 global pointer.
19353 @end table
19355 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
19356 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
19358 The default is @option{-mgpopt} except when @option{-fpic} or
19359 @option{-fPIC} is specified to generate position-independent code.
19360 Note that the Nios II ABI does not permit GP-relative accesses from
19361 shared libraries.
19363 You may need to specify @option{-mno-gpopt} explicitly when building
19364 programs that include large amounts of small data, including large
19365 GOT data sections.  In this case, the 16-bit offset for GP-relative
19366 addressing may not be large enough to allow access to the entire 
19367 small data section.
19369 @item -mel
19370 @itemx -meb
19371 @opindex mel
19372 @opindex meb
19373 Generate little-endian (default) or big-endian (experimental) code,
19374 respectively.
19376 @item -march=@var{arch}
19377 @opindex march
19378 This specifies the name of the target Nios II architecture.  GCC uses this
19379 name to determine what kind of instructions it can emit when generating
19380 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
19382 The preprocessor macro @code{__nios2_arch__} is available to programs,
19383 with value 1 or 2, indicating the targeted ISA level.
19385 @item -mbypass-cache
19386 @itemx -mno-bypass-cache
19387 @opindex mno-bypass-cache
19388 @opindex mbypass-cache
19389 Force all load and store instructions to always bypass cache by 
19390 using I/O variants of the instructions. The default is not to
19391 bypass the cache.
19393 @item -mno-cache-volatile 
19394 @itemx -mcache-volatile       
19395 @opindex mcache-volatile 
19396 @opindex mno-cache-volatile
19397 Volatile memory access bypass the cache using the I/O variants of 
19398 the load and store instructions. The default is not to bypass the cache.
19400 @item -mno-fast-sw-div
19401 @itemx -mfast-sw-div
19402 @opindex mno-fast-sw-div
19403 @opindex mfast-sw-div
19404 Do not use table-based fast divide for small numbers. The default 
19405 is to use the fast divide at @option{-O3} and above.
19407 @item -mno-hw-mul
19408 @itemx -mhw-mul
19409 @itemx -mno-hw-mulx
19410 @itemx -mhw-mulx
19411 @itemx -mno-hw-div
19412 @itemx -mhw-div
19413 @opindex mno-hw-mul
19414 @opindex mhw-mul
19415 @opindex mno-hw-mulx
19416 @opindex mhw-mulx
19417 @opindex mno-hw-div
19418 @opindex mhw-div
19419 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
19420 instructions by the compiler. The default is to emit @code{mul}
19421 and not emit @code{div} and @code{mulx}.
19423 @item -mbmx
19424 @itemx -mno-bmx
19425 @itemx -mcdx
19426 @itemx -mno-cdx
19427 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
19428 CDX (code density) instructions.  Enabling these instructions also
19429 requires @option{-march=r2}.  Since these instructions are optional
19430 extensions to the R2 architecture, the default is not to emit them.
19432 @item -mcustom-@var{insn}=@var{N}
19433 @itemx -mno-custom-@var{insn}
19434 @opindex mcustom-@var{insn}
19435 @opindex mno-custom-@var{insn}
19436 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
19437 custom instruction with encoding @var{N} when generating code that uses 
19438 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
19439 instruction 253 for single-precision floating-point add operations instead
19440 of the default behavior of using a library call.
19442 The following values of @var{insn} are supported.  Except as otherwise
19443 noted, floating-point operations are expected to be implemented with
19444 normal IEEE 754 semantics and correspond directly to the C operators or the
19445 equivalent GCC built-in functions (@pxref{Other Builtins}).
19447 Single-precision floating point:
19448 @table @asis
19450 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
19451 Binary arithmetic operations.
19453 @item @samp{fnegs}
19454 Unary negation.
19456 @item @samp{fabss}
19457 Unary absolute value.
19459 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
19460 Comparison operations.
19462 @item @samp{fmins}, @samp{fmaxs}
19463 Floating-point minimum and maximum.  These instructions are only
19464 generated if @option{-ffinite-math-only} is specified.
19466 @item @samp{fsqrts}
19467 Unary square root operation.
19469 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
19470 Floating-point trigonometric and exponential functions.  These instructions
19471 are only generated if @option{-funsafe-math-optimizations} is also specified.
19473 @end table
19475 Double-precision floating point:
19476 @table @asis
19478 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
19479 Binary arithmetic operations.
19481 @item @samp{fnegd}
19482 Unary negation.
19484 @item @samp{fabsd}
19485 Unary absolute value.
19487 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
19488 Comparison operations.
19490 @item @samp{fmind}, @samp{fmaxd}
19491 Double-precision minimum and maximum.  These instructions are only
19492 generated if @option{-ffinite-math-only} is specified.
19494 @item @samp{fsqrtd}
19495 Unary square root operation.
19497 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
19498 Double-precision trigonometric and exponential functions.  These instructions
19499 are only generated if @option{-funsafe-math-optimizations} is also specified.
19501 @end table
19503 Conversions:
19504 @table @asis
19505 @item @samp{fextsd}
19506 Conversion from single precision to double precision.
19508 @item @samp{ftruncds}
19509 Conversion from double precision to single precision.
19511 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
19512 Conversion from floating point to signed or unsigned integer types, with
19513 truncation towards zero.
19515 @item @samp{round}
19516 Conversion from single-precision floating point to signed integer,
19517 rounding to the nearest integer and ties away from zero.
19518 This corresponds to the @code{__builtin_lroundf} function when
19519 @option{-fno-math-errno} is used.
19521 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
19522 Conversion from signed or unsigned integer types to floating-point types.
19524 @end table
19526 In addition, all of the following transfer instructions for internal
19527 registers X and Y must be provided to use any of the double-precision
19528 floating-point instructions.  Custom instructions taking two
19529 double-precision source operands expect the first operand in the
19530 64-bit register X.  The other operand (or only operand of a unary
19531 operation) is given to the custom arithmetic instruction with the
19532 least significant half in source register @var{src1} and the most
19533 significant half in @var{src2}.  A custom instruction that returns a
19534 double-precision result returns the most significant 32 bits in the
19535 destination register and the other half in 32-bit register Y.  
19536 GCC automatically generates the necessary code sequences to write
19537 register X and/or read register Y when double-precision floating-point
19538 instructions are used.
19540 @table @asis
19542 @item @samp{fwrx}
19543 Write @var{src1} into the least significant half of X and @var{src2} into
19544 the most significant half of X.
19546 @item @samp{fwry}
19547 Write @var{src1} into Y.
19549 @item @samp{frdxhi}, @samp{frdxlo}
19550 Read the most or least (respectively) significant half of X and store it in
19551 @var{dest}.
19553 @item @samp{frdy}
19554 Read the value of Y and store it into @var{dest}.
19555 @end table
19557 Note that you can gain more local control over generation of Nios II custom
19558 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
19559 and @code{target("no-custom-@var{insn}")} function attributes
19560 (@pxref{Function Attributes})
19561 or pragmas (@pxref{Function Specific Option Pragmas}).
19563 @item -mcustom-fpu-cfg=@var{name}
19564 @opindex mcustom-fpu-cfg
19566 This option enables a predefined, named set of custom instruction encodings
19567 (see @option{-mcustom-@var{insn}} above).  
19568 Currently, the following sets are defined:
19570 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
19571 @gccoptlist{-mcustom-fmuls=252 @gol
19572 -mcustom-fadds=253 @gol
19573 -mcustom-fsubs=254 @gol
19574 -fsingle-precision-constant}
19576 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
19577 @gccoptlist{-mcustom-fmuls=252 @gol
19578 -mcustom-fadds=253 @gol
19579 -mcustom-fsubs=254 @gol
19580 -mcustom-fdivs=255 @gol
19581 -fsingle-precision-constant}
19583 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
19584 @gccoptlist{-mcustom-floatus=243 @gol
19585 -mcustom-fixsi=244 @gol
19586 -mcustom-floatis=245 @gol
19587 -mcustom-fcmpgts=246 @gol
19588 -mcustom-fcmples=249 @gol
19589 -mcustom-fcmpeqs=250 @gol
19590 -mcustom-fcmpnes=251 @gol
19591 -mcustom-fmuls=252 @gol
19592 -mcustom-fadds=253 @gol
19593 -mcustom-fsubs=254 @gol
19594 -mcustom-fdivs=255 @gol
19595 -fsingle-precision-constant}
19597 Custom instruction assignments given by individual
19598 @option{-mcustom-@var{insn}=} options override those given by
19599 @option{-mcustom-fpu-cfg=}, regardless of the
19600 order of the options on the command line.
19602 Note that you can gain more local control over selection of a FPU
19603 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
19604 function attribute (@pxref{Function Attributes})
19605 or pragma (@pxref{Function Specific Option Pragmas}).
19607 @end table
19609 These additional @samp{-m} options are available for the Altera Nios II
19610 ELF (bare-metal) target:
19612 @table @gcctabopt
19614 @item -mhal
19615 @opindex mhal
19616 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
19617 startup and termination code, and is typically used in conjunction with
19618 @option{-msys-crt0=} to specify the location of the alternate startup code
19619 provided by the HAL BSP.
19621 @item -msmallc
19622 @opindex msmallc
19623 Link with a limited version of the C library, @option{-lsmallc}, rather than
19624 Newlib.
19626 @item -msys-crt0=@var{startfile}
19627 @opindex msys-crt0
19628 @var{startfile} is the file name of the startfile (crt0) to use 
19629 when linking.  This option is only useful in conjunction with @option{-mhal}.
19631 @item -msys-lib=@var{systemlib}
19632 @opindex msys-lib
19633 @var{systemlib} is the library name of the library that provides
19634 low-level system calls required by the C library,
19635 e.g. @code{read} and @code{write}.
19636 This option is typically used to link with a library provided by a HAL BSP.
19638 @end table
19640 @node Nvidia PTX Options
19641 @subsection Nvidia PTX Options
19642 @cindex Nvidia PTX options
19643 @cindex nvptx options
19645 These options are defined for Nvidia PTX:
19647 @table @gcctabopt
19649 @item -m32
19650 @itemx -m64
19651 @opindex m32
19652 @opindex m64
19653 Generate code for 32-bit or 64-bit ABI.
19655 @item -mmainkernel
19656 @opindex mmainkernel
19657 Link in code for a __main kernel.  This is for stand-alone instead of
19658 offloading execution.
19660 @item -moptimize
19661 @opindex moptimize
19662 Apply partitioned execution optimizations.  This is the default when any
19663 level of optimization is selected.
19665 @end table
19667 @node PDP-11 Options
19668 @subsection PDP-11 Options
19669 @cindex PDP-11 Options
19671 These options are defined for the PDP-11:
19673 @table @gcctabopt
19674 @item -mfpu
19675 @opindex mfpu
19676 Use hardware FPP floating point.  This is the default.  (FIS floating
19677 point on the PDP-11/40 is not supported.)
19679 @item -msoft-float
19680 @opindex msoft-float
19681 Do not use hardware floating point.
19683 @item -mac0
19684 @opindex mac0
19685 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
19687 @item -mno-ac0
19688 @opindex mno-ac0
19689 Return floating-point results in memory.  This is the default.
19691 @item -m40
19692 @opindex m40
19693 Generate code for a PDP-11/40.
19695 @item -m45
19696 @opindex m45
19697 Generate code for a PDP-11/45.  This is the default.
19699 @item -m10
19700 @opindex m10
19701 Generate code for a PDP-11/10.
19703 @item -mbcopy-builtin
19704 @opindex mbcopy-builtin
19705 Use inline @code{movmemhi} patterns for copying memory.  This is the
19706 default.
19708 @item -mbcopy
19709 @opindex mbcopy
19710 Do not use inline @code{movmemhi} patterns for copying memory.
19712 @item -mint16
19713 @itemx -mno-int32
19714 @opindex mint16
19715 @opindex mno-int32
19716 Use 16-bit @code{int}.  This is the default.
19718 @item -mint32
19719 @itemx -mno-int16
19720 @opindex mint32
19721 @opindex mno-int16
19722 Use 32-bit @code{int}.
19724 @item -mfloat64
19725 @itemx -mno-float32
19726 @opindex mfloat64
19727 @opindex mno-float32
19728 Use 64-bit @code{float}.  This is the default.
19730 @item -mfloat32
19731 @itemx -mno-float64
19732 @opindex mfloat32
19733 @opindex mno-float64
19734 Use 32-bit @code{float}.
19736 @item -mabshi
19737 @opindex mabshi
19738 Use @code{abshi2} pattern.  This is the default.
19740 @item -mno-abshi
19741 @opindex mno-abshi
19742 Do not use @code{abshi2} pattern.
19744 @item -mbranch-expensive
19745 @opindex mbranch-expensive
19746 Pretend that branches are expensive.  This is for experimenting with
19747 code generation only.
19749 @item -mbranch-cheap
19750 @opindex mbranch-cheap
19751 Do not pretend that branches are expensive.  This is the default.
19753 @item -munix-asm
19754 @opindex munix-asm
19755 Use Unix assembler syntax.  This is the default when configured for
19756 @samp{pdp11-*-bsd}.
19758 @item -mdec-asm
19759 @opindex mdec-asm
19760 Use DEC assembler syntax.  This is the default when configured for any
19761 PDP-11 target other than @samp{pdp11-*-bsd}.
19762 @end table
19764 @node picoChip Options
19765 @subsection picoChip Options
19766 @cindex picoChip options
19768 These @samp{-m} options are defined for picoChip implementations:
19770 @table @gcctabopt
19772 @item -mae=@var{ae_type}
19773 @opindex mcpu
19774 Set the instruction set, register set, and instruction scheduling
19775 parameters for array element type @var{ae_type}.  Supported values
19776 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
19778 @option{-mae=ANY} selects a completely generic AE type.  Code
19779 generated with this option runs on any of the other AE types.  The
19780 code is not as efficient as it would be if compiled for a specific
19781 AE type, and some types of operation (e.g., multiplication) do not
19782 work properly on all types of AE.
19784 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
19785 for compiled code, and is the default.
19787 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
19788 option may suffer from poor performance of byte (char) manipulation,
19789 since the DSP AE does not provide hardware support for byte load/stores.
19791 @item -msymbol-as-address
19792 Enable the compiler to directly use a symbol name as an address in a
19793 load/store instruction, without first loading it into a
19794 register.  Typically, the use of this option generates larger
19795 programs, which run faster than when the option isn't used.  However, the
19796 results vary from program to program, so it is left as a user option,
19797 rather than being permanently enabled.
19799 @item -mno-inefficient-warnings
19800 Disables warnings about the generation of inefficient code.  These
19801 warnings can be generated, for example, when compiling code that
19802 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19803 no hardware support for byte-level memory operations, so all byte
19804 load/stores must be synthesized from word load/store operations.  This is
19805 inefficient and a warning is generated to indicate
19806 that you should rewrite the code to avoid byte operations, or to target
19807 an AE type that has the necessary hardware support.  This option disables
19808 these warnings.
19810 @end table
19812 @node PowerPC Options
19813 @subsection PowerPC Options
19814 @cindex PowerPC options
19816 These are listed under @xref{RS/6000 and PowerPC Options}.
19818 @node RL78 Options
19819 @subsection RL78 Options
19820 @cindex RL78 Options
19822 @table @gcctabopt
19824 @item -msim
19825 @opindex msim
19826 Links in additional target libraries to support operation within a
19827 simulator.
19829 @item -mmul=none
19830 @itemx -mmul=g10
19831 @itemx -mmul=g13
19832 @itemx -mmul=g14
19833 @itemx -mmul=rl78
19834 @opindex mmul
19835 Specifies the type of hardware multiplication and division support to
19836 be used.  The simplest is @code{none}, which uses software for both
19837 multiplication and division.  This is the default.  The @code{g13}
19838 value is for the hardware multiply/divide peripheral found on the
19839 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
19840 the multiplication and division instructions supported by the RL78/G14
19841 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
19842 the value @code{mg10} is an alias for @code{none}.
19844 In addition a C preprocessor macro is defined, based upon the setting
19845 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
19846 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
19848 @item -mcpu=g10
19849 @itemx -mcpu=g13
19850 @itemx -mcpu=g14
19851 @itemx -mcpu=rl78
19852 @opindex mcpu
19853 Specifies the RL78 core to target.  The default is the G14 core, also
19854 known as an S3 core or just RL78.  The G13 or S2 core does not have
19855 multiply or divide instructions, instead it uses a hardware peripheral
19856 for these operations.  The G10 or S1 core does not have register
19857 banks, so it uses a different calling convention.
19859 If this option is set it also selects the type of hardware multiply
19860 support to use, unless this is overridden by an explicit
19861 @option{-mmul=none} option on the command line.  Thus specifying
19862 @option{-mcpu=g13} enables the use of the G13 hardware multiply
19863 peripheral and specifying @option{-mcpu=g10} disables the use of
19864 hardware multiplications altogether.
19866 Note, although the RL78/G14 core is the default target, specifying
19867 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
19868 change the behavior of the toolchain since it also enables G14
19869 hardware multiply support.  If these options are not specified on the
19870 command line then software multiplication routines will be used even
19871 though the code targets the RL78 core.  This is for backwards
19872 compatibility with older toolchains which did not have hardware
19873 multiply and divide support.
19875 In addition a C preprocessor macro is defined, based upon the setting
19876 of this option.  Possible values are: @code{__RL78_G10__},
19877 @code{__RL78_G13__} or @code{__RL78_G14__}.
19879 @item -mg10
19880 @itemx -mg13
19881 @itemx -mg14
19882 @itemx -mrl78
19883 @opindex mg10
19884 @opindex mg13
19885 @opindex mg14
19886 @opindex mrl78
19887 These are aliases for the corresponding @option{-mcpu=} option.  They
19888 are provided for backwards compatibility.
19890 @item -mallregs
19891 @opindex mallregs
19892 Allow the compiler to use all of the available registers.  By default
19893 registers @code{r24..r31} are reserved for use in interrupt handlers.
19894 With this option enabled these registers can be used in ordinary
19895 functions as well.
19897 @item -m64bit-doubles
19898 @itemx -m32bit-doubles
19899 @opindex m64bit-doubles
19900 @opindex m32bit-doubles
19901 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19902 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19903 @option{-m32bit-doubles}.
19905 @item -msave-mduc-in-interrupts
19906 @item -mno-save-mduc-in-interrupts
19907 @opindex msave-mduc-in-interrupts
19908 @opindex mno-save-mduc-in-interrupts
19909 Specifies that interrupt handler functions should preserve the
19910 MDUC registers.  This is only necessary if normal code might use
19911 the MDUC registers, for example because it performs multiplication
19912 and division operations.  The default is to ignore the MDUC registers
19913 as this makes the interrupt handlers faster.  The target option -mg13
19914 needs to be passed for this to work as this feature is only available
19915 on the G13 target (S2 core).  The MDUC registers will only be saved
19916 if the interrupt handler performs a multiplication or division
19917 operation or it calls another function.
19919 @end table
19921 @node RS/6000 and PowerPC Options
19922 @subsection IBM RS/6000 and PowerPC Options
19923 @cindex RS/6000 and PowerPC Options
19924 @cindex IBM RS/6000 and PowerPC Options
19926 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19927 @table @gcctabopt
19928 @item -mpowerpc-gpopt
19929 @itemx -mno-powerpc-gpopt
19930 @itemx -mpowerpc-gfxopt
19931 @itemx -mno-powerpc-gfxopt
19932 @need 800
19933 @itemx -mpowerpc64
19934 @itemx -mno-powerpc64
19935 @itemx -mmfcrf
19936 @itemx -mno-mfcrf
19937 @itemx -mpopcntb
19938 @itemx -mno-popcntb
19939 @itemx -mpopcntd
19940 @itemx -mno-popcntd
19941 @itemx -mfprnd
19942 @itemx -mno-fprnd
19943 @need 800
19944 @itemx -mcmpb
19945 @itemx -mno-cmpb
19946 @itemx -mmfpgpr
19947 @itemx -mno-mfpgpr
19948 @itemx -mhard-dfp
19949 @itemx -mno-hard-dfp
19950 @opindex mpowerpc-gpopt
19951 @opindex mno-powerpc-gpopt
19952 @opindex mpowerpc-gfxopt
19953 @opindex mno-powerpc-gfxopt
19954 @opindex mpowerpc64
19955 @opindex mno-powerpc64
19956 @opindex mmfcrf
19957 @opindex mno-mfcrf
19958 @opindex mpopcntb
19959 @opindex mno-popcntb
19960 @opindex mpopcntd
19961 @opindex mno-popcntd
19962 @opindex mfprnd
19963 @opindex mno-fprnd
19964 @opindex mcmpb
19965 @opindex mno-cmpb
19966 @opindex mmfpgpr
19967 @opindex mno-mfpgpr
19968 @opindex mhard-dfp
19969 @opindex mno-hard-dfp
19970 You use these options to specify which instructions are available on the
19971 processor you are using.  The default value of these options is
19972 determined when configuring GCC@.  Specifying the
19973 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19974 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19975 rather than the options listed above.
19977 Specifying @option{-mpowerpc-gpopt} allows
19978 GCC to use the optional PowerPC architecture instructions in the
19979 General Purpose group, including floating-point square root.  Specifying
19980 @option{-mpowerpc-gfxopt} allows GCC to
19981 use the optional PowerPC architecture instructions in the Graphics
19982 group, including floating-point select.
19984 The @option{-mmfcrf} option allows GCC to generate the move from
19985 condition register field instruction implemented on the POWER4
19986 processor and other processors that support the PowerPC V2.01
19987 architecture.
19988 The @option{-mpopcntb} option allows GCC to generate the popcount and
19989 double-precision FP reciprocal estimate instruction implemented on the
19990 POWER5 processor and other processors that support the PowerPC V2.02
19991 architecture.
19992 The @option{-mpopcntd} option allows GCC to generate the popcount
19993 instruction implemented on the POWER7 processor and other processors
19994 that support the PowerPC V2.06 architecture.
19995 The @option{-mfprnd} option allows GCC to generate the FP round to
19996 integer instructions implemented on the POWER5+ processor and other
19997 processors that support the PowerPC V2.03 architecture.
19998 The @option{-mcmpb} option allows GCC to generate the compare bytes
19999 instruction implemented on the POWER6 processor and other processors
20000 that support the PowerPC V2.05 architecture.
20001 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
20002 general-purpose register instructions implemented on the POWER6X
20003 processor and other processors that support the extended PowerPC V2.05
20004 architecture.
20005 The @option{-mhard-dfp} option allows GCC to generate the decimal
20006 floating-point instructions implemented on some POWER processors.
20008 The @option{-mpowerpc64} option allows GCC to generate the additional
20009 64-bit instructions that are found in the full PowerPC64 architecture
20010 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
20011 @option{-mno-powerpc64}.
20013 @item -mcpu=@var{cpu_type}
20014 @opindex mcpu
20015 Set architecture type, register usage, and
20016 instruction scheduling parameters for machine type @var{cpu_type}.
20017 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
20018 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
20019 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
20020 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
20021 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
20022 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
20023 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
20024 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
20025 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
20026 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
20027 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
20028 and @samp{rs64}.
20030 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
20031 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
20032 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
20033 architecture machine types, with an appropriate, generic processor
20034 model assumed for scheduling purposes.
20036 The other options specify a specific processor.  Code generated under
20037 those options runs best on that processor, and may not run at all on
20038 others.
20040 The @option{-mcpu} options automatically enable or disable the
20041 following options:
20043 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
20044 -mpopcntb -mpopcntd  -mpowerpc64 @gol
20045 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
20046 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
20047 -mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
20048 -mquad-memory -mquad-memory-atomic -mmodulo -mfloat128 -mfloat128-hardware @gol
20049 -mpower9-fusion -mpower9-vector -mpower9-dform}
20051 The particular options set for any particular CPU varies between
20052 compiler versions, depending on what setting seems to produce optimal
20053 code for that CPU; it doesn't necessarily reflect the actual hardware's
20054 capabilities.  If you wish to set an individual option to a particular
20055 value, you may specify it after the @option{-mcpu} option, like
20056 @option{-mcpu=970 -mno-altivec}.
20058 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
20059 not enabled or disabled by the @option{-mcpu} option at present because
20060 AIX does not have full support for these options.  You may still
20061 enable or disable them individually if you're sure it'll work in your
20062 environment.
20064 @item -mtune=@var{cpu_type}
20065 @opindex mtune
20066 Set the instruction scheduling parameters for machine type
20067 @var{cpu_type}, but do not set the architecture type or register usage,
20068 as @option{-mcpu=@var{cpu_type}} does.  The same
20069 values for @var{cpu_type} are used for @option{-mtune} as for
20070 @option{-mcpu}.  If both are specified, the code generated uses the
20071 architecture and registers set by @option{-mcpu}, but the
20072 scheduling parameters set by @option{-mtune}.
20074 @item -mcmodel=small
20075 @opindex mcmodel=small
20076 Generate PowerPC64 code for the small model: The TOC is limited to
20077 64k.
20079 @item -mcmodel=medium
20080 @opindex mcmodel=medium
20081 Generate PowerPC64 code for the medium model: The TOC and other static
20082 data may be up to a total of 4G in size.
20084 @item -mcmodel=large
20085 @opindex mcmodel=large
20086 Generate PowerPC64 code for the large model: The TOC may be up to 4G
20087 in size.  Other data and code is only limited by the 64-bit address
20088 space.
20090 @item -maltivec
20091 @itemx -mno-altivec
20092 @opindex maltivec
20093 @opindex mno-altivec
20094 Generate code that uses (does not use) AltiVec instructions, and also
20095 enable the use of built-in functions that allow more direct access to
20096 the AltiVec instruction set.  You may also need to set
20097 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
20098 enhancements.
20100 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
20101 @option{-maltivec=be}, the element order for AltiVec intrinsics such
20102 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
20103 match array element order corresponding to the endianness of the
20104 target.  That is, element zero identifies the leftmost element in a
20105 vector register when targeting a big-endian platform, and identifies
20106 the rightmost element in a vector register when targeting a
20107 little-endian platform.
20109 @item -maltivec=be
20110 @opindex maltivec=be
20111 Generate AltiVec instructions using big-endian element order,
20112 regardless of whether the target is big- or little-endian.  This is
20113 the default when targeting a big-endian platform.
20115 The element order is used to interpret element numbers in AltiVec
20116 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
20117 @code{vec_insert}.  By default, these match array element order
20118 corresponding to the endianness for the target.
20120 @item -maltivec=le
20121 @opindex maltivec=le
20122 Generate AltiVec instructions using little-endian element order,
20123 regardless of whether the target is big- or little-endian.  This is
20124 the default when targeting a little-endian platform.  This option is
20125 currently ignored when targeting a big-endian platform.
20127 The element order is used to interpret element numbers in AltiVec
20128 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
20129 @code{vec_insert}.  By default, these match array element order
20130 corresponding to the endianness for the target.
20132 @item -mvrsave
20133 @itemx -mno-vrsave
20134 @opindex mvrsave
20135 @opindex mno-vrsave
20136 Generate VRSAVE instructions when generating AltiVec code.
20138 @item -mgen-cell-microcode
20139 @opindex mgen-cell-microcode
20140 Generate Cell microcode instructions.
20142 @item -mwarn-cell-microcode
20143 @opindex mwarn-cell-microcode
20144 Warn when a Cell microcode instruction is emitted.  An example
20145 of a Cell microcode instruction is a variable shift.
20147 @item -msecure-plt
20148 @opindex msecure-plt
20149 Generate code that allows @command{ld} and @command{ld.so}
20150 to build executables and shared
20151 libraries with non-executable @code{.plt} and @code{.got} sections.
20152 This is a PowerPC
20153 32-bit SYSV ABI option.
20155 @item -mbss-plt
20156 @opindex mbss-plt
20157 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
20158 fills in, and
20159 requires @code{.plt} and @code{.got}
20160 sections that are both writable and executable.
20161 This is a PowerPC 32-bit SYSV ABI option.
20163 @item -misel
20164 @itemx -mno-isel
20165 @opindex misel
20166 @opindex mno-isel
20167 This switch enables or disables the generation of ISEL instructions.
20169 @item -misel=@var{yes/no}
20170 This switch has been deprecated.  Use @option{-misel} and
20171 @option{-mno-isel} instead.
20173 @item -mlra
20174 @opindex mlra
20175 Enable Local Register Allocation.  This is still experimental for PowerPC,
20176 so by default the compiler uses standard reload
20177 (i.e. @option{-mno-lra}).
20179 @item -mspe
20180 @itemx -mno-spe
20181 @opindex mspe
20182 @opindex mno-spe
20183 This switch enables or disables the generation of SPE simd
20184 instructions.
20186 @item -mpaired
20187 @itemx -mno-paired
20188 @opindex mpaired
20189 @opindex mno-paired
20190 This switch enables or disables the generation of PAIRED simd
20191 instructions.
20193 @item -mspe=@var{yes/no}
20194 This option has been deprecated.  Use @option{-mspe} and
20195 @option{-mno-spe} instead.
20197 @item -mvsx
20198 @itemx -mno-vsx
20199 @opindex mvsx
20200 @opindex mno-vsx
20201 Generate code that uses (does not use) vector/scalar (VSX)
20202 instructions, and also enable the use of built-in functions that allow
20203 more direct access to the VSX instruction set.
20205 @item -mcrypto
20206 @itemx -mno-crypto
20207 @opindex mcrypto
20208 @opindex mno-crypto
20209 Enable the use (disable) of the built-in functions that allow direct
20210 access to the cryptographic instructions that were added in version
20211 2.07 of the PowerPC ISA.
20213 @item -mdirect-move
20214 @itemx -mno-direct-move
20215 @opindex mdirect-move
20216 @opindex mno-direct-move
20217 Generate code that uses (does not use) the instructions to move data
20218 between the general purpose registers and the vector/scalar (VSX)
20219 registers that were added in version 2.07 of the PowerPC ISA.
20221 @item -mhtm
20222 @itemx -mno-htm
20223 @opindex mhtm
20224 @opindex mno-htm
20225 Enable (disable) the use of the built-in functions that allow direct
20226 access to the Hardware Transactional Memory (HTM) instructions that
20227 were added in version 2.07 of the PowerPC ISA.
20229 @item -mpower8-fusion
20230 @itemx -mno-power8-fusion
20231 @opindex mpower8-fusion
20232 @opindex mno-power8-fusion
20233 Generate code that keeps (does not keeps) some integer operations
20234 adjacent so that the instructions can be fused together on power8 and
20235 later processors.
20237 @item -mpower8-vector
20238 @itemx -mno-power8-vector
20239 @opindex mpower8-vector
20240 @opindex mno-power8-vector
20241 Generate code that uses (does not use) the vector and scalar
20242 instructions that were added in version 2.07 of the PowerPC ISA.  Also
20243 enable the use of built-in functions that allow more direct access to
20244 the vector instructions.
20246 @item -mquad-memory
20247 @itemx -mno-quad-memory
20248 @opindex mquad-memory
20249 @opindex mno-quad-memory
20250 Generate code that uses (does not use) the non-atomic quad word memory
20251 instructions.  The @option{-mquad-memory} option requires use of
20252 64-bit mode.
20254 @item -mquad-memory-atomic
20255 @itemx -mno-quad-memory-atomic
20256 @opindex mquad-memory-atomic
20257 @opindex mno-quad-memory-atomic
20258 Generate code that uses (does not use) the atomic quad word memory
20259 instructions.  The @option{-mquad-memory-atomic} option requires use of
20260 64-bit mode.
20262 @item -mupper-regs-di
20263 @itemx -mno-upper-regs-di
20264 @opindex mupper-regs-di
20265 @opindex mno-upper-regs-di
20266 Generate code that uses (does not use) the scalar instructions that
20267 target all 64 registers in the vector/scalar floating point register
20268 set that were added in version 2.06 of the PowerPC ISA when processing
20269 integers.  @option{-mupper-regs-di} is turned on by default if you use
20270 any of the @option{-mcpu=power7}, @option{-mcpu=power8},
20271 @option{-mcpu=power9}, or @option{-mvsx} options.
20273 @item -mupper-regs-df
20274 @itemx -mno-upper-regs-df
20275 @opindex mupper-regs-df
20276 @opindex mno-upper-regs-df
20277 Generate code that uses (does not use) the scalar double precision
20278 instructions that target all 64 registers in the vector/scalar
20279 floating point register set that were added in version 2.06 of the
20280 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
20281 use any of the @option{-mcpu=power7}, @option{-mcpu=power8},
20282 @option{-mcpu=power9}, or @option{-mvsx} options.
20284 @item -mupper-regs-sf
20285 @itemx -mno-upper-regs-sf
20286 @opindex mupper-regs-sf
20287 @opindex mno-upper-regs-sf
20288 Generate code that uses (does not use) the scalar single precision
20289 instructions that target all 64 registers in the vector/scalar
20290 floating point register set that were added in version 2.07 of the
20291 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
20292 use either of the @option{-mcpu=power8}, @option{-mpower8-vector}, or
20293 @option{-mpower9} options.
20295 @item -mupper-regs
20296 @itemx -mno-upper-regs
20297 @opindex mupper-regs
20298 @opindex mno-upper-regs
20299 Generate code that uses (does not use) the scalar
20300 instructions that target all 64 registers in the vector/scalar
20301 floating point register set, depending on the model of the machine.
20303 If the @option{-mno-upper-regs} option is used, it turns off both
20304 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
20306 @item -mfloat128
20307 @itemx -mno-float128
20308 @opindex mfloat128
20309 @opindex mno-float128
20310 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
20311 and use either software emulation for IEEE 128-bit floating point or
20312 hardware instructions.
20314 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
20315 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
20316 option.  The @code{-mfloat128} option only works on PowerPC 64-bit
20317 Linux systems.
20319 @item -mfloat128-hardware
20320 @itemx -mno-float128-hardware
20321 @opindex mfloat128-hardware
20322 @opindex mno-float128-hardware
20323 Enable/disable using ISA 3.0 hardware instructions to support the
20324 @var{__float128} data type.
20326 @item -mmodulo
20327 @itemx -mno-modulo
20328 @opindex mmodulo
20329 @opindex mno-module
20330 Generate code that uses (does not use) the ISA 3.0 integer modulo
20331 instructions.  The @option{-mmodulo} option is enabled by default
20332 with the @option{-mcpu=power9} option.
20334 @item -mpower9-fusion
20335 @itemx -mno-power9-fusion
20336 @opindex mpower9-fusion
20337 @opindex mno-power9-fusion
20338 Generate code that keeps (does not keeps) some operations adjacent so
20339 that the instructions can be fused together on power9 and later
20340 processors.
20342 @item -mpower9-vector
20343 @itemx -mno-power9-vector
20344 @opindex mpower9-vector
20345 @opindex mno-power9-vector
20346 Generate code that uses (does not use) the vector and scalar
20347 instructions that were added in version 3.0 of the PowerPC ISA.  Also
20348 enable the use of built-in functions that allow more direct access to
20349 the vector instructions.
20351 @item -mpower9-dform
20352 @itemx -mno-power9-dform
20353 @opindex mpower9-dform
20354 @opindex mno-power9-dform
20355 Enable (disable) scalar d-form (register + offset) memory instructions
20356 to load/store traditional Altivec registers. If the @var{LRA} register
20357 allocator is enabled, also enable (disable) vector d-form memory
20358 instructions.
20360 @item -mfloat-gprs=@var{yes/single/double/no}
20361 @itemx -mfloat-gprs
20362 @opindex mfloat-gprs
20363 This switch enables or disables the generation of floating-point
20364 operations on the general-purpose registers for architectures that
20365 support it.
20367 The argument @samp{yes} or @samp{single} enables the use of
20368 single-precision floating-point operations.
20370 The argument @samp{double} enables the use of single and
20371 double-precision floating-point operations.
20373 The argument @samp{no} disables floating-point operations on the
20374 general-purpose registers.
20376 This option is currently only available on the MPC854x.
20378 @item -m32
20379 @itemx -m64
20380 @opindex m32
20381 @opindex m64
20382 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
20383 targets (including GNU/Linux).  The 32-bit environment sets int, long
20384 and pointer to 32 bits and generates code that runs on any PowerPC
20385 variant.  The 64-bit environment sets int to 32 bits and long and
20386 pointer to 64 bits, and generates code for PowerPC64, as for
20387 @option{-mpowerpc64}.
20389 @item -mfull-toc
20390 @itemx -mno-fp-in-toc
20391 @itemx -mno-sum-in-toc
20392 @itemx -mminimal-toc
20393 @opindex mfull-toc
20394 @opindex mno-fp-in-toc
20395 @opindex mno-sum-in-toc
20396 @opindex mminimal-toc
20397 Modify generation of the TOC (Table Of Contents), which is created for
20398 every executable file.  The @option{-mfull-toc} option is selected by
20399 default.  In that case, GCC allocates at least one TOC entry for
20400 each unique non-automatic variable reference in your program.  GCC
20401 also places floating-point constants in the TOC@.  However, only
20402 16,384 entries are available in the TOC@.
20404 If you receive a linker error message that saying you have overflowed
20405 the available TOC space, you can reduce the amount of TOC space used
20406 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
20407 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
20408 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
20409 generate code to calculate the sum of an address and a constant at
20410 run time instead of putting that sum into the TOC@.  You may specify one
20411 or both of these options.  Each causes GCC to produce very slightly
20412 slower and larger code at the expense of conserving TOC space.
20414 If you still run out of space in the TOC even when you specify both of
20415 these options, specify @option{-mminimal-toc} instead.  This option causes
20416 GCC to make only one TOC entry for every file.  When you specify this
20417 option, GCC produces code that is slower and larger but which
20418 uses extremely little TOC space.  You may wish to use this option
20419 only on files that contain less frequently-executed code.
20421 @item -maix64
20422 @itemx -maix32
20423 @opindex maix64
20424 @opindex maix32
20425 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
20426 @code{long} type, and the infrastructure needed to support them.
20427 Specifying @option{-maix64} implies @option{-mpowerpc64},
20428 while @option{-maix32} disables the 64-bit ABI and
20429 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
20431 @item -mxl-compat
20432 @itemx -mno-xl-compat
20433 @opindex mxl-compat
20434 @opindex mno-xl-compat
20435 Produce code that conforms more closely to IBM XL compiler semantics
20436 when using AIX-compatible ABI@.  Pass floating-point arguments to
20437 prototyped functions beyond the register save area (RSA) on the stack
20438 in addition to argument FPRs.  Do not assume that most significant
20439 double in 128-bit long double value is properly rounded when comparing
20440 values and converting to double.  Use XL symbol names for long double
20441 support routines.
20443 The AIX calling convention was extended but not initially documented to
20444 handle an obscure K&R C case of calling a function that takes the
20445 address of its arguments with fewer arguments than declared.  IBM XL
20446 compilers access floating-point arguments that do not fit in the
20447 RSA from the stack when a subroutine is compiled without
20448 optimization.  Because always storing floating-point arguments on the
20449 stack is inefficient and rarely needed, this option is not enabled by
20450 default and only is necessary when calling subroutines compiled by IBM
20451 XL compilers without optimization.
20453 @item -mpe
20454 @opindex mpe
20455 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
20456 application written to use message passing with special startup code to
20457 enable the application to run.  The system must have PE installed in the
20458 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
20459 must be overridden with the @option{-specs=} option to specify the
20460 appropriate directory location.  The Parallel Environment does not
20461 support threads, so the @option{-mpe} option and the @option{-pthread}
20462 option are incompatible.
20464 @item -malign-natural
20465 @itemx -malign-power
20466 @opindex malign-natural
20467 @opindex malign-power
20468 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
20469 @option{-malign-natural} overrides the ABI-defined alignment of larger
20470 types, such as floating-point doubles, on their natural size-based boundary.
20471 The option @option{-malign-power} instructs GCC to follow the ABI-specified
20472 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
20474 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
20475 is not supported.
20477 @item -msoft-float
20478 @itemx -mhard-float
20479 @opindex msoft-float
20480 @opindex mhard-float
20481 Generate code that does not use (uses) the floating-point register set.
20482 Software floating-point emulation is provided if you use the
20483 @option{-msoft-float} option, and pass the option to GCC when linking.
20485 @item -msingle-float
20486 @itemx -mdouble-float
20487 @opindex msingle-float
20488 @opindex mdouble-float
20489 Generate code for single- or double-precision floating-point operations.
20490 @option{-mdouble-float} implies @option{-msingle-float}.
20492 @item -msimple-fpu
20493 @opindex msimple-fpu
20494 Do not generate @code{sqrt} and @code{div} instructions for hardware
20495 floating-point unit.
20497 @item -mfpu=@var{name}
20498 @opindex mfpu
20499 Specify type of floating-point unit.  Valid values for @var{name} are
20500 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
20501 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
20502 @samp{sp_full} (equivalent to @option{-msingle-float}),
20503 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
20505 @item -mxilinx-fpu
20506 @opindex mxilinx-fpu
20507 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
20509 @item -mmultiple
20510 @itemx -mno-multiple
20511 @opindex mmultiple
20512 @opindex mno-multiple
20513 Generate code that uses (does not use) the load multiple word
20514 instructions and the store multiple word instructions.  These
20515 instructions are generated by default on POWER systems, and not
20516 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
20517 PowerPC systems, since those instructions do not work when the
20518 processor is in little-endian mode.  The exceptions are PPC740 and
20519 PPC750 which permit these instructions in little-endian mode.
20521 @item -mstring
20522 @itemx -mno-string
20523 @opindex mstring
20524 @opindex mno-string
20525 Generate code that uses (does not use) the load string instructions
20526 and the store string word instructions to save multiple registers and
20527 do small block moves.  These instructions are generated by default on
20528 POWER systems, and not generated on PowerPC systems.  Do not use
20529 @option{-mstring} on little-endian PowerPC systems, since those
20530 instructions do not work when the processor is in little-endian mode.
20531 The exceptions are PPC740 and PPC750 which permit these instructions
20532 in little-endian mode.
20534 @item -mupdate
20535 @itemx -mno-update
20536 @opindex mupdate
20537 @opindex mno-update
20538 Generate code that uses (does not use) the load or store instructions
20539 that update the base register to the address of the calculated memory
20540 location.  These instructions are generated by default.  If you use
20541 @option{-mno-update}, there is a small window between the time that the
20542 stack pointer is updated and the address of the previous frame is
20543 stored, which means code that walks the stack frame across interrupts or
20544 signals may get corrupted data.
20546 @item -mavoid-indexed-addresses
20547 @itemx -mno-avoid-indexed-addresses
20548 @opindex mavoid-indexed-addresses
20549 @opindex mno-avoid-indexed-addresses
20550 Generate code that tries to avoid (not avoid) the use of indexed load
20551 or store instructions. These instructions can incur a performance
20552 penalty on Power6 processors in certain situations, such as when
20553 stepping through large arrays that cross a 16M boundary.  This option
20554 is enabled by default when targeting Power6 and disabled otherwise.
20556 @item -mfused-madd
20557 @itemx -mno-fused-madd
20558 @opindex mfused-madd
20559 @opindex mno-fused-madd
20560 Generate code that uses (does not use) the floating-point multiply and
20561 accumulate instructions.  These instructions are generated by default
20562 if hardware floating point is used.  The machine-dependent
20563 @option{-mfused-madd} option is now mapped to the machine-independent
20564 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
20565 mapped to @option{-ffp-contract=off}.
20567 @item -mmulhw
20568 @itemx -mno-mulhw
20569 @opindex mmulhw
20570 @opindex mno-mulhw
20571 Generate code that uses (does not use) the half-word multiply and
20572 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
20573 These instructions are generated by default when targeting those
20574 processors.
20576 @item -mdlmzb
20577 @itemx -mno-dlmzb
20578 @opindex mdlmzb
20579 @opindex mno-dlmzb
20580 Generate code that uses (does not use) the string-search @samp{dlmzb}
20581 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
20582 generated by default when targeting those processors.
20584 @item -mno-bit-align
20585 @itemx -mbit-align
20586 @opindex mno-bit-align
20587 @opindex mbit-align
20588 On System V.4 and embedded PowerPC systems do not (do) force structures
20589 and unions that contain bit-fields to be aligned to the base type of the
20590 bit-field.
20592 For example, by default a structure containing nothing but 8
20593 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
20594 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
20595 the structure is aligned to a 1-byte boundary and is 1 byte in
20596 size.
20598 @item -mno-strict-align
20599 @itemx -mstrict-align
20600 @opindex mno-strict-align
20601 @opindex mstrict-align
20602 On System V.4 and embedded PowerPC systems do not (do) assume that
20603 unaligned memory references are handled by the system.
20605 @item -mrelocatable
20606 @itemx -mno-relocatable
20607 @opindex mrelocatable
20608 @opindex mno-relocatable
20609 Generate code that allows (does not allow) a static executable to be
20610 relocated to a different address at run time.  A simple embedded
20611 PowerPC system loader should relocate the entire contents of
20612 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
20613 a table of 32-bit addresses generated by this option.  For this to
20614 work, all objects linked together must be compiled with
20615 @option{-mrelocatable} or @option{-mrelocatable-lib}.
20616 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
20618 @item -mrelocatable-lib
20619 @itemx -mno-relocatable-lib
20620 @opindex mrelocatable-lib
20621 @opindex mno-relocatable-lib
20622 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
20623 @code{.fixup} section to allow static executables to be relocated at
20624 run time, but @option{-mrelocatable-lib} does not use the smaller stack
20625 alignment of @option{-mrelocatable}.  Objects compiled with
20626 @option{-mrelocatable-lib} may be linked with objects compiled with
20627 any combination of the @option{-mrelocatable} options.
20629 @item -mno-toc
20630 @itemx -mtoc
20631 @opindex mno-toc
20632 @opindex mtoc
20633 On System V.4 and embedded PowerPC systems do not (do) assume that
20634 register 2 contains a pointer to a global area pointing to the addresses
20635 used in the program.
20637 @item -mlittle
20638 @itemx -mlittle-endian
20639 @opindex mlittle
20640 @opindex mlittle-endian
20641 On System V.4 and embedded PowerPC systems compile code for the
20642 processor in little-endian mode.  The @option{-mlittle-endian} option is
20643 the same as @option{-mlittle}.
20645 @item -mbig
20646 @itemx -mbig-endian
20647 @opindex mbig
20648 @opindex mbig-endian
20649 On System V.4 and embedded PowerPC systems compile code for the
20650 processor in big-endian mode.  The @option{-mbig-endian} option is
20651 the same as @option{-mbig}.
20653 @item -mdynamic-no-pic
20654 @opindex mdynamic-no-pic
20655 On Darwin and Mac OS X systems, compile code so that it is not
20656 relocatable, but that its external references are relocatable.  The
20657 resulting code is suitable for applications, but not shared
20658 libraries.
20660 @item -msingle-pic-base
20661 @opindex msingle-pic-base
20662 Treat the register used for PIC addressing as read-only, rather than
20663 loading it in the prologue for each function.  The runtime system is
20664 responsible for initializing this register with an appropriate value
20665 before execution begins.
20667 @item -mprioritize-restricted-insns=@var{priority}
20668 @opindex mprioritize-restricted-insns
20669 This option controls the priority that is assigned to
20670 dispatch-slot restricted instructions during the second scheduling
20671 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
20672 or @samp{2} to assign no, highest, or second-highest (respectively) 
20673 priority to dispatch-slot restricted
20674 instructions.
20676 @item -msched-costly-dep=@var{dependence_type}
20677 @opindex msched-costly-dep
20678 This option controls which dependences are considered costly
20679 by the target during instruction scheduling.  The argument
20680 @var{dependence_type} takes one of the following values:
20682 @table @asis
20683 @item @samp{no}
20684 No dependence is costly.
20686 @item @samp{all}
20687 All dependences are costly.
20689 @item @samp{true_store_to_load}
20690 A true dependence from store to load is costly.
20692 @item @samp{store_to_load}
20693 Any dependence from store to load is costly.
20695 @item @var{number}
20696 Any dependence for which the latency is greater than or equal to 
20697 @var{number} is costly.
20698 @end table
20700 @item -minsert-sched-nops=@var{scheme}
20701 @opindex minsert-sched-nops
20702 This option controls which NOP insertion scheme is used during
20703 the second scheduling pass.  The argument @var{scheme} takes one of the
20704 following values:
20706 @table @asis
20707 @item @samp{no}
20708 Don't insert NOPs.
20710 @item @samp{pad}
20711 Pad with NOPs any dispatch group that has vacant issue slots,
20712 according to the scheduler's grouping.
20714 @item @samp{regroup_exact}
20715 Insert NOPs to force costly dependent insns into
20716 separate groups.  Insert exactly as many NOPs as needed to force an insn
20717 to a new group, according to the estimated processor grouping.
20719 @item @var{number}
20720 Insert NOPs to force costly dependent insns into
20721 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
20722 @end table
20724 @item -mcall-sysv
20725 @opindex mcall-sysv
20726 On System V.4 and embedded PowerPC systems compile code using calling
20727 conventions that adhere to the March 1995 draft of the System V
20728 Application Binary Interface, PowerPC processor supplement.  This is the
20729 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
20731 @item -mcall-sysv-eabi
20732 @itemx -mcall-eabi
20733 @opindex mcall-sysv-eabi
20734 @opindex mcall-eabi
20735 Specify both @option{-mcall-sysv} and @option{-meabi} options.
20737 @item -mcall-sysv-noeabi
20738 @opindex mcall-sysv-noeabi
20739 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
20741 @item -mcall-aixdesc
20742 @opindex m
20743 On System V.4 and embedded PowerPC systems compile code for the AIX
20744 operating system.
20746 @item -mcall-linux
20747 @opindex mcall-linux
20748 On System V.4 and embedded PowerPC systems compile code for the
20749 Linux-based GNU system.
20751 @item -mcall-freebsd
20752 @opindex mcall-freebsd
20753 On System V.4 and embedded PowerPC systems compile code for the
20754 FreeBSD operating system.
20756 @item -mcall-netbsd
20757 @opindex mcall-netbsd
20758 On System V.4 and embedded PowerPC systems compile code for the
20759 NetBSD operating system.
20761 @item -mcall-openbsd
20762 @opindex mcall-netbsd
20763 On System V.4 and embedded PowerPC systems compile code for the
20764 OpenBSD operating system.
20766 @item -maix-struct-return
20767 @opindex maix-struct-return
20768 Return all structures in memory (as specified by the AIX ABI)@.
20770 @item -msvr4-struct-return
20771 @opindex msvr4-struct-return
20772 Return structures smaller than 8 bytes in registers (as specified by the
20773 SVR4 ABI)@.
20775 @item -mabi=@var{abi-type}
20776 @opindex mabi
20777 Extend the current ABI with a particular extension, or remove such extension.
20778 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
20779 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
20780 @samp{elfv1}, @samp{elfv2}@.
20782 @item -mabi=spe
20783 @opindex mabi=spe
20784 Extend the current ABI with SPE ABI extensions.  This does not change
20785 the default ABI, instead it adds the SPE ABI extensions to the current
20786 ABI@.
20788 @item -mabi=no-spe
20789 @opindex mabi=no-spe
20790 Disable Book-E SPE ABI extensions for the current ABI@.
20792 @item -mabi=ibmlongdouble
20793 @opindex mabi=ibmlongdouble
20794 Change the current ABI to use IBM extended-precision long double.
20795 This is a PowerPC 32-bit SYSV ABI option.
20797 @item -mabi=ieeelongdouble
20798 @opindex mabi=ieeelongdouble
20799 Change the current ABI to use IEEE extended-precision long double.
20800 This is a PowerPC 32-bit Linux ABI option.
20802 @item -mabi=elfv1
20803 @opindex mabi=elfv1
20804 Change the current ABI to use the ELFv1 ABI.
20805 This is the default ABI for big-endian PowerPC 64-bit Linux.
20806 Overriding the default ABI requires special system support and is
20807 likely to fail in spectacular ways.
20809 @item -mabi=elfv2
20810 @opindex mabi=elfv2
20811 Change the current ABI to use the ELFv2 ABI.
20812 This is the default ABI for little-endian PowerPC 64-bit Linux.
20813 Overriding the default ABI requires special system support and is
20814 likely to fail in spectacular ways.
20816 @item -mprototype
20817 @itemx -mno-prototype
20818 @opindex mprototype
20819 @opindex mno-prototype
20820 On System V.4 and embedded PowerPC systems assume that all calls to
20821 variable argument functions are properly prototyped.  Otherwise, the
20822 compiler must insert an instruction before every non-prototyped call to
20823 set or clear bit 6 of the condition code register (@code{CR}) to
20824 indicate whether floating-point values are passed in the floating-point
20825 registers in case the function takes variable arguments.  With
20826 @option{-mprototype}, only calls to prototyped variable argument functions
20827 set or clear the bit.
20829 @item -msim
20830 @opindex msim
20831 On embedded PowerPC systems, assume that the startup module is called
20832 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
20833 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
20834 configurations.
20836 @item -mmvme
20837 @opindex mmvme
20838 On embedded PowerPC systems, assume that the startup module is called
20839 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
20840 @file{libc.a}.
20842 @item -mads
20843 @opindex mads
20844 On embedded PowerPC systems, assume that the startup module is called
20845 @file{crt0.o} and the standard C libraries are @file{libads.a} and
20846 @file{libc.a}.
20848 @item -myellowknife
20849 @opindex myellowknife
20850 On embedded PowerPC systems, assume that the startup module is called
20851 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
20852 @file{libc.a}.
20854 @item -mvxworks
20855 @opindex mvxworks
20856 On System V.4 and embedded PowerPC systems, specify that you are
20857 compiling for a VxWorks system.
20859 @item -memb
20860 @opindex memb
20861 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
20862 header to indicate that @samp{eabi} extended relocations are used.
20864 @item -meabi
20865 @itemx -mno-eabi
20866 @opindex meabi
20867 @opindex mno-eabi
20868 On System V.4 and embedded PowerPC systems do (do not) adhere to the
20869 Embedded Applications Binary Interface (EABI), which is a set of
20870 modifications to the System V.4 specifications.  Selecting @option{-meabi}
20871 means that the stack is aligned to an 8-byte boundary, a function
20872 @code{__eabi} is called from @code{main} to set up the EABI
20873 environment, and the @option{-msdata} option can use both @code{r2} and
20874 @code{r13} to point to two separate small data areas.  Selecting
20875 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
20876 no EABI initialization function is called from @code{main}, and the
20877 @option{-msdata} option only uses @code{r13} to point to a single
20878 small data area.  The @option{-meabi} option is on by default if you
20879 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
20881 @item -msdata=eabi
20882 @opindex msdata=eabi
20883 On System V.4 and embedded PowerPC systems, put small initialized
20884 @code{const} global and static data in the @code{.sdata2} section, which
20885 is pointed to by register @code{r2}.  Put small initialized
20886 non-@code{const} global and static data in the @code{.sdata} section,
20887 which is pointed to by register @code{r13}.  Put small uninitialized
20888 global and static data in the @code{.sbss} section, which is adjacent to
20889 the @code{.sdata} section.  The @option{-msdata=eabi} option is
20890 incompatible with the @option{-mrelocatable} option.  The
20891 @option{-msdata=eabi} option also sets the @option{-memb} option.
20893 @item -msdata=sysv
20894 @opindex msdata=sysv
20895 On System V.4 and embedded PowerPC systems, put small global and static
20896 data in the @code{.sdata} section, which is pointed to by register
20897 @code{r13}.  Put small uninitialized global and static data in the
20898 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
20899 The @option{-msdata=sysv} option is incompatible with the
20900 @option{-mrelocatable} option.
20902 @item -msdata=default
20903 @itemx -msdata
20904 @opindex msdata=default
20905 @opindex msdata
20906 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
20907 compile code the same as @option{-msdata=eabi}, otherwise compile code the
20908 same as @option{-msdata=sysv}.
20910 @item -msdata=data
20911 @opindex msdata=data
20912 On System V.4 and embedded PowerPC systems, put small global
20913 data in the @code{.sdata} section.  Put small uninitialized global
20914 data in the @code{.sbss} section.  Do not use register @code{r13}
20915 to address small data however.  This is the default behavior unless
20916 other @option{-msdata} options are used.
20918 @item -msdata=none
20919 @itemx -mno-sdata
20920 @opindex msdata=none
20921 @opindex mno-sdata
20922 On embedded PowerPC systems, put all initialized global and static data
20923 in the @code{.data} section, and all uninitialized data in the
20924 @code{.bss} section.
20926 @item -mblock-move-inline-limit=@var{num}
20927 @opindex mblock-move-inline-limit
20928 Inline all block moves (such as calls to @code{memcpy} or structure
20929 copies) less than or equal to @var{num} bytes.  The minimum value for
20930 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
20931 targets.  The default value is target-specific.
20933 @item -G @var{num}
20934 @opindex G
20935 @cindex smaller data references (PowerPC)
20936 @cindex .sdata/.sdata2 references (PowerPC)
20937 On embedded PowerPC systems, put global and static items less than or
20938 equal to @var{num} bytes into the small data or BSS sections instead of
20939 the normal data or BSS section.  By default, @var{num} is 8.  The
20940 @option{-G @var{num}} switch is also passed to the linker.
20941 All modules should be compiled with the same @option{-G @var{num}} value.
20943 @item -mregnames
20944 @itemx -mno-regnames
20945 @opindex mregnames
20946 @opindex mno-regnames
20947 On System V.4 and embedded PowerPC systems do (do not) emit register
20948 names in the assembly language output using symbolic forms.
20950 @item -mlongcall
20951 @itemx -mno-longcall
20952 @opindex mlongcall
20953 @opindex mno-longcall
20954 By default assume that all calls are far away so that a longer and more
20955 expensive calling sequence is required.  This is required for calls
20956 farther than 32 megabytes (33,554,432 bytes) from the current location.
20957 A short call is generated if the compiler knows
20958 the call cannot be that far away.  This setting can be overridden by
20959 the @code{shortcall} function attribute, or by @code{#pragma
20960 longcall(0)}.
20962 Some linkers are capable of detecting out-of-range calls and generating
20963 glue code on the fly.  On these systems, long calls are unnecessary and
20964 generate slower code.  As of this writing, the AIX linker can do this,
20965 as can the GNU linker for PowerPC/64.  It is planned to add this feature
20966 to the GNU linker for 32-bit PowerPC systems as well.
20968 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
20969 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
20970 addresses represent the callee and the branch island.  The
20971 Darwin/PPC linker prefers the first address and generates a @code{bl
20972 callee} if the PPC @code{bl} instruction reaches the callee directly;
20973 otherwise, the linker generates @code{bl L42} to call the branch
20974 island.  The branch island is appended to the body of the
20975 calling function; it computes the full 32-bit address of the callee
20976 and jumps to it.
20978 On Mach-O (Darwin) systems, this option directs the compiler emit to
20979 the glue for every direct call, and the Darwin linker decides whether
20980 to use or discard it.
20982 In the future, GCC may ignore all longcall specifications
20983 when the linker is known to generate glue.
20985 @item -mtls-markers
20986 @itemx -mno-tls-markers
20987 @opindex mtls-markers
20988 @opindex mno-tls-markers
20989 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20990 specifying the function argument.  The relocation allows the linker to
20991 reliably associate function call with argument setup instructions for
20992 TLS optimization, which in turn allows GCC to better schedule the
20993 sequence.
20995 @item -pthread
20996 @opindex pthread
20997 Adds support for multithreading with the @dfn{pthreads} library.
20998 This option sets flags for both the preprocessor and linker.
21000 @item -mrecip
21001 @itemx -mno-recip
21002 @opindex mrecip
21003 This option enables use of the reciprocal estimate and
21004 reciprocal square root estimate instructions with additional
21005 Newton-Raphson steps to increase precision instead of doing a divide or
21006 square root and divide for floating-point arguments.  You should use
21007 the @option{-ffast-math} option when using @option{-mrecip} (or at
21008 least @option{-funsafe-math-optimizations},
21009 @option{-ffinite-math-only}, @option{-freciprocal-math} and
21010 @option{-fno-trapping-math}).  Note that while the throughput of the
21011 sequence is generally higher than the throughput of the non-reciprocal
21012 instruction, the precision of the sequence can be decreased by up to 2
21013 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
21014 roots.
21016 @item -mrecip=@var{opt}
21017 @opindex mrecip=opt
21018 This option controls which reciprocal estimate instructions
21019 may be used.  @var{opt} is a comma-separated list of options, which may
21020 be preceded by a @code{!} to invert the option:
21022 @table @samp
21024 @item all
21025 Enable all estimate instructions.
21027 @item default 
21028 Enable the default instructions, equivalent to @option{-mrecip}.
21030 @item none 
21031 Disable all estimate instructions, equivalent to @option{-mno-recip}.
21033 @item div 
21034 Enable the reciprocal approximation instructions for both 
21035 single and double precision.
21037 @item divf 
21038 Enable the single-precision reciprocal approximation instructions.
21040 @item divd 
21041 Enable the double-precision reciprocal approximation instructions.
21043 @item rsqrt 
21044 Enable the reciprocal square root approximation instructions for both
21045 single and double precision.
21047 @item rsqrtf 
21048 Enable the single-precision reciprocal square root approximation instructions.
21050 @item rsqrtd 
21051 Enable the double-precision reciprocal square root approximation instructions.
21053 @end table
21055 So, for example, @option{-mrecip=all,!rsqrtd} enables
21056 all of the reciprocal estimate instructions, except for the
21057 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
21058 which handle the double-precision reciprocal square root calculations.
21060 @item -mrecip-precision
21061 @itemx -mno-recip-precision
21062 @opindex mrecip-precision
21063 Assume (do not assume) that the reciprocal estimate instructions
21064 provide higher-precision estimates than is mandated by the PowerPC
21065 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
21066 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
21067 The double-precision square root estimate instructions are not generated by
21068 default on low-precision machines, since they do not provide an
21069 estimate that converges after three steps.
21071 @item -mveclibabi=@var{type}
21072 @opindex mveclibabi
21073 Specifies the ABI type to use for vectorizing intrinsics using an
21074 external library.  The only type supported at present is @samp{mass},
21075 which specifies to use IBM's Mathematical Acceleration Subsystem
21076 (MASS) libraries for vectorizing intrinsics using external libraries.
21077 GCC currently emits calls to @code{acosd2}, @code{acosf4},
21078 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
21079 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
21080 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
21081 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
21082 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
21083 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
21084 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
21085 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
21086 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
21087 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
21088 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
21089 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
21090 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
21091 for power7.  Both @option{-ftree-vectorize} and
21092 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
21093 libraries must be specified at link time.
21095 @item -mfriz
21096 @itemx -mno-friz
21097 @opindex mfriz
21098 Generate (do not generate) the @code{friz} instruction when the
21099 @option{-funsafe-math-optimizations} option is used to optimize
21100 rounding of floating-point values to 64-bit integer and back to floating
21101 point.  The @code{friz} instruction does not return the same value if
21102 the floating-point number is too large to fit in an integer.
21104 @item -mpointers-to-nested-functions
21105 @itemx -mno-pointers-to-nested-functions
21106 @opindex mpointers-to-nested-functions
21107 Generate (do not generate) code to load up the static chain register
21108 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
21109 systems where a function pointer points to a 3-word descriptor giving
21110 the function address, TOC value to be loaded in register @code{r2}, and
21111 static chain value to be loaded in register @code{r11}.  The
21112 @option{-mpointers-to-nested-functions} is on by default.  You cannot
21113 call through pointers to nested functions or pointers
21114 to functions compiled in other languages that use the static chain if
21115 you use @option{-mno-pointers-to-nested-functions}.
21117 @item -msave-toc-indirect
21118 @itemx -mno-save-toc-indirect
21119 @opindex msave-toc-indirect
21120 Generate (do not generate) code to save the TOC value in the reserved
21121 stack location in the function prologue if the function calls through
21122 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
21123 saved in the prologue, it is saved just before the call through the
21124 pointer.  The @option{-mno-save-toc-indirect} option is the default.
21126 @item -mcompat-align-parm
21127 @itemx -mno-compat-align-parm
21128 @opindex mcompat-align-parm
21129 Generate (do not generate) code to pass structure parameters with a
21130 maximum alignment of 64 bits, for compatibility with older versions
21131 of GCC.
21133 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
21134 structure parameter on a 128-bit boundary when that structure contained
21135 a member requiring 128-bit alignment.  This is corrected in more
21136 recent versions of GCC.  This option may be used to generate code
21137 that is compatible with functions compiled with older versions of
21138 GCC.
21140 The @option{-mno-compat-align-parm} option is the default.
21141 @end table
21143 @node RX Options
21144 @subsection RX Options
21145 @cindex RX Options
21147 These command-line options are defined for RX targets:
21149 @table @gcctabopt
21150 @item -m64bit-doubles
21151 @itemx -m32bit-doubles
21152 @opindex m64bit-doubles
21153 @opindex m32bit-doubles
21154 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
21155 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
21156 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
21157 works on 32-bit values, which is why the default is
21158 @option{-m32bit-doubles}.
21160 @item -fpu
21161 @itemx -nofpu
21162 @opindex fpu
21163 @opindex nofpu
21164 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
21165 floating-point hardware.  The default is enabled for the RX600
21166 series and disabled for the RX200 series.
21168 Floating-point instructions are only generated for 32-bit floating-point 
21169 values, however, so the FPU hardware is not used for doubles if the
21170 @option{-m64bit-doubles} option is used.
21172 @emph{Note} If the @option{-fpu} option is enabled then
21173 @option{-funsafe-math-optimizations} is also enabled automatically.
21174 This is because the RX FPU instructions are themselves unsafe.
21176 @item -mcpu=@var{name}
21177 @opindex mcpu
21178 Selects the type of RX CPU to be targeted.  Currently three types are
21179 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
21180 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
21182 The only difference between @samp{RX600} and @samp{RX610} is that the
21183 @samp{RX610} does not support the @code{MVTIPL} instruction.
21185 The @samp{RX200} series does not have a hardware floating-point unit
21186 and so @option{-nofpu} is enabled by default when this type is
21187 selected.
21189 @item -mbig-endian-data
21190 @itemx -mlittle-endian-data
21191 @opindex mbig-endian-data
21192 @opindex mlittle-endian-data
21193 Store data (but not code) in the big-endian format.  The default is
21194 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
21195 format.
21197 @item -msmall-data-limit=@var{N}
21198 @opindex msmall-data-limit
21199 Specifies the maximum size in bytes of global and static variables
21200 which can be placed into the small data area.  Using the small data
21201 area can lead to smaller and faster code, but the size of area is
21202 limited and it is up to the programmer to ensure that the area does
21203 not overflow.  Also when the small data area is used one of the RX's
21204 registers (usually @code{r13}) is reserved for use pointing to this
21205 area, so it is no longer available for use by the compiler.  This
21206 could result in slower and/or larger code if variables are pushed onto
21207 the stack instead of being held in this register.
21209 Note, common variables (variables that have not been initialized) and
21210 constants are not placed into the small data area as they are assigned
21211 to other sections in the output executable.
21213 The default value is zero, which disables this feature.  Note, this
21214 feature is not enabled by default with higher optimization levels
21215 (@option{-O2} etc) because of the potentially detrimental effects of
21216 reserving a register.  It is up to the programmer to experiment and
21217 discover whether this feature is of benefit to their program.  See the
21218 description of the @option{-mpid} option for a description of how the
21219 actual register to hold the small data area pointer is chosen.
21221 @item -msim
21222 @itemx -mno-sim
21223 @opindex msim
21224 @opindex mno-sim
21225 Use the simulator runtime.  The default is to use the libgloss
21226 board-specific runtime.
21228 @item -mas100-syntax
21229 @itemx -mno-as100-syntax
21230 @opindex mas100-syntax
21231 @opindex mno-as100-syntax
21232 When generating assembler output use a syntax that is compatible with
21233 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
21234 assembler, but it has some restrictions so it is not generated by default.
21236 @item -mmax-constant-size=@var{N}
21237 @opindex mmax-constant-size
21238 Specifies the maximum size, in bytes, of a constant that can be used as
21239 an operand in a RX instruction.  Although the RX instruction set does
21240 allow constants of up to 4 bytes in length to be used in instructions,
21241 a longer value equates to a longer instruction.  Thus in some
21242 circumstances it can be beneficial to restrict the size of constants
21243 that are used in instructions.  Constants that are too big are instead
21244 placed into a constant pool and referenced via register indirection.
21246 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
21247 or 4 means that constants of any size are allowed.
21249 @item -mrelax
21250 @opindex mrelax
21251 Enable linker relaxation.  Linker relaxation is a process whereby the
21252 linker attempts to reduce the size of a program by finding shorter
21253 versions of various instructions.  Disabled by default.
21255 @item -mint-register=@var{N}
21256 @opindex mint-register
21257 Specify the number of registers to reserve for fast interrupt handler
21258 functions.  The value @var{N} can be between 0 and 4.  A value of 1
21259 means that register @code{r13} is reserved for the exclusive use
21260 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
21261 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
21262 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
21263 A value of 0, the default, does not reserve any registers.
21265 @item -msave-acc-in-interrupts
21266 @opindex msave-acc-in-interrupts
21267 Specifies that interrupt handler functions should preserve the
21268 accumulator register.  This is only necessary if normal code might use
21269 the accumulator register, for example because it performs 64-bit
21270 multiplications.  The default is to ignore the accumulator as this
21271 makes the interrupt handlers faster.
21273 @item -mpid
21274 @itemx -mno-pid
21275 @opindex mpid
21276 @opindex mno-pid
21277 Enables the generation of position independent data.  When enabled any
21278 access to constant data is done via an offset from a base address
21279 held in a register.  This allows the location of constant data to be
21280 determined at run time without requiring the executable to be
21281 relocated, which is a benefit to embedded applications with tight
21282 memory constraints.  Data that can be modified is not affected by this
21283 option.
21285 Note, using this feature reserves a register, usually @code{r13}, for
21286 the constant data base address.  This can result in slower and/or
21287 larger code, especially in complicated functions.
21289 The actual register chosen to hold the constant data base address
21290 depends upon whether the @option{-msmall-data-limit} and/or the
21291 @option{-mint-register} command-line options are enabled.  Starting
21292 with register @code{r13} and proceeding downwards, registers are
21293 allocated first to satisfy the requirements of @option{-mint-register},
21294 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
21295 is possible for the small data area register to be @code{r8} if both
21296 @option{-mint-register=4} and @option{-mpid} are specified on the
21297 command line.
21299 By default this feature is not enabled.  The default can be restored
21300 via the @option{-mno-pid} command-line option.
21302 @item -mno-warn-multiple-fast-interrupts
21303 @itemx -mwarn-multiple-fast-interrupts
21304 @opindex mno-warn-multiple-fast-interrupts
21305 @opindex mwarn-multiple-fast-interrupts
21306 Prevents GCC from issuing a warning message if it finds more than one
21307 fast interrupt handler when it is compiling a file.  The default is to
21308 issue a warning for each extra fast interrupt handler found, as the RX
21309 only supports one such interrupt.
21311 @item -mallow-string-insns
21312 @itemx -mno-allow-string-insns
21313 @opindex mallow-string-insns
21314 @opindex mno-allow-string-insns
21315 Enables or disables the use of the string manipulation instructions
21316 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
21317 @code{SWHILE} and also the @code{RMPA} instruction.  These
21318 instructions may prefetch data, which is not safe to do if accessing
21319 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
21320 for more information).
21322 The default is to allow these instructions, but it is not possible for
21323 GCC to reliably detect all circumstances where a string instruction
21324 might be used to access an I/O register, so their use cannot be
21325 disabled automatically.  Instead it is reliant upon the programmer to
21326 use the @option{-mno-allow-string-insns} option if their program
21327 accesses I/O space.
21329 When the instructions are enabled GCC defines the C preprocessor
21330 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
21331 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
21333 @item -mjsr
21334 @itemx -mno-jsr
21335 @opindex mjsr
21336 @opindex mno-jsr
21337 Use only (or not only) @code{JSR} instructions to access functions.
21338 This option can be used when code size exceeds the range of @code{BSR}
21339 instructions.  Note that @option{-mno-jsr} does not mean to not use
21340 @code{JSR} but instead means that any type of branch may be used.
21341 @end table
21343 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
21344 has special significance to the RX port when used with the
21345 @code{interrupt} function attribute.  This attribute indicates a
21346 function intended to process fast interrupts.  GCC ensures
21347 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
21348 and/or @code{r13} and only provided that the normal use of the
21349 corresponding registers have been restricted via the
21350 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
21351 options.
21353 @node S/390 and zSeries Options
21354 @subsection S/390 and zSeries Options
21355 @cindex S/390 and zSeries Options
21357 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
21359 @table @gcctabopt
21360 @item -mhard-float
21361 @itemx -msoft-float
21362 @opindex mhard-float
21363 @opindex msoft-float
21364 Use (do not use) the hardware floating-point instructions and registers
21365 for floating-point operations.  When @option{-msoft-float} is specified,
21366 functions in @file{libgcc.a} are used to perform floating-point
21367 operations.  When @option{-mhard-float} is specified, the compiler
21368 generates IEEE floating-point instructions.  This is the default.
21370 @item -mhard-dfp
21371 @itemx -mno-hard-dfp
21372 @opindex mhard-dfp
21373 @opindex mno-hard-dfp
21374 Use (do not use) the hardware decimal-floating-point instructions for
21375 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
21376 specified, functions in @file{libgcc.a} are used to perform
21377 decimal-floating-point operations.  When @option{-mhard-dfp} is
21378 specified, the compiler generates decimal-floating-point hardware
21379 instructions.  This is the default for @option{-march=z9-ec} or higher.
21381 @item -mlong-double-64
21382 @itemx -mlong-double-128
21383 @opindex mlong-double-64
21384 @opindex mlong-double-128
21385 These switches control the size of @code{long double} type. A size
21386 of 64 bits makes the @code{long double} type equivalent to the @code{double}
21387 type. This is the default.
21389 @item -mbackchain
21390 @itemx -mno-backchain
21391 @opindex mbackchain
21392 @opindex mno-backchain
21393 Store (do not store) the address of the caller's frame as backchain pointer
21394 into the callee's stack frame.
21395 A backchain may be needed to allow debugging using tools that do not understand
21396 DWARF call frame information.
21397 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
21398 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
21399 the backchain is placed into the topmost word of the 96/160 byte register
21400 save area.
21402 In general, code compiled with @option{-mbackchain} is call-compatible with
21403 code compiled with @option{-mmo-backchain}; however, use of the backchain
21404 for debugging purposes usually requires that the whole binary is built with
21405 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
21406 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
21407 to build a linux kernel use @option{-msoft-float}.
21409 The default is to not maintain the backchain.
21411 @item -mpacked-stack
21412 @itemx -mno-packed-stack
21413 @opindex mpacked-stack
21414 @opindex mno-packed-stack
21415 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
21416 specified, the compiler uses the all fields of the 96/160 byte register save
21417 area only for their default purpose; unused fields still take up stack space.
21418 When @option{-mpacked-stack} is specified, register save slots are densely
21419 packed at the top of the register save area; unused space is reused for other
21420 purposes, allowing for more efficient use of the available stack space.
21421 However, when @option{-mbackchain} is also in effect, the topmost word of
21422 the save area is always used to store the backchain, and the return address
21423 register is always saved two words below the backchain.
21425 As long as the stack frame backchain is not used, code generated with
21426 @option{-mpacked-stack} is call-compatible with code generated with
21427 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
21428 S/390 or zSeries generated code that uses the stack frame backchain at run
21429 time, not just for debugging purposes.  Such code is not call-compatible
21430 with code compiled with @option{-mpacked-stack}.  Also, note that the
21431 combination of @option{-mbackchain},
21432 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
21433 to build a linux kernel use @option{-msoft-float}.
21435 The default is to not use the packed stack layout.
21437 @item -msmall-exec
21438 @itemx -mno-small-exec
21439 @opindex msmall-exec
21440 @opindex mno-small-exec
21441 Generate (or do not generate) code using the @code{bras} instruction
21442 to do subroutine calls.
21443 This only works reliably if the total executable size does not
21444 exceed 64k.  The default is to use the @code{basr} instruction instead,
21445 which does not have this limitation.
21447 @item -m64
21448 @itemx -m31
21449 @opindex m64
21450 @opindex m31
21451 When @option{-m31} is specified, generate code compliant to the
21452 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
21453 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
21454 particular to generate 64-bit instructions.  For the @samp{s390}
21455 targets, the default is @option{-m31}, while the @samp{s390x}
21456 targets default to @option{-m64}.
21458 @item -mzarch
21459 @itemx -mesa
21460 @opindex mzarch
21461 @opindex mesa
21462 When @option{-mzarch} is specified, generate code using the
21463 instructions available on z/Architecture.
21464 When @option{-mesa} is specified, generate code using the
21465 instructions available on ESA/390.  Note that @option{-mesa} is
21466 not possible with @option{-m64}.
21467 When generating code compliant to the GNU/Linux for S/390 ABI,
21468 the default is @option{-mesa}.  When generating code compliant
21469 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
21471 @item -mhtm
21472 @itemx -mno-htm
21473 @opindex mhtm
21474 @opindex mno-htm
21475 The @option{-mhtm} option enables a set of builtins making use of
21476 instructions available with the transactional execution facility
21477 introduced with the IBM zEnterprise EC12 machine generation
21478 @ref{S/390 System z Built-in Functions}.
21479 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
21481 @item -mvx
21482 @itemx -mno-vx
21483 @opindex mvx
21484 @opindex mno-vx
21485 When @option{-mvx} is specified, generate code using the instructions
21486 available with the vector extension facility introduced with the IBM
21487 z13 machine generation.
21488 This option changes the ABI for some vector type values with regard to
21489 alignment and calling conventions.  In case vector type values are
21490 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
21491 command will be added to mark the resulting binary with the ABI used.
21492 @option{-mvx} is enabled by default when using @option{-march=z13}.
21494 @item -mzvector
21495 @itemx -mno-zvector
21496 @opindex mzvector
21497 @opindex mno-zvector
21498 The @option{-mzvector} option enables vector language extensions and
21499 builtins using instructions available with the vector extension
21500 facility introduced with the IBM z13 machine generation.
21501 This option adds support for @samp{vector} to be used as a keyword to
21502 define vector type variables and arguments.  @samp{vector} is only
21503 available when GNU extensions are enabled.  It will not be expanded
21504 when requesting strict standard compliance e.g. with @option{-std=c99}.
21505 In addition to the GCC low-level builtins @option{-mzvector} enables
21506 a set of builtins added for compatibility with AltiVec-style
21507 implementations like Power and Cell.  In order to make use of these
21508 builtins the header file @file{vecintrin.h} needs to be included.
21509 @option{-mzvector} is disabled by default.
21511 @item -mmvcle
21512 @itemx -mno-mvcle
21513 @opindex mmvcle
21514 @opindex mno-mvcle
21515 Generate (or do not generate) code using the @code{mvcle} instruction
21516 to perform block moves.  When @option{-mno-mvcle} is specified,
21517 use a @code{mvc} loop instead.  This is the default unless optimizing for
21518 size.
21520 @item -mdebug
21521 @itemx -mno-debug
21522 @opindex mdebug
21523 @opindex mno-debug
21524 Print (or do not print) additional debug information when compiling.
21525 The default is to not print debug information.
21527 @item -march=@var{cpu-type}
21528 @opindex march
21529 Generate code that runs on @var{cpu-type}, which is the name of a
21530 system representing a certain processor type.  Possible values for
21531 @var{cpu-type} are @samp{z900}, @samp{z990}, @samp{z9-109},
21532 @samp{z9-ec}, @samp{z10}, @samp{z196}, @samp{zEC12}, and @samp{z13}.
21533 The default is @option{-march=z900}.  @samp{g5} and @samp{g6} are
21534 deprecated and will be removed with future releases.
21536 @item -mtune=@var{cpu-type}
21537 @opindex mtune
21538 Tune to @var{cpu-type} everything applicable about the generated code,
21539 except for the ABI and the set of available instructions.
21540 The list of @var{cpu-type} values is the same as for @option{-march}.
21541 The default is the value used for @option{-march}.
21543 @item -mtpf-trace
21544 @itemx -mno-tpf-trace
21545 @opindex mtpf-trace
21546 @opindex mno-tpf-trace
21547 Generate code that adds (does not add) in TPF OS specific branches to trace
21548 routines in the operating system.  This option is off by default, even
21549 when compiling for the TPF OS@.
21551 @item -mfused-madd
21552 @itemx -mno-fused-madd
21553 @opindex mfused-madd
21554 @opindex mno-fused-madd
21555 Generate code that uses (does not use) the floating-point multiply and
21556 accumulate instructions.  These instructions are generated by default if
21557 hardware floating point is used.
21559 @item -mwarn-framesize=@var{framesize}
21560 @opindex mwarn-framesize
21561 Emit a warning if the current function exceeds the given frame size.  Because
21562 this is a compile-time check it doesn't need to be a real problem when the program
21563 runs.  It is intended to identify functions that most probably cause
21564 a stack overflow.  It is useful to be used in an environment with limited stack
21565 size e.g.@: the linux kernel.
21567 @item -mwarn-dynamicstack
21568 @opindex mwarn-dynamicstack
21569 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
21570 arrays.  This is generally a bad idea with a limited stack size.
21572 @item -mstack-guard=@var{stack-guard}
21573 @itemx -mstack-size=@var{stack-size}
21574 @opindex mstack-guard
21575 @opindex mstack-size
21576 If these options are provided the S/390 back end emits additional instructions in
21577 the function prologue that trigger a trap if the stack size is @var{stack-guard}
21578 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
21579 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
21580 the frame size of the compiled function is chosen.
21581 These options are intended to be used to help debugging stack overflow problems.
21582 The additionally emitted code causes only little overhead and hence can also be
21583 used in production-like systems without greater performance degradation.  The given
21584 values have to be exact powers of 2 and @var{stack-size} has to be greater than
21585 @var{stack-guard} without exceeding 64k.
21586 In order to be efficient the extra code makes the assumption that the stack starts
21587 at an address aligned to the value given by @var{stack-size}.
21588 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
21590 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
21591 @opindex mhotpatch
21592 If the hotpatch option is enabled, a ``hot-patching'' function
21593 prologue is generated for all functions in the compilation unit.
21594 The funtion label is prepended with the given number of two-byte
21595 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
21596 the label, 2 * @var{post-halfwords} bytes are appended, using the
21597 largest NOP like instructions the architecture allows (maximum
21598 1000000).
21600 If both arguments are zero, hotpatching is disabled.
21602 This option can be overridden for individual functions with the
21603 @code{hotpatch} attribute.
21604 @end table
21606 @node Score Options
21607 @subsection Score Options
21608 @cindex Score Options
21610 These options are defined for Score implementations:
21612 @table @gcctabopt
21613 @item -meb
21614 @opindex meb
21615 Compile code for big-endian mode.  This is the default.
21617 @item -mel
21618 @opindex mel
21619 Compile code for little-endian mode.
21621 @item -mnhwloop
21622 @opindex mnhwloop
21623 Disable generation of @code{bcnz} instructions.
21625 @item -muls
21626 @opindex muls
21627 Enable generation of unaligned load and store instructions.
21629 @item -mmac
21630 @opindex mmac
21631 Enable the use of multiply-accumulate instructions. Disabled by default.
21633 @item -mscore5
21634 @opindex mscore5
21635 Specify the SCORE5 as the target architecture.
21637 @item -mscore5u
21638 @opindex mscore5u
21639 Specify the SCORE5U of the target architecture.
21641 @item -mscore7
21642 @opindex mscore7
21643 Specify the SCORE7 as the target architecture. This is the default.
21645 @item -mscore7d
21646 @opindex mscore7d
21647 Specify the SCORE7D as the target architecture.
21648 @end table
21650 @node SH Options
21651 @subsection SH Options
21653 These @samp{-m} options are defined for the SH implementations:
21655 @table @gcctabopt
21656 @item -m1
21657 @opindex m1
21658 Generate code for the SH1.
21660 @item -m2
21661 @opindex m2
21662 Generate code for the SH2.
21664 @item -m2e
21665 Generate code for the SH2e.
21667 @item -m2a-nofpu
21668 @opindex m2a-nofpu
21669 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
21670 that the floating-point unit is not used.
21672 @item -m2a-single-only
21673 @opindex m2a-single-only
21674 Generate code for the SH2a-FPU, in such a way that no double-precision
21675 floating-point operations are used.
21677 @item -m2a-single
21678 @opindex m2a-single
21679 Generate code for the SH2a-FPU assuming the floating-point unit is in
21680 single-precision mode by default.
21682 @item -m2a
21683 @opindex m2a
21684 Generate code for the SH2a-FPU assuming the floating-point unit is in
21685 double-precision mode by default.
21687 @item -m3
21688 @opindex m3
21689 Generate code for the SH3.
21691 @item -m3e
21692 @opindex m3e
21693 Generate code for the SH3e.
21695 @item -m4-nofpu
21696 @opindex m4-nofpu
21697 Generate code for the SH4 without a floating-point unit.
21699 @item -m4-single-only
21700 @opindex m4-single-only
21701 Generate code for the SH4 with a floating-point unit that only
21702 supports single-precision arithmetic.
21704 @item -m4-single
21705 @opindex m4-single
21706 Generate code for the SH4 assuming the floating-point unit is in
21707 single-precision mode by default.
21709 @item -m4
21710 @opindex m4
21711 Generate code for the SH4.
21713 @item -m4-100
21714 @opindex m4-100
21715 Generate code for SH4-100.
21717 @item -m4-100-nofpu
21718 @opindex m4-100-nofpu
21719 Generate code for SH4-100 in such a way that the
21720 floating-point unit is not used.
21722 @item -m4-100-single
21723 @opindex m4-100-single
21724 Generate code for SH4-100 assuming the floating-point unit is in
21725 single-precision mode by default.
21727 @item -m4-100-single-only
21728 @opindex m4-100-single-only
21729 Generate code for SH4-100 in such a way that no double-precision
21730 floating-point operations are used.
21732 @item -m4-200
21733 @opindex m4-200
21734 Generate code for SH4-200.
21736 @item -m4-200-nofpu
21737 @opindex m4-200-nofpu
21738 Generate code for SH4-200 without in such a way that the
21739 floating-point unit is not used.
21741 @item -m4-200-single
21742 @opindex m4-200-single
21743 Generate code for SH4-200 assuming the floating-point unit is in
21744 single-precision mode by default.
21746 @item -m4-200-single-only
21747 @opindex m4-200-single-only
21748 Generate code for SH4-200 in such a way that no double-precision
21749 floating-point operations are used.
21751 @item -m4-300
21752 @opindex m4-300
21753 Generate code for SH4-300.
21755 @item -m4-300-nofpu
21756 @opindex m4-300-nofpu
21757 Generate code for SH4-300 without in such a way that the
21758 floating-point unit is not used.
21760 @item -m4-300-single
21761 @opindex m4-300-single
21762 Generate code for SH4-300 in such a way that no double-precision
21763 floating-point operations are used.
21765 @item -m4-300-single-only
21766 @opindex m4-300-single-only
21767 Generate code for SH4-300 in such a way that no double-precision
21768 floating-point operations are used.
21770 @item -m4-340
21771 @opindex m4-340
21772 Generate code for SH4-340 (no MMU, no FPU).
21774 @item -m4-500
21775 @opindex m4-500
21776 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
21777 assembler.
21779 @item -m4a-nofpu
21780 @opindex m4a-nofpu
21781 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
21782 floating-point unit is not used.
21784 @item -m4a-single-only
21785 @opindex m4a-single-only
21786 Generate code for the SH4a, in such a way that no double-precision
21787 floating-point operations are used.
21789 @item -m4a-single
21790 @opindex m4a-single
21791 Generate code for the SH4a assuming the floating-point unit is in
21792 single-precision mode by default.
21794 @item -m4a
21795 @opindex m4a
21796 Generate code for the SH4a.
21798 @item -m4al
21799 @opindex m4al
21800 Same as @option{-m4a-nofpu}, except that it implicitly passes
21801 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
21802 instructions at the moment.
21804 @item -mb
21805 @opindex mb
21806 Compile code for the processor in big-endian mode.
21808 @item -ml
21809 @opindex ml
21810 Compile code for the processor in little-endian mode.
21812 @item -mdalign
21813 @opindex mdalign
21814 Align doubles at 64-bit boundaries.  Note that this changes the calling
21815 conventions, and thus some functions from the standard C library do
21816 not work unless you recompile it first with @option{-mdalign}.
21818 @item -mrelax
21819 @opindex mrelax
21820 Shorten some address references at link time, when possible; uses the
21821 linker option @option{-relax}.
21823 @item -mbigtable
21824 @opindex mbigtable
21825 Use 32-bit offsets in @code{switch} tables.  The default is to use
21826 16-bit offsets.
21828 @item -mbitops
21829 @opindex mbitops
21830 Enable the use of bit manipulation instructions on SH2A.
21832 @item -mfmovd
21833 @opindex mfmovd
21834 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
21835 alignment constraints.
21837 @item -mrenesas
21838 @opindex mrenesas
21839 Comply with the calling conventions defined by Renesas.
21841 @item -mno-renesas
21842 @opindex mno-renesas
21843 Comply with the calling conventions defined for GCC before the Renesas
21844 conventions were available.  This option is the default for all
21845 targets of the SH toolchain.
21847 @item -mnomacsave
21848 @opindex mnomacsave
21849 Mark the @code{MAC} register as call-clobbered, even if
21850 @option{-mrenesas} is given.
21852 @item -mieee
21853 @itemx -mno-ieee
21854 @opindex mieee
21855 @opindex mno-ieee
21856 Control the IEEE compliance of floating-point comparisons, which affects the
21857 handling of cases where the result of a comparison is unordered.  By default
21858 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
21859 enabled @option{-mno-ieee} is implicitly set, which results in faster
21860 floating-point greater-equal and less-equal comparisons.  The implicit settings
21861 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
21863 @item -minline-ic_invalidate
21864 @opindex minline-ic_invalidate
21865 Inline code to invalidate instruction cache entries after setting up
21866 nested function trampolines.
21867 This option has no effect if @option{-musermode} is in effect and the selected
21868 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
21869 instruction.
21870 If the selected code generation option does not allow the use of the @code{icbi}
21871 instruction, and @option{-musermode} is not in effect, the inlined code
21872 manipulates the instruction cache address array directly with an associative
21873 write.  This not only requires privileged mode at run time, but it also
21874 fails if the cache line had been mapped via the TLB and has become unmapped.
21876 @item -misize
21877 @opindex misize
21878 Dump instruction size and location in the assembly code.
21880 @item -mpadstruct
21881 @opindex mpadstruct
21882 This option is deprecated.  It pads structures to multiple of 4 bytes,
21883 which is incompatible with the SH ABI@.
21885 @item -matomic-model=@var{model}
21886 @opindex matomic-model=@var{model}
21887 Sets the model of atomic operations and additional parameters as a comma
21888 separated list.  For details on the atomic built-in functions see
21889 @ref{__atomic Builtins}.  The following models and parameters are supported:
21891 @table @samp
21893 @item none
21894 Disable compiler generated atomic sequences and emit library calls for atomic
21895 operations.  This is the default if the target is not @code{sh*-*-linux*}.
21897 @item soft-gusa
21898 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
21899 built-in functions.  The generated atomic sequences require additional support
21900 from the interrupt/exception handling code of the system and are only suitable
21901 for SH3* and SH4* single-core systems.  This option is enabled by default when
21902 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
21903 this option also partially utilizes the hardware atomic instructions
21904 @code{movli.l} and @code{movco.l} to create more efficient code, unless
21905 @samp{strict} is specified.  
21907 @item soft-tcb
21908 Generate software atomic sequences that use a variable in the thread control
21909 block.  This is a variation of the gUSA sequences which can also be used on
21910 SH1* and SH2* targets.  The generated atomic sequences require additional
21911 support from the interrupt/exception handling code of the system and are only
21912 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
21913 parameter has to be specified as well.
21915 @item soft-imask
21916 Generate software atomic sequences that temporarily disable interrupts by
21917 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
21918 in privileged mode and is only suitable for single-core systems.  Additional
21919 support from the interrupt/exception handling code of the system is not
21920 required.  This model is enabled by default when the target is
21921 @code{sh*-*-linux*} and SH1* or SH2*.
21923 @item hard-llcs
21924 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
21925 instructions only.  This is only available on SH4A and is suitable for
21926 multi-core systems.  Since the hardware instructions support only 32 bit atomic
21927 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
21928 Code compiled with this option is also compatible with other software
21929 atomic model interrupt/exception handling systems if executed on an SH4A
21930 system.  Additional support from the interrupt/exception handling code of the
21931 system is not required for this model.
21933 @item gbr-offset=
21934 This parameter specifies the offset in bytes of the variable in the thread
21935 control block structure that should be used by the generated atomic sequences
21936 when the @samp{soft-tcb} model has been selected.  For other models this
21937 parameter is ignored.  The specified value must be an integer multiple of four
21938 and in the range 0-1020.
21940 @item strict
21941 This parameter prevents mixed usage of multiple atomic models, even if they
21942 are compatible, and makes the compiler generate atomic sequences of the
21943 specified model only.
21945 @end table
21947 @item -mtas
21948 @opindex mtas
21949 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
21950 Notice that depending on the particular hardware and software configuration
21951 this can degrade overall performance due to the operand cache line flushes
21952 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
21953 processors the @code{tas.b} instruction must be used with caution since it
21954 can result in data corruption for certain cache configurations.
21956 @item -mprefergot
21957 @opindex mprefergot
21958 When generating position-independent code, emit function calls using
21959 the Global Offset Table instead of the Procedure Linkage Table.
21961 @item -musermode
21962 @itemx -mno-usermode
21963 @opindex musermode
21964 @opindex mno-usermode
21965 Don't allow (allow) the compiler generating privileged mode code.  Specifying
21966 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
21967 inlined code would not work in user mode.  @option{-musermode} is the default
21968 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
21969 @option{-musermode} has no effect, since there is no user mode.
21971 @item -multcost=@var{number}
21972 @opindex multcost=@var{number}
21973 Set the cost to assume for a multiply insn.
21975 @item -mdiv=@var{strategy}
21976 @opindex mdiv=@var{strategy}
21977 Set the division strategy to be used for integer division operations.
21978 @var{strategy} can be one of: 
21980 @table @samp
21982 @item call-div1
21983 Calls a library function that uses the single-step division instruction
21984 @code{div1} to perform the operation.  Division by zero calculates an
21985 unspecified result and does not trap.  This is the default except for SH4,
21986 SH2A and SHcompact.
21988 @item call-fp
21989 Calls a library function that performs the operation in double precision
21990 floating point.  Division by zero causes a floating-point exception.  This is
21991 the default for SHcompact with FPU.  Specifying this for targets that do not
21992 have a double precision FPU defaults to @code{call-div1}.
21994 @item call-table
21995 Calls a library function that uses a lookup table for small divisors and
21996 the @code{div1} instruction with case distinction for larger divisors.  Division
21997 by zero calculates an unspecified result and does not trap.  This is the default
21998 for SH4.  Specifying this for targets that do not have dynamic shift
21999 instructions defaults to @code{call-div1}.
22001 @end table
22003 When a division strategy has not been specified the default strategy is
22004 selected based on the current target.  For SH2A the default strategy is to
22005 use the @code{divs} and @code{divu} instructions instead of library function
22006 calls.
22008 @item -maccumulate-outgoing-args
22009 @opindex maccumulate-outgoing-args
22010 Reserve space once for outgoing arguments in the function prologue rather
22011 than around each call.  Generally beneficial for performance and size.  Also
22012 needed for unwinding to avoid changing the stack frame around conditional code.
22014 @item -mdivsi3_libfunc=@var{name}
22015 @opindex mdivsi3_libfunc=@var{name}
22016 Set the name of the library function used for 32-bit signed division to
22017 @var{name}.
22018 This only affects the name used in the @samp{call} division strategies, and
22019 the compiler still expects the same sets of input/output/clobbered registers as
22020 if this option were not present.
22022 @item -mfixed-range=@var{register-range}
22023 @opindex mfixed-range
22024 Generate code treating the given register range as fixed registers.
22025 A fixed register is one that the register allocator can not use.  This is
22026 useful when compiling kernel code.  A register range is specified as
22027 two registers separated by a dash.  Multiple register ranges can be
22028 specified separated by a comma.
22030 @item -mbranch-cost=@var{num}
22031 @opindex mbranch-cost=@var{num}
22032 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
22033 make the compiler try to generate more branch-free code if possible.  
22034 If not specified the value is selected depending on the processor type that
22035 is being compiled for.
22037 @item -mzdcbranch
22038 @itemx -mno-zdcbranch
22039 @opindex mzdcbranch
22040 @opindex mno-zdcbranch
22041 Assume (do not assume) that zero displacement conditional branch instructions
22042 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
22043 compiler prefers zero displacement branch code sequences.  This is
22044 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
22045 disabled by specifying @option{-mno-zdcbranch}.
22047 @item -mcbranch-force-delay-slot
22048 @opindex mcbranch-force-delay-slot
22049 Force the usage of delay slots for conditional branches, which stuffs the delay
22050 slot with a @code{nop} if a suitable instruction can't be found.  By default
22051 this option is disabled.  It can be enabled to work around hardware bugs as
22052 found in the original SH7055.
22054 @item -mfused-madd
22055 @itemx -mno-fused-madd
22056 @opindex mfused-madd
22057 @opindex mno-fused-madd
22058 Generate code that uses (does not use) the floating-point multiply and
22059 accumulate instructions.  These instructions are generated by default
22060 if hardware floating point is used.  The machine-dependent
22061 @option{-mfused-madd} option is now mapped to the machine-independent
22062 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
22063 mapped to @option{-ffp-contract=off}.
22065 @item -mfsca
22066 @itemx -mno-fsca
22067 @opindex mfsca
22068 @opindex mno-fsca
22069 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
22070 and cosine approximations.  The option @option{-mfsca} must be used in
22071 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
22072 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
22073 approximations even if @option{-funsafe-math-optimizations} is in effect.
22075 @item -mfsrra
22076 @itemx -mno-fsrra
22077 @opindex mfsrra
22078 @opindex mno-fsrra
22079 Allow or disallow the compiler to emit the @code{fsrra} instruction for
22080 reciprocal square root approximations.  The option @option{-mfsrra} must be used
22081 in combination with @option{-funsafe-math-optimizations} and
22082 @option{-ffinite-math-only}.  It is enabled by default when generating code for
22083 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
22084 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
22085 in effect.
22087 @item -mpretend-cmove
22088 @opindex mpretend-cmove
22089 Prefer zero-displacement conditional branches for conditional move instruction
22090 patterns.  This can result in faster code on the SH4 processor.
22092 @item -mfdpic
22093 @opindex fdpic
22094 Generate code using the FDPIC ABI.
22096 @end table
22098 @node Solaris 2 Options
22099 @subsection Solaris 2 Options
22100 @cindex Solaris 2 options
22102 These @samp{-m} options are supported on Solaris 2:
22104 @table @gcctabopt
22105 @item -mclear-hwcap
22106 @opindex mclear-hwcap
22107 @option{-mclear-hwcap} tells the compiler to remove the hardware
22108 capabilities generated by the Solaris assembler.  This is only necessary
22109 when object files use ISA extensions not supported by the current
22110 machine, but check at runtime whether or not to use them.
22112 @item -mimpure-text
22113 @opindex mimpure-text
22114 @option{-mimpure-text}, used in addition to @option{-shared}, tells
22115 the compiler to not pass @option{-z text} to the linker when linking a
22116 shared object.  Using this option, you can link position-dependent
22117 code into a shared object.
22119 @option{-mimpure-text} suppresses the ``relocations remain against
22120 allocatable but non-writable sections'' linker error message.
22121 However, the necessary relocations trigger copy-on-write, and the
22122 shared object is not actually shared across processes.  Instead of
22123 using @option{-mimpure-text}, you should compile all source code with
22124 @option{-fpic} or @option{-fPIC}.
22126 @end table
22128 These switches are supported in addition to the above on Solaris 2:
22130 @table @gcctabopt
22131 @item -pthreads
22132 @opindex pthreads
22133 Add support for multithreading using the POSIX threads library.  This
22134 option sets flags for both the preprocessor and linker.  This option does
22135 not affect the thread safety of object code produced  by the compiler or
22136 that of libraries supplied with it.
22138 @item -pthread
22139 @opindex pthread
22140 This is a synonym for @option{-pthreads}.
22141 @end table
22143 @node SPARC Options
22144 @subsection SPARC Options
22145 @cindex SPARC options
22147 These @samp{-m} options are supported on the SPARC:
22149 @table @gcctabopt
22150 @item -mno-app-regs
22151 @itemx -mapp-regs
22152 @opindex mno-app-regs
22153 @opindex mapp-regs
22154 Specify @option{-mapp-regs} to generate output using the global registers
22155 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
22156 global register 1, each global register 2 through 4 is then treated as an
22157 allocable register that is clobbered by function calls.  This is the default.
22159 To be fully SVR4 ABI-compliant at the cost of some performance loss,
22160 specify @option{-mno-app-regs}.  You should compile libraries and system
22161 software with this option.
22163 @item -mflat
22164 @itemx -mno-flat
22165 @opindex mflat
22166 @opindex mno-flat
22167 With @option{-mflat}, the compiler does not generate save/restore instructions
22168 and uses a ``flat'' or single register window model.  This model is compatible
22169 with the regular register window model.  The local registers and the input
22170 registers (0--5) are still treated as ``call-saved'' registers and are
22171 saved on the stack as needed.
22173 With @option{-mno-flat} (the default), the compiler generates save/restore
22174 instructions (except for leaf functions).  This is the normal operating mode.
22176 @item -mfpu
22177 @itemx -mhard-float
22178 @opindex mfpu
22179 @opindex mhard-float
22180 Generate output containing floating-point instructions.  This is the
22181 default.
22183 @item -mno-fpu
22184 @itemx -msoft-float
22185 @opindex mno-fpu
22186 @opindex msoft-float
22187 Generate output containing library calls for floating point.
22188 @strong{Warning:} the requisite libraries are not available for all SPARC
22189 targets.  Normally the facilities of the machine's usual C compiler are
22190 used, but this cannot be done directly in cross-compilation.  You must make
22191 your own arrangements to provide suitable library functions for
22192 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
22193 @samp{sparclite-*-*} do provide software floating-point support.
22195 @option{-msoft-float} changes the calling convention in the output file;
22196 therefore, it is only useful if you compile @emph{all} of a program with
22197 this option.  In particular, you need to compile @file{libgcc.a}, the
22198 library that comes with GCC, with @option{-msoft-float} in order for
22199 this to work.
22201 @item -mhard-quad-float
22202 @opindex mhard-quad-float
22203 Generate output containing quad-word (long double) floating-point
22204 instructions.
22206 @item -msoft-quad-float
22207 @opindex msoft-quad-float
22208 Generate output containing library calls for quad-word (long double)
22209 floating-point instructions.  The functions called are those specified
22210 in the SPARC ABI@.  This is the default.
22212 As of this writing, there are no SPARC implementations that have hardware
22213 support for the quad-word floating-point instructions.  They all invoke
22214 a trap handler for one of these instructions, and then the trap handler
22215 emulates the effect of the instruction.  Because of the trap handler overhead,
22216 this is much slower than calling the ABI library routines.  Thus the
22217 @option{-msoft-quad-float} option is the default.
22219 @item -mno-unaligned-doubles
22220 @itemx -munaligned-doubles
22221 @opindex mno-unaligned-doubles
22222 @opindex munaligned-doubles
22223 Assume that doubles have 8-byte alignment.  This is the default.
22225 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
22226 alignment only if they are contained in another type, or if they have an
22227 absolute address.  Otherwise, it assumes they have 4-byte alignment.
22228 Specifying this option avoids some rare compatibility problems with code
22229 generated by other compilers.  It is not the default because it results
22230 in a performance loss, especially for floating-point code.
22232 @item -muser-mode
22233 @itemx -mno-user-mode
22234 @opindex muser-mode
22235 @opindex mno-user-mode
22236 Do not generate code that can only run in supervisor mode.  This is relevant
22237 only for the @code{casa} instruction emitted for the LEON3 processor.  This
22238 is the default.
22240 @item -mfaster-structs
22241 @itemx -mno-faster-structs
22242 @opindex mfaster-structs
22243 @opindex mno-faster-structs
22244 With @option{-mfaster-structs}, the compiler assumes that structures
22245 should have 8-byte alignment.  This enables the use of pairs of
22246 @code{ldd} and @code{std} instructions for copies in structure
22247 assignment, in place of twice as many @code{ld} and @code{st} pairs.
22248 However, the use of this changed alignment directly violates the SPARC
22249 ABI@.  Thus, it's intended only for use on targets where the developer
22250 acknowledges that their resulting code is not directly in line with
22251 the rules of the ABI@.
22253 @item -mstd-struct-return
22254 @itemx -mno-std-struct-return
22255 @opindex mstd-struct-return
22256 @opindex mno-std-struct-return
22257 With @option{-mstd-struct-return}, the compiler generates checking code
22258 in functions returning structures or unions to detect size mismatches
22259 between the two sides of function calls, as per the 32-bit ABI@.
22261 The default is @option{-mno-std-struct-return}.  This option has no effect
22262 in 64-bit mode.
22264 @item -mcpu=@var{cpu_type}
22265 @opindex mcpu
22266 Set the instruction set, register set, and instruction scheduling parameters
22267 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
22268 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
22269 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
22270 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
22271 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
22272 @samp{niagara3}, @samp{niagara4} and @samp{niagara7}.
22274 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
22275 which selects the best architecture option for the host processor.
22276 @option{-mcpu=native} has no effect if GCC does not recognize
22277 the processor.
22279 Default instruction scheduling parameters are used for values that select
22280 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
22281 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
22283 Here is a list of each supported architecture and their supported
22284 implementations.
22286 @table @asis
22287 @item v7
22288 cypress, leon3v7
22290 @item v8
22291 supersparc, hypersparc, leon, leon3
22293 @item sparclite
22294 f930, f934, sparclite86x
22296 @item sparclet
22297 tsc701
22299 @item v9
22300 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4, niagara7
22301 @end table
22303 By default (unless configured otherwise), GCC generates code for the V7
22304 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
22305 additionally optimizes it for the Cypress CY7C602 chip, as used in the
22306 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
22307 SPARCStation 1, 2, IPX etc.
22309 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
22310 architecture.  The only difference from V7 code is that the compiler emits
22311 the integer multiply and integer divide instructions which exist in SPARC-V8
22312 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
22313 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
22314 2000 series.
22316 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
22317 the SPARC architecture.  This adds the integer multiply, integer divide step
22318 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
22319 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
22320 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
22321 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
22322 MB86934 chip, which is the more recent SPARClite with FPU@.
22324 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
22325 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
22326 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
22327 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
22328 optimizes it for the TEMIC SPARClet chip.
22330 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
22331 architecture.  This adds 64-bit integer and floating-point move instructions,
22332 3 additional floating-point condition code registers and conditional move
22333 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
22334 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
22335 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
22336 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
22337 @option{-mcpu=niagara}, the compiler additionally optimizes it for
22338 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
22339 additionally optimizes it for Sun UltraSPARC T2 chips. With
22340 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
22341 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
22342 additionally optimizes it for Sun UltraSPARC T4 chips.  With
22343 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
22344 Oracle SPARC M7 chips.
22346 @item -mtune=@var{cpu_type}
22347 @opindex mtune
22348 Set the instruction scheduling parameters for machine type
22349 @var{cpu_type}, but do not set the instruction set or register set that the
22350 option @option{-mcpu=@var{cpu_type}} does.
22352 The same values for @option{-mcpu=@var{cpu_type}} can be used for
22353 @option{-mtune=@var{cpu_type}}, but the only useful values are those
22354 that select a particular CPU implementation.  Those are
22355 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
22356 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
22357 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
22358 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
22359 @samp{niagara4} and @samp{niagara7}.  With native Solaris and
22360 GNU/Linux toolchains, @samp{native} can also be used.
22362 @item -mv8plus
22363 @itemx -mno-v8plus
22364 @opindex mv8plus
22365 @opindex mno-v8plus
22366 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
22367 difference from the V8 ABI is that the global and out registers are
22368 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
22369 mode for all SPARC-V9 processors.
22371 @item -mvis
22372 @itemx -mno-vis
22373 @opindex mvis
22374 @opindex mno-vis
22375 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
22376 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
22378 @item -mvis2
22379 @itemx -mno-vis2
22380 @opindex mvis2
22381 @opindex mno-vis2
22382 With @option{-mvis2}, GCC generates code that takes advantage of
22383 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
22384 default is @option{-mvis2} when targeting a cpu that supports such
22385 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
22386 also sets @option{-mvis}.
22388 @item -mvis3
22389 @itemx -mno-vis3
22390 @opindex mvis3
22391 @opindex mno-vis3
22392 With @option{-mvis3}, GCC generates code that takes advantage of
22393 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
22394 default is @option{-mvis3} when targeting a cpu that supports such
22395 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
22396 also sets @option{-mvis2} and @option{-mvis}.
22398 @item -mvis4
22399 @itemx -mno-vis4
22400 @opindex mvis4
22401 @opindex mno-vis4
22402 With @option{-mvis4}, GCC generates code that takes advantage of
22403 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
22404 default is @option{-mvis4} when targeting a cpu that supports such
22405 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
22406 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
22408 @item -mcbcond
22409 @itemx -mno-cbcond
22410 @opindex mcbcond
22411 @opindex mno-cbcond
22412 With @option{-mcbcond}, GCC generates code that takes advantage of
22413 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
22414 The default is @option{-mcbcond} when targeting a cpu that supports such
22415 instructions, such as niagara-4 and later.
22417 @item -mpopc
22418 @itemx -mno-popc
22419 @opindex mpopc
22420 @opindex mno-popc
22421 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
22422 population count instruction.  The default is @option{-mpopc}
22423 when targeting a cpu that supports such instructions, such as Niagara-2 and
22424 later.
22426 @item -mfmaf
22427 @itemx -mno-fmaf
22428 @opindex mfmaf
22429 @opindex mno-fmaf
22430 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
22431 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
22432 when targeting a cpu that supports such instructions, such as Niagara-3 and
22433 later.
22435 @item -mfix-at697f
22436 @opindex mfix-at697f
22437 Enable the documented workaround for the single erratum of the Atmel AT697F
22438 processor (which corresponds to erratum #13 of the AT697E processor).
22440 @item -mfix-ut699
22441 @opindex mfix-ut699
22442 Enable the documented workarounds for the floating-point errata and the data
22443 cache nullify errata of the UT699 processor.
22444 @end table
22446 These @samp{-m} options are supported in addition to the above
22447 on SPARC-V9 processors in 64-bit environments:
22449 @table @gcctabopt
22450 @item -m32
22451 @itemx -m64
22452 @opindex m32
22453 @opindex m64
22454 Generate code for a 32-bit or 64-bit environment.
22455 The 32-bit environment sets int, long and pointer to 32 bits.
22456 The 64-bit environment sets int to 32 bits and long and pointer
22457 to 64 bits.
22459 @item -mcmodel=@var{which}
22460 @opindex mcmodel
22461 Set the code model to one of
22463 @table @samp
22464 @item medlow
22465 The Medium/Low code model: 64-bit addresses, programs
22466 must be linked in the low 32 bits of memory.  Programs can be statically
22467 or dynamically linked.
22469 @item medmid
22470 The Medium/Middle code model: 64-bit addresses, programs
22471 must be linked in the low 44 bits of memory, the text and data segments must
22472 be less than 2GB in size and the data segment must be located within 2GB of
22473 the text segment.
22475 @item medany
22476 The Medium/Anywhere code model: 64-bit addresses, programs
22477 may be linked anywhere in memory, the text and data segments must be less
22478 than 2GB in size and the data segment must be located within 2GB of the
22479 text segment.
22481 @item embmedany
22482 The Medium/Anywhere code model for embedded systems:
22483 64-bit addresses, the text and data segments must be less than 2GB in
22484 size, both starting anywhere in memory (determined at link time).  The
22485 global register %g4 points to the base of the data segment.  Programs
22486 are statically linked and PIC is not supported.
22487 @end table
22489 @item -mmemory-model=@var{mem-model}
22490 @opindex mmemory-model
22491 Set the memory model in force on the processor to one of
22493 @table @samp
22494 @item default
22495 The default memory model for the processor and operating system.
22497 @item rmo
22498 Relaxed Memory Order
22500 @item pso
22501 Partial Store Order
22503 @item tso
22504 Total Store Order
22506 @item sc
22507 Sequential Consistency
22508 @end table
22510 These memory models are formally defined in Appendix D of the Sparc V9
22511 architecture manual, as set in the processor's @code{PSTATE.MM} field.
22513 @item -mstack-bias
22514 @itemx -mno-stack-bias
22515 @opindex mstack-bias
22516 @opindex mno-stack-bias
22517 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
22518 frame pointer if present, are offset by @minus{}2047 which must be added back
22519 when making stack frame references.  This is the default in 64-bit mode.
22520 Otherwise, assume no such offset is present.
22521 @end table
22523 @node SPU Options
22524 @subsection SPU Options
22525 @cindex SPU options
22527 These @samp{-m} options are supported on the SPU:
22529 @table @gcctabopt
22530 @item -mwarn-reloc
22531 @itemx -merror-reloc
22532 @opindex mwarn-reloc
22533 @opindex merror-reloc
22535 The loader for SPU does not handle dynamic relocations.  By default, GCC
22536 gives an error when it generates code that requires a dynamic
22537 relocation.  @option{-mno-error-reloc} disables the error,
22538 @option{-mwarn-reloc} generates a warning instead.
22540 @item -msafe-dma
22541 @itemx -munsafe-dma
22542 @opindex msafe-dma
22543 @opindex munsafe-dma
22545 Instructions that initiate or test completion of DMA must not be
22546 reordered with respect to loads and stores of the memory that is being
22547 accessed.
22548 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
22549 memory accesses, but that can lead to inefficient code in places where the
22550 memory is known to not change.  Rather than mark the memory as volatile,
22551 you can use @option{-msafe-dma} to tell the compiler to treat
22552 the DMA instructions as potentially affecting all memory.  
22554 @item -mbranch-hints
22555 @opindex mbranch-hints
22557 By default, GCC generates a branch hint instruction to avoid
22558 pipeline stalls for always-taken or probably-taken branches.  A hint
22559 is not generated closer than 8 instructions away from its branch.
22560 There is little reason to disable them, except for debugging purposes,
22561 or to make an object a little bit smaller.
22563 @item -msmall-mem
22564 @itemx -mlarge-mem
22565 @opindex msmall-mem
22566 @opindex mlarge-mem
22568 By default, GCC generates code assuming that addresses are never larger
22569 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
22570 a full 32-bit address.
22572 @item -mstdmain
22573 @opindex mstdmain
22575 By default, GCC links against startup code that assumes the SPU-style
22576 main function interface (which has an unconventional parameter list).
22577 With @option{-mstdmain}, GCC links your program against startup
22578 code that assumes a C99-style interface to @code{main}, including a
22579 local copy of @code{argv} strings.
22581 @item -mfixed-range=@var{register-range}
22582 @opindex mfixed-range
22583 Generate code treating the given register range as fixed registers.
22584 A fixed register is one that the register allocator cannot use.  This is
22585 useful when compiling kernel code.  A register range is specified as
22586 two registers separated by a dash.  Multiple register ranges can be
22587 specified separated by a comma.
22589 @item -mea32
22590 @itemx -mea64
22591 @opindex mea32
22592 @opindex mea64
22593 Compile code assuming that pointers to the PPU address space accessed
22594 via the @code{__ea} named address space qualifier are either 32 or 64
22595 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
22596 all object code in an executable must be compiled with the same setting.
22598 @item -maddress-space-conversion
22599 @itemx -mno-address-space-conversion
22600 @opindex maddress-space-conversion
22601 @opindex mno-address-space-conversion
22602 Allow/disallow treating the @code{__ea} address space as superset
22603 of the generic address space.  This enables explicit type casts
22604 between @code{__ea} and generic pointer as well as implicit
22605 conversions of generic pointers to @code{__ea} pointers.  The
22606 default is to allow address space pointer conversions.
22608 @item -mcache-size=@var{cache-size}
22609 @opindex mcache-size
22610 This option controls the version of libgcc that the compiler links to an
22611 executable and selects a software-managed cache for accessing variables
22612 in the @code{__ea} address space with a particular cache size.  Possible
22613 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
22614 and @samp{128}.  The default cache size is 64KB.
22616 @item -matomic-updates
22617 @itemx -mno-atomic-updates
22618 @opindex matomic-updates
22619 @opindex mno-atomic-updates
22620 This option controls the version of libgcc that the compiler links to an
22621 executable and selects whether atomic updates to the software-managed
22622 cache of PPU-side variables are used.  If you use atomic updates, changes
22623 to a PPU variable from SPU code using the @code{__ea} named address space
22624 qualifier do not interfere with changes to other PPU variables residing
22625 in the same cache line from PPU code.  If you do not use atomic updates,
22626 such interference may occur; however, writing back cache lines is
22627 more efficient.  The default behavior is to use atomic updates.
22629 @item -mdual-nops
22630 @itemx -mdual-nops=@var{n}
22631 @opindex mdual-nops
22632 By default, GCC inserts nops to increase dual issue when it expects
22633 it to increase performance.  @var{n} can be a value from 0 to 10.  A
22634 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
22635 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
22637 @item -mhint-max-nops=@var{n}
22638 @opindex mhint-max-nops
22639 Maximum number of nops to insert for a branch hint.  A branch hint must
22640 be at least 8 instructions away from the branch it is affecting.  GCC
22641 inserts up to @var{n} nops to enforce this, otherwise it does not
22642 generate the branch hint.
22644 @item -mhint-max-distance=@var{n}
22645 @opindex mhint-max-distance
22646 The encoding of the branch hint instruction limits the hint to be within
22647 256 instructions of the branch it is affecting.  By default, GCC makes
22648 sure it is within 125.
22650 @item -msafe-hints
22651 @opindex msafe-hints
22652 Work around a hardware bug that causes the SPU to stall indefinitely.
22653 By default, GCC inserts the @code{hbrp} instruction to make sure
22654 this stall won't happen.
22656 @end table
22658 @node System V Options
22659 @subsection Options for System V
22661 These additional options are available on System V Release 4 for
22662 compatibility with other compilers on those systems:
22664 @table @gcctabopt
22665 @item -G
22666 @opindex G
22667 Create a shared object.
22668 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
22670 @item -Qy
22671 @opindex Qy
22672 Identify the versions of each tool used by the compiler, in a
22673 @code{.ident} assembler directive in the output.
22675 @item -Qn
22676 @opindex Qn
22677 Refrain from adding @code{.ident} directives to the output file (this is
22678 the default).
22680 @item -YP,@var{dirs}
22681 @opindex YP
22682 Search the directories @var{dirs}, and no others, for libraries
22683 specified with @option{-l}.
22685 @item -Ym,@var{dir}
22686 @opindex Ym
22687 Look in the directory @var{dir} to find the M4 preprocessor.
22688 The assembler uses this option.
22689 @c This is supposed to go with a -Yd for predefined M4 macro files, but
22690 @c the generic assembler that comes with Solaris takes just -Ym.
22691 @end table
22693 @node TILE-Gx Options
22694 @subsection TILE-Gx Options
22695 @cindex TILE-Gx options
22697 These @samp{-m} options are supported on the TILE-Gx:
22699 @table @gcctabopt
22700 @item -mcmodel=small
22701 @opindex mcmodel=small
22702 Generate code for the small model.  The distance for direct calls is
22703 limited to 500M in either direction.  PC-relative addresses are 32
22704 bits.  Absolute addresses support the full address range.
22706 @item -mcmodel=large
22707 @opindex mcmodel=large
22708 Generate code for the large model.  There is no limitation on call
22709 distance, pc-relative addresses, or absolute addresses.
22711 @item -mcpu=@var{name}
22712 @opindex mcpu
22713 Selects the type of CPU to be targeted.  Currently the only supported
22714 type is @samp{tilegx}.
22716 @item -m32
22717 @itemx -m64
22718 @opindex m32
22719 @opindex m64
22720 Generate code for a 32-bit or 64-bit environment.  The 32-bit
22721 environment sets int, long, and pointer to 32 bits.  The 64-bit
22722 environment sets int to 32 bits and long and pointer to 64 bits.
22724 @item -mbig-endian
22725 @itemx -mlittle-endian
22726 @opindex mbig-endian
22727 @opindex mlittle-endian
22728 Generate code in big/little endian mode, respectively.
22729 @end table
22731 @node TILEPro Options
22732 @subsection TILEPro Options
22733 @cindex TILEPro options
22735 These @samp{-m} options are supported on the TILEPro:
22737 @table @gcctabopt
22738 @item -mcpu=@var{name}
22739 @opindex mcpu
22740 Selects the type of CPU to be targeted.  Currently the only supported
22741 type is @samp{tilepro}.
22743 @item -m32
22744 @opindex m32
22745 Generate code for a 32-bit environment, which sets int, long, and
22746 pointer to 32 bits.  This is the only supported behavior so the flag
22747 is essentially ignored.
22748 @end table
22750 @node V850 Options
22751 @subsection V850 Options
22752 @cindex V850 Options
22754 These @samp{-m} options are defined for V850 implementations:
22756 @table @gcctabopt
22757 @item -mlong-calls
22758 @itemx -mno-long-calls
22759 @opindex mlong-calls
22760 @opindex mno-long-calls
22761 Treat all calls as being far away (near).  If calls are assumed to be
22762 far away, the compiler always loads the function's address into a
22763 register, and calls indirect through the pointer.
22765 @item -mno-ep
22766 @itemx -mep
22767 @opindex mno-ep
22768 @opindex mep
22769 Do not optimize (do optimize) basic blocks that use the same index
22770 pointer 4 or more times to copy pointer into the @code{ep} register, and
22771 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
22772 option is on by default if you optimize.
22774 @item -mno-prolog-function
22775 @itemx -mprolog-function
22776 @opindex mno-prolog-function
22777 @opindex mprolog-function
22778 Do not use (do use) external functions to save and restore registers
22779 at the prologue and epilogue of a function.  The external functions
22780 are slower, but use less code space if more than one function saves
22781 the same number of registers.  The @option{-mprolog-function} option
22782 is on by default if you optimize.
22784 @item -mspace
22785 @opindex mspace
22786 Try to make the code as small as possible.  At present, this just turns
22787 on the @option{-mep} and @option{-mprolog-function} options.
22789 @item -mtda=@var{n}
22790 @opindex mtda
22791 Put static or global variables whose size is @var{n} bytes or less into
22792 the tiny data area that register @code{ep} points to.  The tiny data
22793 area can hold up to 256 bytes in total (128 bytes for byte references).
22795 @item -msda=@var{n}
22796 @opindex msda
22797 Put static or global variables whose size is @var{n} bytes or less into
22798 the small data area that register @code{gp} points to.  The small data
22799 area can hold up to 64 kilobytes.
22801 @item -mzda=@var{n}
22802 @opindex mzda
22803 Put static or global variables whose size is @var{n} bytes or less into
22804 the first 32 kilobytes of memory.
22806 @item -mv850
22807 @opindex mv850
22808 Specify that the target processor is the V850.
22810 @item -mv850e3v5
22811 @opindex mv850e3v5
22812 Specify that the target processor is the V850E3V5.  The preprocessor
22813 constant @code{__v850e3v5__} is defined if this option is used.
22815 @item -mv850e2v4
22816 @opindex mv850e2v4
22817 Specify that the target processor is the V850E3V5.  This is an alias for
22818 the @option{-mv850e3v5} option.
22820 @item -mv850e2v3
22821 @opindex mv850e2v3
22822 Specify that the target processor is the V850E2V3.  The preprocessor
22823 constant @code{__v850e2v3__} is defined if this option is used.
22825 @item -mv850e2
22826 @opindex mv850e2
22827 Specify that the target processor is the V850E2.  The preprocessor
22828 constant @code{__v850e2__} is defined if this option is used.
22830 @item -mv850e1
22831 @opindex mv850e1
22832 Specify that the target processor is the V850E1.  The preprocessor
22833 constants @code{__v850e1__} and @code{__v850e__} are defined if
22834 this option is used.
22836 @item -mv850es
22837 @opindex mv850es
22838 Specify that the target processor is the V850ES.  This is an alias for
22839 the @option{-mv850e1} option.
22841 @item -mv850e
22842 @opindex mv850e
22843 Specify that the target processor is the V850E@.  The preprocessor
22844 constant @code{__v850e__} is defined if this option is used.
22846 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
22847 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
22848 are defined then a default target processor is chosen and the
22849 relevant @samp{__v850*__} preprocessor constant is defined.
22851 The preprocessor constants @code{__v850} and @code{__v851__} are always
22852 defined, regardless of which processor variant is the target.
22854 @item -mdisable-callt
22855 @itemx -mno-disable-callt
22856 @opindex mdisable-callt
22857 @opindex mno-disable-callt
22858 This option suppresses generation of the @code{CALLT} instruction for the
22859 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
22860 architecture.
22862 This option is enabled by default when the RH850 ABI is
22863 in use (see @option{-mrh850-abi}), and disabled by default when the
22864 GCC ABI is in use.  If @code{CALLT} instructions are being generated
22865 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
22867 @item -mrelax
22868 @itemx -mno-relax
22869 @opindex mrelax
22870 @opindex mno-relax
22871 Pass on (or do not pass on) the @option{-mrelax} command-line option
22872 to the assembler.
22874 @item -mlong-jumps
22875 @itemx -mno-long-jumps
22876 @opindex mlong-jumps
22877 @opindex mno-long-jumps
22878 Disable (or re-enable) the generation of PC-relative jump instructions.
22880 @item -msoft-float
22881 @itemx -mhard-float
22882 @opindex msoft-float
22883 @opindex mhard-float
22884 Disable (or re-enable) the generation of hardware floating point
22885 instructions.  This option is only significant when the target
22886 architecture is @samp{V850E2V3} or higher.  If hardware floating point
22887 instructions are being generated then the C preprocessor symbol
22888 @code{__FPU_OK__} is defined, otherwise the symbol
22889 @code{__NO_FPU__} is defined.
22891 @item -mloop
22892 @opindex mloop
22893 Enables the use of the e3v5 LOOP instruction.  The use of this
22894 instruction is not enabled by default when the e3v5 architecture is
22895 selected because its use is still experimental.
22897 @item -mrh850-abi
22898 @itemx -mghs
22899 @opindex mrh850-abi
22900 @opindex mghs
22901 Enables support for the RH850 version of the V850 ABI.  This is the
22902 default.  With this version of the ABI the following rules apply:
22904 @itemize
22905 @item
22906 Integer sized structures and unions are returned via a memory pointer
22907 rather than a register.
22909 @item
22910 Large structures and unions (more than 8 bytes in size) are passed by
22911 value.
22913 @item
22914 Functions are aligned to 16-bit boundaries.
22916 @item
22917 The @option{-m8byte-align} command-line option is supported.
22919 @item
22920 The @option{-mdisable-callt} command-line option is enabled by
22921 default.  The @option{-mno-disable-callt} command-line option is not
22922 supported.
22923 @end itemize
22925 When this version of the ABI is enabled the C preprocessor symbol
22926 @code{__V850_RH850_ABI__} is defined.
22928 @item -mgcc-abi
22929 @opindex mgcc-abi
22930 Enables support for the old GCC version of the V850 ABI.  With this
22931 version of the ABI the following rules apply:
22933 @itemize
22934 @item
22935 Integer sized structures and unions are returned in register @code{r10}.
22937 @item
22938 Large structures and unions (more than 8 bytes in size) are passed by
22939 reference.
22941 @item
22942 Functions are aligned to 32-bit boundaries, unless optimizing for
22943 size.
22945 @item
22946 The @option{-m8byte-align} command-line option is not supported.
22948 @item
22949 The @option{-mdisable-callt} command-line option is supported but not
22950 enabled by default.
22951 @end itemize
22953 When this version of the ABI is enabled the C preprocessor symbol
22954 @code{__V850_GCC_ABI__} is defined.
22956 @item -m8byte-align
22957 @itemx -mno-8byte-align
22958 @opindex m8byte-align
22959 @opindex mno-8byte-align
22960 Enables support for @code{double} and @code{long long} types to be
22961 aligned on 8-byte boundaries.  The default is to restrict the
22962 alignment of all objects to at most 4-bytes.  When
22963 @option{-m8byte-align} is in effect the C preprocessor symbol
22964 @code{__V850_8BYTE_ALIGN__} is defined.
22966 @item -mbig-switch
22967 @opindex mbig-switch
22968 Generate code suitable for big switch tables.  Use this option only if
22969 the assembler/linker complain about out of range branches within a switch
22970 table.
22972 @item -mapp-regs
22973 @opindex mapp-regs
22974 This option causes r2 and r5 to be used in the code generated by
22975 the compiler.  This setting is the default.
22977 @item -mno-app-regs
22978 @opindex mno-app-regs
22979 This option causes r2 and r5 to be treated as fixed registers.
22981 @end table
22983 @node VAX Options
22984 @subsection VAX Options
22985 @cindex VAX options
22987 These @samp{-m} options are defined for the VAX:
22989 @table @gcctabopt
22990 @item -munix
22991 @opindex munix
22992 Do not output certain jump instructions (@code{aobleq} and so on)
22993 that the Unix assembler for the VAX cannot handle across long
22994 ranges.
22996 @item -mgnu
22997 @opindex mgnu
22998 Do output those jump instructions, on the assumption that the
22999 GNU assembler is being used.
23001 @item -mg
23002 @opindex mg
23003 Output code for G-format floating-point numbers instead of D-format.
23004 @end table
23006 @node Visium Options
23007 @subsection Visium Options
23008 @cindex Visium options
23010 @table @gcctabopt
23012 @item -mdebug
23013 @opindex mdebug
23014 A program which performs file I/O and is destined to run on an MCM target
23015 should be linked with this option.  It causes the libraries libc.a and
23016 libdebug.a to be linked.  The program should be run on the target under
23017 the control of the GDB remote debugging stub.
23019 @item -msim
23020 @opindex msim
23021 A program which performs file I/O and is destined to run on the simulator
23022 should be linked with option.  This causes libraries libc.a and libsim.a to
23023 be linked.
23025 @item -mfpu
23026 @itemx -mhard-float
23027 @opindex mfpu
23028 @opindex mhard-float
23029 Generate code containing floating-point instructions.  This is the
23030 default.
23032 @item -mno-fpu
23033 @itemx -msoft-float
23034 @opindex mno-fpu
23035 @opindex msoft-float
23036 Generate code containing library calls for floating-point.
23038 @option{-msoft-float} changes the calling convention in the output file;
23039 therefore, it is only useful if you compile @emph{all} of a program with
23040 this option.  In particular, you need to compile @file{libgcc.a}, the
23041 library that comes with GCC, with @option{-msoft-float} in order for
23042 this to work.
23044 @item -mcpu=@var{cpu_type}
23045 @opindex mcpu
23046 Set the instruction set, register set, and instruction scheduling parameters
23047 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
23048 @samp{mcm}, @samp{gr5} and @samp{gr6}.
23050 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
23052 By default (unless configured otherwise), GCC generates code for the GR5
23053 variant of the Visium architecture.  
23055 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
23056 architecture.  The only difference from GR5 code is that the compiler will
23057 generate block move instructions.
23059 @item -mtune=@var{cpu_type}
23060 @opindex mtune
23061 Set the instruction scheduling parameters for machine type @var{cpu_type},
23062 but do not set the instruction set or register set that the option
23063 @option{-mcpu=@var{cpu_type}} would.
23065 @item -msv-mode
23066 @opindex msv-mode
23067 Generate code for the supervisor mode, where there are no restrictions on
23068 the access to general registers.  This is the default.
23070 @item -muser-mode
23071 @opindex muser-mode
23072 Generate code for the user mode, where the access to some general registers
23073 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
23074 mode; on the GR6, only registers r29 to r31 are affected.
23075 @end table
23077 @node VMS Options
23078 @subsection VMS Options
23080 These @samp{-m} options are defined for the VMS implementations:
23082 @table @gcctabopt
23083 @item -mvms-return-codes
23084 @opindex mvms-return-codes
23085 Return VMS condition codes from @code{main}. The default is to return POSIX-style
23086 condition (e.g.@ error) codes.
23088 @item -mdebug-main=@var{prefix}
23089 @opindex mdebug-main=@var{prefix}
23090 Flag the first routine whose name starts with @var{prefix} as the main
23091 routine for the debugger.
23093 @item -mmalloc64
23094 @opindex mmalloc64
23095 Default to 64-bit memory allocation routines.
23097 @item -mpointer-size=@var{size}
23098 @opindex mpointer-size=@var{size}
23099 Set the default size of pointers. Possible options for @var{size} are
23100 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
23101 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
23102 The later option disables @code{pragma pointer_size}.
23103 @end table
23105 @node VxWorks Options
23106 @subsection VxWorks Options
23107 @cindex VxWorks Options
23109 The options in this section are defined for all VxWorks targets.
23110 Options specific to the target hardware are listed with the other
23111 options for that target.
23113 @table @gcctabopt
23114 @item -mrtp
23115 @opindex mrtp
23116 GCC can generate code for both VxWorks kernels and real time processes
23117 (RTPs).  This option switches from the former to the latter.  It also
23118 defines the preprocessor macro @code{__RTP__}.
23120 @item -non-static
23121 @opindex non-static
23122 Link an RTP executable against shared libraries rather than static
23123 libraries.  The options @option{-static} and @option{-shared} can
23124 also be used for RTPs (@pxref{Link Options}); @option{-static}
23125 is the default.
23127 @item -Bstatic
23128 @itemx -Bdynamic
23129 @opindex Bstatic
23130 @opindex Bdynamic
23131 These options are passed down to the linker.  They are defined for
23132 compatibility with Diab.
23134 @item -Xbind-lazy
23135 @opindex Xbind-lazy
23136 Enable lazy binding of function calls.  This option is equivalent to
23137 @option{-Wl,-z,now} and is defined for compatibility with Diab.
23139 @item -Xbind-now
23140 @opindex Xbind-now
23141 Disable lazy binding of function calls.  This option is the default and
23142 is defined for compatibility with Diab.
23143 @end table
23145 @node x86 Options
23146 @subsection x86 Options
23147 @cindex x86 Options
23149 These @samp{-m} options are defined for the x86 family of computers.
23151 @table @gcctabopt
23153 @item -march=@var{cpu-type}
23154 @opindex march
23155 Generate instructions for the machine type @var{cpu-type}.  In contrast to
23156 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
23157 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
23158 to generate code that may not run at all on processors other than the one
23159 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
23160 @option{-mtune=@var{cpu-type}}.
23162 The choices for @var{cpu-type} are:
23164 @table @samp
23165 @item native
23166 This selects the CPU to generate code for at compilation time by determining
23167 the processor type of the compiling machine.  Using @option{-march=native}
23168 enables all instruction subsets supported by the local machine (hence
23169 the result might not run on different machines).  Using @option{-mtune=native}
23170 produces code optimized for the local machine under the constraints
23171 of the selected instruction set.  
23173 @item i386
23174 Original Intel i386 CPU@.
23176 @item i486
23177 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
23179 @item i586
23180 @itemx pentium
23181 Intel Pentium CPU with no MMX support.
23183 @item lakemont
23184 Intel Lakemont MCU, based on Intel Pentium CPU.
23186 @item pentium-mmx
23187 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
23189 @item pentiumpro
23190 Intel Pentium Pro CPU@.
23192 @item i686
23193 When used with @option{-march}, the Pentium Pro
23194 instruction set is used, so the code runs on all i686 family chips.
23195 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
23197 @item pentium2
23198 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
23199 support.
23201 @item pentium3
23202 @itemx pentium3m
23203 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
23204 set support.
23206 @item pentium-m
23207 Intel Pentium M; low-power version of Intel Pentium III CPU
23208 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
23210 @item pentium4
23211 @itemx pentium4m
23212 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
23214 @item prescott
23215 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
23216 set support.
23218 @item nocona
23219 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
23220 SSE2 and SSE3 instruction set support.
23222 @item core2
23223 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
23224 instruction set support.
23226 @item nehalem
23227 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23228 SSE4.1, SSE4.2 and POPCNT instruction set support.
23230 @item westmere
23231 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23232 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
23234 @item sandybridge
23235 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23236 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
23238 @item ivybridge
23239 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23240 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
23241 instruction set support.
23243 @item haswell
23244 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23245 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23246 BMI, BMI2 and F16C instruction set support.
23248 @item broadwell
23249 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23250 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23251 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
23253 @item skylake
23254 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23255 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23256 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
23257 XSAVES instruction set support.
23259 @item bonnell
23260 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
23261 instruction set support.
23263 @item silvermont
23264 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23265 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
23267 @item knl
23268 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
23269 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23270 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
23271 AVX512CD instruction set support.
23273 @item skylake-avx512
23274 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
23275 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23276 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
23277 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
23279 @item k6
23280 AMD K6 CPU with MMX instruction set support.
23282 @item k6-2
23283 @itemx k6-3
23284 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
23286 @item athlon
23287 @itemx athlon-tbird
23288 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
23289 support.
23291 @item athlon-4
23292 @itemx athlon-xp
23293 @itemx athlon-mp
23294 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
23295 instruction set support.
23297 @item k8
23298 @itemx opteron
23299 @itemx athlon64
23300 @itemx athlon-fx
23301 Processors based on the AMD K8 core with x86-64 instruction set support,
23302 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
23303 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
23304 instruction set extensions.)
23306 @item k8-sse3
23307 @itemx opteron-sse3
23308 @itemx athlon64-sse3
23309 Improved versions of AMD K8 cores with SSE3 instruction set support.
23311 @item amdfam10
23312 @itemx barcelona
23313 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
23314 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
23315 instruction set extensions.)
23317 @item bdver1
23318 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
23319 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
23320 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
23321 @item bdver2
23322 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23323 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
23324 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
23325 extensions.)
23326 @item bdver3
23327 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23328 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
23329 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
23330 64-bit instruction set extensions.
23331 @item bdver4
23332 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23333 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
23334 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
23335 SSE4.2, ABM and 64-bit instruction set extensions.
23337 @item znver1
23338 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
23339 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
23340 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
23341 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
23342 instruction set extensions.
23344 @item btver1
23345 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
23346 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
23347 instruction set extensions.)
23349 @item btver2
23350 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
23351 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
23352 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
23354 @item winchip-c6
23355 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
23356 set support.
23358 @item winchip2
23359 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
23360 instruction set support.
23362 @item c3
23363 VIA C3 CPU with MMX and 3DNow!@: instruction set support.
23364 (No scheduling is implemented for this chip.)
23366 @item c3-2
23367 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
23368 (No scheduling is implemented for this chip.)
23370 @item c7
23371 VIA C7 (Esther) CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
23372 (No scheduling is implemented for this chip.)
23374 @item samuel-2
23375 VIA Eden Samuel 2 CPU with MMX and 3DNow!@: instruction set support.
23376 (No scheduling is implemented for this chip.)
23378 @item nehemiah
23379 VIA Eden Nehemiah CPU with MMX and SSE instruction set support.
23380 (No scheduling is implemented for this chip.)
23382 @item esther
23383 VIA Eden Esther CPU with MMX, SSE, SSE2 and SSE3 instruction set support.
23384 (No scheduling is implemented for this chip.)
23386 @item eden-x2
23387 VIA Eden X2 CPU with x86-64, MMX, SSE, SSE2 and SSE3 instruction set support.
23388 (No scheduling is implemented for this chip.)
23390 @item eden-x4
23391 VIA Eden X4 CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2,
23392 AVX and AVX2 instruction set support.
23393 (No scheduling is implemented for this chip.)
23395 @item nano
23396 Generic VIA Nano CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
23397 instruction set support.
23398 (No scheduling is implemented for this chip.)
23400 @item nano-1000
23401 VIA Nano 1xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
23402 instruction set support.
23403 (No scheduling is implemented for this chip.)
23405 @item nano-2000
23406 VIA Nano 2xxx CPU with x86-64, MMX, SSE, SSE2, SSE3 and SSSE3
23407 instruction set support.
23408 (No scheduling is implemented for this chip.)
23410 @item nano-3000
23411 VIA Nano 3xxx CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
23412 instruction set support.
23413 (No scheduling is implemented for this chip.)
23415 @item nano-x2
23416 VIA Nano Dual Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
23417 instruction set support.
23418 (No scheduling is implemented for this chip.)
23420 @item nano-x4
23421 VIA Nano Quad Core CPU with x86-64, MMX, SSE, SSE2, SSE3, SSSE3 and SSE4.1
23422 instruction set support.
23423 (No scheduling is implemented for this chip.)
23425 @item geode
23426 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
23427 @end table
23429 @item -mtune=@var{cpu-type}
23430 @opindex mtune
23431 Tune to @var{cpu-type} everything applicable about the generated code, except
23432 for the ABI and the set of available instructions.  
23433 While picking a specific @var{cpu-type} schedules things appropriately
23434 for that particular chip, the compiler does not generate any code that
23435 cannot run on the default machine type unless you use a
23436 @option{-march=@var{cpu-type}} option.
23437 For example, if GCC is configured for i686-pc-linux-gnu
23438 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
23439 but still runs on i686 machines.
23441 The choices for @var{cpu-type} are the same as for @option{-march}.
23442 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
23444 @table @samp
23445 @item generic
23446 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
23447 If you know the CPU on which your code will run, then you should use
23448 the corresponding @option{-mtune} or @option{-march} option instead of
23449 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
23450 of your application will have, then you should use this option.
23452 As new processors are deployed in the marketplace, the behavior of this
23453 option will change.  Therefore, if you upgrade to a newer version of
23454 GCC, code generation controlled by this option will change to reflect
23455 the processors
23456 that are most common at the time that version of GCC is released.
23458 There is no @option{-march=generic} option because @option{-march}
23459 indicates the instruction set the compiler can use, and there is no
23460 generic instruction set applicable to all processors.  In contrast,
23461 @option{-mtune} indicates the processor (or, in this case, collection of
23462 processors) for which the code is optimized.
23464 @item intel
23465 Produce code optimized for the most current Intel processors, which are
23466 Haswell and Silvermont for this version of GCC.  If you know the CPU
23467 on which your code will run, then you should use the corresponding
23468 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
23469 But, if you want your application performs better on both Haswell and
23470 Silvermont, then you should use this option.
23472 As new Intel processors are deployed in the marketplace, the behavior of
23473 this option will change.  Therefore, if you upgrade to a newer version of
23474 GCC, code generation controlled by this option will change to reflect
23475 the most current Intel processors at the time that version of GCC is
23476 released.
23478 There is no @option{-march=intel} option because @option{-march} indicates
23479 the instruction set the compiler can use, and there is no common
23480 instruction set applicable to all processors.  In contrast,
23481 @option{-mtune} indicates the processor (or, in this case, collection of
23482 processors) for which the code is optimized.
23483 @end table
23485 @item -mcpu=@var{cpu-type}
23486 @opindex mcpu
23487 A deprecated synonym for @option{-mtune}.
23489 @item -mfpmath=@var{unit}
23490 @opindex mfpmath
23491 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
23492 for @var{unit} are:
23494 @table @samp
23495 @item 387
23496 Use the standard 387 floating-point coprocessor present on the majority of chips and
23497 emulated otherwise.  Code compiled with this option runs almost everywhere.
23498 The temporary results are computed in 80-bit precision instead of the precision
23499 specified by the type, resulting in slightly different results compared to most
23500 of other chips.  See @option{-ffloat-store} for more detailed description.
23502 This is the default choice for x86-32 targets.
23504 @item sse
23505 Use scalar floating-point instructions present in the SSE instruction set.
23506 This instruction set is supported by Pentium III and newer chips,
23507 and in the AMD line
23508 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
23509 instruction set supports only single-precision arithmetic, thus the double and
23510 extended-precision arithmetic are still done using 387.  A later version, present
23511 only in Pentium 4 and AMD x86-64 chips, supports double-precision
23512 arithmetic too.
23514 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
23515 or @option{-msse2} switches to enable SSE extensions and make this option
23516 effective.  For the x86-64 compiler, these extensions are enabled by default.
23518 The resulting code should be considerably faster in the majority of cases and avoid
23519 the numerical instability problems of 387 code, but may break some existing
23520 code that expects temporaries to be 80 bits.
23522 This is the default choice for the x86-64 compiler.
23524 @item sse,387
23525 @itemx sse+387
23526 @itemx both
23527 Attempt to utilize both instruction sets at once.  This effectively doubles the
23528 amount of available registers, and on chips with separate execution units for
23529 387 and SSE the execution resources too.  Use this option with care, as it is
23530 still experimental, because the GCC register allocator does not model separate
23531 functional units well, resulting in unstable performance.
23532 @end table
23534 @item -masm=@var{dialect}
23535 @opindex masm=@var{dialect}
23536 Output assembly instructions using selected @var{dialect}.  Also affects
23537 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
23538 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
23539 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
23540 not support @samp{intel}.
23542 @item -mieee-fp
23543 @itemx -mno-ieee-fp
23544 @opindex mieee-fp
23545 @opindex mno-ieee-fp
23546 Control whether or not the compiler uses IEEE floating-point
23547 comparisons.  These correctly handle the case where the result of a
23548 comparison is unordered.
23550 @item -m80387
23551 @item -mhard-float
23552 @opindex 80387
23553 @opindex mhard-float
23554 Generate output containing 80387 instructions for floating point.
23556 @item -mno-80387
23557 @item -msoft-float
23558 @opindex no-80387
23559 @opindex msoft-float
23560 Generate output containing library calls for floating point.
23562 @strong{Warning:} the requisite libraries are not part of GCC@.
23563 Normally the facilities of the machine's usual C compiler are used, but
23564 this can't be done directly in cross-compilation.  You must make your
23565 own arrangements to provide suitable library functions for
23566 cross-compilation.
23568 On machines where a function returns floating-point results in the 80387
23569 register stack, some floating-point opcodes may be emitted even if
23570 @option{-msoft-float} is used.
23572 @item -mno-fp-ret-in-387
23573 @opindex mno-fp-ret-in-387
23574 Do not use the FPU registers for return values of functions.
23576 The usual calling convention has functions return values of types
23577 @code{float} and @code{double} in an FPU register, even if there
23578 is no FPU@.  The idea is that the operating system should emulate
23579 an FPU@.
23581 The option @option{-mno-fp-ret-in-387} causes such values to be returned
23582 in ordinary CPU registers instead.
23584 @item -mno-fancy-math-387
23585 @opindex mno-fancy-math-387
23586 Some 387 emulators do not support the @code{sin}, @code{cos} and
23587 @code{sqrt} instructions for the 387.  Specify this option to avoid
23588 generating those instructions.  This option is the default on
23589 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
23590 indicates that the target CPU always has an FPU and so the
23591 instruction does not need emulation.  These
23592 instructions are not generated unless you also use the
23593 @option{-funsafe-math-optimizations} switch.
23595 @item -malign-double
23596 @itemx -mno-align-double
23597 @opindex malign-double
23598 @opindex mno-align-double
23599 Control whether GCC aligns @code{double}, @code{long double}, and
23600 @code{long long} variables on a two-word boundary or a one-word
23601 boundary.  Aligning @code{double} variables on a two-word boundary
23602 produces code that runs somewhat faster on a Pentium at the
23603 expense of more memory.
23605 On x86-64, @option{-malign-double} is enabled by default.
23607 @strong{Warning:} if you use the @option{-malign-double} switch,
23608 structures containing the above types are aligned differently than
23609 the published application binary interface specifications for the x86-32
23610 and are not binary compatible with structures in code compiled
23611 without that switch.
23613 @item -m96bit-long-double
23614 @itemx -m128bit-long-double
23615 @opindex m96bit-long-double
23616 @opindex m128bit-long-double
23617 These switches control the size of @code{long double} type.  The x86-32
23618 application binary interface specifies the size to be 96 bits,
23619 so @option{-m96bit-long-double} is the default in 32-bit mode.
23621 Modern architectures (Pentium and newer) prefer @code{long double}
23622 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
23623 conforming to the ABI, this is not possible.  So specifying
23624 @option{-m128bit-long-double} aligns @code{long double}
23625 to a 16-byte boundary by padding the @code{long double} with an additional
23626 32-bit zero.
23628 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
23629 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
23631 Notice that neither of these options enable any extra precision over the x87
23632 standard of 80 bits for a @code{long double}.
23634 @strong{Warning:} if you override the default value for your target ABI, this
23635 changes the size of 
23636 structures and arrays containing @code{long double} variables,
23637 as well as modifying the function calling convention for functions taking
23638 @code{long double}.  Hence they are not binary-compatible
23639 with code compiled without that switch.
23641 @item -mlong-double-64
23642 @itemx -mlong-double-80
23643 @itemx -mlong-double-128
23644 @opindex mlong-double-64
23645 @opindex mlong-double-80
23646 @opindex mlong-double-128
23647 These switches control the size of @code{long double} type. A size
23648 of 64 bits makes the @code{long double} type equivalent to the @code{double}
23649 type. This is the default for 32-bit Bionic C library.  A size
23650 of 128 bits makes the @code{long double} type equivalent to the
23651 @code{__float128} type. This is the default for 64-bit Bionic C library.
23653 @strong{Warning:} if you override the default value for your target ABI, this
23654 changes the size of
23655 structures and arrays containing @code{long double} variables,
23656 as well as modifying the function calling convention for functions taking
23657 @code{long double}.  Hence they are not binary-compatible
23658 with code compiled without that switch.
23660 @item -malign-data=@var{type}
23661 @opindex malign-data
23662 Control how GCC aligns variables.  Supported values for @var{type} are
23663 @samp{compat} uses increased alignment value compatible uses GCC 4.8
23664 and earlier, @samp{abi} uses alignment value as specified by the
23665 psABI, and @samp{cacheline} uses increased alignment value to match
23666 the cache line size.  @samp{compat} is the default.
23668 @item -mlarge-data-threshold=@var{threshold}
23669 @opindex mlarge-data-threshold
23670 When @option{-mcmodel=medium} is specified, data objects larger than
23671 @var{threshold} are placed in the large data section.  This value must be the
23672 same across all objects linked into the binary, and defaults to 65535.
23674 @item -mrtd
23675 @opindex mrtd
23676 Use a different function-calling convention, in which functions that
23677 take a fixed number of arguments return with the @code{ret @var{num}}
23678 instruction, which pops their arguments while returning.  This saves one
23679 instruction in the caller since there is no need to pop the arguments
23680 there.
23682 You can specify that an individual function is called with this calling
23683 sequence with the function attribute @code{stdcall}.  You can also
23684 override the @option{-mrtd} option by using the function attribute
23685 @code{cdecl}.  @xref{Function Attributes}.
23687 @strong{Warning:} this calling convention is incompatible with the one
23688 normally used on Unix, so you cannot use it if you need to call
23689 libraries compiled with the Unix compiler.
23691 Also, you must provide function prototypes for all functions that
23692 take variable numbers of arguments (including @code{printf});
23693 otherwise incorrect code is generated for calls to those
23694 functions.
23696 In addition, seriously incorrect code results if you call a
23697 function with too many arguments.  (Normally, extra arguments are
23698 harmlessly ignored.)
23700 @item -mregparm=@var{num}
23701 @opindex mregparm
23702 Control how many registers are used to pass integer arguments.  By
23703 default, no registers are used to pass arguments, and at most 3
23704 registers can be used.  You can control this behavior for a specific
23705 function by using the function attribute @code{regparm}.
23706 @xref{Function Attributes}.
23708 @strong{Warning:} if you use this switch, and
23709 @var{num} is nonzero, then you must build all modules with the same
23710 value, including any libraries.  This includes the system libraries and
23711 startup modules.
23713 @item -msseregparm
23714 @opindex msseregparm
23715 Use SSE register passing conventions for float and double arguments
23716 and return values.  You can control this behavior for a specific
23717 function by using the function attribute @code{sseregparm}.
23718 @xref{Function Attributes}.
23720 @strong{Warning:} if you use this switch then you must build all
23721 modules with the same value, including any libraries.  This includes
23722 the system libraries and startup modules.
23724 @item -mvect8-ret-in-mem
23725 @opindex mvect8-ret-in-mem
23726 Return 8-byte vectors in memory instead of MMX registers.  This is the
23727 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
23728 Studio compilers until version 12.  Later compiler versions (starting
23729 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
23730 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
23731 you need to remain compatible with existing code produced by those
23732 previous compiler versions or older versions of GCC@.
23734 @item -mpc32
23735 @itemx -mpc64
23736 @itemx -mpc80
23737 @opindex mpc32
23738 @opindex mpc64
23739 @opindex mpc80
23741 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
23742 is specified, the significands of results of floating-point operations are
23743 rounded to 24 bits (single precision); @option{-mpc64} rounds the
23744 significands of results of floating-point operations to 53 bits (double
23745 precision) and @option{-mpc80} rounds the significands of results of
23746 floating-point operations to 64 bits (extended double precision), which is
23747 the default.  When this option is used, floating-point operations in higher
23748 precisions are not available to the programmer without setting the FPU
23749 control word explicitly.
23751 Setting the rounding of floating-point operations to less than the default
23752 80 bits can speed some programs by 2% or more.  Note that some mathematical
23753 libraries assume that extended-precision (80-bit) floating-point operations
23754 are enabled by default; routines in such libraries could suffer significant
23755 loss of accuracy, typically through so-called ``catastrophic cancellation'',
23756 when this option is used to set the precision to less than extended precision.
23758 @item -mstackrealign
23759 @opindex mstackrealign
23760 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
23761 option generates an alternate prologue and epilogue that realigns the
23762 run-time stack if necessary.  This supports mixing legacy codes that keep
23763 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
23764 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
23765 applicable to individual functions.
23767 @item -mpreferred-stack-boundary=@var{num}
23768 @opindex mpreferred-stack-boundary
23769 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
23770 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
23771 the default is 4 (16 bytes or 128 bits).
23773 @strong{Warning:} When generating code for the x86-64 architecture with
23774 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
23775 used to keep the stack boundary aligned to 8 byte boundary.  Since
23776 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
23777 intended to be used in controlled environment where stack space is
23778 important limitation.  This option leads to wrong code when functions
23779 compiled with 16 byte stack alignment (such as functions from a standard
23780 library) are called with misaligned stack.  In this case, SSE
23781 instructions may lead to misaligned memory access traps.  In addition,
23782 variable arguments are handled incorrectly for 16 byte aligned
23783 objects (including x87 long double and __int128), leading to wrong
23784 results.  You must build all modules with
23785 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
23786 includes the system libraries and startup modules.
23788 @item -mincoming-stack-boundary=@var{num}
23789 @opindex mincoming-stack-boundary
23790 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
23791 boundary.  If @option{-mincoming-stack-boundary} is not specified,
23792 the one specified by @option{-mpreferred-stack-boundary} is used.
23794 On Pentium and Pentium Pro, @code{double} and @code{long double} values
23795 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
23796 suffer significant run time performance penalties.  On Pentium III, the
23797 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
23798 properly if it is not 16-byte aligned.
23800 To ensure proper alignment of this values on the stack, the stack boundary
23801 must be as aligned as that required by any value stored on the stack.
23802 Further, every function must be generated such that it keeps the stack
23803 aligned.  Thus calling a function compiled with a higher preferred
23804 stack boundary from a function compiled with a lower preferred stack
23805 boundary most likely misaligns the stack.  It is recommended that
23806 libraries that use callbacks always use the default setting.
23808 This extra alignment does consume extra stack space, and generally
23809 increases code size.  Code that is sensitive to stack space usage, such
23810 as embedded systems and operating system kernels, may want to reduce the
23811 preferred alignment to @option{-mpreferred-stack-boundary=2}.
23813 @need 200
23814 @item -mmmx
23815 @opindex mmmx
23816 @need 200
23817 @itemx -msse
23818 @opindex msse
23819 @need 200
23820 @itemx -msse2
23821 @opindex msse2
23822 @need 200
23823 @itemx -msse3
23824 @opindex msse3
23825 @need 200
23826 @itemx -mssse3
23827 @opindex mssse3
23828 @need 200
23829 @itemx -msse4
23830 @opindex msse4
23831 @need 200
23832 @itemx -msse4a
23833 @opindex msse4a
23834 @need 200
23835 @itemx -msse4.1
23836 @opindex msse4.1
23837 @need 200
23838 @itemx -msse4.2
23839 @opindex msse4.2
23840 @need 200
23841 @itemx -mavx
23842 @opindex mavx
23843 @need 200
23844 @itemx -mavx2
23845 @opindex mavx2
23846 @need 200
23847 @itemx -mavx512f
23848 @opindex mavx512f
23849 @need 200
23850 @itemx -mavx512pf
23851 @opindex mavx512pf
23852 @need 200
23853 @itemx -mavx512er
23854 @opindex mavx512er
23855 @need 200
23856 @itemx -mavx512cd
23857 @opindex mavx512cd
23858 @need 200
23859 @itemx -mavx512vl
23860 @opindex mavx512vl
23861 @need 200
23862 @itemx -mavx512bw
23863 @opindex mavx512bw
23864 @need 200
23865 @itemx -mavx512dq
23866 @opindex mavx512dq
23867 @need 200
23868 @itemx -mavx512ifma
23869 @opindex mavx512ifma
23870 @need 200
23871 @itemx -mavx512vbmi
23872 @opindex mavx512vbmi
23873 @need 200
23874 @itemx -msha
23875 @opindex msha
23876 @need 200
23877 @itemx -maes
23878 @opindex maes
23879 @need 200
23880 @itemx -mpclmul
23881 @opindex mpclmul
23882 @need 200
23883 @itemx -mclfushopt
23884 @opindex mclfushopt
23885 @need 200
23886 @itemx -mfsgsbase
23887 @opindex mfsgsbase
23888 @need 200
23889 @itemx -mrdrnd
23890 @opindex mrdrnd
23891 @need 200
23892 @itemx -mf16c
23893 @opindex mf16c
23894 @need 200
23895 @itemx -mfma
23896 @opindex mfma
23897 @need 200
23898 @itemx -mfma4
23899 @opindex mfma4
23900 @need 200
23901 @itemx -mprefetchwt1
23902 @opindex mprefetchwt1
23903 @need 200
23904 @itemx -mxop
23905 @opindex mxop
23906 @need 200
23907 @itemx -mlwp
23908 @opindex mlwp
23909 @need 200
23910 @itemx -m3dnow
23911 @opindex m3dnow
23912 @need 200
23913 @itemx -mpopcnt
23914 @opindex mpopcnt
23915 @need 200
23916 @itemx -mabm
23917 @opindex mabm
23918 @need 200
23919 @itemx -mbmi
23920 @opindex mbmi
23921 @need 200
23922 @itemx -mbmi2
23923 @need 200
23924 @itemx -mlzcnt
23925 @opindex mlzcnt
23926 @need 200
23927 @itemx -mfxsr
23928 @opindex mfxsr
23929 @need 200
23930 @itemx -mxsave
23931 @opindex mxsave
23932 @need 200
23933 @itemx -mxsaveopt
23934 @opindex mxsaveopt
23935 @need 200
23936 @itemx -mxsavec
23937 @opindex mxsavec
23938 @need 200
23939 @itemx -mxsaves
23940 @opindex mxsaves
23941 @need 200
23942 @itemx -mrtm
23943 @opindex mrtm
23944 @need 200
23945 @itemx -mtbm
23946 @opindex mtbm
23947 @need 200
23948 @itemx -mmpx
23949 @opindex mmpx
23950 @need 200
23951 @itemx -mmwaitx
23952 @opindex mmwaitx
23953 @need 200
23954 @itemx -mclzero
23955 @opindex mclzero
23956 @itemx -mpku
23957 @opindex mpku
23958 These switches enable the use of instructions in the MMX, SSE,
23959 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
23960 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
23961 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
23962 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU or 3DNow!@:
23963 extended instruction sets.  Each has a corresponding @option{-mno-} option
23964 to disable use of these instructions.
23966 These extensions are also available as built-in functions: see
23967 @ref{x86 Built-in Functions}, for details of the functions enabled and
23968 disabled by these switches.
23970 To generate SSE/SSE2 instructions automatically from floating-point
23971 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
23973 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
23974 generates new AVX instructions or AVX equivalence for all SSEx instructions
23975 when needed.
23977 These options enable GCC to use these extended instructions in
23978 generated code, even without @option{-mfpmath=sse}.  Applications that
23979 perform run-time CPU detection must compile separate files for each
23980 supported architecture, using the appropriate flags.  In particular,
23981 the file containing the CPU detection code should be compiled without
23982 these options.
23984 @item -mdump-tune-features
23985 @opindex mdump-tune-features
23986 This option instructs GCC to dump the names of the x86 performance 
23987 tuning features and default settings. The names can be used in 
23988 @option{-mtune-ctrl=@var{feature-list}}.
23990 @item -mtune-ctrl=@var{feature-list}
23991 @opindex mtune-ctrl=@var{feature-list}
23992 This option is used to do fine grain control of x86 code generation features.
23993 @var{feature-list} is a comma separated list of @var{feature} names. See also
23994 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
23995 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
23996 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
23997 developers. Using it may lead to code paths not covered by testing and can
23998 potentially result in compiler ICEs or runtime errors.
24000 @item -mno-default
24001 @opindex mno-default
24002 This option instructs GCC to turn off all tunable features. See also 
24003 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
24005 @item -mcld
24006 @opindex mcld
24007 This option instructs GCC to emit a @code{cld} instruction in the prologue
24008 of functions that use string instructions.  String instructions depend on
24009 the DF flag to select between autoincrement or autodecrement mode.  While the
24010 ABI specifies the DF flag to be cleared on function entry, some operating
24011 systems violate this specification by not clearing the DF flag in their
24012 exception dispatchers.  The exception handler can be invoked with the DF flag
24013 set, which leads to wrong direction mode when string instructions are used.
24014 This option can be enabled by default on 32-bit x86 targets by configuring
24015 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
24016 instructions can be suppressed with the @option{-mno-cld} compiler option
24017 in this case.
24019 @item -mvzeroupper
24020 @opindex mvzeroupper
24021 This option instructs GCC to emit a @code{vzeroupper} instruction
24022 before a transfer of control flow out of the function to minimize
24023 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
24024 intrinsics.
24026 @item -mprefer-avx128
24027 @opindex mprefer-avx128
24028 This option instructs GCC to use 128-bit AVX instructions instead of
24029 256-bit AVX instructions in the auto-vectorizer.
24031 @item -mcx16
24032 @opindex mcx16
24033 This option enables GCC to generate @code{CMPXCHG16B} instructions.
24034 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
24035 (or oword) data types.  
24036 This is useful for high-resolution counters that can be updated
24037 by multiple processors (or cores).  This instruction is generated as part of
24038 atomic built-in functions: see @ref{__sync Builtins} or
24039 @ref{__atomic Builtins} for details.
24041 @item -msahf
24042 @opindex msahf
24043 This option enables generation of @code{SAHF} instructions in 64-bit code.
24044 Early Intel Pentium 4 CPUs with Intel 64 support,
24045 prior to the introduction of Pentium 4 G1 step in December 2005,
24046 lacked the @code{LAHF} and @code{SAHF} instructions
24047 which are supported by AMD64.
24048 These are load and store instructions, respectively, for certain status flags.
24049 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
24050 @code{drem}, and @code{remainder} built-in functions;
24051 see @ref{Other Builtins} for details.
24053 @item -mmovbe
24054 @opindex mmovbe
24055 This option enables use of the @code{movbe} instruction to implement
24056 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
24058 @item -mcrc32
24059 @opindex mcrc32
24060 This option enables built-in functions @code{__builtin_ia32_crc32qi},
24061 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
24062 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
24064 @item -mrecip
24065 @opindex mrecip
24066 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
24067 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
24068 with an additional Newton-Raphson step
24069 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
24070 (and their vectorized
24071 variants) for single-precision floating-point arguments.  These instructions
24072 are generated only when @option{-funsafe-math-optimizations} is enabled
24073 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
24074 Note that while the throughput of the sequence is higher than the throughput
24075 of the non-reciprocal instruction, the precision of the sequence can be
24076 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
24078 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
24079 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
24080 combination), and doesn't need @option{-mrecip}.
24082 Also note that GCC emits the above sequence with additional Newton-Raphson step
24083 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
24084 already with @option{-ffast-math} (or the above option combination), and
24085 doesn't need @option{-mrecip}.
24087 @item -mrecip=@var{opt}
24088 @opindex mrecip=opt
24089 This option controls which reciprocal estimate instructions
24090 may be used.  @var{opt} is a comma-separated list of options, which may
24091 be preceded by a @samp{!} to invert the option:
24093 @table @samp
24094 @item all
24095 Enable all estimate instructions.
24097 @item default
24098 Enable the default instructions, equivalent to @option{-mrecip}.
24100 @item none
24101 Disable all estimate instructions, equivalent to @option{-mno-recip}.
24103 @item div
24104 Enable the approximation for scalar division.
24106 @item vec-div
24107 Enable the approximation for vectorized division.
24109 @item sqrt
24110 Enable the approximation for scalar square root.
24112 @item vec-sqrt
24113 Enable the approximation for vectorized square root.
24114 @end table
24116 So, for example, @option{-mrecip=all,!sqrt} enables
24117 all of the reciprocal approximations, except for square root.
24119 @item -mveclibabi=@var{type}
24120 @opindex mveclibabi
24121 Specifies the ABI type to use for vectorizing intrinsics using an
24122 external library.  Supported values for @var{type} are @samp{svml} 
24123 for the Intel short
24124 vector math library and @samp{acml} for the AMD math core library.
24125 To use this option, both @option{-ftree-vectorize} and
24126 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
24127 ABI-compatible library must be specified at link time.
24129 GCC currently emits calls to @code{vmldExp2},
24130 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
24131 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
24132 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
24133 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
24134 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
24135 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
24136 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
24137 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
24138 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
24139 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
24140 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
24141 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
24142 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
24143 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
24144 when @option{-mveclibabi=acml} is used.  
24146 @item -mabi=@var{name}
24147 @opindex mabi
24148 Generate code for the specified calling convention.  Permissible values
24149 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
24150 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
24151 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
24152 You can control this behavior for specific functions by
24153 using the function attributes @code{ms_abi} and @code{sysv_abi}.
24154 @xref{Function Attributes}.
24156 @item -mtls-dialect=@var{type}
24157 @opindex mtls-dialect
24158 Generate code to access thread-local storage using the @samp{gnu} or
24159 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
24160 @samp{gnu2} is more efficient, but it may add compile- and run-time
24161 requirements that cannot be satisfied on all systems.
24163 @item -mpush-args
24164 @itemx -mno-push-args
24165 @opindex mpush-args
24166 @opindex mno-push-args
24167 Use PUSH operations to store outgoing parameters.  This method is shorter
24168 and usually equally fast as method using SUB/MOV operations and is enabled
24169 by default.  In some cases disabling it may improve performance because of
24170 improved scheduling and reduced dependencies.
24172 @item -maccumulate-outgoing-args
24173 @opindex maccumulate-outgoing-args
24174 If enabled, the maximum amount of space required for outgoing arguments is
24175 computed in the function prologue.  This is faster on most modern CPUs
24176 because of reduced dependencies, improved scheduling and reduced stack usage
24177 when the preferred stack boundary is not equal to 2.  The drawback is a notable
24178 increase in code size.  This switch implies @option{-mno-push-args}.
24180 @item -mthreads
24181 @opindex mthreads
24182 Support thread-safe exception handling on MinGW.  Programs that rely
24183 on thread-safe exception handling must compile and link all code with the
24184 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
24185 @option{-D_MT}; when linking, it links in a special thread helper library
24186 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
24188 @item -mms-bitfields
24189 @itemx -mno-ms-bitfields
24190 @opindex mms-bitfields
24191 @opindex mno-ms-bitfields
24193 Enable/disable bit-field layout compatible with the native Microsoft
24194 Windows compiler.  
24196 If @code{packed} is used on a structure, or if bit-fields are used,
24197 it may be that the Microsoft ABI lays out the structure differently
24198 than the way GCC normally does.  Particularly when moving packed
24199 data between functions compiled with GCC and the native Microsoft compiler
24200 (either via function call or as data in a file), it may be necessary to access
24201 either format.
24203 This option is enabled by default for Microsoft Windows
24204 targets.  This behavior can also be controlled locally by use of variable
24205 or type attributes.  For more information, see @ref{x86 Variable Attributes}
24206 and @ref{x86 Type Attributes}.
24208 The Microsoft structure layout algorithm is fairly simple with the exception
24209 of the bit-field packing.  
24210 The padding and alignment of members of structures and whether a bit-field 
24211 can straddle a storage-unit boundary are determine by these rules:
24213 @enumerate
24214 @item Structure members are stored sequentially in the order in which they are
24215 declared: the first member has the lowest memory address and the last member
24216 the highest.
24218 @item Every data object has an alignment requirement.  The alignment requirement
24219 for all data except structures, unions, and arrays is either the size of the
24220 object or the current packing size (specified with either the
24221 @code{aligned} attribute or the @code{pack} pragma),
24222 whichever is less.  For structures, unions, and arrays,
24223 the alignment requirement is the largest alignment requirement of its members.
24224 Every object is allocated an offset so that:
24226 @smallexample
24227 offset % alignment_requirement == 0
24228 @end smallexample
24230 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
24231 unit if the integral types are the same size and if the next bit-field fits
24232 into the current allocation unit without crossing the boundary imposed by the
24233 common alignment requirements of the bit-fields.
24234 @end enumerate
24236 MSVC interprets zero-length bit-fields in the following ways:
24238 @enumerate
24239 @item If a zero-length bit-field is inserted between two bit-fields that
24240 are normally coalesced, the bit-fields are not coalesced.
24242 For example:
24244 @smallexample
24245 struct
24246  @{
24247    unsigned long bf_1 : 12;
24248    unsigned long : 0;
24249    unsigned long bf_2 : 12;
24250  @} t1;
24251 @end smallexample
24253 @noindent
24254 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
24255 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
24257 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
24258 alignment of the zero-length bit-field is greater than the member that follows it,
24259 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
24261 For example:
24263 @smallexample
24264 struct
24265  @{
24266    char foo : 4;
24267    short : 0;
24268    char bar;
24269  @} t2;
24271 struct
24272  @{
24273    char foo : 4;
24274    short : 0;
24275    double bar;
24276  @} t3;
24277 @end smallexample
24279 @noindent
24280 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
24281 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
24282 bit-field does not affect the alignment of @code{bar} or, as a result, the size
24283 of the structure.
24285 Taking this into account, it is important to note the following:
24287 @enumerate
24288 @item If a zero-length bit-field follows a normal bit-field, the type of the
24289 zero-length bit-field may affect the alignment of the structure as whole. For
24290 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
24291 normal bit-field, and is of type short.
24293 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
24294 still affect the alignment of the structure:
24296 @smallexample
24297 struct
24298  @{
24299    char foo : 6;
24300    long : 0;
24301  @} t4;
24302 @end smallexample
24304 @noindent
24305 Here, @code{t4} takes up 4 bytes.
24306 @end enumerate
24308 @item Zero-length bit-fields following non-bit-field members are ignored:
24310 @smallexample
24311 struct
24312  @{
24313    char foo;
24314    long : 0;
24315    char bar;
24316  @} t5;
24317 @end smallexample
24319 @noindent
24320 Here, @code{t5} takes up 2 bytes.
24321 @end enumerate
24324 @item -mno-align-stringops
24325 @opindex mno-align-stringops
24326 Do not align the destination of inlined string operations.  This switch reduces
24327 code size and improves performance in case the destination is already aligned,
24328 but GCC doesn't know about it.
24330 @item -minline-all-stringops
24331 @opindex minline-all-stringops
24332 By default GCC inlines string operations only when the destination is 
24333 known to be aligned to least a 4-byte boundary.  
24334 This enables more inlining and increases code
24335 size, but may improve performance of code that depends on fast
24336 @code{memcpy}, @code{strlen},
24337 and @code{memset} for short lengths.
24339 @item -minline-stringops-dynamically
24340 @opindex minline-stringops-dynamically
24341 For string operations of unknown size, use run-time checks with
24342 inline code for small blocks and a library call for large blocks.
24344 @item -mstringop-strategy=@var{alg}
24345 @opindex mstringop-strategy=@var{alg}
24346 Override the internal decision heuristic for the particular algorithm to use
24347 for inlining string operations.  The allowed values for @var{alg} are:
24349 @table @samp
24350 @item rep_byte
24351 @itemx rep_4byte
24352 @itemx rep_8byte
24353 Expand using i386 @code{rep} prefix of the specified size.
24355 @item byte_loop
24356 @itemx loop
24357 @itemx unrolled_loop
24358 Expand into an inline loop.
24360 @item libcall
24361 Always use a library call.
24362 @end table
24364 @item -mmemcpy-strategy=@var{strategy}
24365 @opindex mmemcpy-strategy=@var{strategy}
24366 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
24367 should be inlined and what inline algorithm to use when the expected size
24368 of the copy operation is known. @var{strategy} 
24369 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
24370 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
24371 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
24372 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
24373 in the list must be specified in increasing order.  The minimal byte size for 
24374 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
24375 preceding range.
24377 @item -mmemset-strategy=@var{strategy}
24378 @opindex mmemset-strategy=@var{strategy}
24379 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
24380 @code{__builtin_memset} expansion.
24382 @item -momit-leaf-frame-pointer
24383 @opindex momit-leaf-frame-pointer
24384 Don't keep the frame pointer in a register for leaf functions.  This
24385 avoids the instructions to save, set up, and restore frame pointers and
24386 makes an extra register available in leaf functions.  The option
24387 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
24388 which might make debugging harder.
24390 @item -mtls-direct-seg-refs
24391 @itemx -mno-tls-direct-seg-refs
24392 @opindex mtls-direct-seg-refs
24393 Controls whether TLS variables may be accessed with offsets from the
24394 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
24395 or whether the thread base pointer must be added.  Whether or not this
24396 is valid depends on the operating system, and whether it maps the
24397 segment to cover the entire TLS area.
24399 For systems that use the GNU C Library, the default is on.
24401 @item -msse2avx
24402 @itemx -mno-sse2avx
24403 @opindex msse2avx
24404 Specify that the assembler should encode SSE instructions with VEX
24405 prefix.  The option @option{-mavx} turns this on by default.
24407 @item -mfentry
24408 @itemx -mno-fentry
24409 @opindex mfentry
24410 If profiling is active (@option{-pg}), put the profiling
24411 counter call before the prologue.
24412 Note: On x86 architectures the attribute @code{ms_hook_prologue}
24413 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
24415 @item -mrecord-mcount
24416 @itemx -mno-record-mcount
24417 @opindex mrecord-mcount
24418 If profiling is active (@option{-pg}), generate a __mcount_loc section
24419 that contains pointers to each profiling call. This is useful for
24420 automatically patching and out calls.
24422 @item -mnop-mcount
24423 @itemx -mno-nop-mcount
24424 @opindex mnop-mcount
24425 If profiling is active (@option{-pg}), generate the calls to
24426 the profiling functions as nops. This is useful when they
24427 should be patched in later dynamically. This is likely only
24428 useful together with @option{-mrecord-mcount}.
24430 @item -mskip-rax-setup
24431 @itemx -mno-skip-rax-setup
24432 @opindex mskip-rax-setup
24433 When generating code for the x86-64 architecture with SSE extensions
24434 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
24435 register when there are no variable arguments passed in vector registers.
24437 @strong{Warning:} Since RAX register is used to avoid unnecessarily
24438 saving vector registers on stack when passing variable arguments, the
24439 impacts of this option are callees may waste some stack space,
24440 misbehave or jump to a random location.  GCC 4.4 or newer don't have
24441 those issues, regardless the RAX register value.
24443 @item -m8bit-idiv
24444 @itemx -mno-8bit-idiv
24445 @opindex m8bit-idiv
24446 On some processors, like Intel Atom, 8-bit unsigned integer divide is
24447 much faster than 32-bit/64-bit integer divide.  This option generates a
24448 run-time check.  If both dividend and divisor are within range of 0
24449 to 255, 8-bit unsigned integer divide is used instead of
24450 32-bit/64-bit integer divide.
24452 @item -mavx256-split-unaligned-load
24453 @itemx -mavx256-split-unaligned-store
24454 @opindex mavx256-split-unaligned-load
24455 @opindex mavx256-split-unaligned-store
24456 Split 32-byte AVX unaligned load and store.
24458 @item -mstack-protector-guard=@var{guard}
24459 @opindex mstack-protector-guard=@var{guard}
24460 Generate stack protection code using canary at @var{guard}.  Supported
24461 locations are @samp{global} for global canary or @samp{tls} for per-thread
24462 canary in the TLS block (the default).  This option has effect only when
24463 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
24465 @item -mmitigate-rop
24466 @opindex mmitigate-rop
24467 Try to avoid generating code sequences that contain unintended return
24468 opcodes, to mitigate against certain forms of attack. At the moment,
24469 this option is limited in what it can do and should not be relied
24470 on to provide serious protection.
24472 @item -mgeneral-regs-only
24473 @opindex mgeneral-regs-only
24474 Generate code that uses only the general-purpose registers.  This
24475 prevents the compiler from using floating-point, vector, mask and bound
24476 registers.
24478 @end table
24480 These @samp{-m} switches are supported in addition to the above
24481 on x86-64 processors in 64-bit environments.
24483 @table @gcctabopt
24484 @item -m32
24485 @itemx -m64
24486 @itemx -mx32
24487 @itemx -m16
24488 @itemx -miamcu
24489 @opindex m32
24490 @opindex m64
24491 @opindex mx32
24492 @opindex m16
24493 @opindex miamcu
24494 Generate code for a 16-bit, 32-bit or 64-bit environment.
24495 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
24496 to 32 bits, and
24497 generates code that runs on any i386 system.
24499 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
24500 types to 64 bits, and generates code for the x86-64 architecture.
24501 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
24502 and @option{-mdynamic-no-pic} options.
24504 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
24505 to 32 bits, and
24506 generates code for the x86-64 architecture.
24508 The @option{-m16} option is the same as @option{-m32}, except for that
24509 it outputs the @code{.code16gcc} assembly directive at the beginning of
24510 the assembly output so that the binary can run in 16-bit mode.
24512 The @option{-miamcu} option generates code which conforms to Intel MCU
24513 psABI.  It requires the @option{-m32} option to be turned on.
24515 @item -mno-red-zone
24516 @opindex mno-red-zone
24517 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
24518 by the x86-64 ABI; it is a 128-byte area beyond the location of the
24519 stack pointer that is not modified by signal or interrupt handlers
24520 and therefore can be used for temporary data without adjusting the stack
24521 pointer.  The flag @option{-mno-red-zone} disables this red zone.
24523 @item -mcmodel=small
24524 @opindex mcmodel=small
24525 Generate code for the small code model: the program and its symbols must
24526 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
24527 Programs can be statically or dynamically linked.  This is the default
24528 code model.
24530 @item -mcmodel=kernel
24531 @opindex mcmodel=kernel
24532 Generate code for the kernel code model.  The kernel runs in the
24533 negative 2 GB of the address space.
24534 This model has to be used for Linux kernel code.
24536 @item -mcmodel=medium
24537 @opindex mcmodel=medium
24538 Generate code for the medium model: the program is linked in the lower 2
24539 GB of the address space.  Small symbols are also placed there.  Symbols
24540 with sizes larger than @option{-mlarge-data-threshold} are put into
24541 large data or BSS sections and can be located above 2GB.  Programs can
24542 be statically or dynamically linked.
24544 @item -mcmodel=large
24545 @opindex mcmodel=large
24546 Generate code for the large model.  This model makes no assumptions
24547 about addresses and sizes of sections.
24549 @item -maddress-mode=long
24550 @opindex maddress-mode=long
24551 Generate code for long address mode.  This is only supported for 64-bit
24552 and x32 environments.  It is the default address mode for 64-bit
24553 environments.
24555 @item -maddress-mode=short
24556 @opindex maddress-mode=short
24557 Generate code for short address mode.  This is only supported for 32-bit
24558 and x32 environments.  It is the default address mode for 32-bit and
24559 x32 environments.
24560 @end table
24562 @node x86 Windows Options
24563 @subsection x86 Windows Options
24564 @cindex x86 Windows Options
24565 @cindex Windows Options for x86
24567 These additional options are available for Microsoft Windows targets:
24569 @table @gcctabopt
24570 @item -mconsole
24571 @opindex mconsole
24572 This option
24573 specifies that a console application is to be generated, by
24574 instructing the linker to set the PE header subsystem type
24575 required for console applications.
24576 This option is available for Cygwin and MinGW targets and is
24577 enabled by default on those targets.
24579 @item -mdll
24580 @opindex mdll
24581 This option is available for Cygwin and MinGW targets.  It
24582 specifies that a DLL---a dynamic link library---is to be
24583 generated, enabling the selection of the required runtime
24584 startup object and entry point.
24586 @item -mnop-fun-dllimport
24587 @opindex mnop-fun-dllimport
24588 This option is available for Cygwin and MinGW targets.  It
24589 specifies that the @code{dllimport} attribute should be ignored.
24591 @item -mthread
24592 @opindex mthread
24593 This option is available for MinGW targets. It specifies
24594 that MinGW-specific thread support is to be used.
24596 @item -municode
24597 @opindex municode
24598 This option is available for MinGW-w64 targets.  It causes
24599 the @code{UNICODE} preprocessor macro to be predefined, and
24600 chooses Unicode-capable runtime startup code.
24602 @item -mwin32
24603 @opindex mwin32
24604 This option is available for Cygwin and MinGW targets.  It
24605 specifies that the typical Microsoft Windows predefined macros are to
24606 be set in the pre-processor, but does not influence the choice
24607 of runtime library/startup code.
24609 @item -mwindows
24610 @opindex mwindows
24611 This option is available for Cygwin and MinGW targets.  It
24612 specifies that a GUI application is to be generated by
24613 instructing the linker to set the PE header subsystem type
24614 appropriately.
24616 @item -fno-set-stack-executable
24617 @opindex fno-set-stack-executable
24618 This option is available for MinGW targets. It specifies that
24619 the executable flag for the stack used by nested functions isn't
24620 set. This is necessary for binaries running in kernel mode of
24621 Microsoft Windows, as there the User32 API, which is used to set executable
24622 privileges, isn't available.
24624 @item -fwritable-relocated-rdata
24625 @opindex fno-writable-relocated-rdata
24626 This option is available for MinGW and Cygwin targets.  It specifies
24627 that relocated-data in read-only section is put into the @code{.data}
24628 section.  This is a necessary for older runtimes not supporting
24629 modification of @code{.rdata} sections for pseudo-relocation.
24631 @item -mpe-aligned-commons
24632 @opindex mpe-aligned-commons
24633 This option is available for Cygwin and MinGW targets.  It
24634 specifies that the GNU extension to the PE file format that
24635 permits the correct alignment of COMMON variables should be
24636 used when generating code.  It is enabled by default if
24637 GCC detects that the target assembler found during configuration
24638 supports the feature.
24639 @end table
24641 See also under @ref{x86 Options} for standard options.
24643 @node Xstormy16 Options
24644 @subsection Xstormy16 Options
24645 @cindex Xstormy16 Options
24647 These options are defined for Xstormy16:
24649 @table @gcctabopt
24650 @item -msim
24651 @opindex msim
24652 Choose startup files and linker script suitable for the simulator.
24653 @end table
24655 @node Xtensa Options
24656 @subsection Xtensa Options
24657 @cindex Xtensa Options
24659 These options are supported for Xtensa targets:
24661 @table @gcctabopt
24662 @item -mconst16
24663 @itemx -mno-const16
24664 @opindex mconst16
24665 @opindex mno-const16
24666 Enable or disable use of @code{CONST16} instructions for loading
24667 constant values.  The @code{CONST16} instruction is currently not a
24668 standard option from Tensilica.  When enabled, @code{CONST16}
24669 instructions are always used in place of the standard @code{L32R}
24670 instructions.  The use of @code{CONST16} is enabled by default only if
24671 the @code{L32R} instruction is not available.
24673 @item -mfused-madd
24674 @itemx -mno-fused-madd
24675 @opindex mfused-madd
24676 @opindex mno-fused-madd
24677 Enable or disable use of fused multiply/add and multiply/subtract
24678 instructions in the floating-point option.  This has no effect if the
24679 floating-point option is not also enabled.  Disabling fused multiply/add
24680 and multiply/subtract instructions forces the compiler to use separate
24681 instructions for the multiply and add/subtract operations.  This may be
24682 desirable in some cases where strict IEEE 754-compliant results are
24683 required: the fused multiply add/subtract instructions do not round the
24684 intermediate result, thereby producing results with @emph{more} bits of
24685 precision than specified by the IEEE standard.  Disabling fused multiply
24686 add/subtract instructions also ensures that the program output is not
24687 sensitive to the compiler's ability to combine multiply and add/subtract
24688 operations.
24690 @item -mserialize-volatile
24691 @itemx -mno-serialize-volatile
24692 @opindex mserialize-volatile
24693 @opindex mno-serialize-volatile
24694 When this option is enabled, GCC inserts @code{MEMW} instructions before
24695 @code{volatile} memory references to guarantee sequential consistency.
24696 The default is @option{-mserialize-volatile}.  Use
24697 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
24699 @item -mforce-no-pic
24700 @opindex mforce-no-pic
24701 For targets, like GNU/Linux, where all user-mode Xtensa code must be
24702 position-independent code (PIC), this option disables PIC for compiling
24703 kernel code.
24705 @item -mtext-section-literals
24706 @itemx -mno-text-section-literals
24707 @opindex mtext-section-literals
24708 @opindex mno-text-section-literals
24709 These options control the treatment of literal pools.  The default is
24710 @option{-mno-text-section-literals}, which places literals in a separate
24711 section in the output file.  This allows the literal pool to be placed
24712 in a data RAM/ROM, and it also allows the linker to combine literal
24713 pools from separate object files to remove redundant literals and
24714 improve code size.  With @option{-mtext-section-literals}, the literals
24715 are interspersed in the text section in order to keep them as close as
24716 possible to their references.  This may be necessary for large assembly
24717 files.  Literals for each function are placed right before that function.
24719 @item -mauto-litpools
24720 @itemx -mno-auto-litpools
24721 @opindex mauto-litpools
24722 @opindex mno-auto-litpools
24723 These options control the treatment of literal pools.  The default is
24724 @option{-mno-auto-litpools}, which places literals in a separate
24725 section in the output file unless @option{-mtext-section-literals} is
24726 used.  With @option{-mauto-litpools} the literals are interspersed in
24727 the text section by the assembler.  Compiler does not produce explicit
24728 @code{.literal} directives and loads literals into registers with
24729 @code{MOVI} instructions instead of @code{L32R} to let the assembler
24730 do relaxation and place literals as necessary.  This option allows
24731 assembler to create several literal pools per function and assemble
24732 very big functions, which may not be possible with
24733 @option{-mtext-section-literals}.
24735 @item -mtarget-align
24736 @itemx -mno-target-align
24737 @opindex mtarget-align
24738 @opindex mno-target-align
24739 When this option is enabled, GCC instructs the assembler to
24740 automatically align instructions to reduce branch penalties at the
24741 expense of some code density.  The assembler attempts to widen density
24742 instructions to align branch targets and the instructions following call
24743 instructions.  If there are not enough preceding safe density
24744 instructions to align a target, no widening is performed.  The
24745 default is @option{-mtarget-align}.  These options do not affect the
24746 treatment of auto-aligned instructions like @code{LOOP}, which the
24747 assembler always aligns, either by widening density instructions or
24748 by inserting NOP instructions.
24750 @item -mlongcalls
24751 @itemx -mno-longcalls
24752 @opindex mlongcalls
24753 @opindex mno-longcalls
24754 When this option is enabled, GCC instructs the assembler to translate
24755 direct calls to indirect calls unless it can determine that the target
24756 of a direct call is in the range allowed by the call instruction.  This
24757 translation typically occurs for calls to functions in other source
24758 files.  Specifically, the assembler translates a direct @code{CALL}
24759 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
24760 The default is @option{-mno-longcalls}.  This option should be used in
24761 programs where the call target can potentially be out of range.  This
24762 option is implemented in the assembler, not the compiler, so the
24763 assembly code generated by GCC still shows direct call
24764 instructions---look at the disassembled object code to see the actual
24765 instructions.  Note that the assembler uses an indirect call for
24766 every cross-file call, not just those that really are out of range.
24767 @end table
24769 @node zSeries Options
24770 @subsection zSeries Options
24771 @cindex zSeries options
24773 These are listed under @xref{S/390 and zSeries Options}.
24776 @c man end
24778 @node Spec Files
24779 @section Specifying Subprocesses and the Switches to Pass to Them
24780 @cindex Spec Files
24782 @command{gcc} is a driver program.  It performs its job by invoking a
24783 sequence of other programs to do the work of compiling, assembling and
24784 linking.  GCC interprets its command-line parameters and uses these to
24785 deduce which programs it should invoke, and which command-line options
24786 it ought to place on their command lines.  This behavior is controlled
24787 by @dfn{spec strings}.  In most cases there is one spec string for each
24788 program that GCC can invoke, but a few programs have multiple spec
24789 strings to control their behavior.  The spec strings built into GCC can
24790 be overridden by using the @option{-specs=} command-line switch to specify
24791 a spec file.
24793 @dfn{Spec files} are plain-text files that are used to construct spec
24794 strings.  They consist of a sequence of directives separated by blank
24795 lines.  The type of directive is determined by the first non-whitespace
24796 character on the line, which can be one of the following:
24798 @table @code
24799 @item %@var{command}
24800 Issues a @var{command} to the spec file processor.  The commands that can
24801 appear here are:
24803 @table @code
24804 @item %include <@var{file}>
24805 @cindex @code{%include}
24806 Search for @var{file} and insert its text at the current point in the
24807 specs file.
24809 @item %include_noerr <@var{file}>
24810 @cindex @code{%include_noerr}
24811 Just like @samp{%include}, but do not generate an error message if the include
24812 file cannot be found.
24814 @item %rename @var{old_name} @var{new_name}
24815 @cindex @code{%rename}
24816 Rename the spec string @var{old_name} to @var{new_name}.
24818 @end table
24820 @item *[@var{spec_name}]:
24821 This tells the compiler to create, override or delete the named spec
24822 string.  All lines after this directive up to the next directive or
24823 blank line are considered to be the text for the spec string.  If this
24824 results in an empty string then the spec is deleted.  (Or, if the
24825 spec did not exist, then nothing happens.)  Otherwise, if the spec
24826 does not currently exist a new spec is created.  If the spec does
24827 exist then its contents are overridden by the text of this
24828 directive, unless the first character of that text is the @samp{+}
24829 character, in which case the text is appended to the spec.
24831 @item [@var{suffix}]:
24832 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
24833 and up to the next directive or blank line are considered to make up the
24834 spec string for the indicated suffix.  When the compiler encounters an
24835 input file with the named suffix, it processes the spec string in
24836 order to work out how to compile that file.  For example:
24838 @smallexample
24839 .ZZ:
24840 z-compile -input %i
24841 @end smallexample
24843 This says that any input file whose name ends in @samp{.ZZ} should be
24844 passed to the program @samp{z-compile}, which should be invoked with the
24845 command-line switch @option{-input} and with the result of performing the
24846 @samp{%i} substitution.  (See below.)
24848 As an alternative to providing a spec string, the text following a
24849 suffix directive can be one of the following:
24851 @table @code
24852 @item @@@var{language}
24853 This says that the suffix is an alias for a known @var{language}.  This is
24854 similar to using the @option{-x} command-line switch to GCC to specify a
24855 language explicitly.  For example:
24857 @smallexample
24858 .ZZ:
24859 @@c++
24860 @end smallexample
24862 Says that .ZZ files are, in fact, C++ source files.
24864 @item #@var{name}
24865 This causes an error messages saying:
24867 @smallexample
24868 @var{name} compiler not installed on this system.
24869 @end smallexample
24870 @end table
24872 GCC already has an extensive list of suffixes built into it.
24873 This directive adds an entry to the end of the list of suffixes, but
24874 since the list is searched from the end backwards, it is effectively
24875 possible to override earlier entries using this technique.
24877 @end table
24879 GCC has the following spec strings built into it.  Spec files can
24880 override these strings or create their own.  Note that individual
24881 targets can also add their own spec strings to this list.
24883 @smallexample
24884 asm          Options to pass to the assembler
24885 asm_final    Options to pass to the assembler post-processor
24886 cpp          Options to pass to the C preprocessor
24887 cc1          Options to pass to the C compiler
24888 cc1plus      Options to pass to the C++ compiler
24889 endfile      Object files to include at the end of the link
24890 link         Options to pass to the linker
24891 lib          Libraries to include on the command line to the linker
24892 libgcc       Decides which GCC support library to pass to the linker
24893 linker       Sets the name of the linker
24894 predefines   Defines to be passed to the C preprocessor
24895 signed_char  Defines to pass to CPP to say whether @code{char} is signed
24896              by default
24897 startfile    Object files to include at the start of the link
24898 @end smallexample
24900 Here is a small example of a spec file:
24902 @smallexample
24903 %rename lib                 old_lib
24905 *lib:
24906 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
24907 @end smallexample
24909 This example renames the spec called @samp{lib} to @samp{old_lib} and
24910 then overrides the previous definition of @samp{lib} with a new one.
24911 The new definition adds in some extra command-line options before
24912 including the text of the old definition.
24914 @dfn{Spec strings} are a list of command-line options to be passed to their
24915 corresponding program.  In addition, the spec strings can contain
24916 @samp{%}-prefixed sequences to substitute variable text or to
24917 conditionally insert text into the command line.  Using these constructs
24918 it is possible to generate quite complex command lines.
24920 Here is a table of all defined @samp{%}-sequences for spec
24921 strings.  Note that spaces are not generated automatically around the
24922 results of expanding these sequences.  Therefore you can concatenate them
24923 together or combine them with constant text in a single argument.
24925 @table @code
24926 @item %%
24927 Substitute one @samp{%} into the program name or argument.
24929 @item %i
24930 Substitute the name of the input file being processed.
24932 @item %b
24933 Substitute the basename of the input file being processed.
24934 This is the substring up to (and not including) the last period
24935 and not including the directory.
24937 @item %B
24938 This is the same as @samp{%b}, but include the file suffix (text after
24939 the last period).
24941 @item %d
24942 Marks the argument containing or following the @samp{%d} as a
24943 temporary file name, so that that file is deleted if GCC exits
24944 successfully.  Unlike @samp{%g}, this contributes no text to the
24945 argument.
24947 @item %g@var{suffix}
24948 Substitute a file name that has suffix @var{suffix} and is chosen
24949 once per compilation, and mark the argument in the same way as
24950 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
24951 name is now chosen in a way that is hard to predict even when previously
24952 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
24953 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
24954 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
24955 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
24956 was simply substituted with a file name chosen once per compilation,
24957 without regard to any appended suffix (which was therefore treated
24958 just like ordinary text), making such attacks more likely to succeed.
24960 @item %u@var{suffix}
24961 Like @samp{%g}, but generates a new temporary file name
24962 each time it appears instead of once per compilation.
24964 @item %U@var{suffix}
24965 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
24966 new one if there is no such last file name.  In the absence of any
24967 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
24968 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
24969 involves the generation of two distinct file names, one
24970 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
24971 simply substituted with a file name chosen for the previous @samp{%u},
24972 without regard to any appended suffix.
24974 @item %j@var{suffix}
24975 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
24976 writable, and if @option{-save-temps} is not used; 
24977 otherwise, substitute the name
24978 of a temporary file, just like @samp{%u}.  This temporary file is not
24979 meant for communication between processes, but rather as a junk
24980 disposal mechanism.
24982 @item %|@var{suffix}
24983 @itemx %m@var{suffix}
24984 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
24985 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
24986 all.  These are the two most common ways to instruct a program that it
24987 should read from standard input or write to standard output.  If you
24988 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
24989 construct: see for example @file{f/lang-specs.h}.
24991 @item %.@var{SUFFIX}
24992 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
24993 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
24994 terminated by the next space or %.
24996 @item %w
24997 Marks the argument containing or following the @samp{%w} as the
24998 designated output file of this compilation.  This puts the argument
24999 into the sequence of arguments that @samp{%o} substitutes.
25001 @item %o
25002 Substitutes the names of all the output files, with spaces
25003 automatically placed around them.  You should write spaces
25004 around the @samp{%o} as well or the results are undefined.
25005 @samp{%o} is for use in the specs for running the linker.
25006 Input files whose names have no recognized suffix are not compiled
25007 at all, but they are included among the output files, so they are
25008 linked.
25010 @item %O
25011 Substitutes the suffix for object files.  Note that this is
25012 handled specially when it immediately follows @samp{%g, %u, or %U},
25013 because of the need for those to form complete file names.  The
25014 handling is such that @samp{%O} is treated exactly as if it had already
25015 been substituted, except that @samp{%g, %u, and %U} do not currently
25016 support additional @var{suffix} characters following @samp{%O} as they do
25017 following, for example, @samp{.o}.
25019 @item %p
25020 Substitutes the standard macro predefinitions for the
25021 current target machine.  Use this when running @command{cpp}.
25023 @item %P
25024 Like @samp{%p}, but puts @samp{__} before and after the name of each
25025 predefined macro, except for macros that start with @samp{__} or with
25026 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
25029 @item %I
25030 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
25031 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
25032 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
25033 and @option{-imultilib} as necessary.
25035 @item %s
25036 Current argument is the name of a library or startup file of some sort.
25037 Search for that file in a standard list of directories and substitute
25038 the full name found.  The current working directory is included in the
25039 list of directories scanned.
25041 @item %T
25042 Current argument is the name of a linker script.  Search for that file
25043 in the current list of directories to scan for libraries. If the file
25044 is located insert a @option{--script} option into the command line
25045 followed by the full path name found.  If the file is not found then
25046 generate an error message.  Note: the current working directory is not
25047 searched.
25049 @item %e@var{str}
25050 Print @var{str} as an error message.  @var{str} is terminated by a newline.
25051 Use this when inconsistent options are detected.
25053 @item %(@var{name})
25054 Substitute the contents of spec string @var{name} at this point.
25056 @item %x@{@var{option}@}
25057 Accumulate an option for @samp{%X}.
25059 @item %X
25060 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
25061 spec string.
25063 @item %Y
25064 Output the accumulated assembler options specified by @option{-Wa}.
25066 @item %Z
25067 Output the accumulated preprocessor options specified by @option{-Wp}.
25069 @item %a
25070 Process the @code{asm} spec.  This is used to compute the
25071 switches to be passed to the assembler.
25073 @item %A
25074 Process the @code{asm_final} spec.  This is a spec string for
25075 passing switches to an assembler post-processor, if such a program is
25076 needed.
25078 @item %l
25079 Process the @code{link} spec.  This is the spec for computing the
25080 command line passed to the linker.  Typically it makes use of the
25081 @samp{%L %G %S %D and %E} sequences.
25083 @item %D
25084 Dump out a @option{-L} option for each directory that GCC believes might
25085 contain startup files.  If the target supports multilibs then the
25086 current multilib directory is prepended to each of these paths.
25088 @item %L
25089 Process the @code{lib} spec.  This is a spec string for deciding which
25090 libraries are included on the command line to the linker.
25092 @item %G
25093 Process the @code{libgcc} spec.  This is a spec string for deciding
25094 which GCC support library is included on the command line to the linker.
25096 @item %S
25097 Process the @code{startfile} spec.  This is a spec for deciding which
25098 object files are the first ones passed to the linker.  Typically
25099 this might be a file named @file{crt0.o}.
25101 @item %E
25102 Process the @code{endfile} spec.  This is a spec string that specifies
25103 the last object files that are passed to the linker.
25105 @item %C
25106 Process the @code{cpp} spec.  This is used to construct the arguments
25107 to be passed to the C preprocessor.
25109 @item %1
25110 Process the @code{cc1} spec.  This is used to construct the options to be
25111 passed to the actual C compiler (@command{cc1}).
25113 @item %2
25114 Process the @code{cc1plus} spec.  This is used to construct the options to be
25115 passed to the actual C++ compiler (@command{cc1plus}).
25117 @item %*
25118 Substitute the variable part of a matched option.  See below.
25119 Note that each comma in the substituted string is replaced by
25120 a single space.
25122 @item %<@code{S}
25123 Remove all occurrences of @code{-S} from the command line.  Note---this
25124 command is position dependent.  @samp{%} commands in the spec string
25125 before this one see @code{-S}, @samp{%} commands in the spec string
25126 after this one do not.
25128 @item %:@var{function}(@var{args})
25129 Call the named function @var{function}, passing it @var{args}.
25130 @var{args} is first processed as a nested spec string, then split
25131 into an argument vector in the usual fashion.  The function returns
25132 a string which is processed as if it had appeared literally as part
25133 of the current spec.
25135 The following built-in spec functions are provided:
25137 @table @code
25138 @item @code{getenv}
25139 The @code{getenv} spec function takes two arguments: an environment
25140 variable name and a string.  If the environment variable is not
25141 defined, a fatal error is issued.  Otherwise, the return value is the
25142 value of the environment variable concatenated with the string.  For
25143 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
25145 @smallexample
25146 %:getenv(TOPDIR /include)
25147 @end smallexample
25149 expands to @file{/path/to/top/include}.
25151 @item @code{if-exists}
25152 The @code{if-exists} spec function takes one argument, an absolute
25153 pathname to a file.  If the file exists, @code{if-exists} returns the
25154 pathname.  Here is a small example of its usage:
25156 @smallexample
25157 *startfile:
25158 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
25159 @end smallexample
25161 @item @code{if-exists-else}
25162 The @code{if-exists-else} spec function is similar to the @code{if-exists}
25163 spec function, except that it takes two arguments.  The first argument is
25164 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
25165 returns the pathname.  If it does not exist, it returns the second argument.
25166 This way, @code{if-exists-else} can be used to select one file or another,
25167 based on the existence of the first.  Here is a small example of its usage:
25169 @smallexample
25170 *startfile:
25171 crt0%O%s %:if-exists(crti%O%s) \
25172 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
25173 @end smallexample
25175 @item @code{replace-outfile}
25176 The @code{replace-outfile} spec function takes two arguments.  It looks for the
25177 first argument in the outfiles array and replaces it with the second argument.  Here
25178 is a small example of its usage:
25180 @smallexample
25181 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
25182 @end smallexample
25184 @item @code{remove-outfile}
25185 The @code{remove-outfile} spec function takes one argument.  It looks for the
25186 first argument in the outfiles array and removes it.  Here is a small example
25187 its usage:
25189 @smallexample
25190 %:remove-outfile(-lm)
25191 @end smallexample
25193 @item @code{pass-through-libs}
25194 The @code{pass-through-libs} spec function takes any number of arguments.  It
25195 finds any @option{-l} options and any non-options ending in @file{.a} (which it
25196 assumes are the names of linker input library archive files) and returns a
25197 result containing all the found arguments each prepended by
25198 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
25199 intended to be passed to the LTO linker plugin.
25201 @smallexample
25202 %:pass-through-libs(%G %L %G)
25203 @end smallexample
25205 @item @code{print-asm-header}
25206 The @code{print-asm-header} function takes no arguments and simply
25207 prints a banner like:
25209 @smallexample
25210 Assembler options
25211 =================
25213 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
25214 @end smallexample
25216 It is used to separate compiler options from assembler options
25217 in the @option{--target-help} output.
25218 @end table
25220 @item %@{@code{S}@}
25221 Substitutes the @code{-S} switch, if that switch is given to GCC@.
25222 If that switch is not specified, this substitutes nothing.  Note that
25223 the leading dash is omitted when specifying this option, and it is
25224 automatically inserted if the substitution is performed.  Thus the spec
25225 string @samp{%@{foo@}} matches the command-line option @option{-foo}
25226 and outputs the command-line option @option{-foo}.
25228 @item %W@{@code{S}@}
25229 Like %@{@code{S}@} but mark last argument supplied within as a file to be
25230 deleted on failure.
25232 @item %@{@code{S}*@}
25233 Substitutes all the switches specified to GCC whose names start
25234 with @code{-S}, but which also take an argument.  This is used for
25235 switches like @option{-o}, @option{-D}, @option{-I}, etc.
25236 GCC considers @option{-o foo} as being
25237 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
25238 text, including the space.  Thus two arguments are generated.
25240 @item %@{@code{S}*&@code{T}*@}
25241 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
25242 (the order of @code{S} and @code{T} in the spec is not significant).
25243 There can be any number of ampersand-separated variables; for each the
25244 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
25246 @item %@{@code{S}:@code{X}@}
25247 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
25249 @item %@{!@code{S}:@code{X}@}
25250 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
25252 @item %@{@code{S}*:@code{X}@}
25253 Substitutes @code{X} if one or more switches whose names start with
25254 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
25255 once, no matter how many such switches appeared.  However, if @code{%*}
25256 appears somewhere in @code{X}, then @code{X} is substituted once
25257 for each matching switch, with the @code{%*} replaced by the part of
25258 that switch matching the @code{*}.
25260 If @code{%*} appears as the last part of a spec sequence then a space
25261 is added after the end of the last substitution.  If there is more
25262 text in the sequence, however, then a space is not generated.  This
25263 allows the @code{%*} substitution to be used as part of a larger
25264 string.  For example, a spec string like this:
25266 @smallexample
25267 %@{mcu=*:--script=%*/memory.ld@}
25268 @end smallexample
25270 @noindent
25271 when matching an option like @option{-mcu=newchip} produces:
25273 @smallexample
25274 --script=newchip/memory.ld
25275 @end smallexample
25277 @item %@{.@code{S}:@code{X}@}
25278 Substitutes @code{X}, if processing a file with suffix @code{S}.
25280 @item %@{!.@code{S}:@code{X}@}
25281 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
25283 @item %@{,@code{S}:@code{X}@}
25284 Substitutes @code{X}, if processing a file for language @code{S}.
25286 @item %@{!,@code{S}:@code{X}@}
25287 Substitutes @code{X}, if not processing a file for language @code{S}.
25289 @item %@{@code{S}|@code{P}:@code{X}@}
25290 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
25291 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
25292 @code{*} sequences as well, although they have a stronger binding than
25293 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
25294 alternatives must be starred, and only the first matching alternative
25295 is substituted.
25297 For example, a spec string like this:
25299 @smallexample
25300 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
25301 @end smallexample
25303 @noindent
25304 outputs the following command-line options from the following input
25305 command-line options:
25307 @smallexample
25308 fred.c        -foo -baz
25309 jim.d         -bar -boggle
25310 -d fred.c     -foo -baz -boggle
25311 -d jim.d      -bar -baz -boggle
25312 @end smallexample
25314 @item %@{S:X; T:Y; :D@}
25316 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
25317 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
25318 be as many clauses as you need.  This may be combined with @code{.},
25319 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
25322 @end table
25324 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
25325 construct may contain other nested @samp{%} constructs or spaces, or
25326 even newlines.  They are processed as usual, as described above.
25327 Trailing white space in @code{X} is ignored.  White space may also
25328 appear anywhere on the left side of the colon in these constructs,
25329 except between @code{.} or @code{*} and the corresponding word.
25331 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
25332 handled specifically in these constructs.  If another value of
25333 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
25334 @option{-W} switch is found later in the command line, the earlier
25335 switch value is ignored, except with @{@code{S}*@} where @code{S} is
25336 just one letter, which passes all matching options.
25338 The character @samp{|} at the beginning of the predicate text is used to
25339 indicate that a command should be piped to the following command, but
25340 only if @option{-pipe} is specified.
25342 It is built into GCC which switches take arguments and which do not.
25343 (You might think it would be useful to generalize this to allow each
25344 compiler's spec to say which switches take arguments.  But this cannot
25345 be done in a consistent fashion.  GCC cannot even decide which input
25346 files have been specified without knowing which switches take arguments,
25347 and it must know which input files to compile in order to tell which
25348 compilers to run).
25350 GCC also knows implicitly that arguments starting in @option{-l} are to be
25351 treated as compiler output files, and passed to the linker in their
25352 proper position among the other output files.
25354 @node Environment Variables
25355 @section Environment Variables Affecting GCC
25356 @cindex environment variables
25358 @c man begin ENVIRONMENT
25359 This section describes several environment variables that affect how GCC
25360 operates.  Some of them work by specifying directories or prefixes to use
25361 when searching for various kinds of files.  Some are used to specify other
25362 aspects of the compilation environment.
25364 Note that you can also specify places to search using options such as
25365 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
25366 take precedence over places specified using environment variables, which
25367 in turn take precedence over those specified by the configuration of GCC@.
25368 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
25369 GNU Compiler Collection (GCC) Internals}.
25371 @table @env
25372 @item LANG
25373 @itemx LC_CTYPE
25374 @c @itemx LC_COLLATE
25375 @itemx LC_MESSAGES
25376 @c @itemx LC_MONETARY
25377 @c @itemx LC_NUMERIC
25378 @c @itemx LC_TIME
25379 @itemx LC_ALL
25380 @findex LANG
25381 @findex LC_CTYPE
25382 @c @findex LC_COLLATE
25383 @findex LC_MESSAGES
25384 @c @findex LC_MONETARY
25385 @c @findex LC_NUMERIC
25386 @c @findex LC_TIME
25387 @findex LC_ALL
25388 @cindex locale
25389 These environment variables control the way that GCC uses
25390 localization information which allows GCC to work with different
25391 national conventions.  GCC inspects the locale categories
25392 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
25393 so.  These locale categories can be set to any value supported by your
25394 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
25395 Kingdom encoded in UTF-8.
25397 The @env{LC_CTYPE} environment variable specifies character
25398 classification.  GCC uses it to determine the character boundaries in
25399 a string; this is needed for some multibyte encodings that contain quote
25400 and escape characters that are otherwise interpreted as a string
25401 end or escape.
25403 The @env{LC_MESSAGES} environment variable specifies the language to
25404 use in diagnostic messages.
25406 If the @env{LC_ALL} environment variable is set, it overrides the value
25407 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
25408 and @env{LC_MESSAGES} default to the value of the @env{LANG}
25409 environment variable.  If none of these variables are set, GCC
25410 defaults to traditional C English behavior.
25412 @item TMPDIR
25413 @findex TMPDIR
25414 If @env{TMPDIR} is set, it specifies the directory to use for temporary
25415 files.  GCC uses temporary files to hold the output of one stage of
25416 compilation which is to be used as input to the next stage: for example,
25417 the output of the preprocessor, which is the input to the compiler
25418 proper.
25420 @item GCC_COMPARE_DEBUG
25421 @findex GCC_COMPARE_DEBUG
25422 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
25423 @option{-fcompare-debug} to the compiler driver.  See the documentation
25424 of this option for more details.
25426 @item GCC_EXEC_PREFIX
25427 @findex GCC_EXEC_PREFIX
25428 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
25429 names of the subprograms executed by the compiler.  No slash is added
25430 when this prefix is combined with the name of a subprogram, but you can
25431 specify a prefix that ends with a slash if you wish.
25433 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
25434 an appropriate prefix to use based on the pathname it is invoked with.
25436 If GCC cannot find the subprogram using the specified prefix, it
25437 tries looking in the usual places for the subprogram.
25439 The default value of @env{GCC_EXEC_PREFIX} is
25440 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
25441 the installed compiler. In many cases @var{prefix} is the value
25442 of @code{prefix} when you ran the @file{configure} script.
25444 Other prefixes specified with @option{-B} take precedence over this prefix.
25446 This prefix is also used for finding files such as @file{crt0.o} that are
25447 used for linking.
25449 In addition, the prefix is used in an unusual way in finding the
25450 directories to search for header files.  For each of the standard
25451 directories whose name normally begins with @samp{/usr/local/lib/gcc}
25452 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
25453 replacing that beginning with the specified prefix to produce an
25454 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
25455 @file{foo/bar} just before it searches the standard directory 
25456 @file{/usr/local/lib/bar}.
25457 If a standard directory begins with the configured
25458 @var{prefix} then the value of @var{prefix} is replaced by
25459 @env{GCC_EXEC_PREFIX} when looking for header files.
25461 @item COMPILER_PATH
25462 @findex COMPILER_PATH
25463 The value of @env{COMPILER_PATH} is a colon-separated list of
25464 directories, much like @env{PATH}.  GCC tries the directories thus
25465 specified when searching for subprograms, if it can't find the
25466 subprograms using @env{GCC_EXEC_PREFIX}.
25468 @item LIBRARY_PATH
25469 @findex LIBRARY_PATH
25470 The value of @env{LIBRARY_PATH} is a colon-separated list of
25471 directories, much like @env{PATH}.  When configured as a native compiler,
25472 GCC tries the directories thus specified when searching for special
25473 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
25474 using GCC also uses these directories when searching for ordinary
25475 libraries for the @option{-l} option (but directories specified with
25476 @option{-L} come first).
25478 @item LANG
25479 @findex LANG
25480 @cindex locale definition
25481 This variable is used to pass locale information to the compiler.  One way in
25482 which this information is used is to determine the character set to be used
25483 when character literals, string literals and comments are parsed in C and C++.
25484 When the compiler is configured to allow multibyte characters,
25485 the following values for @env{LANG} are recognized:
25487 @table @samp
25488 @item C-JIS
25489 Recognize JIS characters.
25490 @item C-SJIS
25491 Recognize SJIS characters.
25492 @item C-EUCJP
25493 Recognize EUCJP characters.
25494 @end table
25496 If @env{LANG} is not defined, or if it has some other value, then the
25497 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
25498 recognize and translate multibyte characters.
25499 @end table
25501 @noindent
25502 Some additional environment variables affect the behavior of the
25503 preprocessor.
25505 @include cppenv.texi
25507 @c man end
25509 @node Precompiled Headers
25510 @section Using Precompiled Headers
25511 @cindex precompiled headers
25512 @cindex speed of compilation
25514 Often large projects have many header files that are included in every
25515 source file.  The time the compiler takes to process these header files
25516 over and over again can account for nearly all of the time required to
25517 build the project.  To make builds faster, GCC allows you to
25518 @dfn{precompile} a header file.
25520 To create a precompiled header file, simply compile it as you would any
25521 other file, if necessary using the @option{-x} option to make the driver
25522 treat it as a C or C++ header file.  You may want to use a
25523 tool like @command{make} to keep the precompiled header up-to-date when
25524 the headers it contains change.
25526 A precompiled header file is searched for when @code{#include} is
25527 seen in the compilation.  As it searches for the included file
25528 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
25529 compiler looks for a precompiled header in each directory just before it
25530 looks for the include file in that directory.  The name searched for is
25531 the name specified in the @code{#include} with @samp{.gch} appended.  If
25532 the precompiled header file can't be used, it is ignored.
25534 For instance, if you have @code{#include "all.h"}, and you have
25535 @file{all.h.gch} in the same directory as @file{all.h}, then the
25536 precompiled header file is used if possible, and the original
25537 header is used otherwise.
25539 Alternatively, you might decide to put the precompiled header file in a
25540 directory and use @option{-I} to ensure that directory is searched
25541 before (or instead of) the directory containing the original header.
25542 Then, if you want to check that the precompiled header file is always
25543 used, you can put a file of the same name as the original header in this
25544 directory containing an @code{#error} command.
25546 This also works with @option{-include}.  So yet another way to use
25547 precompiled headers, good for projects not designed with precompiled
25548 header files in mind, is to simply take most of the header files used by
25549 a project, include them from another header file, precompile that header
25550 file, and @option{-include} the precompiled header.  If the header files
25551 have guards against multiple inclusion, they are skipped because
25552 they've already been included (in the precompiled header).
25554 If you need to precompile the same header file for different
25555 languages, targets, or compiler options, you can instead make a
25556 @emph{directory} named like @file{all.h.gch}, and put each precompiled
25557 header in the directory, perhaps using @option{-o}.  It doesn't matter
25558 what you call the files in the directory; every precompiled header in
25559 the directory is considered.  The first precompiled header
25560 encountered in the directory that is valid for this compilation is
25561 used; they're searched in no particular order.
25563 There are many other possibilities, limited only by your imagination,
25564 good sense, and the constraints of your build system.
25566 A precompiled header file can be used only when these conditions apply:
25568 @itemize
25569 @item
25570 Only one precompiled header can be used in a particular compilation.
25572 @item
25573 A precompiled header can't be used once the first C token is seen.  You
25574 can have preprocessor directives before a precompiled header; you cannot
25575 include a precompiled header from inside another header.
25577 @item
25578 The precompiled header file must be produced for the same language as
25579 the current compilation.  You can't use a C precompiled header for a C++
25580 compilation.
25582 @item
25583 The precompiled header file must have been produced by the same compiler
25584 binary as the current compilation is using.
25586 @item
25587 Any macros defined before the precompiled header is included must
25588 either be defined in the same way as when the precompiled header was
25589 generated, or must not affect the precompiled header, which usually
25590 means that they don't appear in the precompiled header at all.
25592 The @option{-D} option is one way to define a macro before a
25593 precompiled header is included; using a @code{#define} can also do it.
25594 There are also some options that define macros implicitly, like
25595 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
25596 defined this way.
25598 @item If debugging information is output when using the precompiled
25599 header, using @option{-g} or similar, the same kind of debugging information
25600 must have been output when building the precompiled header.  However,
25601 a precompiled header built using @option{-g} can be used in a compilation
25602 when no debugging information is being output.
25604 @item The same @option{-m} options must generally be used when building
25605 and using the precompiled header.  @xref{Submodel Options},
25606 for any cases where this rule is relaxed.
25608 @item Each of the following options must be the same when building and using
25609 the precompiled header:
25611 @gccoptlist{-fexceptions}
25613 @item
25614 Some other command-line options starting with @option{-f},
25615 @option{-p}, or @option{-O} must be defined in the same way as when
25616 the precompiled header was generated.  At present, it's not clear
25617 which options are safe to change and which are not; the safest choice
25618 is to use exactly the same options when generating and using the
25619 precompiled header.  The following are known to be safe:
25621 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
25622 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
25623 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
25624 -pedantic-errors}
25626 @end itemize
25628 For all of these except the last, the compiler automatically
25629 ignores the precompiled header if the conditions aren't met.  If you
25630 find an option combination that doesn't work and doesn't cause the
25631 precompiled header to be ignored, please consider filing a bug report,
25632 see @ref{Bugs}.
25634 If you do use differing options when generating and using the
25635 precompiled header, the actual behavior is a mixture of the
25636 behavior for the options.  For instance, if you use @option{-g} to
25637 generate the precompiled header but not when using it, you may or may
25638 not get debugging information for routines in the precompiled header.