* doc/invoke.texi (RS/6000 and PowerPC Options): Document -mhtm and
[official-gcc.git] / gcc / doc / invoke.texi
blobfc66be55ba8d74989d999f94c2a62011e6f77f1c
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  -fcheck-new @gol
193 -fconstexpr-depth=@var{n}  -ffriend-injection @gol
194 -fno-elide-constructors @gol
195 -fno-enforce-eh-specs @gol
196 -ffor-scope  -fno-for-scope  -fno-gnu-keywords @gol
197 -fno-implicit-templates @gol
198 -fno-implicit-inline-templates @gol
199 -fno-implement-inlines  -fms-extensions @gol
200 -fno-nonansi-builtins  -fnothrow-opt  -fno-operator-names @gol
201 -fno-optional-diags  -fpermissive @gol
202 -fno-pretty-templates @gol
203 -frepo  -fno-rtti -fsized-deallocation @gol
204 -ftemplate-backtrace-limit=@var{n} @gol
205 -ftemplate-depth=@var{n} @gol
206 -fno-threadsafe-statics  -fuse-cxa-atexit @gol
207 -fno-weak  -nostdinc++ @gol
208 -fvisibility-inlines-hidden @gol
209 -fvisibility-ms-compat @gol
210 -fext-numeric-literals @gol
211 -Wabi=@var{n}  -Wabi-tag  -Wconversion-null  -Wctor-dtor-privacy @gol
212 -Wdelete-non-virtual-dtor -Wliteral-suffix -Wmultiple-inheritance @gol
213 -Wnamespaces -Wnarrowing @gol
214 -Wnoexcept -Wnon-virtual-dtor  -Wreorder @gol
215 -Weffc++  -Wstrict-null-sentinel -Wtemplates @gol
216 -Wno-non-template-friend  -Wold-style-cast @gol
217 -Woverloaded-virtual  -Wno-pmf-conversions @gol
218 -Wsign-promo -Wvirtual-inheritance}
220 @item Objective-C and Objective-C++ Language Options
221 @xref{Objective-C and Objective-C++ Dialect Options,,Options Controlling
222 Objective-C and Objective-C++ Dialects}.
223 @gccoptlist{-fconstant-string-class=@var{class-name} @gol
224 -fgnu-runtime  -fnext-runtime @gol
225 -fno-nil-receivers @gol
226 -fobjc-abi-version=@var{n} @gol
227 -fobjc-call-cxx-cdtors @gol
228 -fobjc-direct-dispatch @gol
229 -fobjc-exceptions @gol
230 -fobjc-gc @gol
231 -fobjc-nilcheck @gol
232 -fobjc-std=objc1 @gol
233 -fno-local-ivars @gol
234 -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]} @gol
235 -freplace-objc-classes @gol
236 -fzero-link @gol
237 -gen-decls @gol
238 -Wassign-intercept @gol
239 -Wno-protocol  -Wselector @gol
240 -Wstrict-selector-match @gol
241 -Wundeclared-selector}
243 @item Diagnostic Message Formatting Options
244 @xref{Diagnostic Message Formatting Options,,Options to Control Diagnostic Messages Formatting}.
245 @gccoptlist{-fmessage-length=@var{n}  @gol
246 -fdiagnostics-show-location=@r{[}once@r{|}every-line@r{]}  @gol
247 -fdiagnostics-color=@r{[}auto@r{|}never@r{|}always@r{]}  @gol
248 -fno-diagnostics-show-option -fno-diagnostics-show-caret}
250 @item Warning Options
251 @xref{Warning Options,,Options to Request or Suppress Warnings}.
252 @gccoptlist{-fsyntax-only  -fmax-errors=@var{n}  -Wpedantic @gol
253 -pedantic-errors @gol
254 -w  -Wextra  -Wall  -Waddress  -Waggregate-return  @gol
255 -Wno-aggressive-loop-optimizations -Warray-bounds -Warray-bounds=@var{n} @gol
256 -Wno-attributes -Wbool-compare -Wno-builtin-macro-redefined @gol
257 -Wc90-c99-compat -Wc99-c11-compat @gol
258 -Wc++-compat -Wc++11-compat -Wc++14-compat -Wcast-align  -Wcast-qual  @gol
259 -Wchar-subscripts -Wclobbered  -Wcomment -Wconditionally-supported  @gol
260 -Wconversion -Wcoverage-mismatch -Wno-cpp -Wdangling-else -Wdate-time @gol
261 -Wdelete-incomplete @gol
262 -Wno-deprecated -Wno-deprecated-declarations -Wno-designated-init @gol
263 -Wdisabled-optimization @gol
264 -Wno-discarded-qualifiers -Wno-discarded-array-qualifiers @gol
265 -Wno-div-by-zero -Wdouble-promotion -Wduplicated-cond @gol
266 -Wempty-body  -Wenum-compare -Wno-endif-labels @gol
267 -Werror  -Werror=* -Wfatal-errors -Wfloat-equal  -Wformat  -Wformat=2 @gol
268 -Wno-format-contains-nul -Wno-format-extra-args -Wformat-nonliteral @gol
269 -Wformat-security  -Wformat-signedness  -Wformat-y2k -Wframe-address @gol
270 -Wframe-larger-than=@var{len} -Wno-free-nonheap-object -Wjump-misses-init @gol
271 -Wignored-qualifiers  -Wignored-attributes  -Wincompatible-pointer-types @gol
272 -Wimplicit  -Wimplicit-function-declaration  -Wimplicit-int @gol
273 -Winit-self  -Winline  -Wno-int-conversion @gol
274 -Wno-int-to-pointer-cast -Winvalid-memory-model -Wno-invalid-offsetof @gol
275 -Winvalid-pch -Wlarger-than=@var{len} @gol
276 -Wlogical-op -Wlogical-not-parentheses -Wlong-long @gol
277 -Wmain -Wmaybe-uninitialized -Wmemset-elt-size -Wmemset-transposed-args @gol
278 -Wmisleading-indentation -Wmissing-braces @gol
279 -Wmissing-field-initializers -Wmissing-include-dirs @gol
280 -Wno-multichar -Wnonnull -Wnonnull-compare @gol
281 -Wnormalized=@r{[}none@r{|}id@r{|}nfc@r{|}nfkc@r{]} @gol
282 -Wnull-dereference -Wodr  -Wno-overflow  -Wopenmp-simd  @gol
283 -Woverride-init-side-effects -Woverlength-strings @gol
284 -Wpacked  -Wpacked-bitfield-compat  -Wpadded @gol
285 -Wparentheses -Wno-pedantic-ms-format @gol
286 -Wplacement-new -Wplacement-new=@var{n} @gol
287 -Wpointer-arith  -Wno-pointer-to-int-cast @gol
288 -Wno-pragmas -Wredundant-decls  -Wno-return-local-addr @gol
289 -Wreturn-type  -Wsequence-point  -Wshadow  -Wno-shadow-ivar @gol
290 -Wshift-overflow -Wshift-overflow=@var{n} @gol
291 -Wshift-count-negative -Wshift-count-overflow -Wshift-negative-value @gol
292 -Wsign-compare  -Wsign-conversion -Wfloat-conversion @gol
293 -Wno-scalar-storage-order @gol
294 -Wsizeof-pointer-memaccess  -Wsizeof-array-argument @gol
295 -Wstack-protector -Wstack-usage=@var{len} -Wstrict-aliasing @gol
296 -Wstrict-aliasing=n -Wstrict-overflow -Wstrict-overflow=@var{n} @gol
297 -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]} @gol
298 -Wsuggest-final-types @gol -Wsuggest-final-methods -Wsuggest-override @gol
299 -Wmissing-format-attribute -Wsubobject-linkage @gol
300 -Wswitch  -Wswitch-bool  -Wswitch-default  -Wswitch-enum @gol
301 -Wswitch-unreachable  -Wsync-nand @gol
302 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
303 -Wtype-limits  -Wundef @gol
304 -Wuninitialized  -Wunknown-pragmas  -Wunsafe-loop-optimizations @gol
305 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
306 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
307 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
308 -Wunused-const-variable -Wunused-const-variable=@var{n} @gol
309 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
310 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
311 -Wvla -Wvolatile-register-var  -Wwrite-strings @gol
312 -Wzero-as-null-pointer-constant -Whsa}
314 @item C and Objective-C-only Warning Options
315 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
316 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
317 -Wold-style-declaration  -Wold-style-definition @gol
318 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
319 -Wdeclaration-after-statement -Wpointer-sign}
321 @item Debugging Options
322 @xref{Debugging Options,,Options for Debugging Your Program}.
323 @gccoptlist{-g  -g@var{level}  -gcoff  -gdwarf -gdwarf-@var{version} @gol
324 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
325 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
326 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
327 -fdebug-prefix-map=@var{old}=@var{new} -fdebug-types-section @gol
328 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
329 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
330 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
331 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
332 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
333 -fvar-tracking -fvar-tracking-assignments}
335 @item Optimization Options
336 @xref{Optimize Options,,Options that Control Optimization}.
337 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
338 -falign-jumps[=@var{n}] @gol
339 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
340 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
341 -fauto-inc-dec -fbranch-probabilities @gol
342 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
343 -fbtr-bb-exclusive -fcaller-saves @gol
344 -fcombine-stack-adjustments -fconserve-stack @gol
345 -fcompare-elim -fcprop-registers -fcrossjumping @gol
346 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
347 -fcx-limited-range @gol
348 -fdata-sections -fdce -fdelayed-branch @gol
349 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively @gol
350 -fdevirtualize-at-ltrans -fdse @gol
351 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
352 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
353 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
354 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
355 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
356 -fif-conversion2 -findirect-inlining @gol
357 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
358 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-cp-alignment @gol
359 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
360 -fira-algorithm=@var{algorithm} @gol
361 -fira-region=@var{region} -fira-hoist-pressure @gol
362 -fira-loop-pressure -fno-ira-share-save-slots @gol
363 -fno-ira-share-spill-slots @gol
364 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
365 -fivopts -fkeep-inline-functions -fkeep-static-functions @gol
366 -fkeep-static-consts -flive-range-shrinkage @gol
367 -floop-block -floop-interchange -floop-strip-mine @gol
368 -floop-unroll-and-jam -floop-nest-optimize @gol
369 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
370 -flto-partition=@var{alg} -fmerge-all-constants @gol
371 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
372 -fmove-loop-invariants -fno-branch-count-reg @gol
373 -fno-defer-pop -fno-fp-int-builtin-inexact -fno-function-cse @gol
374 -fno-guess-branch-probability -fno-inline -fno-math-errno -fno-peephole @gol
375 -fno-peephole2 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
376 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
377 -fomit-frame-pointer -foptimize-sibling-calls @gol
378 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
379 -fprefetch-loop-arrays @gol
380 -fprofile-correction @gol
381 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
382 -fprofile-reorder-functions @gol
383 -freciprocal-math -free -frename-registers -freorder-blocks @gol
384 -freorder-blocks-algorithm=@var{algorithm} @gol
385 -freorder-blocks-and-partition -freorder-functions @gol
386 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
387 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
388 -fsched-spec-load -fsched-spec-load-dangerous @gol
389 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
390 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
391 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
392 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
393 -fschedule-fusion @gol
394 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
395 -fselective-scheduling -fselective-scheduling2 @gol
396 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
397 -fsemantic-interposition -fshrink-wrap -fsignaling-nans @gol
398 -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
399 -fsplit-paths @gol
400 -fsplit-wide-types -fssa-backprop -fssa-phiopt @gol
401 -fstdarg-opt -fstrict-aliasing @gol
402 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
403 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
404 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts @gol
405 -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
406 -ftree-loop-if-convert-stores -ftree-loop-im @gol
407 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
408 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
409 -ftree-loop-vectorize @gol
410 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
411 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
412 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
413 -ftree-vectorize -ftree-vrp -funconstrained-commons @gol
414 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
415 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
416 -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
417 -fweb -fwhole-program -fwpa -fuse-linker-plugin @gol
418 --param @var{name}=@var{value}
419 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
421 @item Program Instrumentation Options
422 @xref{Instrumentation Options,,Program Instrumentation Options}.
423 @gccoptlist{-p  -pg  -fprofile-arcs --coverage -ftest-coverage @gol
424 -fprofile-dir=@var{path} -fprofile-generate -fprofile-generate=@var{path} @gol
425 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
426 -fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
427 -fsanitize-undefined-trap-on-error -fbounds-check @gol
428 -fcheck-pointer-bounds -fchkp-check-incomplete-type @gol
429 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
430 -fchkp-narrow-to-innermost-array -fchkp-optimize @gol
431 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
432 -fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
433 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
434 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
435 -fchkp-instrument-calls -fchkp-instrument-marked-only @gol
436 -fchkp-use-wrappers @gol
437 -fstack-protector -fstack-protector-all -fstack-protector-strong @gol
438 -fstack-protector-explicit -fstack-check @gol
439 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
440 -fno-stack-limit -fsplit-stack @gol
441 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
442 -fvtv-counts -fvtv-debug @gol
443 -finstrument-functions @gol
444 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
445 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
447 @item Preprocessor Options
448 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
449 @gccoptlist{-A@var{question}=@var{answer} @gol
450 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
451 -C  -dD  -dI  -dM  -dN @gol
452 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
453 -idirafter @var{dir} @gol
454 -include @var{file}  -imacros @var{file} @gol
455 -iprefix @var{file}  -iwithprefix @var{dir} @gol
456 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
457 -imultilib @var{dir} -isysroot @var{dir} @gol
458 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
459 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
460 -remap -trigraphs  -undef  -U@var{macro}  @gol
461 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
463 @item Assembler Option
464 @xref{Assembler Options,,Passing Options to the Assembler}.
465 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
467 @item Linker Options
468 @xref{Link Options,,Options for Linking}.
469 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker} -l@var{library} @gol
470 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
471 -s  -static -static-libgcc -static-libstdc++ @gol
472 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
473 -static-libmpx -static-libmpxwrappers @gol
474 -shared -shared-libgcc  -symbolic @gol
475 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
476 -u @var{symbol} -z @var{keyword}}
478 @item Directory Options
479 @xref{Directory Options,,Options for Directory Search}.
480 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
481 -iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol
482 --sysroot=@var{dir} --no-sysroot-suffix}
484 @item Code Generation Options
485 @xref{Code Gen Options,,Options for Code Generation Conventions}.
486 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
487 -ffixed-@var{reg}  -fexceptions @gol
488 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
489 -fasynchronous-unwind-tables @gol
490 -fno-gnu-unique @gol
491 -finhibit-size-directive  -fno-common  -fno-ident @gol
492 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE -fno-plt @gol
493 -fno-jump-tables @gol
494 -frecord-gcc-switches @gol
495 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
496 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
497 -fleading-underscore  -ftls-model=@var{model} @gol
498 -fstack-reuse=@var{reuse_level} @gol
499 -ftrapv  -fwrapv @gol
500 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
501 -fstrict-volatile-bitfields -fsync-libcalls}
503 @item Developer Options
504 @xref{Developer Options,,GCC Developer Options}.
505 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
506 -fchecking -fchecking=@var{n} -fdbg-cnt-list @gol
507 -fdbg-cnt=@var{counter-value-list} @gol
508 -fdisable-ipa-@var{pass_name} @gol
509 -fdisable-rtl-@var{pass_name} @gol
510 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
511 -fdisable-tree-@var{pass_name} @gol
512 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
513 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
514 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
515 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
516 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
517 -fdump-passes @gol
518 -fdump-rtl-@var{pass} -fdump-rtl-@var{pass}=@var{filename} @gol
519 -fdump-statistics @gol
520 -fdump-tree-all @gol
521 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
522 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
523 -fdump-tree-cfg -fdump-tree-alias @gol
524 -fdump-tree-ch @gol
525 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
526 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
527 -fdump-tree-gimple@r{[}-raw@r{]} @gol
528 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
529 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
530 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
531 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
532 -fdump-tree-backprop@r{[}-@var{n}@r{]} @gol
533 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
534 -fdump-tree-nrv -fdump-tree-vect @gol
535 -fdump-tree-sink @gol
536 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
537 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
538 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
539 -fdump-tree-vtable-verify @gol
540 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
541 -fdump-tree-split-paths@r{[}-@var{n}@r{]} @gol
542 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
543 -fdump-final-insns=@var{file} @gol
544 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
545 -fenable-@var{kind}-@var{pass} @gol
546 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
547 -fira-verbose=@var{n} @gol
548 -flto-report -flto-report-wpa -fmem-report-wpa @gol
549 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report @gol
550 -fopt-info -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
551 -fprofile-report @gol
552 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
553 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
554 -fstats  -fstack-usage  -ftime-report @gol
555 -fvar-tracking-assignments-toggle -gtoggle @gol
556 -print-file-name=@var{library}  -print-libgcc-file-name @gol
557 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
558 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
559 -print-sysroot -print-sysroot-headers-suffix @gol
560 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
562 @item Machine-Dependent Options
563 @xref{Submodel Options,,Machine-Dependent Options}.
564 @c This list is ordered alphanumerically by subsection name.
565 @c Try and put the significant identifier (CPU or system) first,
566 @c so users have a clue at guessing where the ones they want will be.
568 @emph{AArch64 Options}
569 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
570 -mgeneral-regs-only @gol
571 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
572 -mstrict-align @gol
573 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
574 -mtls-dialect=desc  -mtls-dialect=traditional @gol
575 -mtls-size=@var{size} @gol
576 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
577 -mfix-cortex-a53-843419  -mno-fix-cortex-a53-843419 @gol
578 -mlow-precision-recip-sqrt -mno-low-precision-recip-sqrt@gol
579 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
581 @emph{Adapteva Epiphany Options}
582 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
583 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
584 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
585 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
586 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
587 -msplit-vecmove-early -m1reg-@var{reg}}
589 @emph{ARC Options}
590 @gccoptlist{-mbarrel-shifter @gol
591 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
592 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
593 -mea -mno-mpy -mmul32x16 -mmul64 -matomic @gol
594 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
595 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
596 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
597 -mlong-calls -mmedium-calls -msdata @gol
598 -mucb-mcount -mvolatile-cache -mtp-regno=@var{regno} @gol
599 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
600 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
601 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
602 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
603 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
604 -mtune=@var{cpu} -mmultcost=@var{num} @gol
605 -munalign-prob-threshold=@var{probability} -mmpy-option=@var{multo} @gol
606 -mdiv-rem -mcode-density -mll64 -mfpu=@var{fpu}}
608 @emph{ARM Options}
609 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
610 -mabi=@var{name} @gol
611 -mapcs-stack-check  -mno-apcs-stack-check @gol
612 -mapcs-float  -mno-apcs-float @gol
613 -mapcs-reentrant  -mno-apcs-reentrant @gol
614 -msched-prolog  -mno-sched-prolog @gol
615 -mlittle-endian  -mbig-endian @gol
616 -mfloat-abi=@var{name} @gol
617 -mfp16-format=@var{name}
618 -mthumb-interwork  -mno-thumb-interwork @gol
619 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
620 -mtune=@var{name} -mprint-tune-info @gol
621 -mstructure-size-boundary=@var{n} @gol
622 -mabort-on-noreturn @gol
623 -mlong-calls  -mno-long-calls @gol
624 -msingle-pic-base  -mno-single-pic-base @gol
625 -mpic-register=@var{reg} @gol
626 -mnop-fun-dllimport @gol
627 -mpoke-function-name @gol
628 -mthumb  -marm @gol
629 -mtpcs-frame  -mtpcs-leaf-frame @gol
630 -mcaller-super-interworking  -mcallee-super-interworking @gol
631 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
632 -mword-relocations @gol
633 -mfix-cortex-m3-ldrd @gol
634 -munaligned-access @gol
635 -mneon-for-64bits @gol
636 -mslow-flash-data @gol
637 -masm-syntax-unified @gol
638 -mrestrict-it}
640 @emph{AVR Options}
641 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
642 -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol
643 -mrelax -mrmw -mstrict-X -mtiny-stack -nodevicelib -Waddr-space-convert}
645 @emph{Blackfin Options}
646 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
647 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
648 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
649 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
650 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
651 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
652 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
653 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
654 -micplb}
656 @emph{C6X Options}
657 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
658 -msim -msdata=@var{sdata-type}}
660 @emph{CRIS Options}
661 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
662 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
663 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
664 -mstack-align  -mdata-align  -mconst-align @gol
665 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
666 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
667 -mmul-bug-workaround  -mno-mul-bug-workaround}
669 @emph{CR16 Options}
670 @gccoptlist{-mmac @gol
671 -mcr16cplus -mcr16c @gol
672 -msim -mint32 -mbit-ops
673 -mdata-model=@var{model}}
675 @emph{Darwin Options}
676 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
677 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
678 -client_name  -compatibility_version  -current_version @gol
679 -dead_strip @gol
680 -dependency-file  -dylib_file  -dylinker_install_name @gol
681 -dynamic  -dynamiclib  -exported_symbols_list @gol
682 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
683 -force_flat_namespace  -headerpad_max_install_names @gol
684 -iframework @gol
685 -image_base  -init  -install_name  -keep_private_externs @gol
686 -multi_module  -multiply_defined  -multiply_defined_unused @gol
687 -noall_load   -no_dead_strip_inits_and_terms @gol
688 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
689 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
690 -private_bundle  -read_only_relocs  -sectalign @gol
691 -sectobjectsymbols  -whyload  -seg1addr @gol
692 -sectcreate  -sectobjectsymbols  -sectorder @gol
693 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
694 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
695 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
696 -single_module  -static  -sub_library  -sub_umbrella @gol
697 -twolevel_namespace  -umbrella  -undefined @gol
698 -unexported_symbols_list  -weak_reference_mismatches @gol
699 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
700 -mkernel -mone-byte-bool}
702 @emph{DEC Alpha Options}
703 @gccoptlist{-mno-fp-regs  -msoft-float @gol
704 -mieee  -mieee-with-inexact  -mieee-conformant @gol
705 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
706 -mtrap-precision=@var{mode}  -mbuild-constants @gol
707 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
708 -mbwx  -mmax  -mfix  -mcix @gol
709 -mfloat-vax  -mfloat-ieee @gol
710 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
711 -msmall-text  -mlarge-text @gol
712 -mmemory-latency=@var{time}}
714 @emph{FR30 Options}
715 @gccoptlist{-msmall-model -mno-lsim}
717 @emph{FT32 Options}
718 @gccoptlist{-msim -mlra -mnodiv}
720 @emph{FRV Options}
721 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
722 -mhard-float  -msoft-float @gol
723 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
724 -mdouble  -mno-double @gol
725 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
726 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
727 -mlinked-fp  -mlong-calls  -malign-labels @gol
728 -mlibrary-pic  -macc-4  -macc-8 @gol
729 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
730 -moptimize-membar -mno-optimize-membar @gol
731 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
732 -mvliw-branch  -mno-vliw-branch @gol
733 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
734 -mno-nested-cond-exec  -mtomcat-stats @gol
735 -mTLS -mtls @gol
736 -mcpu=@var{cpu}}
738 @emph{GNU/Linux Options}
739 @gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
740 -tno-android-cc -tno-android-ld}
742 @emph{H8/300 Options}
743 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
745 @emph{HPPA Options}
746 @gccoptlist{-march=@var{architecture-type} @gol
747 -mdisable-fpregs  -mdisable-indexing @gol
748 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
749 -mfixed-range=@var{register-range} @gol
750 -mjump-in-delay -mlinker-opt -mlong-calls @gol
751 -mlong-load-store  -mno-disable-fpregs @gol
752 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
753 -mno-jump-in-delay  -mno-long-load-store @gol
754 -mno-portable-runtime  -mno-soft-float @gol
755 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
756 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
757 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
758 -munix=@var{unix-std}  -nolibdld  -static  -threads}
760 @emph{IA-64 Options}
761 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
762 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
763 -mconstant-gp  -mauto-pic  -mfused-madd @gol
764 -minline-float-divide-min-latency @gol
765 -minline-float-divide-max-throughput @gol
766 -mno-inline-float-divide @gol
767 -minline-int-divide-min-latency @gol
768 -minline-int-divide-max-throughput  @gol
769 -mno-inline-int-divide @gol
770 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
771 -mno-inline-sqrt @gol
772 -mdwarf2-asm -mearly-stop-bits @gol
773 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
774 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
775 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
776 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
777 -msched-spec-ldc -msched-spec-control-ldc @gol
778 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
779 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
780 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
781 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
783 @emph{LM32 Options}
784 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
785 -msign-extend-enabled -muser-enabled}
787 @emph{M32R/D Options}
788 @gccoptlist{-m32r2 -m32rx -m32r @gol
789 -mdebug @gol
790 -malign-loops -mno-align-loops @gol
791 -missue-rate=@var{number} @gol
792 -mbranch-cost=@var{number} @gol
793 -mmodel=@var{code-size-model-type} @gol
794 -msdata=@var{sdata-type} @gol
795 -mno-flush-func -mflush-func=@var{name} @gol
796 -mno-flush-trap -mflush-trap=@var{number} @gol
797 -G @var{num}}
799 @emph{M32C Options}
800 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
802 @emph{M680x0 Options}
803 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
804 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
805 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
806 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
807 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
808 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
809 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
810 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
811 -mxgot -mno-xgot}
813 @emph{MCore Options}
814 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
815 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
816 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
817 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
818 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
820 @emph{MeP Options}
821 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
822 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
823 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
824 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
825 -mtiny=@var{n}}
827 @emph{MicroBlaze Options}
828 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
829 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
830 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
831 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
832 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
834 @emph{MIPS Options}
835 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
836 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
837 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
838 -mips16  -mno-mips16  -mflip-mips16 @gol
839 -minterlink-compressed -mno-interlink-compressed @gol
840 -minterlink-mips16  -mno-interlink-mips16 @gol
841 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
842 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
843 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
844 -mno-float  -msingle-float  -mdouble-float @gol
845 -modd-spreg -mno-odd-spreg @gol
846 -mabs=@var{mode}  -mnan=@var{encoding} @gol
847 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
848 -mmcu -mmno-mcu @gol
849 -meva -mno-eva @gol
850 -mvirt -mno-virt @gol
851 -mxpa -mno-xpa @gol
852 -mmicromips -mno-micromips @gol
853 -mmsa -mno-msa @gol
854 -mfpu=@var{fpu-type} @gol
855 -msmartmips  -mno-smartmips @gol
856 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
857 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
858 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
859 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
860 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
861 -membedded-data  -mno-embedded-data @gol
862 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
863 -mcode-readable=@var{setting} @gol
864 -msplit-addresses  -mno-split-addresses @gol
865 -mexplicit-relocs  -mno-explicit-relocs @gol
866 -mcheck-zero-division  -mno-check-zero-division @gol
867 -mdivide-traps  -mdivide-breaks @gol
868 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
869 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
870 -mfix-24k -mno-fix-24k @gol
871 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
872 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
873 -mfix-vr4120  -mno-fix-vr4120 @gol
874 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
875 -mflush-func=@var{func}  -mno-flush-func @gol
876 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
877 -mcompact-branches=@var{policy} @gol
878 -mfp-exceptions -mno-fp-exceptions @gol
879 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
880 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address @gol
881 -mframe-header-opt -mno-frame-header-opt}
883 @emph{MMIX Options}
884 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
885 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
886 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
887 -mno-base-addresses  -msingle-exit  -mno-single-exit}
889 @emph{MN10300 Options}
890 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
891 -mno-am33 -mam33 -mam33-2 -mam34 @gol
892 -mtune=@var{cpu-type} @gol
893 -mreturn-pointer-on-d0 @gol
894 -mno-crt0  -mrelax -mliw -msetlb}
896 @emph{Moxie Options}
897 @gccoptlist{-meb -mel -mmul.x -mno-crt0}
899 @emph{MSP430 Options}
900 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
901 -mwarn-mcu @gol
902 -mcode-region= -mdata-region= @gol
903 -msilicon-errata= -msilicon-errata-warn= @gol
904 -mhwmult= -minrt}
906 @emph{NDS32 Options}
907 @gccoptlist{-mbig-endian -mlittle-endian @gol
908 -mreduced-regs -mfull-regs @gol
909 -mcmov -mno-cmov @gol
910 -mperf-ext -mno-perf-ext @gol
911 -mv3push -mno-v3push @gol
912 -m16bit -mno-16bit @gol
913 -misr-vector-size=@var{num} @gol
914 -mcache-block-size=@var{num} @gol
915 -march=@var{arch} @gol
916 -mcmodel=@var{code-model} @gol
917 -mctor-dtor -mrelax}
919 @emph{Nios II Options}
920 @gccoptlist{-G @var{num} -mgpopt=@var{option} -mgpopt -mno-gpopt @gol
921 -mel -meb @gol
922 -mno-bypass-cache -mbypass-cache @gol
923 -mno-cache-volatile -mcache-volatile @gol
924 -mno-fast-sw-div -mfast-sw-div @gol
925 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
926 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
927 -mcustom-fpu-cfg=@var{name} @gol
928 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name} @gol
929 -march=@var{arch} -mbmx -mno-bmx -mcdx -mno-cdx}
931 @emph{Nvidia PTX Options}
932 @gccoptlist{-m32 -m64 -mmainkernel -moptimize}
934 @emph{PDP-11 Options}
935 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
936 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
937 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
938 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
939 -mbranch-expensive  -mbranch-cheap @gol
940 -munix-asm  -mdec-asm}
942 @emph{picoChip Options}
943 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
944 -msymbol-as-address -mno-inefficient-warnings}
946 @emph{PowerPC Options}
947 See RS/6000 and PowerPC Options.
949 @emph{RL78 Options}
950 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
951 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14 @gol
952 -m64bit-doubles -m32bit-doubles -msave-mduc-in-interrupts}
954 @emph{RS/6000 and PowerPC Options}
955 @gccoptlist{-mcpu=@var{cpu-type} @gol
956 -mtune=@var{cpu-type} @gol
957 -mcmodel=@var{code-model} @gol
958 -mpowerpc64 @gol
959 -maltivec  -mno-altivec @gol
960 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
961 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
962 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
963 -mfprnd  -mno-fprnd @gol
964 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
965 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
966 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
967 -malign-power  -malign-natural @gol
968 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
969 -msingle-float -mdouble-float -msimple-fpu @gol
970 -mstring  -mno-string  -mupdate  -mno-update @gol
971 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
972 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
973 -mstrict-align  -mno-strict-align  -mrelocatable @gol
974 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
975 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
976 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
977 -mprioritize-restricted-insns=@var{priority} @gol
978 -msched-costly-dep=@var{dependence_type} @gol
979 -minsert-sched-nops=@var{scheme} @gol
980 -mcall-sysv  -mcall-netbsd @gol
981 -maix-struct-return  -msvr4-struct-return @gol
982 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
983 -mblock-move-inline-limit=@var{num} @gol
984 -misel -mno-isel @gol
985 -misel=yes  -misel=no @gol
986 -mspe -mno-spe @gol
987 -mspe=yes  -mspe=no @gol
988 -mpaired @gol
989 -mgen-cell-microcode -mwarn-cell-microcode @gol
990 -mvrsave -mno-vrsave @gol
991 -mmulhw -mno-mulhw @gol
992 -mdlmzb -mno-dlmzb @gol
993 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
994 -mprototype  -mno-prototype @gol
995 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
996 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
997 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
998 -mno-recip-precision @gol
999 -mveclibabi=@var{type} -mfriz -mno-friz @gol
1000 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
1001 -msave-toc-indirect -mno-save-toc-indirect @gol
1002 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
1003 -mcrypto -mno-crypto -mhtm -mno-htm -mdirect-move -mno-direct-move @gol
1004 -mquad-memory -mno-quad-memory @gol
1005 -mquad-memory-atomic -mno-quad-memory-atomic @gol
1006 -mcompat-align-parm -mno-compat-align-parm @gol
1007 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf -mno-upper-regs-sf @gol
1008 -mupper-regs -mno-upper-regs -mmodulo -mno-modulo @gol
1009 -mfloat128 -mno-float128 -mfloat128-hardware -mno-float128-hardware @gol
1010 -mpower9-fusion -mno-mpower9-fusion -mpower9-vector -mno-power9-vector @gol
1011 -mpower9-dform -mno-power9-dform -mlra -mno-lra}
1013 @emph{RX Options}
1014 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1015 -mcpu=@gol
1016 -mbig-endian-data -mlittle-endian-data @gol
1017 -msmall-data @gol
1018 -msim  -mno-sim@gol
1019 -mas100-syntax -mno-as100-syntax@gol
1020 -mrelax@gol
1021 -mmax-constant-size=@gol
1022 -mint-register=@gol
1023 -mpid@gol
1024 -mallow-string-insns -mno-allow-string-insns@gol
1025 -mjsr@gol
1026 -mno-warn-multiple-fast-interrupts@gol
1027 -msave-acc-in-interrupts}
1029 @emph{S/390 and zSeries Options}
1030 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1031 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
1032 -mlong-double-64 -mlong-double-128 @gol
1033 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
1034 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
1035 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1036 -mhtm -mvx -mzvector @gol
1037 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1038 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
1039 -mhotpatch=@var{halfwords},@var{halfwords}}
1041 @emph{Score Options}
1042 @gccoptlist{-meb -mel @gol
1043 -mnhwloop @gol
1044 -muls @gol
1045 -mmac @gol
1046 -mscore5 -mscore5u -mscore7 -mscore7d}
1048 @emph{SH Options}
1049 @gccoptlist{-m1  -m2  -m2e @gol
1050 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
1051 -m3  -m3e @gol
1052 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1053 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
1054 -mb  -ml  -mdalign  -mrelax @gol
1055 -mbigtable -mfmovd -mrenesas -mno-renesas -mnomacsave @gol
1056 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
1057 -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
1058 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
1059 -maccumulate-outgoing-args @gol
1060 -matomic-model=@var{atomic-model} @gol
1061 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
1062 -mcbranch-force-delay-slot @gol
1063 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
1064 -mpretend-cmove -mtas}
1066 @emph{Solaris 2 Options}
1067 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
1068 -pthreads -pthread}
1070 @emph{SPARC Options}
1071 @gccoptlist{-mcpu=@var{cpu-type} @gol
1072 -mtune=@var{cpu-type} @gol
1073 -mcmodel=@var{code-model} @gol
1074 -mmemory-model=@var{mem-model} @gol
1075 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1076 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1077 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1078 -mhard-quad-float  -msoft-quad-float @gol
1079 -mstack-bias  -mno-stack-bias @gol
1080 -mstd-struct-return  -mno-std-struct-return @gol
1081 -munaligned-doubles  -mno-unaligned-doubles @gol
1082 -muser-mode  -mno-user-mode @gol
1083 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1084 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1085 -mcbcond -mno-cbcond @gol
1086 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1087 -mfix-at697f -mfix-ut699}
1089 @emph{SPU Options}
1090 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1091 -msafe-dma -munsafe-dma @gol
1092 -mbranch-hints @gol
1093 -msmall-mem -mlarge-mem -mstdmain @gol
1094 -mfixed-range=@var{register-range} @gol
1095 -mea32 -mea64 @gol
1096 -maddress-space-conversion -mno-address-space-conversion @gol
1097 -mcache-size=@var{cache-size} @gol
1098 -matomic-updates -mno-atomic-updates}
1100 @emph{System V Options}
1101 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1103 @emph{TILE-Gx Options}
1104 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1105 -mcmodel=@var{code-model}}
1107 @emph{TILEPro Options}
1108 @gccoptlist{-mcpu=@var{cpu} -m32}
1110 @emph{V850 Options}
1111 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1112 -mprolog-function  -mno-prolog-function  -mspace @gol
1113 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1114 -mapp-regs  -mno-app-regs @gol
1115 -mdisable-callt  -mno-disable-callt @gol
1116 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1117 -mv850e -mv850 -mv850e3v5 @gol
1118 -mloop @gol
1119 -mrelax @gol
1120 -mlong-jumps @gol
1121 -msoft-float @gol
1122 -mhard-float @gol
1123 -mgcc-abi @gol
1124 -mrh850-abi @gol
1125 -mbig-switch}
1127 @emph{VAX Options}
1128 @gccoptlist{-mg  -mgnu  -munix}
1130 @emph{Visium Options}
1131 @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol
1132 -mcpu=@var{cpu-type} -mtune=@var{cpu-type} -msv-mode -muser-mode}
1134 @emph{VMS Options}
1135 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1136 -mpointer-size=@var{size}}
1138 @emph{VxWorks Options}
1139 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1140 -Xbind-lazy  -Xbind-now}
1142 @emph{x86 Options}
1143 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1144 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
1145 -mfpmath=@var{unit} @gol
1146 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1147 -mno-fp-ret-in-387  -msoft-float @gol
1148 -mno-wide-multiply  -mrtd  -malign-double @gol
1149 -mpreferred-stack-boundary=@var{num} @gol
1150 -mincoming-stack-boundary=@var{num} @gol
1151 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
1152 -mrecip -mrecip=@var{opt} @gol
1153 -mvzeroupper -mprefer-avx128 @gol
1154 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
1155 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl @gol
1156 -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi -msha -maes @gol
1157 -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
1158 -mprefetchwt1 -mclflushopt -mxsavec -mxsaves @gol
1159 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
1160 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mclzero
1161 -mpku -mthreads @gol
1162 -mms-bitfields -mno-align-stringops  -minline-all-stringops @gol
1163 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
1164 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} @gol
1165 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1166 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
1167 -mregparm=@var{num}  -msseregparm @gol
1168 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
1169 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
1170 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
1171 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
1172 -m32 -m64 -mx32 -m16 -miamcu -mlarge-data-threshold=@var{num} @gol
1173 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
1174 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
1175 -malign-data=@var{type} -mstack-protector-guard=@var{guard} @gol
1176 -mmitigate-rop -mgeneral-regs-only}
1178 @emph{x86 Windows Options}
1179 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
1180 -mnop-fun-dllimport -mthread @gol
1181 -municode -mwin32 -mwindows -fno-set-stack-executable}
1183 @emph{Xstormy16 Options}
1184 @gccoptlist{-msim}
1186 @emph{Xtensa Options}
1187 @gccoptlist{-mconst16 -mno-const16 @gol
1188 -mfused-madd  -mno-fused-madd @gol
1189 -mforce-no-pic @gol
1190 -mserialize-volatile  -mno-serialize-volatile @gol
1191 -mtext-section-literals  -mno-text-section-literals @gol
1192 -mauto-litpools  -mno-auto-litpools @gol
1193 -mtarget-align  -mno-target-align @gol
1194 -mlongcalls  -mno-longcalls}
1196 @emph{zSeries Options}
1197 See S/390 and zSeries Options.
1198 @end table
1201 @node Overall Options
1202 @section Options Controlling the Kind of Output
1204 Compilation can involve up to four stages: preprocessing, compilation
1205 proper, assembly and linking, always in that order.  GCC is capable of
1206 preprocessing and compiling several files either into several
1207 assembler input files, or into one assembler input file; then each
1208 assembler input file produces an object file, and linking combines all
1209 the object files (those newly compiled, and those specified as input)
1210 into an executable file.
1212 @cindex file name suffix
1213 For any given input file, the file name suffix determines what kind of
1214 compilation is done:
1216 @table @gcctabopt
1217 @item @var{file}.c
1218 C source code that must be preprocessed.
1220 @item @var{file}.i
1221 C source code that should not be preprocessed.
1223 @item @var{file}.ii
1224 C++ source code that should not be preprocessed.
1226 @item @var{file}.m
1227 Objective-C source code.  Note that you must link with the @file{libobjc}
1228 library to make an Objective-C program work.
1230 @item @var{file}.mi
1231 Objective-C source code that should not be preprocessed.
1233 @item @var{file}.mm
1234 @itemx @var{file}.M
1235 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1236 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1237 to a literal capital M@.
1239 @item @var{file}.mii
1240 Objective-C++ source code that should not be preprocessed.
1242 @item @var{file}.h
1243 C, C++, Objective-C or Objective-C++ header file to be turned into a
1244 precompiled header (default), or C, C++ header file to be turned into an
1245 Ada spec (via the @option{-fdump-ada-spec} switch).
1247 @item @var{file}.cc
1248 @itemx @var{file}.cp
1249 @itemx @var{file}.cxx
1250 @itemx @var{file}.cpp
1251 @itemx @var{file}.CPP
1252 @itemx @var{file}.c++
1253 @itemx @var{file}.C
1254 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1255 the last two letters must both be literally @samp{x}.  Likewise,
1256 @samp{.C} refers to a literal capital C@.
1258 @item @var{file}.mm
1259 @itemx @var{file}.M
1260 Objective-C++ source code that must be preprocessed.
1262 @item @var{file}.mii
1263 Objective-C++ source code that should not be preprocessed.
1265 @item @var{file}.hh
1266 @itemx @var{file}.H
1267 @itemx @var{file}.hp
1268 @itemx @var{file}.hxx
1269 @itemx @var{file}.hpp
1270 @itemx @var{file}.HPP
1271 @itemx @var{file}.h++
1272 @itemx @var{file}.tcc
1273 C++ header file to be turned into a precompiled header or Ada spec.
1275 @item @var{file}.f
1276 @itemx @var{file}.for
1277 @itemx @var{file}.ftn
1278 Fixed form Fortran source code that should not be preprocessed.
1280 @item @var{file}.F
1281 @itemx @var{file}.FOR
1282 @itemx @var{file}.fpp
1283 @itemx @var{file}.FPP
1284 @itemx @var{file}.FTN
1285 Fixed form Fortran source code that must be preprocessed (with the traditional
1286 preprocessor).
1288 @item @var{file}.f90
1289 @itemx @var{file}.f95
1290 @itemx @var{file}.f03
1291 @itemx @var{file}.f08
1292 Free form Fortran source code that should not be preprocessed.
1294 @item @var{file}.F90
1295 @itemx @var{file}.F95
1296 @itemx @var{file}.F03
1297 @itemx @var{file}.F08
1298 Free form Fortran source code that must be preprocessed (with the
1299 traditional preprocessor).
1301 @item @var{file}.go
1302 Go source code.
1304 @c FIXME: Descriptions of Java file types.
1305 @c @var{file}.java
1306 @c @var{file}.class
1307 @c @var{file}.zip
1308 @c @var{file}.jar
1310 @item @var{file}.ads
1311 Ada source code file that contains a library unit declaration (a
1312 declaration of a package, subprogram, or generic, or a generic
1313 instantiation), or a library unit renaming declaration (a package,
1314 generic, or subprogram renaming declaration).  Such files are also
1315 called @dfn{specs}.
1317 @item @var{file}.adb
1318 Ada source code file containing a library unit body (a subprogram or
1319 package body).  Such files are also called @dfn{bodies}.
1321 @c GCC also knows about some suffixes for languages not yet included:
1322 @c Pascal:
1323 @c @var{file}.p
1324 @c @var{file}.pas
1325 @c Ratfor:
1326 @c @var{file}.r
1328 @item @var{file}.s
1329 Assembler code.
1331 @item @var{file}.S
1332 @itemx @var{file}.sx
1333 Assembler code that must be preprocessed.
1335 @item @var{other}
1336 An object file to be fed straight into linking.
1337 Any file name with no recognized suffix is treated this way.
1338 @end table
1340 @opindex x
1341 You can specify the input language explicitly with the @option{-x} option:
1343 @table @gcctabopt
1344 @item -x @var{language}
1345 Specify explicitly the @var{language} for the following input files
1346 (rather than letting the compiler choose a default based on the file
1347 name suffix).  This option applies to all following input files until
1348 the next @option{-x} option.  Possible values for @var{language} are:
1349 @smallexample
1350 c  c-header  cpp-output
1351 c++  c++-header  c++-cpp-output
1352 objective-c  objective-c-header  objective-c-cpp-output
1353 objective-c++ objective-c++-header objective-c++-cpp-output
1354 assembler  assembler-with-cpp
1356 f77  f77-cpp-input f95  f95-cpp-input
1358 java
1359 @end smallexample
1361 @item -x none
1362 Turn off any specification of a language, so that subsequent files are
1363 handled according to their file name suffixes (as they are if @option{-x}
1364 has not been used at all).
1365 @end table
1367 If you only want some of the stages of compilation, you can use
1368 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1369 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1370 @command{gcc} is to stop.  Note that some combinations (for example,
1371 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1373 @table @gcctabopt
1374 @item -c
1375 @opindex c
1376 Compile or assemble the source files, but do not link.  The linking
1377 stage simply is not done.  The ultimate output is in the form of an
1378 object file for each source file.
1380 By default, the object file name for a source file is made by replacing
1381 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1383 Unrecognized input files, not requiring compilation or assembly, are
1384 ignored.
1386 @item -S
1387 @opindex S
1388 Stop after the stage of compilation proper; do not assemble.  The output
1389 is in the form of an assembler code file for each non-assembler input
1390 file specified.
1392 By default, the assembler file name for a source file is made by
1393 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1395 Input files that don't require compilation are ignored.
1397 @item -E
1398 @opindex E
1399 Stop after the preprocessing stage; do not run the compiler proper.  The
1400 output is in the form of preprocessed source code, which is sent to the
1401 standard output.
1403 Input files that don't require preprocessing are ignored.
1405 @cindex output file option
1406 @item -o @var{file}
1407 @opindex o
1408 Place output in file @var{file}.  This applies to whatever
1409 sort of output is being produced, whether it be an executable file,
1410 an object file, an assembler file or preprocessed C code.
1412 If @option{-o} is not specified, the default is to put an executable
1413 file in @file{a.out}, the object file for
1414 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1415 assembler file in @file{@var{source}.s}, a precompiled header file in
1416 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1417 standard output.
1419 @item -v
1420 @opindex v
1421 Print (on standard error output) the commands executed to run the stages
1422 of compilation.  Also print the version number of the compiler driver
1423 program and of the preprocessor and the compiler proper.
1425 @item -###
1426 @opindex ###
1427 Like @option{-v} except the commands are not executed and arguments
1428 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1429 This is useful for shell scripts to capture the driver-generated command lines.
1431 @item --help
1432 @opindex help
1433 Print (on the standard output) a description of the command-line options
1434 understood by @command{gcc}.  If the @option{-v} option is also specified
1435 then @option{--help} is also passed on to the various processes
1436 invoked by @command{gcc}, so that they can display the command-line options
1437 they accept.  If the @option{-Wextra} option has also been specified
1438 (prior to the @option{--help} option), then command-line options that
1439 have no documentation associated with them are also displayed.
1441 @item --target-help
1442 @opindex target-help
1443 Print (on the standard output) a description of target-specific command-line
1444 options for each tool.  For some targets extra target-specific
1445 information may also be printed.
1447 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1448 Print (on the standard output) a description of the command-line
1449 options understood by the compiler that fit into all specified classes
1450 and qualifiers.  These are the supported classes:
1452 @table @asis
1453 @item @samp{optimizers}
1454 Display all of the optimization options supported by the
1455 compiler.
1457 @item @samp{warnings}
1458 Display all of the options controlling warning messages
1459 produced by the compiler.
1461 @item @samp{target}
1462 Display target-specific options.  Unlike the
1463 @option{--target-help} option however, target-specific options of the
1464 linker and assembler are not displayed.  This is because those
1465 tools do not currently support the extended @option{--help=} syntax.
1467 @item @samp{params}
1468 Display the values recognized by the @option{--param}
1469 option.
1471 @item @var{language}
1472 Display the options supported for @var{language}, where
1473 @var{language} is the name of one of the languages supported in this
1474 version of GCC@.
1476 @item @samp{common}
1477 Display the options that are common to all languages.
1478 @end table
1480 These are the supported qualifiers:
1482 @table @asis
1483 @item @samp{undocumented}
1484 Display only those options that are undocumented.
1486 @item @samp{joined}
1487 Display options taking an argument that appears after an equal
1488 sign in the same continuous piece of text, such as:
1489 @samp{--help=target}.
1491 @item @samp{separate}
1492 Display options taking an argument that appears as a separate word
1493 following the original option, such as: @samp{-o output-file}.
1494 @end table
1496 Thus for example to display all the undocumented target-specific
1497 switches supported by the compiler, use:
1499 @smallexample
1500 --help=target,undocumented
1501 @end smallexample
1503 The sense of a qualifier can be inverted by prefixing it with the
1504 @samp{^} character, so for example to display all binary warning
1505 options (i.e., ones that are either on or off and that do not take an
1506 argument) that have a description, use:
1508 @smallexample
1509 --help=warnings,^joined,^undocumented
1510 @end smallexample
1512 The argument to @option{--help=} should not consist solely of inverted
1513 qualifiers.
1515 Combining several classes is possible, although this usually
1516 restricts the output so much that there is nothing to display.  One
1517 case where it does work, however, is when one of the classes is
1518 @var{target}.  For example, to display all the target-specific
1519 optimization options, use:
1521 @smallexample
1522 --help=target,optimizers
1523 @end smallexample
1525 The @option{--help=} option can be repeated on the command line.  Each
1526 successive use displays its requested class of options, skipping
1527 those that have already been displayed.
1529 If the @option{-Q} option appears on the command line before the
1530 @option{--help=} option, then the descriptive text displayed by
1531 @option{--help=} is changed.  Instead of describing the displayed
1532 options, an indication is given as to whether the option is enabled,
1533 disabled or set to a specific value (assuming that the compiler
1534 knows this at the point where the @option{--help=} option is used).
1536 Here is a truncated example from the ARM port of @command{gcc}:
1538 @smallexample
1539   % gcc -Q -mabi=2 --help=target -c
1540   The following options are target specific:
1541   -mabi=                                2
1542   -mabort-on-noreturn                   [disabled]
1543   -mapcs                                [disabled]
1544 @end smallexample
1546 The output is sensitive to the effects of previous command-line
1547 options, so for example it is possible to find out which optimizations
1548 are enabled at @option{-O2} by using:
1550 @smallexample
1551 -Q -O2 --help=optimizers
1552 @end smallexample
1554 Alternatively you can discover which binary optimizations are enabled
1555 by @option{-O3} by using:
1557 @smallexample
1558 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1559 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1560 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1561 @end smallexample
1563 @item --version
1564 @opindex version
1565 Display the version number and copyrights of the invoked GCC@.
1567 @item -pass-exit-codes
1568 @opindex pass-exit-codes
1569 Normally the @command{gcc} program exits with the code of 1 if any
1570 phase of the compiler returns a non-success return code.  If you specify
1571 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1572 the numerically highest error produced by any phase returning an error
1573 indication.  The C, C++, and Fortran front ends return 4 if an internal
1574 compiler error is encountered.
1576 @item -pipe
1577 @opindex pipe
1578 Use pipes rather than temporary files for communication between the
1579 various stages of compilation.  This fails to work on some systems where
1580 the assembler is unable to read from a pipe; but the GNU assembler has
1581 no trouble.
1583 @item -specs=@var{file}
1584 @opindex specs
1585 Process @var{file} after the compiler reads in the standard @file{specs}
1586 file, in order to override the defaults which the @command{gcc} driver
1587 program uses when determining what switches to pass to @command{cc1},
1588 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1589 @option{-specs=@var{file}} can be specified on the command line, and they
1590 are processed in order, from left to right.  @xref{Spec Files}, for
1591 information about the format of the @var{file}.
1593 @item -wrapper
1594 @opindex wrapper
1595 Invoke all subcommands under a wrapper program.  The name of the
1596 wrapper program and its parameters are passed as a comma separated
1597 list.
1599 @smallexample
1600 gcc -c t.c -wrapper gdb,--args
1601 @end smallexample
1603 @noindent
1604 This invokes all subprograms of @command{gcc} under
1605 @samp{gdb --args}, thus the invocation of @command{cc1} is
1606 @samp{gdb --args cc1 @dots{}}.
1608 @item -fplugin=@var{name}.so
1609 @opindex fplugin
1610 Load the plugin code in file @var{name}.so, assumed to be a
1611 shared object to be dlopen'd by the compiler.  The base name of
1612 the shared object file is used to identify the plugin for the
1613 purposes of argument parsing (See
1614 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1615 Each plugin should define the callback functions specified in the
1616 Plugins API.
1618 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1619 @opindex fplugin-arg
1620 Define an argument called @var{key} with a value of @var{value}
1621 for the plugin called @var{name}.
1623 @item -fdump-ada-spec@r{[}-slim@r{]}
1624 @opindex fdump-ada-spec
1625 For C and C++ source and include files, generate corresponding Ada specs.
1626 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1627 GNAT User's Guide}, which provides detailed documentation on this feature.
1629 @item -fada-spec-parent=@var{unit}
1630 @opindex fada-spec-parent
1631 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1632 Ada specs as child units of parent @var{unit}.
1634 @item -fdump-go-spec=@var{file}
1635 @opindex fdump-go-spec
1636 For input files in any language, generate corresponding Go
1637 declarations in @var{file}.  This generates Go @code{const},
1638 @code{type}, @code{var}, and @code{func} declarations which may be a
1639 useful way to start writing a Go interface to code written in some
1640 other language.
1642 @include @value{srcdir}/../libiberty/at-file.texi
1643 @end table
1645 @node Invoking G++
1646 @section Compiling C++ Programs
1648 @cindex suffixes for C++ source
1649 @cindex C++ source file suffixes
1650 C++ source files conventionally use one of the suffixes @samp{.C},
1651 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1652 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1653 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1654 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1655 files with these names and compiles them as C++ programs even if you
1656 call the compiler the same way as for compiling C programs (usually
1657 with the name @command{gcc}).
1659 @findex g++
1660 @findex c++
1661 However, the use of @command{gcc} does not add the C++ library.
1662 @command{g++} is a program that calls GCC and automatically specifies linking
1663 against the C++ library.  It treats @samp{.c},
1664 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1665 files unless @option{-x} is used.  This program is also useful when
1666 precompiling a C header file with a @samp{.h} extension for use in C++
1667 compilations.  On many systems, @command{g++} is also installed with
1668 the name @command{c++}.
1670 @cindex invoking @command{g++}
1671 When you compile C++ programs, you may specify many of the same
1672 command-line options that you use for compiling programs in any
1673 language; or command-line options meaningful for C and related
1674 languages; or options that are meaningful only for C++ programs.
1675 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1676 explanations of options for languages related to C@.
1677 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1678 explanations of options that are meaningful only for C++ programs.
1680 @node C Dialect Options
1681 @section Options Controlling C Dialect
1682 @cindex dialect options
1683 @cindex language dialect options
1684 @cindex options, dialect
1686 The following options control the dialect of C (or languages derived
1687 from C, such as C++, Objective-C and Objective-C++) that the compiler
1688 accepts:
1690 @table @gcctabopt
1691 @cindex ANSI support
1692 @cindex ISO support
1693 @item -ansi
1694 @opindex ansi
1695 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1696 equivalent to @option{-std=c++98}.
1698 This turns off certain features of GCC that are incompatible with ISO
1699 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1700 such as the @code{asm} and @code{typeof} keywords, and
1701 predefined macros such as @code{unix} and @code{vax} that identify the
1702 type of system you are using.  It also enables the undesirable and
1703 rarely used ISO trigraph feature.  For the C compiler,
1704 it disables recognition of C++ style @samp{//} comments as well as
1705 the @code{inline} keyword.
1707 The alternate keywords @code{__asm__}, @code{__extension__},
1708 @code{__inline__} and @code{__typeof__} continue to work despite
1709 @option{-ansi}.  You would not want to use them in an ISO C program, of
1710 course, but it is useful to put them in header files that might be included
1711 in compilations done with @option{-ansi}.  Alternate predefined macros
1712 such as @code{__unix__} and @code{__vax__} are also available, with or
1713 without @option{-ansi}.
1715 The @option{-ansi} option does not cause non-ISO programs to be
1716 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1717 addition to @option{-ansi}.  @xref{Warning Options}.
1719 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1720 option is used.  Some header files may notice this macro and refrain
1721 from declaring certain functions or defining certain macros that the
1722 ISO standard doesn't call for; this is to avoid interfering with any
1723 programs that might use these names for other things.
1725 Functions that are normally built in but do not have semantics
1726 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1727 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1728 built-in functions provided by GCC}, for details of the functions
1729 affected.
1731 @item -std=
1732 @opindex std
1733 Determine the language standard. @xref{Standards,,Language Standards
1734 Supported by GCC}, for details of these standard versions.  This option
1735 is currently only supported when compiling C or C++.
1737 The compiler can accept several base standards, such as @samp{c90} or
1738 @samp{c++98}, and GNU dialects of those standards, such as
1739 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1740 compiler accepts all programs following that standard plus those
1741 using GNU extensions that do not contradict it.  For example,
1742 @option{-std=c90} turns off certain features of GCC that are
1743 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1744 keywords, but not other GNU extensions that do not have a meaning in
1745 ISO C90, such as omitting the middle term of a @code{?:}
1746 expression. On the other hand, when a GNU dialect of a standard is
1747 specified, all features supported by the compiler are enabled, even when
1748 those features change the meaning of the base standard.  As a result, some
1749 strict-conforming programs may be rejected.  The particular standard
1750 is used by @option{-Wpedantic} to identify which features are GNU
1751 extensions given that version of the standard. For example
1752 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1753 comments, while @option{-std=gnu99 -Wpedantic} does not.
1755 A value for this option must be provided; possible values are
1757 @table @samp
1758 @item c90
1759 @itemx c89
1760 @itemx iso9899:1990
1761 Support all ISO C90 programs (certain GNU extensions that conflict
1762 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1764 @item iso9899:199409
1765 ISO C90 as modified in amendment 1.
1767 @item c99
1768 @itemx c9x
1769 @itemx iso9899:1999
1770 @itemx iso9899:199x
1771 ISO C99.  This standard is substantially completely supported, modulo
1772 bugs and floating-point issues
1773 (mainly but not entirely relating to optional C99 features from
1774 Annexes F and G).  See
1775 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1776 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1778 @item c11
1779 @itemx c1x
1780 @itemx iso9899:2011
1781 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1782 substantially completely supported, modulo bugs, floating-point issues
1783 (mainly but not entirely relating to optional C11 features from
1784 Annexes F and G) and the optional Annexes K (Bounds-checking
1785 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1787 @item gnu90
1788 @itemx gnu89
1789 GNU dialect of ISO C90 (including some C99 features).
1791 @item gnu99
1792 @itemx gnu9x
1793 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1795 @item gnu11
1796 @itemx gnu1x
1797 GNU dialect of ISO C11.  This is the default for C code.
1798 The name @samp{gnu1x} is deprecated.
1800 @item c++98
1801 @itemx c++03
1802 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1803 additional defect reports. Same as @option{-ansi} for C++ code.
1805 @item gnu++98
1806 @itemx gnu++03
1807 GNU dialect of @option{-std=c++98}.
1809 @item c++11
1810 @itemx c++0x
1811 The 2011 ISO C++ standard plus amendments.
1812 The name @samp{c++0x} is deprecated.
1814 @item gnu++11
1815 @itemx gnu++0x
1816 GNU dialect of @option{-std=c++11}.
1817 The name @samp{gnu++0x} is deprecated.
1819 @item c++14
1820 @itemx c++1y
1821 The 2014 ISO C++ standard plus amendments.
1822 The name @samp{c++1y} is deprecated.
1824 @item gnu++14
1825 @itemx gnu++1y
1826 GNU dialect of @option{-std=c++14}.
1827 This is the default for C++ code.
1828 The name @samp{gnu++1y} is deprecated.
1830 @item c++1z
1831 The next revision of the ISO C++ standard, tentatively planned for
1832 2017.  Support is highly experimental, and will almost certainly
1833 change in incompatible ways in future releases.
1835 @item gnu++1z
1836 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1837 and will almost certainly change in incompatible ways in future
1838 releases.
1839 @end table
1841 @item -fgnu89-inline
1842 @opindex fgnu89-inline
1843 The option @option{-fgnu89-inline} tells GCC to use the traditional
1844 GNU semantics for @code{inline} functions when in C99 mode.
1845 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1846 Using this option is roughly equivalent to adding the
1847 @code{gnu_inline} function attribute to all inline functions
1848 (@pxref{Function Attributes}).
1850 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1851 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1852 specifies the default behavior).
1853 This option is not supported in @option{-std=c90} or
1854 @option{-std=gnu90} mode.
1856 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1857 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1858 in effect for @code{inline} functions.  @xref{Common Predefined
1859 Macros,,,cpp,The C Preprocessor}.
1861 @item -aux-info @var{filename}
1862 @opindex aux-info
1863 Output to the given filename prototyped declarations for all functions
1864 declared and/or defined in a translation unit, including those in header
1865 files.  This option is silently ignored in any language other than C@.
1867 Besides declarations, the file indicates, in comments, the origin of
1868 each declaration (source file and line), whether the declaration was
1869 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1870 @samp{O} for old, respectively, in the first character after the line
1871 number and the colon), and whether it came from a declaration or a
1872 definition (@samp{C} or @samp{F}, respectively, in the following
1873 character).  In the case of function definitions, a K&R-style list of
1874 arguments followed by their declarations is also provided, inside
1875 comments, after the declaration.
1877 @item -fallow-parameterless-variadic-functions
1878 @opindex fallow-parameterless-variadic-functions
1879 Accept variadic functions without named parameters.
1881 Although it is possible to define such a function, this is not very
1882 useful as it is not possible to read the arguments.  This is only
1883 supported for C as this construct is allowed by C++.
1885 @item -fno-asm
1886 @opindex fno-asm
1887 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1888 keyword, so that code can use these words as identifiers.  You can use
1889 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1890 instead.  @option{-ansi} implies @option{-fno-asm}.
1892 In C++, this switch only affects the @code{typeof} keyword, since
1893 @code{asm} and @code{inline} are standard keywords.  You may want to
1894 use the @option{-fno-gnu-keywords} flag instead, which has the same
1895 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1896 switch only affects the @code{asm} and @code{typeof} keywords, since
1897 @code{inline} is a standard keyword in ISO C99.
1899 @item -fno-builtin
1900 @itemx -fno-builtin-@var{function}
1901 @opindex fno-builtin
1902 @cindex built-in functions
1903 Don't recognize built-in functions that do not begin with
1904 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1905 functions provided by GCC}, for details of the functions affected,
1906 including those which are not built-in functions when @option{-ansi} or
1907 @option{-std} options for strict ISO C conformance are used because they
1908 do not have an ISO standard meaning.
1910 GCC normally generates special code to handle certain built-in functions
1911 more efficiently; for instance, calls to @code{alloca} may become single
1912 instructions which adjust the stack directly, and calls to @code{memcpy}
1913 may become inline copy loops.  The resulting code is often both smaller
1914 and faster, but since the function calls no longer appear as such, you
1915 cannot set a breakpoint on those calls, nor can you change the behavior
1916 of the functions by linking with a different library.  In addition,
1917 when a function is recognized as a built-in function, GCC may use
1918 information about that function to warn about problems with calls to
1919 that function, or to generate more efficient code, even if the
1920 resulting code still contains calls to that function.  For example,
1921 warnings are given with @option{-Wformat} for bad calls to
1922 @code{printf} when @code{printf} is built in and @code{strlen} is
1923 known not to modify global memory.
1925 With the @option{-fno-builtin-@var{function}} option
1926 only the built-in function @var{function} is
1927 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1928 function is named that is not built-in in this version of GCC, this
1929 option is ignored.  There is no corresponding
1930 @option{-fbuiltin-@var{function}} option; if you wish to enable
1931 built-in functions selectively when using @option{-fno-builtin} or
1932 @option{-ffreestanding}, you may define macros such as:
1934 @smallexample
1935 #define abs(n)          __builtin_abs ((n))
1936 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1937 @end smallexample
1939 @item -fhosted
1940 @opindex fhosted
1941 @cindex hosted environment
1943 Assert that compilation targets a hosted environment.  This implies
1944 @option{-fbuiltin}.  A hosted environment is one in which the
1945 entire standard library is available, and in which @code{main} has a return
1946 type of @code{int}.  Examples are nearly everything except a kernel.
1947 This is equivalent to @option{-fno-freestanding}.
1949 @item -ffreestanding
1950 @opindex ffreestanding
1951 @cindex hosted environment
1953 Assert that compilation targets a freestanding environment.  This
1954 implies @option{-fno-builtin}.  A freestanding environment
1955 is one in which the standard library may not exist, and program startup may
1956 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1957 This is equivalent to @option{-fno-hosted}.
1959 @xref{Standards,,Language Standards Supported by GCC}, for details of
1960 freestanding and hosted environments.
1962 @item -fopenacc
1963 @opindex fopenacc
1964 @cindex OpenACC accelerator programming
1965 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
1966 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
1967 compiler generates accelerated code according to the OpenACC Application
1968 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1969 implies @option{-pthread}, and thus is only supported on targets that
1970 have support for @option{-pthread}.
1972 @item -fopenacc-dim=@var{geom}
1973 @opindex fopenacc-dim
1974 @cindex OpenACC accelerator programming
1975 Specify default compute dimensions for parallel offload regions that do
1976 not explicitly specify.  The @var{geom} value is a triple of
1977 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
1978 can be omitted, to use a target-specific default value.
1980 @item -fopenmp
1981 @opindex fopenmp
1982 @cindex OpenMP parallel
1983 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1984 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1985 compiler generates parallel code according to the OpenMP Application
1986 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1987 implies @option{-pthread}, and thus is only supported on targets that
1988 have support for @option{-pthread}. @option{-fopenmp} implies
1989 @option{-fopenmp-simd}.
1991 @item -fopenmp-simd
1992 @opindex fopenmp-simd
1993 @cindex OpenMP SIMD
1994 @cindex SIMD
1995 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1996 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1997 are ignored.
1999 @item -fcilkplus
2000 @opindex fcilkplus
2001 @cindex Enable Cilk Plus
2002 Enable the usage of Cilk Plus language extension features for C/C++.
2003 When the option @option{-fcilkplus} is specified, enable the usage of
2004 the Cilk Plus Language extension features for C/C++.  The present
2005 implementation follows ABI version 1.2.  This is an experimental
2006 feature that is only partially complete, and whose interface may
2007 change in future versions of GCC as the official specification
2008 changes.  Currently, all features but @code{_Cilk_for} have been
2009 implemented.
2011 @item -fgnu-tm
2012 @opindex fgnu-tm
2013 When the option @option{-fgnu-tm} is specified, the compiler
2014 generates code for the Linux variant of Intel's current Transactional
2015 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2016 an experimental feature whose interface may change in future versions
2017 of GCC, as the official specification changes.  Please note that not
2018 all architectures are supported for this feature.
2020 For more information on GCC's support for transactional memory,
2021 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2022 Transactional Memory Library}.
2024 Note that the transactional memory feature is not supported with
2025 non-call exceptions (@option{-fnon-call-exceptions}).
2027 @item -fms-extensions
2028 @opindex fms-extensions
2029 Accept some non-standard constructs used in Microsoft header files.
2031 In C++ code, this allows member names in structures to be similar
2032 to previous types declarations.
2034 @smallexample
2035 typedef int UOW;
2036 struct ABC @{
2037   UOW UOW;
2039 @end smallexample
2041 Some cases of unnamed fields in structures and unions are only
2042 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2043 fields within structs/unions}, for details.
2045 Note that this option is off for all targets but x86 
2046 targets using ms-abi.
2048 @item -fplan9-extensions
2049 @opindex fplan9-extensions
2050 Accept some non-standard constructs used in Plan 9 code.
2052 This enables @option{-fms-extensions}, permits passing pointers to
2053 structures with anonymous fields to functions that expect pointers to
2054 elements of the type of the field, and permits referring to anonymous
2055 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2056 struct/union fields within structs/unions}, for details.  This is only
2057 supported for C, not C++.
2059 @item -trigraphs
2060 @opindex trigraphs
2061 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
2062 options for strict ISO C conformance) implies @option{-trigraphs}.
2064 @cindex traditional C language
2065 @cindex C language, traditional
2066 @item -traditional
2067 @itemx -traditional-cpp
2068 @opindex traditional-cpp
2069 @opindex traditional
2070 Formerly, these options caused GCC to attempt to emulate a pre-standard
2071 C compiler.  They are now only supported with the @option{-E} switch.
2072 The preprocessor continues to support a pre-standard mode.  See the GNU
2073 CPP manual for details.
2075 @item -fcond-mismatch
2076 @opindex fcond-mismatch
2077 Allow conditional expressions with mismatched types in the second and
2078 third arguments.  The value of such an expression is void.  This option
2079 is not supported for C++.
2081 @item -flax-vector-conversions
2082 @opindex flax-vector-conversions
2083 Allow implicit conversions between vectors with differing numbers of
2084 elements and/or incompatible element types.  This option should not be
2085 used for new code.
2087 @item -funsigned-char
2088 @opindex funsigned-char
2089 Let the type @code{char} be unsigned, like @code{unsigned char}.
2091 Each kind of machine has a default for what @code{char} should
2092 be.  It is either like @code{unsigned char} by default or like
2093 @code{signed char} by default.
2095 Ideally, a portable program should always use @code{signed char} or
2096 @code{unsigned char} when it depends on the signedness of an object.
2097 But many programs have been written to use plain @code{char} and
2098 expect it to be signed, or expect it to be unsigned, depending on the
2099 machines they were written for.  This option, and its inverse, let you
2100 make such a program work with the opposite default.
2102 The type @code{char} is always a distinct type from each of
2103 @code{signed char} or @code{unsigned char}, even though its behavior
2104 is always just like one of those two.
2106 @item -fsigned-char
2107 @opindex fsigned-char
2108 Let the type @code{char} be signed, like @code{signed char}.
2110 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2111 the negative form of @option{-funsigned-char}.  Likewise, the option
2112 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2114 @item -fsigned-bitfields
2115 @itemx -funsigned-bitfields
2116 @itemx -fno-signed-bitfields
2117 @itemx -fno-unsigned-bitfields
2118 @opindex fsigned-bitfields
2119 @opindex funsigned-bitfields
2120 @opindex fno-signed-bitfields
2121 @opindex fno-unsigned-bitfields
2122 These options control whether a bit-field is signed or unsigned, when the
2123 declaration does not use either @code{signed} or @code{unsigned}.  By
2124 default, such a bit-field is signed, because this is consistent: the
2125 basic integer types such as @code{int} are signed types.
2127 @item -fsso-struct=@var{endianness}
2128 @opindex fsso-struct
2129 Set the default scalar storage order of structures and unions to the
2130 specified endianness.  The accepted values are @samp{big-endian} and
2131 @samp{little-endian}.  If the option is not passed, the compiler uses
2132 the native endianness of the target.  This option is not supported for C++.
2134 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2135 code that is not binary compatible with code generated without it if the
2136 specified endianness is not the native endianness of the target.
2137 @end table
2139 @node C++ Dialect Options
2140 @section Options Controlling C++ Dialect
2142 @cindex compiler options, C++
2143 @cindex C++ options, command-line
2144 @cindex options, C++
2145 This section describes the command-line options that are only meaningful
2146 for C++ programs.  You can also use most of the GNU compiler options
2147 regardless of what language your program is in.  For example, you
2148 might compile a file @file{firstClass.C} like this:
2150 @smallexample
2151 g++ -g -fstrict-enums -O -c firstClass.C
2152 @end smallexample
2154 @noindent
2155 In this example, only @option{-fstrict-enums} is an option meant
2156 only for C++ programs; you can use the other options with any
2157 language supported by GCC@.
2159 Some options for compiling C programs, such as @option{-std}, are also
2160 relevant for C++ programs.
2161 @xref{C Dialect Options,,Options Controlling C Dialect}.
2163 Here is a list of options that are @emph{only} for compiling C++ programs:
2165 @table @gcctabopt
2167 @item -fabi-version=@var{n}
2168 @opindex fabi-version
2169 Use version @var{n} of the C++ ABI@.  The default is version 0.
2171 Version 0 refers to the version conforming most closely to
2172 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2173 will change in different versions of G++ as ABI bugs are fixed.
2175 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2177 Version 2 is the version of the C++ ABI that first appeared in G++
2178 3.4, and was the default through G++ 4.9.
2180 Version 3 corrects an error in mangling a constant address as a
2181 template argument.
2183 Version 4, which first appeared in G++ 4.5, implements a standard
2184 mangling for vector types.
2186 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2187 attribute const/volatile on function pointer types, decltype of a
2188 plain decl, and use of a function parameter in the declaration of
2189 another parameter.
2191 Version 6, which first appeared in G++ 4.7, corrects the promotion
2192 behavior of C++11 scoped enums and the mangling of template argument
2193 packs, const/static_cast, prefix ++ and --, and a class scope function
2194 used as a template argument.
2196 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2197 builtin type and corrects the mangling of lambdas in default argument
2198 scope.
2200 Version 8, which first appeared in G++ 4.9, corrects the substitution
2201 behavior of function types with function-cv-qualifiers.
2203 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2204 @code{nullptr_t}.
2206 Version 10, which first appeared in G++ 6.1, adds mangling of
2207 attributes that affect type identity, such as ia32 calling convention
2208 attributes (e.g. @samp{stdcall}).
2210 See also @option{-Wabi}.
2212 @item -fabi-compat-version=@var{n}
2213 @opindex fabi-compat-version
2214 On targets that support strong aliases, G++
2215 works around mangling changes by creating an alias with the correct
2216 mangled name when defining a symbol with an incorrect mangled name.
2217 This switch specifies which ABI version to use for the alias.
2219 With @option{-fabi-version=0} (the default), this defaults to 8 (GCC 5
2220 compatibility).  If another ABI version is explicitly selected, this
2221 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2222 use @option{-fabi-compat-version=2}.
2224 If this option is not provided but @option{-Wabi=@var{n}} is, that
2225 version is used for compatibility aliases.  If this option is provided
2226 along with @option{-Wabi} (without the version), the version from this
2227 option is used for the warning.
2229 @item -fno-access-control
2230 @opindex fno-access-control
2231 Turn off all access checking.  This switch is mainly useful for working
2232 around bugs in the access control code.
2234 @item -fcheck-new
2235 @opindex fcheck-new
2236 Check that the pointer returned by @code{operator new} is non-null
2237 before attempting to modify the storage allocated.  This check is
2238 normally unnecessary because the C++ standard specifies that
2239 @code{operator new} only returns @code{0} if it is declared
2240 @code{throw()}, in which case the compiler always checks the
2241 return value even without this option.  In all other cases, when
2242 @code{operator new} has a non-empty exception specification, memory
2243 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2244 @samp{new (nothrow)}.
2246 @item -fconcepts
2247 @opindex fconcepts
2248 Enable support for the C++ Extensions for Concepts Technical
2249 Specification, ISO 19217 (2015), which allows code like
2251 @smallexample
2252 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2253 template <Addable T> T add (T a, T b) @{ return a + b; @}
2254 @end smallexample
2256 @item -fconstexpr-depth=@var{n}
2257 @opindex fconstexpr-depth
2258 Set the maximum nested evaluation depth for C++11 constexpr functions
2259 to @var{n}.  A limit is needed to detect endless recursion during
2260 constant expression evaluation.  The minimum specified by the standard
2261 is 512.
2263 @item -fdeduce-init-list
2264 @opindex fdeduce-init-list
2265 Enable deduction of a template type parameter as
2266 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2268 @smallexample
2269 template <class T> auto forward(T t) -> decltype (realfn (t))
2271   return realfn (t);
2274 void f()
2276   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2278 @end smallexample
2280 This deduction was implemented as a possible extension to the
2281 originally proposed semantics for the C++11 standard, but was not part
2282 of the final standard, so it is disabled by default.  This option is
2283 deprecated, and may be removed in a future version of G++.
2285 @item -ffriend-injection
2286 @opindex ffriend-injection
2287 Inject friend functions into the enclosing namespace, so that they are
2288 visible outside the scope of the class in which they are declared.
2289 Friend functions were documented to work this way in the old Annotated
2290 C++ Reference Manual.  
2291 However, in ISO C++ a friend function that is not declared
2292 in an enclosing scope can only be found using argument dependent
2293 lookup.  GCC defaults to the standard behavior.
2295 This option is for compatibility, and may be removed in a future
2296 release of G++.
2298 @item -fno-elide-constructors
2299 @opindex fno-elide-constructors
2300 The C++ standard allows an implementation to omit creating a temporary
2301 that is only used to initialize another object of the same type.
2302 Specifying this option disables that optimization, and forces G++ to
2303 call the copy constructor in all cases.
2305 @item -fno-enforce-eh-specs
2306 @opindex fno-enforce-eh-specs
2307 Don't generate code to check for violation of exception specifications
2308 at run time.  This option violates the C++ standard, but may be useful
2309 for reducing code size in production builds, much like defining
2310 @code{NDEBUG}.  This does not give user code permission to throw
2311 exceptions in violation of the exception specifications; the compiler
2312 still optimizes based on the specifications, so throwing an
2313 unexpected exception results in undefined behavior at run time.
2315 @item -fextern-tls-init
2316 @itemx -fno-extern-tls-init
2317 @opindex fextern-tls-init
2318 @opindex fno-extern-tls-init
2319 The C++11 and OpenMP standards allow @code{thread_local} and
2320 @code{threadprivate} variables to have dynamic (runtime)
2321 initialization.  To support this, any use of such a variable goes
2322 through a wrapper function that performs any necessary initialization.
2323 When the use and definition of the variable are in the same
2324 translation unit, this overhead can be optimized away, but when the
2325 use is in a different translation unit there is significant overhead
2326 even if the variable doesn't actually need dynamic initialization.  If
2327 the programmer can be sure that no use of the variable in a
2328 non-defining TU needs to trigger dynamic initialization (either
2329 because the variable is statically initialized, or a use of the
2330 variable in the defining TU will be executed before any uses in
2331 another TU), they can avoid this overhead with the
2332 @option{-fno-extern-tls-init} option.
2334 On targets that support symbol aliases, the default is
2335 @option{-fextern-tls-init}.  On targets that do not support symbol
2336 aliases, the default is @option{-fno-extern-tls-init}.
2338 @item -ffor-scope
2339 @itemx -fno-for-scope
2340 @opindex ffor-scope
2341 @opindex fno-for-scope
2342 If @option{-ffor-scope} is specified, the scope of variables declared in
2343 a @i{for-init-statement} is limited to the @code{for} loop itself,
2344 as specified by the C++ standard.
2345 If @option{-fno-for-scope} is specified, the scope of variables declared in
2346 a @i{for-init-statement} extends to the end of the enclosing scope,
2347 as was the case in old versions of G++, and other (traditional)
2348 implementations of C++.
2350 If neither flag is given, the default is to follow the standard,
2351 but to allow and give a warning for old-style code that would
2352 otherwise be invalid, or have different behavior.
2354 @item -fno-gnu-keywords
2355 @opindex fno-gnu-keywords
2356 Do not recognize @code{typeof} as a keyword, so that code can use this
2357 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2358 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2359 @option{-std=c++98}, @option{-std=c++11}, etc.
2361 @item -fno-implicit-templates
2362 @opindex fno-implicit-templates
2363 Never emit code for non-inline templates that are instantiated
2364 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2365 @xref{Template Instantiation}, for more information.
2367 @item -fno-implicit-inline-templates
2368 @opindex fno-implicit-inline-templates
2369 Don't emit code for implicit instantiations of inline templates, either.
2370 The default is to handle inlines differently so that compiles with and
2371 without optimization need the same set of explicit instantiations.
2373 @item -fno-implement-inlines
2374 @opindex fno-implement-inlines
2375 To save space, do not emit out-of-line copies of inline functions
2376 controlled by @code{#pragma implementation}.  This causes linker
2377 errors if these functions are not inlined everywhere they are called.
2379 @item -fms-extensions
2380 @opindex fms-extensions
2381 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2382 int and getting a pointer to member function via non-standard syntax.
2384 @item -fno-nonansi-builtins
2385 @opindex fno-nonansi-builtins
2386 Disable built-in declarations of functions that are not mandated by
2387 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2388 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2390 @item -fnothrow-opt
2391 @opindex fnothrow-opt
2392 Treat a @code{throw()} exception specification as if it were a
2393 @code{noexcept} specification to reduce or eliminate the text size
2394 overhead relative to a function with no exception specification.  If
2395 the function has local variables of types with non-trivial
2396 destructors, the exception specification actually makes the
2397 function smaller because the EH cleanups for those variables can be
2398 optimized away.  The semantic effect is that an exception thrown out of
2399 a function with such an exception specification results in a call
2400 to @code{terminate} rather than @code{unexpected}.
2402 @item -fno-operator-names
2403 @opindex fno-operator-names
2404 Do not treat the operator name keywords @code{and}, @code{bitand},
2405 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2406 synonyms as keywords.
2408 @item -fno-optional-diags
2409 @opindex fno-optional-diags
2410 Disable diagnostics that the standard says a compiler does not need to
2411 issue.  Currently, the only such diagnostic issued by G++ is the one for
2412 a name having multiple meanings within a class.
2414 @item -fpermissive
2415 @opindex fpermissive
2416 Downgrade some diagnostics about nonconformant code from errors to
2417 warnings.  Thus, using @option{-fpermissive} allows some
2418 nonconforming code to compile.
2420 @item -fno-pretty-templates
2421 @opindex fno-pretty-templates
2422 When an error message refers to a specialization of a function
2423 template, the compiler normally prints the signature of the
2424 template followed by the template arguments and any typedefs or
2425 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2426 rather than @code{void f(int)}) so that it's clear which template is
2427 involved.  When an error message refers to a specialization of a class
2428 template, the compiler omits any template arguments that match
2429 the default template arguments for that template.  If either of these
2430 behaviors make it harder to understand the error message rather than
2431 easier, you can use @option{-fno-pretty-templates} to disable them.
2433 @item -frepo
2434 @opindex frepo
2435 Enable automatic template instantiation at link time.  This option also
2436 implies @option{-fno-implicit-templates}.  @xref{Template
2437 Instantiation}, for more information.
2439 @item -fno-rtti
2440 @opindex fno-rtti
2441 Disable generation of information about every class with virtual
2442 functions for use by the C++ run-time type identification features
2443 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2444 of the language, you can save some space by using this flag.  Note that
2445 exception handling uses the same information, but G++ generates it as
2446 needed. The @code{dynamic_cast} operator can still be used for casts that
2447 do not require run-time type information, i.e.@: casts to @code{void *} or to
2448 unambiguous base classes.
2450 @item -fsized-deallocation
2451 @opindex fsized-deallocation
2452 Enable the built-in global declarations
2453 @smallexample
2454 void operator delete (void *, std::size_t) noexcept;
2455 void operator delete[] (void *, std::size_t) noexcept;
2456 @end smallexample
2457 as introduced in C++14.  This is useful for user-defined replacement
2458 deallocation functions that, for example, use the size of the object
2459 to make deallocation faster.  Enabled by default under
2460 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2461 warns about places that might want to add a definition.
2463 @item -fstrict-enums
2464 @opindex fstrict-enums
2465 Allow the compiler to optimize using the assumption that a value of
2466 enumerated type can only be one of the values of the enumeration (as
2467 defined in the C++ standard; basically, a value that can be
2468 represented in the minimum number of bits needed to represent all the
2469 enumerators).  This assumption may not be valid if the program uses a
2470 cast to convert an arbitrary integer value to the enumerated type.
2472 @item -ftemplate-backtrace-limit=@var{n}
2473 @opindex ftemplate-backtrace-limit
2474 Set the maximum number of template instantiation notes for a single
2475 warning or error to @var{n}.  The default value is 10.
2477 @item -ftemplate-depth=@var{n}
2478 @opindex ftemplate-depth
2479 Set the maximum instantiation depth for template classes to @var{n}.
2480 A limit on the template instantiation depth is needed to detect
2481 endless recursions during template class instantiation.  ANSI/ISO C++
2482 conforming programs must not rely on a maximum depth greater than 17
2483 (changed to 1024 in C++11).  The default value is 900, as the compiler
2484 can run out of stack space before hitting 1024 in some situations.
2486 @item -fno-threadsafe-statics
2487 @opindex fno-threadsafe-statics
2488 Do not emit the extra code to use the routines specified in the C++
2489 ABI for thread-safe initialization of local statics.  You can use this
2490 option to reduce code size slightly in code that doesn't need to be
2491 thread-safe.
2493 @item -fuse-cxa-atexit
2494 @opindex fuse-cxa-atexit
2495 Register destructors for objects with static storage duration with the
2496 @code{__cxa_atexit} function rather than the @code{atexit} function.
2497 This option is required for fully standards-compliant handling of static
2498 destructors, but only works if your C library supports
2499 @code{__cxa_atexit}.
2501 @item -fno-use-cxa-get-exception-ptr
2502 @opindex fno-use-cxa-get-exception-ptr
2503 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2504 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2505 if the runtime routine is not available.
2507 @item -fvisibility-inlines-hidden
2508 @opindex fvisibility-inlines-hidden
2509 This switch declares that the user does not attempt to compare
2510 pointers to inline functions or methods where the addresses of the two functions
2511 are taken in different shared objects.
2513 The effect of this is that GCC may, effectively, mark inline methods with
2514 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2515 appear in the export table of a DSO and do not require a PLT indirection
2516 when used within the DSO@.  Enabling this option can have a dramatic effect
2517 on load and link times of a DSO as it massively reduces the size of the
2518 dynamic export table when the library makes heavy use of templates.
2520 The behavior of this switch is not quite the same as marking the
2521 methods as hidden directly, because it does not affect static variables
2522 local to the function or cause the compiler to deduce that
2523 the function is defined in only one shared object.
2525 You may mark a method as having a visibility explicitly to negate the
2526 effect of the switch for that method.  For example, if you do want to
2527 compare pointers to a particular inline method, you might mark it as
2528 having default visibility.  Marking the enclosing class with explicit
2529 visibility has no effect.
2531 Explicitly instantiated inline methods are unaffected by this option
2532 as their linkage might otherwise cross a shared library boundary.
2533 @xref{Template Instantiation}.
2535 @item -fvisibility-ms-compat
2536 @opindex fvisibility-ms-compat
2537 This flag attempts to use visibility settings to make GCC's C++
2538 linkage model compatible with that of Microsoft Visual Studio.
2540 The flag makes these changes to GCC's linkage model:
2542 @enumerate
2543 @item
2544 It sets the default visibility to @code{hidden}, like
2545 @option{-fvisibility=hidden}.
2547 @item
2548 Types, but not their members, are not hidden by default.
2550 @item
2551 The One Definition Rule is relaxed for types without explicit
2552 visibility specifications that are defined in more than one
2553 shared object: those declarations are permitted if they are
2554 permitted when this option is not used.
2555 @end enumerate
2557 In new code it is better to use @option{-fvisibility=hidden} and
2558 export those classes that are intended to be externally visible.
2559 Unfortunately it is possible for code to rely, perhaps accidentally,
2560 on the Visual Studio behavior.
2562 Among the consequences of these changes are that static data members
2563 of the same type with the same name but defined in different shared
2564 objects are different, so changing one does not change the other;
2565 and that pointers to function members defined in different shared
2566 objects may not compare equal.  When this flag is given, it is a
2567 violation of the ODR to define types with the same name differently.
2569 @item -fno-weak
2570 @opindex fno-weak
2571 Do not use weak symbol support, even if it is provided by the linker.
2572 By default, G++ uses weak symbols if they are available.  This
2573 option exists only for testing, and should not be used by end-users;
2574 it results in inferior code and has no benefits.  This option may
2575 be removed in a future release of G++.
2577 @item -nostdinc++
2578 @opindex nostdinc++
2579 Do not search for header files in the standard directories specific to
2580 C++, but do still search the other standard directories.  (This option
2581 is used when building the C++ library.)
2582 @end table
2584 In addition, these optimization, warning, and code generation options
2585 have meanings only for C++ programs:
2587 @table @gcctabopt
2588 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2589 @opindex Wabi
2590 @opindex Wno-abi
2591 Warn when G++ it generates code that is probably not compatible with
2592 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2593 ABI with each major release, normally @option{-Wabi} will warn only if
2594 there is a check added later in a release series for an ABI issue
2595 discovered since the initial release.  @option{-Wabi} will warn about
2596 more things if an older ABI version is selected (with
2597 @option{-fabi-version=@var{n}}).
2599 @option{-Wabi} can also be used with an explicit version number to
2600 warn about compatibility with a particular @option{-fabi-version}
2601 level, e.g. @option{-Wabi=2} to warn about changes relative to
2602 @option{-fabi-version=2}.
2604 If an explicit version number is provided and
2605 @option{-fabi-compat-version} is not specified, the version number
2606 from this option is used for compatibility aliases.  If no explicit
2607 version number is provided with this option, but
2608 @option{-fabi-compat-version} is specified, that version number is
2609 used for ABI warnings.
2611 Although an effort has been made to warn about
2612 all such cases, there are probably some cases that are not warned about,
2613 even though G++ is generating incompatible code.  There may also be
2614 cases where warnings are emitted even though the code that is generated
2615 is compatible.
2617 You should rewrite your code to avoid these warnings if you are
2618 concerned about the fact that code generated by G++ may not be binary
2619 compatible with code generated by other compilers.
2621 Known incompatibilities in @option{-fabi-version=2} (which was the
2622 default from GCC 3.4 to 4.9) include:
2624 @itemize @bullet
2626 @item
2627 A template with a non-type template parameter of reference type was
2628 mangled incorrectly:
2629 @smallexample
2630 extern int N;
2631 template <int &> struct S @{@};
2632 void n (S<N>) @{2@}
2633 @end smallexample
2635 This was fixed in @option{-fabi-version=3}.
2637 @item
2638 SIMD vector types declared using @code{__attribute ((vector_size))} were
2639 mangled in a non-standard way that does not allow for overloading of
2640 functions taking vectors of different sizes.
2642 The mangling was changed in @option{-fabi-version=4}.
2644 @item
2645 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2646 qualifiers, and @code{decltype} of a plain declaration was folded away.
2648 These mangling issues were fixed in @option{-fabi-version=5}.
2650 @item
2651 Scoped enumerators passed as arguments to a variadic function are
2652 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2653 On most targets this does not actually affect the parameter passing
2654 ABI, as there is no way to pass an argument smaller than @code{int}.
2656 Also, the ABI changed the mangling of template argument packs,
2657 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2658 a class scope function used as a template argument.
2660 These issues were corrected in @option{-fabi-version=6}.
2662 @item
2663 Lambdas in default argument scope were mangled incorrectly, and the
2664 ABI changed the mangling of @code{nullptr_t}.
2666 These issues were corrected in @option{-fabi-version=7}.
2668 @item
2669 When mangling a function type with function-cv-qualifiers, the
2670 un-qualified function type was incorrectly treated as a substitution
2671 candidate.
2673 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2675 @item
2676 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2677 unaligned accesses.  Note that this did not affect the ABI of a
2678 function with a @code{nullptr_t} parameter, as parameters have a
2679 minimum alignment.
2681 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2683 @item
2684 Target-specific attributes that affect the identity of a type, such as
2685 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2686 did not affect the mangled name, leading to name collisions when
2687 function pointers were used as template arguments.
2689 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2691 @end itemize
2693 It also warns about psABI-related changes.  The known psABI changes at this
2694 point include:
2696 @itemize @bullet
2698 @item
2699 For SysV/x86-64, unions with @code{long double} members are 
2700 passed in memory as specified in psABI.  For example:
2702 @smallexample
2703 union U @{
2704   long double ld;
2705   int i;
2707 @end smallexample
2709 @noindent
2710 @code{union U} is always passed in memory.
2712 @end itemize
2714 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2715 @opindex Wabi-tag
2716 @opindex -Wabi-tag
2717 Warn when a type with an ABI tag is used in a context that does not
2718 have that ABI tag.  See @ref{C++ Attributes} for more information
2719 about ABI tags.
2721 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2722 @opindex Wctor-dtor-privacy
2723 @opindex Wno-ctor-dtor-privacy
2724 Warn when a class seems unusable because all the constructors or
2725 destructors in that class are private, and it has neither friends nor
2726 public static member functions.  Also warn if there are no non-private
2727 methods, and there's at least one private member function that isn't
2728 a constructor or destructor.
2730 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2731 @opindex Wdelete-non-virtual-dtor
2732 @opindex Wno-delete-non-virtual-dtor
2733 Warn when @code{delete} is used to destroy an instance of a class that
2734 has virtual functions and non-virtual destructor. It is unsafe to delete
2735 an instance of a derived class through a pointer to a base class if the
2736 base class does not have a virtual destructor.  This warning is enabled
2737 by @option{-Wall}.
2739 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2740 @opindex Wliteral-suffix
2741 @opindex Wno-literal-suffix
2742 Warn when a string or character literal is followed by a ud-suffix which does
2743 not begin with an underscore.  As a conforming extension, GCC treats such
2744 suffixes as separate preprocessing tokens in order to maintain backwards
2745 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2746 For example:
2748 @smallexample
2749 #define __STDC_FORMAT_MACROS
2750 #include <inttypes.h>
2751 #include <stdio.h>
2753 int main() @{
2754   int64_t i64 = 123;
2755   printf("My int64: %" PRId64"\n", i64);
2757 @end smallexample
2759 In this case, @code{PRId64} is treated as a separate preprocessing token.
2761 This warning is enabled by default.
2763 @item -Wlto-type-mismatch
2764 @opindex Wlto-type-mismatch
2765 @opindex Wno-lto-type-mismatch
2767 During the link-time optimization warn about type mismatches in
2768 global declarations from different compilation units.
2769 Requires @option{-flto} to be enabled.  Enabled by default.
2771 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2772 @opindex Wnarrowing
2773 @opindex Wno-narrowing
2774 With @option{-std=gnu++98} or @option{-std=c++98}, warn when a narrowing
2775 conversion prohibited by C++11 occurs within
2776 @samp{@{ @}}, e.g.
2778 @smallexample
2779 int i = @{ 2.2 @}; // error: narrowing from double to int
2780 @end smallexample
2782 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2784 When a later standard is in effect, e.g. when using @option{-std=c++11},
2785 narrowing conversions are diagnosed by default, as required by the standard.
2786 A narrowing conversion from a constant produces an error,
2787 and a narrowing conversion from a non-constant produces a warning,
2788 but @option{-Wno-narrowing} suppresses the diagnostic.
2789 Note that this does not affect the meaning of well-formed code;
2790 narrowing conversions are still considered ill-formed in SFINAE contexts.
2792 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2793 @opindex Wnoexcept
2794 @opindex Wno-noexcept
2795 Warn when a noexcept-expression evaluates to false because of a call
2796 to a function that does not have a non-throwing exception
2797 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2798 the compiler to never throw an exception.
2800 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2801 @opindex Wnon-virtual-dtor
2802 @opindex Wno-non-virtual-dtor
2803 Warn when a class has virtual functions and an accessible non-virtual
2804 destructor itself or in an accessible polymorphic base class, in which
2805 case it is possible but unsafe to delete an instance of a derived
2806 class through a pointer to the class itself or base class.  This
2807 warning is automatically enabled if @option{-Weffc++} is specified.
2809 @item -Wreorder @r{(C++ and Objective-C++ only)}
2810 @opindex Wreorder
2811 @opindex Wno-reorder
2812 @cindex reordering, warning
2813 @cindex warning for reordering of member initializers
2814 Warn when the order of member initializers given in the code does not
2815 match the order in which they must be executed.  For instance:
2817 @smallexample
2818 struct A @{
2819   int i;
2820   int j;
2821   A(): j (0), i (1) @{ @}
2823 @end smallexample
2825 @noindent
2826 The compiler rearranges the member initializers for @code{i}
2827 and @code{j} to match the declaration order of the members, emitting
2828 a warning to that effect.  This warning is enabled by @option{-Wall}.
2830 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2831 @opindex fext-numeric-literals
2832 @opindex fno-ext-numeric-literals
2833 Accept imaginary, fixed-point, or machine-defined
2834 literal number suffixes as GNU extensions.
2835 When this option is turned off these suffixes are treated
2836 as C++11 user-defined literal numeric suffixes.
2837 This is on by default for all pre-C++11 dialects and all GNU dialects:
2838 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2839 @option{-std=gnu++14}.
2840 This option is off by default
2841 for ISO C++11 onwards (@option{-std=c++11}, ...).
2842 @end table
2844 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2846 @table @gcctabopt
2847 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2848 @opindex Weffc++
2849 @opindex Wno-effc++
2850 Warn about violations of the following style guidelines from Scott Meyers'
2851 @cite{Effective C++} series of books:
2853 @itemize @bullet
2854 @item
2855 Define a copy constructor and an assignment operator for classes
2856 with dynamically-allocated memory.
2858 @item
2859 Prefer initialization to assignment in constructors.
2861 @item
2862 Have @code{operator=} return a reference to @code{*this}.
2864 @item
2865 Don't try to return a reference when you must return an object.
2867 @item
2868 Distinguish between prefix and postfix forms of increment and
2869 decrement operators.
2871 @item
2872 Never overload @code{&&}, @code{||}, or @code{,}.
2874 @end itemize
2876 This option also enables @option{-Wnon-virtual-dtor}, which is also
2877 one of the effective C++ recommendations.  However, the check is
2878 extended to warn about the lack of virtual destructor in accessible
2879 non-polymorphic bases classes too.
2881 When selecting this option, be aware that the standard library
2882 headers do not obey all of these guidelines; use @samp{grep -v}
2883 to filter out those warnings.
2885 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2886 @opindex Wstrict-null-sentinel
2887 @opindex Wno-strict-null-sentinel
2888 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2889 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2890 to @code{__null}.  Although it is a null pointer constant rather than a
2891 null pointer, it is guaranteed to be of the same size as a pointer.
2892 But this use is not portable across different compilers.
2894 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2895 @opindex Wno-non-template-friend
2896 @opindex Wnon-template-friend
2897 Disable warnings when non-templatized friend functions are declared
2898 within a template.  Since the advent of explicit template specification
2899 support in G++, if the name of the friend is an unqualified-id (i.e.,
2900 @samp{friend foo(int)}), the C++ language specification demands that the
2901 friend declare or define an ordinary, nontemplate function.  (Section
2902 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2903 could be interpreted as a particular specialization of a templatized
2904 function.  Because this non-conforming behavior is no longer the default
2905 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2906 check existing code for potential trouble spots and is on by default.
2907 This new compiler behavior can be turned off with
2908 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2909 but disables the helpful warning.
2911 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2912 @opindex Wold-style-cast
2913 @opindex Wno-old-style-cast
2914 Warn if an old-style (C-style) cast to a non-void type is used within
2915 a C++ program.  The new-style casts (@code{dynamic_cast},
2916 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
2917 less vulnerable to unintended effects and much easier to search for.
2919 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2920 @opindex Woverloaded-virtual
2921 @opindex Wno-overloaded-virtual
2922 @cindex overloaded virtual function, warning
2923 @cindex warning for overloaded virtual function
2924 Warn when a function declaration hides virtual functions from a
2925 base class.  For example, in:
2927 @smallexample
2928 struct A @{
2929   virtual void f();
2932 struct B: public A @{
2933   void f(int);
2935 @end smallexample
2937 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2938 like:
2940 @smallexample
2941 B* b;
2942 b->f();
2943 @end smallexample
2945 @noindent
2946 fails to compile.
2948 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2949 @opindex Wno-pmf-conversions
2950 @opindex Wpmf-conversions
2951 Disable the diagnostic for converting a bound pointer to member function
2952 to a plain pointer.
2954 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2955 @opindex Wsign-promo
2956 @opindex Wno-sign-promo
2957 Warn when overload resolution chooses a promotion from unsigned or
2958 enumerated type to a signed type, over a conversion to an unsigned type of
2959 the same size.  Previous versions of G++ tried to preserve
2960 unsignedness, but the standard mandates the current behavior.
2962 @item -Wtemplates @r{(C++ and Objective-C++ only)}
2963 @opindex Wtemplates
2964 Warn when a primary template declaration is encountered.  Some coding
2965 rules disallow templates, and this may be used to enforce that rule.
2966 The warning is inactive inside a system header file, such as the STL, so
2967 one can still use the STL.  One may also instantiate or specialize
2968 templates.
2970 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
2971 @opindex Wmultiple-inheritance
2972 Warn when a class is defined with multiple direct base classes.  Some
2973 coding rules disallow multiple inheritance, and this may be used to
2974 enforce that rule.  The warning is inactive inside a system header file,
2975 such as the STL, so one can still use the STL.  One may also define
2976 classes that indirectly use multiple inheritance.
2978 @item -Wvirtual-inheritance
2979 @opindex Wvirtual-inheritance
2980 Warn when a class is defined with a virtual direct base classe.  Some
2981 coding rules disallow multiple inheritance, and this may be used to
2982 enforce that rule.  The warning is inactive inside a system header file,
2983 such as the STL, so one can still use the STL.  One may also define
2984 classes that indirectly use virtual inheritance.
2986 @item -Wnamespaces
2987 @opindex Wnamespaces
2988 Warn when a namespace definition is opened.  Some coding rules disallow
2989 namespaces, and this may be used to enforce that rule.  The warning is
2990 inactive inside a system header file, such as the STL, so one can still
2991 use the STL.  One may also use using directives and qualified names.
2993 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
2994 @opindex Wterminate
2995 @opindex Wno-terminate
2996 Disable the warning about a throw-expression that will immediately
2997 result in a call to @code{terminate}.
2998 @end table
3000 @node Objective-C and Objective-C++ Dialect Options
3001 @section Options Controlling Objective-C and Objective-C++ Dialects
3003 @cindex compiler options, Objective-C and Objective-C++
3004 @cindex Objective-C and Objective-C++ options, command-line
3005 @cindex options, Objective-C and Objective-C++
3006 (NOTE: This manual does not describe the Objective-C and Objective-C++
3007 languages themselves.  @xref{Standards,,Language Standards
3008 Supported by GCC}, for references.)
3010 This section describes the command-line options that are only meaningful
3011 for Objective-C and Objective-C++ programs.  You can also use most of
3012 the language-independent GNU compiler options.
3013 For example, you might compile a file @file{some_class.m} like this:
3015 @smallexample
3016 gcc -g -fgnu-runtime -O -c some_class.m
3017 @end smallexample
3019 @noindent
3020 In this example, @option{-fgnu-runtime} is an option meant only for
3021 Objective-C and Objective-C++ programs; you can use the other options with
3022 any language supported by GCC@.
3024 Note that since Objective-C is an extension of the C language, Objective-C
3025 compilations may also use options specific to the C front-end (e.g.,
3026 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3027 C++-specific options (e.g., @option{-Wabi}).
3029 Here is a list of options that are @emph{only} for compiling Objective-C
3030 and Objective-C++ programs:
3032 @table @gcctabopt
3033 @item -fconstant-string-class=@var{class-name}
3034 @opindex fconstant-string-class
3035 Use @var{class-name} as the name of the class to instantiate for each
3036 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3037 class name is @code{NXConstantString} if the GNU runtime is being used, and
3038 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3039 @option{-fconstant-cfstrings} option, if also present, overrides the
3040 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3041 to be laid out as constant CoreFoundation strings.
3043 @item -fgnu-runtime
3044 @opindex fgnu-runtime
3045 Generate object code compatible with the standard GNU Objective-C
3046 runtime.  This is the default for most types of systems.
3048 @item -fnext-runtime
3049 @opindex fnext-runtime
3050 Generate output compatible with the NeXT runtime.  This is the default
3051 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3052 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3053 used.
3055 @item -fno-nil-receivers
3056 @opindex fno-nil-receivers
3057 Assume that all Objective-C message dispatches (@code{[receiver
3058 message:arg]}) in this translation unit ensure that the receiver is
3059 not @code{nil}.  This allows for more efficient entry points in the
3060 runtime to be used.  This option is only available in conjunction with
3061 the NeXT runtime and ABI version 0 or 1.
3063 @item -fobjc-abi-version=@var{n}
3064 @opindex fobjc-abi-version
3065 Use version @var{n} of the Objective-C ABI for the selected runtime.
3066 This option is currently supported only for the NeXT runtime.  In that
3067 case, Version 0 is the traditional (32-bit) ABI without support for
3068 properties and other Objective-C 2.0 additions.  Version 1 is the
3069 traditional (32-bit) ABI with support for properties and other
3070 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3071 nothing is specified, the default is Version 0 on 32-bit target
3072 machines, and Version 2 on 64-bit target machines.
3074 @item -fobjc-call-cxx-cdtors
3075 @opindex fobjc-call-cxx-cdtors
3076 For each Objective-C class, check if any of its instance variables is a
3077 C++ object with a non-trivial default constructor.  If so, synthesize a
3078 special @code{- (id) .cxx_construct} instance method which runs
3079 non-trivial default constructors on any such instance variables, in order,
3080 and then return @code{self}.  Similarly, check if any instance variable
3081 is a C++ object with a non-trivial destructor, and if so, synthesize a
3082 special @code{- (void) .cxx_destruct} method which runs
3083 all such default destructors, in reverse order.
3085 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3086 methods thusly generated only operate on instance variables
3087 declared in the current Objective-C class, and not those inherited
3088 from superclasses.  It is the responsibility of the Objective-C
3089 runtime to invoke all such methods in an object's inheritance
3090 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3091 by the runtime immediately after a new object instance is allocated;
3092 the @code{- (void) .cxx_destruct} methods are invoked immediately
3093 before the runtime deallocates an object instance.
3095 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3096 support for invoking the @code{- (id) .cxx_construct} and
3097 @code{- (void) .cxx_destruct} methods.
3099 @item -fobjc-direct-dispatch
3100 @opindex fobjc-direct-dispatch
3101 Allow fast jumps to the message dispatcher.  On Darwin this is
3102 accomplished via the comm page.
3104 @item -fobjc-exceptions
3105 @opindex fobjc-exceptions
3106 Enable syntactic support for structured exception handling in
3107 Objective-C, similar to what is offered by C++ and Java.  This option
3108 is required to use the Objective-C keywords @code{@@try},
3109 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3110 @code{@@synchronized}.  This option is available with both the GNU
3111 runtime and the NeXT runtime (but not available in conjunction with
3112 the NeXT runtime on Mac OS X 10.2 and earlier).
3114 @item -fobjc-gc
3115 @opindex fobjc-gc
3116 Enable garbage collection (GC) in Objective-C and Objective-C++
3117 programs.  This option is only available with the NeXT runtime; the
3118 GNU runtime has a different garbage collection implementation that
3119 does not require special compiler flags.
3121 @item -fobjc-nilcheck
3122 @opindex fobjc-nilcheck
3123 For the NeXT runtime with version 2 of the ABI, check for a nil
3124 receiver in method invocations before doing the actual method call.
3125 This is the default and can be disabled using
3126 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3127 checked for nil in this way no matter what this flag is set to.
3128 Currently this flag does nothing when the GNU runtime, or an older
3129 version of the NeXT runtime ABI, is used.
3131 @item -fobjc-std=objc1
3132 @opindex fobjc-std
3133 Conform to the language syntax of Objective-C 1.0, the language
3134 recognized by GCC 4.0.  This only affects the Objective-C additions to
3135 the C/C++ language; it does not affect conformance to C/C++ standards,
3136 which is controlled by the separate C/C++ dialect option flags.  When
3137 this option is used with the Objective-C or Objective-C++ compiler,
3138 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3139 This is useful if you need to make sure that your Objective-C code can
3140 be compiled with older versions of GCC@.
3142 @item -freplace-objc-classes
3143 @opindex freplace-objc-classes
3144 Emit a special marker instructing @command{ld(1)} not to statically link in
3145 the resulting object file, and allow @command{dyld(1)} to load it in at
3146 run time instead.  This is used in conjunction with the Fix-and-Continue
3147 debugging mode, where the object file in question may be recompiled and
3148 dynamically reloaded in the course of program execution, without the need
3149 to restart the program itself.  Currently, Fix-and-Continue functionality
3150 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3151 and later.
3153 @item -fzero-link
3154 @opindex fzero-link
3155 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3156 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3157 compile time) with static class references that get initialized at load time,
3158 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3159 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3160 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3161 for individual class implementations to be modified during program execution.
3162 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3163 regardless of command-line options.
3165 @item -fno-local-ivars
3166 @opindex fno-local-ivars
3167 @opindex flocal-ivars
3168 By default instance variables in Objective-C can be accessed as if
3169 they were local variables from within the methods of the class they're
3170 declared in.  This can lead to shadowing between instance variables
3171 and other variables declared either locally inside a class method or
3172 globally with the same name.  Specifying the @option{-fno-local-ivars}
3173 flag disables this behavior thus avoiding variable shadowing issues.
3175 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3176 @opindex fivar-visibility
3177 Set the default instance variable visibility to the specified option
3178 so that instance variables declared outside the scope of any access
3179 modifier directives default to the specified visibility.
3181 @item -gen-decls
3182 @opindex gen-decls
3183 Dump interface declarations for all classes seen in the source file to a
3184 file named @file{@var{sourcename}.decl}.
3186 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3187 @opindex Wassign-intercept
3188 @opindex Wno-assign-intercept
3189 Warn whenever an Objective-C assignment is being intercepted by the
3190 garbage collector.
3192 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3193 @opindex Wno-protocol
3194 @opindex Wprotocol
3195 If a class is declared to implement a protocol, a warning is issued for
3196 every method in the protocol that is not implemented by the class.  The
3197 default behavior is to issue a warning for every method not explicitly
3198 implemented in the class, even if a method implementation is inherited
3199 from the superclass.  If you use the @option{-Wno-protocol} option, then
3200 methods inherited from the superclass are considered to be implemented,
3201 and no warning is issued for them.
3203 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3204 @opindex Wselector
3205 @opindex Wno-selector
3206 Warn if multiple methods of different types for the same selector are
3207 found during compilation.  The check is performed on the list of methods
3208 in the final stage of compilation.  Additionally, a check is performed
3209 for each selector appearing in a @code{@@selector(@dots{})}
3210 expression, and a corresponding method for that selector has been found
3211 during compilation.  Because these checks scan the method table only at
3212 the end of compilation, these warnings are not produced if the final
3213 stage of compilation is not reached, for example because an error is
3214 found during compilation, or because the @option{-fsyntax-only} option is
3215 being used.
3217 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3218 @opindex Wstrict-selector-match
3219 @opindex Wno-strict-selector-match
3220 Warn if multiple methods with differing argument and/or return types are
3221 found for a given selector when attempting to send a message using this
3222 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3223 is off (which is the default behavior), the compiler omits such warnings
3224 if any differences found are confined to types that share the same size
3225 and alignment.
3227 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3228 @opindex Wundeclared-selector
3229 @opindex Wno-undeclared-selector
3230 Warn if a @code{@@selector(@dots{})} expression referring to an
3231 undeclared selector is found.  A selector is considered undeclared if no
3232 method with that name has been declared before the
3233 @code{@@selector(@dots{})} expression, either explicitly in an
3234 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3235 an @code{@@implementation} section.  This option always performs its
3236 checks as soon as a @code{@@selector(@dots{})} expression is found,
3237 while @option{-Wselector} only performs its checks in the final stage of
3238 compilation.  This also enforces the coding style convention
3239 that methods and selectors must be declared before being used.
3241 @item -print-objc-runtime-info
3242 @opindex print-objc-runtime-info
3243 Generate C header describing the largest structure that is passed by
3244 value, if any.
3246 @end table
3248 @node Diagnostic Message Formatting Options
3249 @section Options to Control Diagnostic Messages Formatting
3250 @cindex options to control diagnostics formatting
3251 @cindex diagnostic messages
3252 @cindex message formatting
3254 Traditionally, diagnostic messages have been formatted irrespective of
3255 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3256 options described below
3257 to control the formatting algorithm for diagnostic messages, 
3258 e.g.@: how many characters per line, how often source location
3259 information should be reported.  Note that some language front ends may not
3260 honor these options.
3262 @table @gcctabopt
3263 @item -fmessage-length=@var{n}
3264 @opindex fmessage-length
3265 Try to format error messages so that they fit on lines of about
3266 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3267 done; each error message appears on a single line.  This is the
3268 default for all front ends.
3270 @item -fdiagnostics-show-location=once
3271 @opindex fdiagnostics-show-location
3272 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3273 reporter to emit source location information @emph{once}; that is, in
3274 case the message is too long to fit on a single physical line and has to
3275 be wrapped, the source location won't be emitted (as prefix) again,
3276 over and over, in subsequent continuation lines.  This is the default
3277 behavior.
3279 @item -fdiagnostics-show-location=every-line
3280 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3281 messages reporter to emit the same source location information (as
3282 prefix) for physical lines that result from the process of breaking
3283 a message which is too long to fit on a single line.
3285 @item -fdiagnostics-color[=@var{WHEN}]
3286 @itemx -fno-diagnostics-color
3287 @opindex fdiagnostics-color
3288 @cindex highlight, color
3289 @vindex GCC_COLORS @r{environment variable}
3290 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3291 or @samp{auto}.  The default depends on how the compiler has been configured,
3292 it can be any of the above @var{WHEN} options or also @samp{never}
3293 if @env{GCC_COLORS} environment variable isn't present in the environment,
3294 and @samp{auto} otherwise.
3295 @samp{auto} means to use color only when the standard error is a terminal.
3296 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3297 aliases for @option{-fdiagnostics-color=always} and
3298 @option{-fdiagnostics-color=never}, respectively.
3300 The colors are defined by the environment variable @env{GCC_COLORS}.
3301 Its value is a colon-separated list of capabilities and Select Graphic
3302 Rendition (SGR) substrings. SGR commands are interpreted by the
3303 terminal or terminal emulator.  (See the section in the documentation
3304 of your text terminal for permitted values and their meanings as
3305 character attributes.)  These substring values are integers in decimal
3306 representation and can be concatenated with semicolons.
3307 Common values to concatenate include
3308 @samp{1} for bold,
3309 @samp{4} for underline,
3310 @samp{5} for blink,
3311 @samp{7} for inverse,
3312 @samp{39} for default foreground color,
3313 @samp{30} to @samp{37} for foreground colors,
3314 @samp{90} to @samp{97} for 16-color mode foreground colors,
3315 @samp{38;5;0} to @samp{38;5;255}
3316 for 88-color and 256-color modes foreground colors,
3317 @samp{49} for default background color,
3318 @samp{40} to @samp{47} for background colors,
3319 @samp{100} to @samp{107} for 16-color mode background colors,
3320 and @samp{48;5;0} to @samp{48;5;255}
3321 for 88-color and 256-color modes background colors.
3323 The default @env{GCC_COLORS} is
3324 @smallexample
3325 error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
3326 @end smallexample
3327 @noindent
3328 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3329 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3330 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3331 string disables colors.
3332 Supported capabilities are as follows.
3334 @table @code
3335 @item error=
3336 @vindex error GCC_COLORS @r{capability}
3337 SGR substring for error: markers.
3339 @item warning=
3340 @vindex warning GCC_COLORS @r{capability}
3341 SGR substring for warning: markers.
3343 @item note=
3344 @vindex note GCC_COLORS @r{capability}
3345 SGR substring for note: markers.
3347 @item caret=
3348 @vindex caret GCC_COLORS @r{capability}
3349 SGR substring for caret line.
3351 @item locus=
3352 @vindex locus GCC_COLORS @r{capability}
3353 SGR substring for location information, @samp{file:line} or
3354 @samp{file:line:column} etc.
3356 @item quote=
3357 @vindex quote GCC_COLORS @r{capability}
3358 SGR substring for information printed within quotes.
3359 @end table
3361 @item -fno-diagnostics-show-option
3362 @opindex fno-diagnostics-show-option
3363 @opindex fdiagnostics-show-option
3364 By default, each diagnostic emitted includes text indicating the
3365 command-line option that directly controls the diagnostic (if such an
3366 option is known to the diagnostic machinery).  Specifying the
3367 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3369 @item -fno-diagnostics-show-caret
3370 @opindex fno-diagnostics-show-caret
3371 @opindex fdiagnostics-show-caret
3372 By default, each diagnostic emitted includes the original source line
3373 and a caret @samp{^} indicating the column.  This option suppresses this
3374 information.  The source line is truncated to @var{n} characters, if
3375 the @option{-fmessage-length=n} option is given.  When the output is done
3376 to the terminal, the width is limited to the width given by the
3377 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3379 @end table
3381 @node Warning Options
3382 @section Options to Request or Suppress Warnings
3383 @cindex options to control warnings
3384 @cindex warning messages
3385 @cindex messages, warning
3386 @cindex suppressing warnings
3388 Warnings are diagnostic messages that report constructions that
3389 are not inherently erroneous but that are risky or suggest there
3390 may have been an error.
3392 The following language-independent options do not enable specific
3393 warnings but control the kinds of diagnostics produced by GCC@.
3395 @table @gcctabopt
3396 @cindex syntax checking
3397 @item -fsyntax-only
3398 @opindex fsyntax-only
3399 Check the code for syntax errors, but don't do anything beyond that.
3401 @item -fmax-errors=@var{n}
3402 @opindex fmax-errors
3403 Limits the maximum number of error messages to @var{n}, at which point
3404 GCC bails out rather than attempting to continue processing the source
3405 code.  If @var{n} is 0 (the default), there is no limit on the number
3406 of error messages produced.  If @option{-Wfatal-errors} is also
3407 specified, then @option{-Wfatal-errors} takes precedence over this
3408 option.
3410 @item -w
3411 @opindex w
3412 Inhibit all warning messages.
3414 @item -Werror
3415 @opindex Werror
3416 @opindex Wno-error
3417 Make all warnings into errors.
3419 @item -Werror=
3420 @opindex Werror=
3421 @opindex Wno-error=
3422 Make the specified warning into an error.  The specifier for a warning
3423 is appended; for example @option{-Werror=switch} turns the warnings
3424 controlled by @option{-Wswitch} into errors.  This switch takes a
3425 negative form, to be used to negate @option{-Werror} for specific
3426 warnings; for example @option{-Wno-error=switch} makes
3427 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3428 is in effect.
3430 The warning message for each controllable warning includes the
3431 option that controls the warning.  That option can then be used with
3432 @option{-Werror=} and @option{-Wno-error=} as described above.
3433 (Printing of the option in the warning message can be disabled using the
3434 @option{-fno-diagnostics-show-option} flag.)
3436 Note that specifying @option{-Werror=}@var{foo} automatically implies
3437 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3438 imply anything.
3440 @item -Wfatal-errors
3441 @opindex Wfatal-errors
3442 @opindex Wno-fatal-errors
3443 This option causes the compiler to abort compilation on the first error
3444 occurred rather than trying to keep going and printing further error
3445 messages.
3447 @end table
3449 You can request many specific warnings with options beginning with
3450 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3451 implicit declarations.  Each of these specific warning options also
3452 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3453 example, @option{-Wno-implicit}.  This manual lists only one of the
3454 two forms, whichever is not the default.  For further
3455 language-specific options also refer to @ref{C++ Dialect Options} and
3456 @ref{Objective-C and Objective-C++ Dialect Options}.
3458 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3459 options, such as @option{-Wunused}, which may turn on further options,
3460 such as @option{-Wunused-value}. The combined effect of positive and
3461 negative forms is that more specific options have priority over less
3462 specific ones, independently of their position in the command-line. For
3463 options of the same specificity, the last one takes effect. Options
3464 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3465 as if they appeared at the end of the command-line.
3467 When an unrecognized warning option is requested (e.g.,
3468 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3469 that the option is not recognized.  However, if the @option{-Wno-} form
3470 is used, the behavior is slightly different: no diagnostic is
3471 produced for @option{-Wno-unknown-warning} unless other diagnostics
3472 are being produced.  This allows the use of new @option{-Wno-} options
3473 with old compilers, but if something goes wrong, the compiler
3474 warns that an unrecognized option is present.
3476 @table @gcctabopt
3477 @item -Wpedantic
3478 @itemx -pedantic
3479 @opindex pedantic
3480 @opindex Wpedantic
3481 Issue all the warnings demanded by strict ISO C and ISO C++;
3482 reject all programs that use forbidden extensions, and some other
3483 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3484 version of the ISO C standard specified by any @option{-std} option used.
3486 Valid ISO C and ISO C++ programs should compile properly with or without
3487 this option (though a rare few require @option{-ansi} or a
3488 @option{-std} option specifying the required version of ISO C)@.  However,
3489 without this option, certain GNU extensions and traditional C and C++
3490 features are supported as well.  With this option, they are rejected.
3492 @option{-Wpedantic} does not cause warning messages for use of the
3493 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3494 warnings are also disabled in the expression that follows
3495 @code{__extension__}.  However, only system header files should use
3496 these escape routes; application programs should avoid them.
3497 @xref{Alternate Keywords}.
3499 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3500 C conformance.  They soon find that it does not do quite what they want:
3501 it finds some non-ISO practices, but not all---only those for which
3502 ISO C @emph{requires} a diagnostic, and some others for which
3503 diagnostics have been added.
3505 A feature to report any failure to conform to ISO C might be useful in
3506 some instances, but would require considerable additional work and would
3507 be quite different from @option{-Wpedantic}.  We don't have plans to
3508 support such a feature in the near future.
3510 Where the standard specified with @option{-std} represents a GNU
3511 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3512 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3513 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3514 where they are required by the base standard.  (It does not make sense
3515 for such warnings to be given only for features not in the specified GNU
3516 C dialect, since by definition the GNU dialects of C include all
3517 features the compiler supports with the given option, and there would be
3518 nothing to warn about.)
3520 @item -pedantic-errors
3521 @opindex pedantic-errors
3522 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3523 requires a diagnostic, in some cases where there is undefined behavior
3524 at compile-time and in some other cases that do not prevent compilation
3525 of programs that are valid according to the standard. This is not
3526 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3527 by this option and not enabled by the latter and vice versa.
3529 @item -Wall
3530 @opindex Wall
3531 @opindex Wno-all
3532 This enables all the warnings about constructions that some users
3533 consider questionable, and that are easy to avoid (or modify to
3534 prevent the warning), even in conjunction with macros.  This also
3535 enables some language-specific warnings described in @ref{C++ Dialect
3536 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3538 @option{-Wall} turns on the following warning flags:
3540 @gccoptlist{-Waddress   @gol
3541 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3542 -Wbool-compare  @gol
3543 -Wc++11-compat  -Wc++14-compat@gol
3544 -Wchar-subscripts  @gol
3545 -Wcomment  @gol
3546 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
3547 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3548 -Wformat   @gol
3549 -Wimplicit @r{(C and Objective-C only)} @gol
3550 -Wimplicit-int @r{(C and Objective-C only)} @gol
3551 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3552 -Winit-self @r{(only for C++)} @gol
3553 -Wlogical-not-parentheses
3554 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3555 -Wmaybe-uninitialized @gol
3556 -Wmemset-elt-size @gol
3557 -Wmemset-transposed-args @gol
3558 -Wmisleading-indentation @r{(only for C/C++)} @gol
3559 -Wmissing-braces @r{(only for C/ObjC)} @gol
3560 -Wnarrowing @r{(only for C++)}  @gol
3561 -Wnonnull  @gol
3562 -Wnonnull-compare  @gol
3563 -Wopenmp-simd @gol
3564 -Wparentheses  @gol
3565 -Wpointer-sign  @gol
3566 -Wreorder   @gol
3567 -Wreturn-type  @gol
3568 -Wsequence-point  @gol
3569 -Wsign-compare @r{(only in C++)}  @gol
3570 -Wsizeof-pointer-memaccess @gol
3571 -Wstrict-aliasing  @gol
3572 -Wstrict-overflow=1  @gol
3573 -Wswitch  @gol
3574 -Wtautological-compare  @gol
3575 -Wtrigraphs  @gol
3576 -Wuninitialized  @gol
3577 -Wunknown-pragmas  @gol
3578 -Wunused-function  @gol
3579 -Wunused-label     @gol
3580 -Wunused-value     @gol
3581 -Wunused-variable  @gol
3582 -Wvolatile-register-var @gol
3585 Note that some warning flags are not implied by @option{-Wall}.  Some of
3586 them warn about constructions that users generally do not consider
3587 questionable, but which occasionally you might wish to check for;
3588 others warn about constructions that are necessary or hard to avoid in
3589 some cases, and there is no simple way to modify the code to suppress
3590 the warning. Some of them are enabled by @option{-Wextra} but many of
3591 them must be enabled individually.
3593 @item -Wextra
3594 @opindex W
3595 @opindex Wextra
3596 @opindex Wno-extra
3597 This enables some extra warning flags that are not enabled by
3598 @option{-Wall}. (This option used to be called @option{-W}.  The older
3599 name is still supported, but the newer name is more descriptive.)
3601 @gccoptlist{-Wclobbered  @gol
3602 -Wempty-body  @gol
3603 -Wignored-qualifiers @gol
3604 -Wmissing-field-initializers  @gol
3605 -Wmissing-parameter-type @r{(C only)}  @gol
3606 -Wold-style-declaration @r{(C only)}  @gol
3607 -Woverride-init  @gol
3608 -Wsign-compare @r{(C only)} @gol
3609 -Wtype-limits  @gol
3610 -Wuninitialized  @gol
3611 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
3612 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3613 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3616 The option @option{-Wextra} also prints warning messages for the
3617 following cases:
3619 @itemize @bullet
3621 @item
3622 A pointer is compared against integer zero with @code{<}, @code{<=},
3623 @code{>}, or @code{>=}.
3625 @item
3626 (C++ only) An enumerator and a non-enumerator both appear in a
3627 conditional expression.
3629 @item
3630 (C++ only) Ambiguous virtual bases.
3632 @item
3633 (C++ only) Subscripting an array that has been declared @code{register}.
3635 @item
3636 (C++ only) Taking the address of a variable that has been declared
3637 @code{register}.
3639 @item
3640 (C++ only) A base class is not initialized in a derived class's copy
3641 constructor.
3643 @end itemize
3645 @item -Wchar-subscripts
3646 @opindex Wchar-subscripts
3647 @opindex Wno-char-subscripts
3648 Warn if an array subscript has type @code{char}.  This is a common cause
3649 of error, as programmers often forget that this type is signed on some
3650 machines.
3651 This warning is enabled by @option{-Wall}.
3653 @item -Wcomment
3654 @opindex Wcomment
3655 @opindex Wno-comment
3656 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3657 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3658 This warning is enabled by @option{-Wall}.
3660 @item -Wno-coverage-mismatch
3661 @opindex Wno-coverage-mismatch
3662 Warn if feedback profiles do not match when using the
3663 @option{-fprofile-use} option.
3664 If a source file is changed between compiling with @option{-fprofile-gen} and
3665 with @option{-fprofile-use}, the files with the profile feedback can fail
3666 to match the source file and GCC cannot use the profile feedback
3667 information.  By default, this warning is enabled and is treated as an
3668 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3669 warning or @option{-Wno-error=coverage-mismatch} can be used to
3670 disable the error.  Disabling the error for this warning can result in
3671 poorly optimized code and is useful only in the
3672 case of very minor changes such as bug fixes to an existing code-base.
3673 Completely disabling the warning is not recommended.
3675 @item -Wno-cpp
3676 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3678 Suppress warning messages emitted by @code{#warning} directives.
3680 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3681 @opindex Wdouble-promotion
3682 @opindex Wno-double-promotion
3683 Give a warning when a value of type @code{float} is implicitly
3684 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3685 floating-point unit implement @code{float} in hardware, but emulate
3686 @code{double} in software.  On such a machine, doing computations
3687 using @code{double} values is much more expensive because of the
3688 overhead required for software emulation.
3690 It is easy to accidentally do computations with @code{double} because
3691 floating-point literals are implicitly of type @code{double}.  For
3692 example, in:
3693 @smallexample
3694 @group
3695 float area(float radius)
3697    return 3.14159 * radius * radius;
3699 @end group
3700 @end smallexample
3701 the compiler performs the entire computation with @code{double}
3702 because the floating-point literal is a @code{double}.
3704 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
3705 @opindex Wduplicate-decl-specifier
3706 @opindex Wno-duplicate-decl-specifier
3707 Warn if a declaration has duplicate @code{const}, @code{volatile},
3708 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
3709 @option{-Wall}.
3711 @item -Wformat
3712 @itemx -Wformat=@var{n}
3713 @opindex Wformat
3714 @opindex Wno-format
3715 @opindex ffreestanding
3716 @opindex fno-builtin
3717 @opindex Wformat=
3718 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3719 the arguments supplied have types appropriate to the format string
3720 specified, and that the conversions specified in the format string make
3721 sense.  This includes standard functions, and others specified by format
3722 attributes (@pxref{Function Attributes}), in the @code{printf},
3723 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3724 not in the C standard) families (or other target-specific families).
3725 Which functions are checked without format attributes having been
3726 specified depends on the standard version selected, and such checks of
3727 functions without the attribute specified are disabled by
3728 @option{-ffreestanding} or @option{-fno-builtin}.
3730 The formats are checked against the format features supported by GNU
3731 libc version 2.2.  These include all ISO C90 and C99 features, as well
3732 as features from the Single Unix Specification and some BSD and GNU
3733 extensions.  Other library implementations may not support all these
3734 features; GCC does not support warning about features that go beyond a
3735 particular library's limitations.  However, if @option{-Wpedantic} is used
3736 with @option{-Wformat}, warnings are given about format features not
3737 in the selected standard version (but not for @code{strfmon} formats,
3738 since those are not in any version of the C standard).  @xref{C Dialect
3739 Options,,Options Controlling C Dialect}.
3741 @table @gcctabopt
3742 @item -Wformat=1
3743 @itemx -Wformat
3744 @opindex Wformat
3745 @opindex Wformat=1
3746 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3747 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3748 @option{-Wformat} also checks for null format arguments for several
3749 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3750 aspects of this level of format checking can be disabled by the
3751 options: @option{-Wno-format-contains-nul},
3752 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3753 @option{-Wformat} is enabled by @option{-Wall}.
3755 @item -Wno-format-contains-nul
3756 @opindex Wno-format-contains-nul
3757 @opindex Wformat-contains-nul
3758 If @option{-Wformat} is specified, do not warn about format strings that
3759 contain NUL bytes.
3761 @item -Wno-format-extra-args
3762 @opindex Wno-format-extra-args
3763 @opindex Wformat-extra-args
3764 If @option{-Wformat} is specified, do not warn about excess arguments to a
3765 @code{printf} or @code{scanf} format function.  The C standard specifies
3766 that such arguments are ignored.
3768 Where the unused arguments lie between used arguments that are
3769 specified with @samp{$} operand number specifications, normally
3770 warnings are still given, since the implementation could not know what
3771 type to pass to @code{va_arg} to skip the unused arguments.  However,
3772 in the case of @code{scanf} formats, this option suppresses the
3773 warning if the unused arguments are all pointers, since the Single
3774 Unix Specification says that such unused arguments are allowed.
3776 @item -Wno-format-zero-length
3777 @opindex Wno-format-zero-length
3778 @opindex Wformat-zero-length
3779 If @option{-Wformat} is specified, do not warn about zero-length formats.
3780 The C standard specifies that zero-length formats are allowed.
3783 @item -Wformat=2
3784 @opindex Wformat=2
3785 Enable @option{-Wformat} plus additional format checks.  Currently
3786 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3787 -Wformat-y2k}.
3789 @item -Wformat-nonliteral
3790 @opindex Wformat-nonliteral
3791 @opindex Wno-format-nonliteral
3792 If @option{-Wformat} is specified, also warn if the format string is not a
3793 string literal and so cannot be checked, unless the format function
3794 takes its format arguments as a @code{va_list}.
3796 @item -Wformat-security
3797 @opindex Wformat-security
3798 @opindex Wno-format-security
3799 If @option{-Wformat} is specified, also warn about uses of format
3800 functions that represent possible security problems.  At present, this
3801 warns about calls to @code{printf} and @code{scanf} functions where the
3802 format string is not a string literal and there are no format arguments,
3803 as in @code{printf (foo);}.  This may be a security hole if the format
3804 string came from untrusted input and contains @samp{%n}.  (This is
3805 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3806 in future warnings may be added to @option{-Wformat-security} that are not
3807 included in @option{-Wformat-nonliteral}.)
3809 @item -Wformat-signedness
3810 @opindex Wformat-signedness
3811 @opindex Wno-format-signedness
3812 If @option{-Wformat} is specified, also warn if the format string
3813 requires an unsigned argument and the argument is signed and vice versa.
3815 @item -Wformat-y2k
3816 @opindex Wformat-y2k
3817 @opindex Wno-format-y2k
3818 If @option{-Wformat} is specified, also warn about @code{strftime}
3819 formats that may yield only a two-digit year.
3820 @end table
3822 @item -Wnonnull
3823 @opindex Wnonnull
3824 @opindex Wno-nonnull
3825 Warn about passing a null pointer for arguments marked as
3826 requiring a non-null value by the @code{nonnull} function attribute.
3828 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3829 can be disabled with the @option{-Wno-nonnull} option.
3831 @item -Wnonnull-compare
3832 @opindex Wnonnull-compare
3833 @opindex Wno-nonnull-compare
3834 Warn when comparing an argument marked with the @code{nonnull}
3835 function attribute against null inside the function.
3837 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
3838 can be disabled with the @option{-Wno-nonnull-compare} option.
3840 @item -Wnull-dereference
3841 @opindex Wnull-dereference
3842 @opindex Wno-null-dereference
3843 Warn if the compiler detects paths that trigger erroneous or
3844 undefined behavior due to dereferencing a null pointer.  This option
3845 is only active when @option{-fdelete-null-pointer-checks} is active,
3846 which is enabled by optimizations in most targets.  The precision of
3847 the warnings depends on the optimization options used.
3849 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3850 @opindex Winit-self
3851 @opindex Wno-init-self
3852 Warn about uninitialized variables that are initialized with themselves.
3853 Note this option can only be used with the @option{-Wuninitialized} option.
3855 For example, GCC warns about @code{i} being uninitialized in the
3856 following snippet only when @option{-Winit-self} has been specified:
3857 @smallexample
3858 @group
3859 int f()
3861   int i = i;
3862   return i;
3864 @end group
3865 @end smallexample
3867 This warning is enabled by @option{-Wall} in C++.
3869 @item -Wimplicit-int @r{(C and Objective-C only)}
3870 @opindex Wimplicit-int
3871 @opindex Wno-implicit-int
3872 Warn when a declaration does not specify a type.
3873 This warning is enabled by @option{-Wall}.
3875 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3876 @opindex Wimplicit-function-declaration
3877 @opindex Wno-implicit-function-declaration
3878 Give a warning whenever a function is used before being declared. In
3879 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3880 enabled by default and it is made into an error by
3881 @option{-pedantic-errors}. This warning is also enabled by
3882 @option{-Wall}.
3884 @item -Wimplicit @r{(C and Objective-C only)}
3885 @opindex Wimplicit
3886 @opindex Wno-implicit
3887 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3888 This warning is enabled by @option{-Wall}.
3890 @item -Wignored-qualifiers @r{(C and C++ only)}
3891 @opindex Wignored-qualifiers
3892 @opindex Wno-ignored-qualifiers
3893 Warn if the return type of a function has a type qualifier
3894 such as @code{const}.  For ISO C such a type qualifier has no effect,
3895 since the value returned by a function is not an lvalue.
3896 For C++, the warning is only emitted for scalar types or @code{void}.
3897 ISO C prohibits qualified @code{void} return types on function
3898 definitions, so such return types always receive a warning
3899 even without this option.
3901 This warning is also enabled by @option{-Wextra}.
3903 @item -Wignored-attributes @r{(C and C++ only)}
3904 @opindex Wignored-attributes
3905 @opindex Wno-ignored-attributes
3906 Warn when an attribute is ignored.  This is different from the
3907 @option{-Wattributes} option in that it warns whenever the compiler decides
3908 to drop an attribute, not that the attribute is either unknown, used in a
3909 wrong place, etc.  This warning is enabled by default.
3911 @item -Wmain
3912 @opindex Wmain
3913 @opindex Wno-main
3914 Warn if the type of @code{main} is suspicious.  @code{main} should be
3915 a function with external linkage, returning int, taking either zero
3916 arguments, two, or three arguments of appropriate types.  This warning
3917 is enabled by default in C++ and is enabled by either @option{-Wall}
3918 or @option{-Wpedantic}.
3920 @item -Wmisleading-indentation @r{(C and C++ only)}
3921 @opindex Wmisleading-indentation
3922 @opindex Wno-misleading-indentation
3923 Warn when the indentation of the code does not reflect the block structure.
3924 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
3925 @code{for} clauses with a guarded statement that does not use braces,
3926 followed by an unguarded statement with the same indentation.
3928 In the following example, the call to ``bar'' is misleadingly indented as
3929 if it were guarded by the ``if'' conditional.
3931 @smallexample
3932   if (some_condition ())
3933     foo ();
3934     bar ();  /* Gotcha: this is not guarded by the "if".  */
3935 @end smallexample
3937 In the case of mixed tabs and spaces, the warning uses the
3938 @option{-ftabstop=} option to determine if the statements line up
3939 (defaulting to 8).
3941 The warning is not issued for code involving multiline preprocessor logic
3942 such as the following example.
3944 @smallexample
3945   if (flagA)
3946     foo (0);
3947 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
3948   if (flagB)
3949 #endif
3950     foo (1);
3951 @end smallexample
3953 The warning is not issued after a @code{#line} directive, since this
3954 typically indicates autogenerated code, and no assumptions can be made
3955 about the layout of the file that the directive references.
3957 This warning is enabled by @option{-Wall} in C and C++.
3959 @item -Wmissing-braces
3960 @opindex Wmissing-braces
3961 @opindex Wno-missing-braces
3962 Warn if an aggregate or union initializer is not fully bracketed.  In
3963 the following example, the initializer for @code{a} is not fully
3964 bracketed, but that for @code{b} is fully bracketed.  This warning is
3965 enabled by @option{-Wall} in C.
3967 @smallexample
3968 int a[2][2] = @{ 0, 1, 2, 3 @};
3969 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3970 @end smallexample
3972 This warning is enabled by @option{-Wall}.
3974 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3975 @opindex Wmissing-include-dirs
3976 @opindex Wno-missing-include-dirs
3977 Warn if a user-supplied include directory does not exist.
3979 @item -Wparentheses
3980 @opindex Wparentheses
3981 @opindex Wno-parentheses
3982 Warn if parentheses are omitted in certain contexts, such
3983 as when there is an assignment in a context where a truth value
3984 is expected, or when operators are nested whose precedence people
3985 often get confused about.
3987 Also warn if a comparison like @code{x<=y<=z} appears; this is
3988 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
3989 interpretation from that of ordinary mathematical notation.
3991 Also warn for dangerous uses of the GNU extension to
3992 @code{?:} with omitted middle operand. When the condition
3993 in the @code{?}: operator is a boolean expression, the omitted value is
3994 always 1.  Often programmers expect it to be a value computed
3995 inside the conditional expression instead.
3997 This warning is enabled by @option{-Wall}.
3999 @item -Wsequence-point
4000 @opindex Wsequence-point
4001 @opindex Wno-sequence-point
4002 Warn about code that may have undefined semantics because of violations
4003 of sequence point rules in the C and C++ standards.
4005 The C and C++ standards define the order in which expressions in a C/C++
4006 program are evaluated in terms of @dfn{sequence points}, which represent
4007 a partial ordering between the execution of parts of the program: those
4008 executed before the sequence point, and those executed after it.  These
4009 occur after the evaluation of a full expression (one which is not part
4010 of a larger expression), after the evaluation of the first operand of a
4011 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4012 function is called (but after the evaluation of its arguments and the
4013 expression denoting the called function), and in certain other places.
4014 Other than as expressed by the sequence point rules, the order of
4015 evaluation of subexpressions of an expression is not specified.  All
4016 these rules describe only a partial order rather than a total order,
4017 since, for example, if two functions are called within one expression
4018 with no sequence point between them, the order in which the functions
4019 are called is not specified.  However, the standards committee have
4020 ruled that function calls do not overlap.
4022 It is not specified when between sequence points modifications to the
4023 values of objects take effect.  Programs whose behavior depends on this
4024 have undefined behavior; the C and C++ standards specify that ``Between
4025 the previous and next sequence point an object shall have its stored
4026 value modified at most once by the evaluation of an expression.
4027 Furthermore, the prior value shall be read only to determine the value
4028 to be stored.''.  If a program breaks these rules, the results on any
4029 particular implementation are entirely unpredictable.
4031 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4032 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4033 diagnosed by this option, and it may give an occasional false positive
4034 result, but in general it has been found fairly effective at detecting
4035 this sort of problem in programs.
4037 The standard is worded confusingly, therefore there is some debate
4038 over the precise meaning of the sequence point rules in subtle cases.
4039 Links to discussions of the problem, including proposed formal
4040 definitions, may be found on the GCC readings page, at
4041 @uref{http://gcc.gnu.org/@/readings.html}.
4043 This warning is enabled by @option{-Wall} for C and C++.
4045 @item -Wno-return-local-addr
4046 @opindex Wno-return-local-addr
4047 @opindex Wreturn-local-addr
4048 Do not warn about returning a pointer (or in C++, a reference) to a
4049 variable that goes out of scope after the function returns.
4051 @item -Wreturn-type
4052 @opindex Wreturn-type
4053 @opindex Wno-return-type
4054 Warn whenever a function is defined with a return type that defaults
4055 to @code{int}.  Also warn about any @code{return} statement with no
4056 return value in a function whose return type is not @code{void}
4057 (falling off the end of the function body is considered returning
4058 without a value).
4060 For C only, warn about a @code{return} statement with an expression in a
4061 function whose return type is @code{void}, unless the expression type is
4062 also @code{void}.  As a GNU extension, the latter case is accepted
4063 without a warning unless @option{-Wpedantic} is used.
4065 For C++, a function without return type always produces a diagnostic
4066 message, even when @option{-Wno-return-type} is specified.  The only
4067 exceptions are @code{main} and functions defined in system headers.
4069 This warning is enabled by @option{-Wall}.
4071 @item -Wshift-count-negative
4072 @opindex Wshift-count-negative
4073 @opindex Wno-shift-count-negative
4074 Warn if shift count is negative. This warning is enabled by default.
4076 @item -Wshift-count-overflow
4077 @opindex Wshift-count-overflow
4078 @opindex Wno-shift-count-overflow
4079 Warn if shift count >= width of type. This warning is enabled by default.
4081 @item -Wshift-negative-value
4082 @opindex Wshift-negative-value
4083 @opindex Wno-shift-negative-value
4084 Warn if left shifting a negative value.  This warning is enabled by
4085 @option{-Wextra} in C99 and C++11 modes (and newer).
4087 @item -Wshift-overflow
4088 @itemx -Wshift-overflow=@var{n}
4089 @opindex Wshift-overflow
4090 @opindex Wno-shift-overflow
4091 Warn about left shift overflows.  This warning is enabled by
4092 default in C99 and C++11 modes (and newer).
4094 @table @gcctabopt
4095 @item -Wshift-overflow=1
4096 This is the warning level of @option{-Wshift-overflow} and is enabled
4097 by default in C99 and C++11 modes (and newer).  This warning level does
4098 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4099 an overflow is still rejected in contexts where an integer constant expression
4100 is required.)
4102 @item -Wshift-overflow=2
4103 This warning level also warns about left-shifting 1 into the sign bit,
4104 unless C++14 mode is active.
4105 @end table
4107 @item -Wswitch
4108 @opindex Wswitch
4109 @opindex Wno-switch
4110 Warn whenever a @code{switch} statement has an index of enumerated type
4111 and lacks a @code{case} for one or more of the named codes of that
4112 enumeration.  (The presence of a @code{default} label prevents this
4113 warning.)  @code{case} labels outside the enumeration range also
4114 provoke warnings when this option is used (even if there is a
4115 @code{default} label).
4116 This warning is enabled by @option{-Wall}.
4118 @item -Wswitch-default
4119 @opindex Wswitch-default
4120 @opindex Wno-switch-default
4121 Warn whenever a @code{switch} statement does not have a @code{default}
4122 case.
4124 @item -Wswitch-enum
4125 @opindex Wswitch-enum
4126 @opindex Wno-switch-enum
4127 Warn whenever a @code{switch} statement has an index of enumerated type
4128 and lacks a @code{case} for one or more of the named codes of that
4129 enumeration.  @code{case} labels outside the enumeration range also
4130 provoke warnings when this option is used.  The only difference
4131 between @option{-Wswitch} and this option is that this option gives a
4132 warning about an omitted enumeration code even if there is a
4133 @code{default} label.
4135 @item -Wswitch-bool
4136 @opindex Wswitch-bool
4137 @opindex Wno-switch-bool
4138 Warn whenever a @code{switch} statement has an index of boolean type
4139 and the case values are outside the range of a boolean type.
4140 It is possible to suppress this warning by casting the controlling
4141 expression to a type other than @code{bool}.  For example:
4142 @smallexample
4143 @group
4144 switch ((int) (a == 4))
4145   @{
4146   @dots{}
4147   @}
4148 @end group
4149 @end smallexample
4150 This warning is enabled by default for C and C++ programs.
4152 @item -Wswitch-unreachable
4153 @opindex Wswitch-unreachable
4154 @opindex Wno-switch-unreachable
4155 Warn whenever a @code{switch} statement contains statements between the
4156 controlling expression and the first case label, which will never be
4157 executed.  For example:
4158 @smallexample
4159 @group
4160 switch (cond)
4161   @{
4162    i = 15;
4163   @dots{}
4164    case 5:
4165   @dots{}
4166   @}
4167 @end group
4168 @end smallexample
4169 @option{-Wswitch-unreachable} does not warn if the statement between the
4170 controlling expression and the first case label is just a declaration:
4171 @smallexample
4172 @group
4173 switch (cond)
4174   @{
4175    int i;
4176   @dots{}
4177    case 5:
4178    i = 5;
4179   @dots{}
4180   @}
4181 @end group
4182 @end smallexample
4183 This warning is enabled by default for C and C++ programs.
4185 @item -Wsync-nand @r{(C and C++ only)}
4186 @opindex Wsync-nand
4187 @opindex Wno-sync-nand
4188 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4189 built-in functions are used.  These functions changed semantics in GCC 4.4.
4191 @item -Wtrigraphs
4192 @opindex Wtrigraphs
4193 @opindex Wno-trigraphs
4194 Warn if any trigraphs are encountered that might change the meaning of
4195 the program (trigraphs within comments are not warned about).
4196 This warning is enabled by @option{-Wall}.
4198 @item -Wunused-but-set-parameter
4199 @opindex Wunused-but-set-parameter
4200 @opindex Wno-unused-but-set-parameter
4201 Warn whenever a function parameter is assigned to, but otherwise unused
4202 (aside from its declaration).
4204 To suppress this warning use the @code{unused} attribute
4205 (@pxref{Variable Attributes}).
4207 This warning is also enabled by @option{-Wunused} together with
4208 @option{-Wextra}.
4210 @item -Wunused-but-set-variable
4211 @opindex Wunused-but-set-variable
4212 @opindex Wno-unused-but-set-variable
4213 Warn whenever a local variable is assigned to, but otherwise unused
4214 (aside from its declaration).
4215 This warning is enabled by @option{-Wall}.
4217 To suppress this warning use the @code{unused} attribute
4218 (@pxref{Variable Attributes}).
4220 This warning is also enabled by @option{-Wunused}, which is enabled
4221 by @option{-Wall}.
4223 @item -Wunused-function
4224 @opindex Wunused-function
4225 @opindex Wno-unused-function
4226 Warn whenever a static function is declared but not defined or a
4227 non-inline static function is unused.
4228 This warning is enabled by @option{-Wall}.
4230 @item -Wunused-label
4231 @opindex Wunused-label
4232 @opindex Wno-unused-label
4233 Warn whenever a label is declared but not used.
4234 This warning is enabled by @option{-Wall}.
4236 To suppress this warning use the @code{unused} attribute
4237 (@pxref{Variable Attributes}).
4239 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4240 @opindex Wunused-local-typedefs
4241 Warn when a typedef locally defined in a function is not used.
4242 This warning is enabled by @option{-Wall}.
4244 @item -Wunused-parameter
4245 @opindex Wunused-parameter
4246 @opindex Wno-unused-parameter
4247 Warn whenever a function parameter is unused aside from its declaration.
4249 To suppress this warning use the @code{unused} attribute
4250 (@pxref{Variable Attributes}).
4252 @item -Wno-unused-result
4253 @opindex Wunused-result
4254 @opindex Wno-unused-result
4255 Do not warn if a caller of a function marked with attribute
4256 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4257 its return value. The default is @option{-Wunused-result}.
4259 @item -Wunused-variable
4260 @opindex Wunused-variable
4261 @opindex Wno-unused-variable
4262 Warn whenever a local or static variable is unused aside from its
4263 declaration. This option implies @option{-Wunused-const-variable=1} for C,
4264 but not for C++. This warning is enabled by @option{-Wall}.
4266 To suppress this warning use the @code{unused} attribute
4267 (@pxref{Variable Attributes}).
4269 @item -Wunused-const-variable
4270 @itemx -Wunused-const-variable=@var{n}
4271 @opindex Wunused-const-variable
4272 @opindex Wno-unused-const-variable
4273 Warn whenever a constant static variable is unused aside from its declaration.
4274 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
4275 for C, but not for C++. In C this declares variable storage, but in C++ this
4276 is not an error since const variables take the place of @code{#define}s.
4278 To suppress this warning use the @code{unused} attribute
4279 (@pxref{Variable Attributes}).
4281 @table @gcctabopt
4282 @item -Wunused-const-variable=1
4283 This is the warning level that is enabled by @option{-Wunused-variable} for
4284 C.  It warns only about unused static const variables defined in the main
4285 compilation unit, but not about static const variables declared in any
4286 header included.
4288 @item -Wunused-const-variable=2
4289 This warning level also warns for unused constant static variables in
4290 headers (excluding system headers).  This is the warning level of
4291 @option{-Wunused-const-variable} and must be explicitly requested since
4292 in C++ this isn't an error and in C it might be harder to clean up all
4293 headers included.
4294 @end table
4296 @item -Wunused-value
4297 @opindex Wunused-value
4298 @opindex Wno-unused-value
4299 Warn whenever a statement computes a result that is explicitly not
4300 used. To suppress this warning cast the unused expression to
4301 @code{void}. This includes an expression-statement or the left-hand
4302 side of a comma expression that contains no side effects. For example,
4303 an expression such as @code{x[i,j]} causes a warning, while
4304 @code{x[(void)i,j]} does not.
4306 This warning is enabled by @option{-Wall}.
4308 @item -Wunused
4309 @opindex Wunused
4310 @opindex Wno-unused
4311 All the above @option{-Wunused} options combined.
4313 In order to get a warning about an unused function parameter, you must
4314 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4315 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4317 @item -Wuninitialized
4318 @opindex Wuninitialized
4319 @opindex Wno-uninitialized
4320 Warn if an automatic variable is used without first being initialized
4321 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4322 warn if a non-static reference or non-static @code{const} member
4323 appears in a class without constructors.
4325 If you want to warn about code that uses the uninitialized value of the
4326 variable in its own initializer, use the @option{-Winit-self} option.
4328 These warnings occur for individual uninitialized or clobbered
4329 elements of structure, union or array variables as well as for
4330 variables that are uninitialized or clobbered as a whole.  They do
4331 not occur for variables or elements declared @code{volatile}.  Because
4332 these warnings depend on optimization, the exact variables or elements
4333 for which there are warnings depends on the precise optimization
4334 options and version of GCC used.
4336 Note that there may be no warning about a variable that is used only
4337 to compute a value that itself is never used, because such
4338 computations may be deleted by data flow analysis before the warnings
4339 are printed.
4341 @item -Winvalid-memory-model
4342 @opindex Winvalid-memory-model
4343 @opindex Wno-invalid-memory-model
4344 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
4345 and the C11 atomic generic functions with a memory consistency argument
4346 that is either invalid for the operation or outside the range of values
4347 of the @code{memory_order} enumeration.  For example, since the
4348 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
4349 defined for the relaxed, release, and sequentially consistent memory
4350 orders the following code is diagnosed:
4352 @smallexample
4353 void store (int *i)
4355   __atomic_store_n (i, 0, memory_order_consume);
4357 @end smallexample
4359 @option{-Winvalid-memory-model} is enabled by default.
4361 @item -Wmaybe-uninitialized
4362 @opindex Wmaybe-uninitialized
4363 @opindex Wno-maybe-uninitialized
4364 For an automatic variable, if there exists a path from the function
4365 entry to a use of the variable that is initialized, but there exist
4366 some other paths for which the variable is not initialized, the compiler
4367 emits a warning if it cannot prove the uninitialized paths are not
4368 executed at run time. These warnings are made optional because GCC is
4369 not smart enough to see all the reasons why the code might be correct
4370 in spite of appearing to have an error.  Here is one example of how
4371 this can happen:
4373 @smallexample
4374 @group
4376   int x;
4377   switch (y)
4378     @{
4379     case 1: x = 1;
4380       break;
4381     case 2: x = 4;
4382       break;
4383     case 3: x = 5;
4384     @}
4385   foo (x);
4387 @end group
4388 @end smallexample
4390 @noindent
4391 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4392 always initialized, but GCC doesn't know this. To suppress the
4393 warning, you need to provide a default case with assert(0) or
4394 similar code.
4396 @cindex @code{longjmp} warnings
4397 This option also warns when a non-volatile automatic variable might be
4398 changed by a call to @code{longjmp}.  These warnings as well are possible
4399 only in optimizing compilation.
4401 The compiler sees only the calls to @code{setjmp}.  It cannot know
4402 where @code{longjmp} will be called; in fact, a signal handler could
4403 call it at any point in the code.  As a result, you may get a warning
4404 even when there is in fact no problem because @code{longjmp} cannot
4405 in fact be called at the place that would cause a problem.
4407 Some spurious warnings can be avoided if you declare all the functions
4408 you use that never return as @code{noreturn}.  @xref{Function
4409 Attributes}.
4411 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4413 @item -Wunknown-pragmas
4414 @opindex Wunknown-pragmas
4415 @opindex Wno-unknown-pragmas
4416 @cindex warning for unknown pragmas
4417 @cindex unknown pragmas, warning
4418 @cindex pragmas, warning of unknown
4419 Warn when a @code{#pragma} directive is encountered that is not understood by 
4420 GCC@.  If this command-line option is used, warnings are even issued
4421 for unknown pragmas in system header files.  This is not the case if
4422 the warnings are only enabled by the @option{-Wall} command-line option.
4424 @item -Wno-pragmas
4425 @opindex Wno-pragmas
4426 @opindex Wpragmas
4427 Do not warn about misuses of pragmas, such as incorrect parameters,
4428 invalid syntax, or conflicts between pragmas.  See also
4429 @option{-Wunknown-pragmas}.
4431 @item -Wstrict-aliasing
4432 @opindex Wstrict-aliasing
4433 @opindex Wno-strict-aliasing
4434 This option is only active when @option{-fstrict-aliasing} is active.
4435 It warns about code that might break the strict aliasing rules that the
4436 compiler is using for optimization.  The warning does not catch all
4437 cases, but does attempt to catch the more common pitfalls.  It is
4438 included in @option{-Wall}.
4439 It is equivalent to @option{-Wstrict-aliasing=3}
4441 @item -Wstrict-aliasing=n
4442 @opindex Wstrict-aliasing=n
4443 This option is only active when @option{-fstrict-aliasing} is active.
4444 It warns about code that might break the strict aliasing rules that the
4445 compiler is using for optimization.
4446 Higher levels correspond to higher accuracy (fewer false positives).
4447 Higher levels also correspond to more effort, similar to the way @option{-O} 
4448 works.
4449 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4451 Level 1: Most aggressive, quick, least accurate.
4452 Possibly useful when higher levels
4453 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4454 false negatives.  However, it has many false positives.
4455 Warns for all pointer conversions between possibly incompatible types,
4456 even if never dereferenced.  Runs in the front end only.
4458 Level 2: Aggressive, quick, not too precise.
4459 May still have many false positives (not as many as level 1 though),
4460 and few false negatives (but possibly more than level 1).
4461 Unlike level 1, it only warns when an address is taken.  Warns about
4462 incomplete types.  Runs in the front end only.
4464 Level 3 (default for @option{-Wstrict-aliasing}):
4465 Should have very few false positives and few false
4466 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4467 Takes care of the common pun+dereference pattern in the front end:
4468 @code{*(int*)&some_float}.
4469 If optimization is enabled, it also runs in the back end, where it deals
4470 with multiple statement cases using flow-sensitive points-to information.
4471 Only warns when the converted pointer is dereferenced.
4472 Does not warn about incomplete types.
4474 @item -Wstrict-overflow
4475 @itemx -Wstrict-overflow=@var{n}
4476 @opindex Wstrict-overflow
4477 @opindex Wno-strict-overflow
4478 This option is only active when @option{-fstrict-overflow} is active.
4479 It warns about cases where the compiler optimizes based on the
4480 assumption that signed overflow does not occur.  Note that it does not
4481 warn about all cases where the code might overflow: it only warns
4482 about cases where the compiler implements some optimization.  Thus
4483 this warning depends on the optimization level.
4485 An optimization that assumes that signed overflow does not occur is
4486 perfectly safe if the values of the variables involved are such that
4487 overflow never does, in fact, occur.  Therefore this warning can
4488 easily give a false positive: a warning about code that is not
4489 actually a problem.  To help focus on important issues, several
4490 warning levels are defined.  No warnings are issued for the use of
4491 undefined signed overflow when estimating how many iterations a loop
4492 requires, in particular when determining whether a loop will be
4493 executed at all.
4495 @table @gcctabopt
4496 @item -Wstrict-overflow=1
4497 Warn about cases that are both questionable and easy to avoid.  For
4498 example,  with @option{-fstrict-overflow}, the compiler simplifies
4499 @code{x + 1 > x} to @code{1}.  This level of
4500 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4501 are not, and must be explicitly requested.
4503 @item -Wstrict-overflow=2
4504 Also warn about other cases where a comparison is simplified to a
4505 constant.  For example: @code{abs (x) >= 0}.  This can only be
4506 simplified when @option{-fstrict-overflow} is in effect, because
4507 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4508 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4509 @option{-Wstrict-overflow=2}.
4511 @item -Wstrict-overflow=3
4512 Also warn about other cases where a comparison is simplified.  For
4513 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4515 @item -Wstrict-overflow=4
4516 Also warn about other simplifications not covered by the above cases.
4517 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4519 @item -Wstrict-overflow=5
4520 Also warn about cases where the compiler reduces the magnitude of a
4521 constant involved in a comparison.  For example: @code{x + 2 > y} is
4522 simplified to @code{x + 1 >= y}.  This is reported only at the
4523 highest warning level because this simplification applies to many
4524 comparisons, so this warning level gives a very large number of
4525 false positives.
4526 @end table
4528 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4529 @opindex Wsuggest-attribute=
4530 @opindex Wno-suggest-attribute=
4531 Warn for cases where adding an attribute may be beneficial. The
4532 attributes currently supported are listed below.
4534 @table @gcctabopt
4535 @item -Wsuggest-attribute=pure
4536 @itemx -Wsuggest-attribute=const
4537 @itemx -Wsuggest-attribute=noreturn
4538 @opindex Wsuggest-attribute=pure
4539 @opindex Wno-suggest-attribute=pure
4540 @opindex Wsuggest-attribute=const
4541 @opindex Wno-suggest-attribute=const
4542 @opindex Wsuggest-attribute=noreturn
4543 @opindex Wno-suggest-attribute=noreturn
4545 Warn about functions that might be candidates for attributes
4546 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4547 functions visible in other compilation units or (in the case of @code{pure} and
4548 @code{const}) if it cannot prove that the function returns normally. A function
4549 returns normally if it doesn't contain an infinite loop or return abnormally
4550 by throwing, calling @code{abort} or trapping.  This analysis requires option
4551 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4552 higher.  Higher optimization levels improve the accuracy of the analysis.
4554 @item -Wsuggest-attribute=format
4555 @itemx -Wmissing-format-attribute
4556 @opindex Wsuggest-attribute=format
4557 @opindex Wmissing-format-attribute
4558 @opindex Wno-suggest-attribute=format
4559 @opindex Wno-missing-format-attribute
4560 @opindex Wformat
4561 @opindex Wno-format
4563 Warn about function pointers that might be candidates for @code{format}
4564 attributes.  Note these are only possible candidates, not absolute ones.
4565 GCC guesses that function pointers with @code{format} attributes that
4566 are used in assignment, initialization, parameter passing or return
4567 statements should have a corresponding @code{format} attribute in the
4568 resulting type.  I.e.@: the left-hand side of the assignment or
4569 initialization, the type of the parameter variable, or the return type
4570 of the containing function respectively should also have a @code{format}
4571 attribute to avoid the warning.
4573 GCC also warns about function definitions that might be
4574 candidates for @code{format} attributes.  Again, these are only
4575 possible candidates.  GCC guesses that @code{format} attributes
4576 might be appropriate for any function that calls a function like
4577 @code{vprintf} or @code{vscanf}, but this might not always be the
4578 case, and some functions for which @code{format} attributes are
4579 appropriate may not be detected.
4580 @end table
4582 @item -Wsuggest-final-types
4583 @opindex Wno-suggest-final-types
4584 @opindex Wsuggest-final-types
4585 Warn about types with virtual methods where code quality would be improved
4586 if the type were declared with the C++11 @code{final} specifier, 
4587 or, if possible,
4588 declared in an anonymous namespace. This allows GCC to more aggressively
4589 devirtualize the polymorphic calls. This warning is more effective with link
4590 time optimization, where the information about the class hierarchy graph is
4591 more complete.
4593 @item -Wsuggest-final-methods
4594 @opindex Wno-suggest-final-methods
4595 @opindex Wsuggest-final-methods
4596 Warn about virtual methods where code quality would be improved if the method
4597 were declared with the C++11 @code{final} specifier, 
4598 or, if possible, its type were
4599 declared in an anonymous namespace or with the @code{final} specifier.
4600 This warning is
4601 more effective with link time optimization, where the information about the
4602 class hierarchy graph is more complete. It is recommended to first consider
4603 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4604 annotations.
4606 @item -Wsuggest-override
4607 Warn about overriding virtual functions that are not marked with the override
4608 keyword.
4610 @item -Warray-bounds
4611 @itemx -Warray-bounds=@var{n}
4612 @opindex Wno-array-bounds
4613 @opindex Warray-bounds
4614 This option is only active when @option{-ftree-vrp} is active
4615 (default for @option{-O2} and above). It warns about subscripts to arrays
4616 that are always out of bounds. This warning is enabled by @option{-Wall}.
4618 @table @gcctabopt
4619 @item -Warray-bounds=1
4620 This is the warning level of @option{-Warray-bounds} and is enabled
4621 by @option{-Wall}; higher levels are not, and must be explicitly requested.
4623 @item -Warray-bounds=2
4624 This warning level also warns about out of bounds access for
4625 arrays at the end of a struct and for arrays accessed through
4626 pointers. This warning level may give a larger number of
4627 false positives and is deactivated by default.
4628 @end table
4630 @item -Wbool-compare
4631 @opindex Wno-bool-compare
4632 @opindex Wbool-compare
4633 Warn about boolean expression compared with an integer value different from
4634 @code{true}/@code{false}.  For instance, the following comparison is
4635 always false:
4636 @smallexample
4637 int n = 5;
4638 @dots{}
4639 if ((n > 1) == 2) @{ @dots{} @}
4640 @end smallexample
4641 This warning is enabled by @option{-Wall}.
4643 @item -Wduplicated-cond
4644 @opindex Wno-duplicated-cond
4645 @opindex Wduplicated-cond
4646 Warn about duplicated conditions in an if-else-if chain.  For instance,
4647 warn for the following code:
4648 @smallexample
4649 if (p->q != NULL) @{ @dots{} @}
4650 else if (p->q != NULL) @{ @dots{} @}
4651 @end smallexample
4653 @item -Wframe-address
4654 @opindex Wno-frame-address
4655 @opindex Wframe-address
4656 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
4657 is called with an argument greater than 0.  Such calls may return indeterminate
4658 values or crash the program.  The warning is included in @option{-Wall}.
4660 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4661 @opindex Wno-discarded-qualifiers
4662 @opindex Wdiscarded-qualifiers
4663 Do not warn if type qualifiers on pointers are being discarded.
4664 Typically, the compiler warns if a @code{const char *} variable is
4665 passed to a function that takes a @code{char *} parameter.  This option
4666 can be used to suppress such a warning.
4668 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
4669 @opindex Wno-discarded-array-qualifiers
4670 @opindex Wdiscarded-array-qualifiers
4671 Do not warn if type qualifiers on arrays which are pointer targets
4672 are being discarded. Typically, the compiler warns if a
4673 @code{const int (*)[]} variable is passed to a function that
4674 takes a @code{int (*)[]} parameter.  This option can be used to
4675 suppress such a warning.
4677 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4678 @opindex Wno-incompatible-pointer-types
4679 @opindex Wincompatible-pointer-types
4680 Do not warn when there is a conversion between pointers that have incompatible
4681 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4682 which warns for pointer argument passing or assignment with different
4683 signedness.
4685 @item -Wno-int-conversion @r{(C and Objective-C only)}
4686 @opindex Wno-int-conversion
4687 @opindex Wint-conversion
4688 Do not warn about incompatible integer to pointer and pointer to integer
4689 conversions.  This warning is about implicit conversions; for explicit
4690 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4691 @option{-Wno-pointer-to-int-cast} may be used.
4693 @item -Wno-div-by-zero
4694 @opindex Wno-div-by-zero
4695 @opindex Wdiv-by-zero
4696 Do not warn about compile-time integer division by zero.  Floating-point
4697 division by zero is not warned about, as it can be a legitimate way of
4698 obtaining infinities and NaNs.
4700 @item -Wsystem-headers
4701 @opindex Wsystem-headers
4702 @opindex Wno-system-headers
4703 @cindex warnings from system headers
4704 @cindex system headers, warnings from
4705 Print warning messages for constructs found in system header files.
4706 Warnings from system headers are normally suppressed, on the assumption
4707 that they usually do not indicate real problems and would only make the
4708 compiler output harder to read.  Using this command-line option tells
4709 GCC to emit warnings from system headers as if they occurred in user
4710 code.  However, note that using @option{-Wall} in conjunction with this
4711 option does @emph{not} warn about unknown pragmas in system
4712 headers---for that, @option{-Wunknown-pragmas} must also be used.
4714 @item -Wtautological-compare
4715 @opindex Wtautological-compare
4716 @opindex Wno-tautological-compare
4717 Warn if a self-comparison always evaluates to true or false.  This
4718 warning detects various mistakes such as:
4719 @smallexample
4720 int i = 1;
4721 @dots{}
4722 if (i > i) @{ @dots{} @}
4723 @end smallexample
4724 This warning is enabled by @option{-Wall}.
4726 @item -Wtrampolines
4727 @opindex Wtrampolines
4728 @opindex Wno-trampolines
4729 Warn about trampolines generated for pointers to nested functions.
4730 A trampoline is a small piece of data or code that is created at run
4731 time on the stack when the address of a nested function is taken, and is
4732 used to call the nested function indirectly.  For some targets, it is
4733 made up of data only and thus requires no special treatment.  But, for
4734 most targets, it is made up of code and thus requires the stack to be
4735 made executable in order for the program to work properly.
4737 @item -Wfloat-equal
4738 @opindex Wfloat-equal
4739 @opindex Wno-float-equal
4740 Warn if floating-point values are used in equality comparisons.
4742 The idea behind this is that sometimes it is convenient (for the
4743 programmer) to consider floating-point values as approximations to
4744 infinitely precise real numbers.  If you are doing this, then you need
4745 to compute (by analyzing the code, or in some other way) the maximum or
4746 likely maximum error that the computation introduces, and allow for it
4747 when performing comparisons (and when producing output, but that's a
4748 different problem).  In particular, instead of testing for equality, you
4749 should check to see whether the two values have ranges that overlap; and
4750 this is done with the relational operators, so equality comparisons are
4751 probably mistaken.
4753 @item -Wtraditional @r{(C and Objective-C only)}
4754 @opindex Wtraditional
4755 @opindex Wno-traditional
4756 Warn about certain constructs that behave differently in traditional and
4757 ISO C@.  Also warn about ISO C constructs that have no traditional C
4758 equivalent, and/or problematic constructs that should be avoided.
4760 @itemize @bullet
4761 @item
4762 Macro parameters that appear within string literals in the macro body.
4763 In traditional C macro replacement takes place within string literals,
4764 but in ISO C it does not.
4766 @item
4767 In traditional C, some preprocessor directives did not exist.
4768 Traditional preprocessors only considered a line to be a directive
4769 if the @samp{#} appeared in column 1 on the line.  Therefore
4770 @option{-Wtraditional} warns about directives that traditional C
4771 understands but ignores because the @samp{#} does not appear as the
4772 first character on the line.  It also suggests you hide directives like
4773 @code{#pragma} not understood by traditional C by indenting them.  Some
4774 traditional implementations do not recognize @code{#elif}, so this option
4775 suggests avoiding it altogether.
4777 @item
4778 A function-like macro that appears without arguments.
4780 @item
4781 The unary plus operator.
4783 @item
4784 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4785 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4786 constants.)  Note, these suffixes appear in macros defined in the system
4787 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4788 Use of these macros in user code might normally lead to spurious
4789 warnings, however GCC's integrated preprocessor has enough context to
4790 avoid warning in these cases.
4792 @item
4793 A function declared external in one block and then used after the end of
4794 the block.
4796 @item
4797 A @code{switch} statement has an operand of type @code{long}.
4799 @item
4800 A non-@code{static} function declaration follows a @code{static} one.
4801 This construct is not accepted by some traditional C compilers.
4803 @item
4804 The ISO type of an integer constant has a different width or
4805 signedness from its traditional type.  This warning is only issued if
4806 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4807 typically represent bit patterns, are not warned about.
4809 @item
4810 Usage of ISO string concatenation is detected.
4812 @item
4813 Initialization of automatic aggregates.
4815 @item
4816 Identifier conflicts with labels.  Traditional C lacks a separate
4817 namespace for labels.
4819 @item
4820 Initialization of unions.  If the initializer is zero, the warning is
4821 omitted.  This is done under the assumption that the zero initializer in
4822 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4823 initializer warnings and relies on default initialization to zero in the
4824 traditional C case.
4826 @item
4827 Conversions by prototypes between fixed/floating-point values and vice
4828 versa.  The absence of these prototypes when compiling with traditional
4829 C causes serious problems.  This is a subset of the possible
4830 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4832 @item
4833 Use of ISO C style function definitions.  This warning intentionally is
4834 @emph{not} issued for prototype declarations or variadic functions
4835 because these ISO C features appear in your code when using
4836 libiberty's traditional C compatibility macros, @code{PARAMS} and
4837 @code{VPARAMS}.  This warning is also bypassed for nested functions
4838 because that feature is already a GCC extension and thus not relevant to
4839 traditional C compatibility.
4840 @end itemize
4842 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4843 @opindex Wtraditional-conversion
4844 @opindex Wno-traditional-conversion
4845 Warn if a prototype causes a type conversion that is different from what
4846 would happen to the same argument in the absence of a prototype.  This
4847 includes conversions of fixed point to floating and vice versa, and
4848 conversions changing the width or signedness of a fixed-point argument
4849 except when the same as the default promotion.
4851 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4852 @opindex Wdeclaration-after-statement
4853 @opindex Wno-declaration-after-statement
4854 Warn when a declaration is found after a statement in a block.  This
4855 construct, known from C++, was introduced with ISO C99 and is by default
4856 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
4858 @item -Wundef
4859 @opindex Wundef
4860 @opindex Wno-undef
4861 Warn if an undefined identifier is evaluated in an @code{#if} directive.
4863 @item -Wno-endif-labels
4864 @opindex Wno-endif-labels
4865 @opindex Wendif-labels
4866 Do not warn whenever an @code{#else} or an @code{#endif} are followed by text.
4868 @item -Wshadow
4869 @opindex Wshadow
4870 @opindex Wno-shadow
4871 Warn whenever a local variable or type declaration shadows another
4872 variable, parameter, type, class member (in C++), or instance variable
4873 (in Objective-C) or whenever a built-in function is shadowed. Note
4874 that in C++, the compiler warns if a local variable shadows an
4875 explicit typedef, but not if it shadows a struct/class/enum.
4877 @item -Wno-shadow-ivar @r{(Objective-C only)}
4878 @opindex Wno-shadow-ivar
4879 @opindex Wshadow-ivar
4880 Do not warn whenever a local variable shadows an instance variable in an
4881 Objective-C method.
4883 @item -Wlarger-than=@var{len}
4884 @opindex Wlarger-than=@var{len}
4885 @opindex Wlarger-than-@var{len}
4886 Warn whenever an object of larger than @var{len} bytes is defined.
4888 @item -Wframe-larger-than=@var{len}
4889 @opindex Wframe-larger-than
4890 Warn if the size of a function frame is larger than @var{len} bytes.
4891 The computation done to determine the stack frame size is approximate
4892 and not conservative.
4893 The actual requirements may be somewhat greater than @var{len}
4894 even if you do not get a warning.  In addition, any space allocated
4895 via @code{alloca}, variable-length arrays, or related constructs
4896 is not included by the compiler when determining
4897 whether or not to issue a warning.
4899 @item -Wno-free-nonheap-object
4900 @opindex Wno-free-nonheap-object
4901 @opindex Wfree-nonheap-object
4902 Do not warn when attempting to free an object that was not allocated
4903 on the heap.
4905 @item -Wstack-usage=@var{len}
4906 @opindex Wstack-usage
4907 Warn if the stack usage of a function might be larger than @var{len} bytes.
4908 The computation done to determine the stack usage is conservative.
4909 Any space allocated via @code{alloca}, variable-length arrays, or related
4910 constructs is included by the compiler when determining whether or not to
4911 issue a warning.
4913 The message is in keeping with the output of @option{-fstack-usage}.
4915 @itemize
4916 @item
4917 If the stack usage is fully static but exceeds the specified amount, it's:
4919 @smallexample
4920   warning: stack usage is 1120 bytes
4921 @end smallexample
4922 @item
4923 If the stack usage is (partly) dynamic but bounded, it's:
4925 @smallexample
4926   warning: stack usage might be 1648 bytes
4927 @end smallexample
4928 @item
4929 If the stack usage is (partly) dynamic and not bounded, it's:
4931 @smallexample
4932   warning: stack usage might be unbounded
4933 @end smallexample
4934 @end itemize
4936 @item -Wunsafe-loop-optimizations
4937 @opindex Wunsafe-loop-optimizations
4938 @opindex Wno-unsafe-loop-optimizations
4939 Warn if the loop cannot be optimized because the compiler cannot
4940 assume anything on the bounds of the loop indices.  With
4941 @option{-funsafe-loop-optimizations} warn if the compiler makes
4942 such assumptions.
4944 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4945 @opindex Wno-pedantic-ms-format
4946 @opindex Wpedantic-ms-format
4947 When used in combination with @option{-Wformat}
4948 and @option{-pedantic} without GNU extensions, this option
4949 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4950 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4951 which depend on the MS runtime.
4953 @item -Wplacement-new
4954 @itemx -Wplacement-new=@var{n}
4955 @opindex Wplacement-new
4956 @opindex Wno-placement-new
4957 Warn about placement new expressions with undefined behavior, such as
4958 constructing an object in a buffer that is smaller than the type of
4959 the object.  For example, the placement new expression below is diagnosed
4960 because it attempts to construct an array of 64 integers in a buffer only
4961 64 bytes large.
4962 @smallexample
4963 char buf [64];
4964 new (buf) int[64];
4965 @end smallexample
4966 This warning is enabled by default.
4968 @table @gcctabopt
4969 @item -Wplacement-new=1
4970 This is the default warning level of @option{-Wplacement-new}.  At this
4971 level the warning is not issued for some strictly undefined constructs that
4972 GCC allows as extensions for compatibility with legacy code.  For example,
4973 the following @code{new} expression is not diagnosed at this level even
4974 though it has undefined behavior according to the C++ standard because
4975 it writes past the end of the one-element array.
4976 @smallexample
4977 struct S @{ int n, a[1]; @};
4978 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
4979 new (s->a)int [32]();
4980 @end smallexample
4982 @item -Wplacement-new=2
4983 At this level, in addition to diagnosing all the same constructs as at level
4984 1, a diagnostic is also issued for placement new expressions that construct
4985 an object in the last member of structure whose type is an array of a single
4986 element and whose size is less than the size of the object being constructed.
4987 While the previous example would be diagnosed, the following construct makes
4988 use of the flexible member array extension to avoid the warning at level 2.
4989 @smallexample
4990 struct S @{ int n, a[]; @};
4991 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
4992 new (s->a)int [32]();
4993 @end smallexample
4995 @end table
4997 @item -Wpointer-arith
4998 @opindex Wpointer-arith
4999 @opindex Wno-pointer-arith
5000 Warn about anything that depends on the ``size of'' a function type or
5001 of @code{void}.  GNU C assigns these types a size of 1, for
5002 convenience in calculations with @code{void *} pointers and pointers
5003 to functions.  In C++, warn also when an arithmetic operation involves
5004 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
5006 @item -Wtype-limits
5007 @opindex Wtype-limits
5008 @opindex Wno-type-limits
5009 Warn if a comparison is always true or always false due to the limited
5010 range of the data type, but do not warn for constant expressions.  For
5011 example, warn if an unsigned variable is compared against zero with
5012 @code{<} or @code{>=}.  This warning is also enabled by
5013 @option{-Wextra}.
5015 @item -Wbad-function-cast @r{(C and Objective-C only)}
5016 @opindex Wbad-function-cast
5017 @opindex Wno-bad-function-cast
5018 Warn when a function call is cast to a non-matching type.
5019 For example, warn if a call to a function returning an integer type 
5020 is cast to a pointer type.
5022 @item -Wc90-c99-compat @r{(C and Objective-C only)}
5023 @opindex Wc90-c99-compat
5024 @opindex Wno-c90-c99-compat
5025 Warn about features not present in ISO C90, but present in ISO C99.
5026 For instance, warn about use of variable length arrays, @code{long long}
5027 type, @code{bool} type, compound literals, designated initializers, and so
5028 on.  This option is independent of the standards mode.  Warnings are disabled
5029 in the expression that follows @code{__extension__}.
5031 @item -Wc99-c11-compat @r{(C and Objective-C only)}
5032 @opindex Wc99-c11-compat
5033 @opindex Wno-c99-c11-compat
5034 Warn about features not present in ISO C99, but present in ISO C11.
5035 For instance, warn about use of anonymous structures and unions,
5036 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
5037 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
5038 and so on.  This option is independent of the standards mode.  Warnings are
5039 disabled in the expression that follows @code{__extension__}.
5041 @item -Wc++-compat @r{(C and Objective-C only)}
5042 @opindex Wc++-compat
5043 Warn about ISO C constructs that are outside of the common subset of
5044 ISO C and ISO C++, e.g.@: request for implicit conversion from
5045 @code{void *} to a pointer to non-@code{void} type.
5047 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
5048 @opindex Wc++11-compat
5049 Warn about C++ constructs whose meaning differs between ISO C++ 1998
5050 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
5051 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
5052 enabled by @option{-Wall}.
5054 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
5055 @opindex Wc++14-compat
5056 Warn about C++ constructs whose meaning differs between ISO C++ 2011
5057 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
5059 @item -Wcast-qual
5060 @opindex Wcast-qual
5061 @opindex Wno-cast-qual
5062 Warn whenever a pointer is cast so as to remove a type qualifier from
5063 the target type.  For example, warn if a @code{const char *} is cast
5064 to an ordinary @code{char *}.
5066 Also warn when making a cast that introduces a type qualifier in an
5067 unsafe way.  For example, casting @code{char **} to @code{const char **}
5068 is unsafe, as in this example:
5070 @smallexample
5071   /* p is char ** value.  */
5072   const char **q = (const char **) p;
5073   /* Assignment of readonly string to const char * is OK.  */
5074   *q = "string";
5075   /* Now char** pointer points to read-only memory.  */
5076   **p = 'b';
5077 @end smallexample
5079 @item -Wcast-align
5080 @opindex Wcast-align
5081 @opindex Wno-cast-align
5082 Warn whenever a pointer is cast such that the required alignment of the
5083 target is increased.  For example, warn if a @code{char *} is cast to
5084 an @code{int *} on machines where integers can only be accessed at
5085 two- or four-byte boundaries.
5087 @item -Wwrite-strings
5088 @opindex Wwrite-strings
5089 @opindex Wno-write-strings
5090 When compiling C, give string constants the type @code{const
5091 char[@var{length}]} so that copying the address of one into a
5092 non-@code{const} @code{char *} pointer produces a warning.  These
5093 warnings help you find at compile time code that can try to write
5094 into a string constant, but only if you have been very careful about
5095 using @code{const} in declarations and prototypes.  Otherwise, it is
5096 just a nuisance. This is why we did not make @option{-Wall} request
5097 these warnings.
5099 When compiling C++, warn about the deprecated conversion from string
5100 literals to @code{char *}.  This warning is enabled by default for C++
5101 programs.
5103 @item -Wclobbered
5104 @opindex Wclobbered
5105 @opindex Wno-clobbered
5106 Warn for variables that might be changed by @code{longjmp} or
5107 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5109 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5110 @opindex Wconditionally-supported
5111 @opindex Wno-conditionally-supported
5112 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5114 @item -Wconversion
5115 @opindex Wconversion
5116 @opindex Wno-conversion
5117 Warn for implicit conversions that may alter a value. This includes
5118 conversions between real and integer, like @code{abs (x)} when
5119 @code{x} is @code{double}; conversions between signed and unsigned,
5120 like @code{unsigned ui = -1}; and conversions to smaller types, like
5121 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5122 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5123 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5124 conversions between signed and unsigned integers can be disabled by
5125 using @option{-Wno-sign-conversion}.
5127 For C++, also warn for confusing overload resolution for user-defined
5128 conversions; and conversions that never use a type conversion
5129 operator: conversions to @code{void}, the same type, a base class or a
5130 reference to them. Warnings about conversions between signed and
5131 unsigned integers are disabled by default in C++ unless
5132 @option{-Wsign-conversion} is explicitly enabled.
5134 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5135 @opindex Wconversion-null
5136 @opindex Wno-conversion-null
5137 Do not warn for conversions between @code{NULL} and non-pointer
5138 types. @option{-Wconversion-null} is enabled by default.
5140 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5141 @opindex Wzero-as-null-pointer-constant
5142 @opindex Wno-zero-as-null-pointer-constant
5143 Warn when a literal @samp{0} is used as null pointer constant.  This can
5144 be useful to facilitate the conversion to @code{nullptr} in C++11.
5146 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
5147 @opindex Wsubobject-linkage
5148 @opindex Wno-subobject-linkage
5149 Warn if a class type has a base or a field whose type uses the anonymous
5150 namespace or depends on a type with no linkage.  If a type A depends on
5151 a type B with no or internal linkage, defining it in multiple
5152 translation units would be an ODR violation because the meaning of B
5153 is different in each translation unit.  If A only appears in a single
5154 translation unit, the best way to silence the warning is to give it
5155 internal linkage by putting it in an anonymous namespace as well.  The
5156 compiler doesn't give this warning for types defined in the main .C
5157 file, as those are unlikely to have multiple definitions.
5158 @option{-Wsubobject-linkage} is enabled by default.
5160 @item -Wdangling-else
5161 @opindex Wdangling-else
5162 @opindex Wno-dangling-else
5163 Warn about constructions where there may be confusion to which
5164 @code{if} statement an @code{else} branch belongs.  Here is an example of
5165 such a case:
5167 @smallexample
5168 @group
5170   if (a)
5171     if (b)
5172       foo ();
5173   else
5174     bar ();
5176 @end group
5177 @end smallexample
5179 In C/C++, every @code{else} branch belongs to the innermost possible
5180 @code{if} statement, which in this example is @code{if (b)}.  This is
5181 often not what the programmer expected, as illustrated in the above
5182 example by indentation the programmer chose.  When there is the
5183 potential for this confusion, GCC issues a warning when this flag
5184 is specified.  To eliminate the warning, add explicit braces around
5185 the innermost @code{if} statement so there is no way the @code{else}
5186 can belong to the enclosing @code{if}.  The resulting code
5187 looks like this:
5189 @smallexample
5190 @group
5192   if (a)
5193     @{
5194       if (b)
5195         foo ();
5196       else
5197         bar ();
5198     @}
5200 @end group
5201 @end smallexample
5203 This warning is enabled by @option{-Wparentheses}.
5205 @item -Wdate-time
5206 @opindex Wdate-time
5207 @opindex Wno-date-time
5208 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
5209 are encountered as they might prevent bit-wise-identical reproducible
5210 compilations.
5212 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
5213 @opindex Wdelete-incomplete
5214 @opindex Wno-delete-incomplete
5215 Warn when deleting a pointer to incomplete type, which may cause
5216 undefined behavior at runtime.  This warning is enabled by default.
5218 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
5219 @opindex Wuseless-cast
5220 @opindex Wno-useless-cast
5221 Warn when an expression is casted to its own type.
5223 @item -Wempty-body
5224 @opindex Wempty-body
5225 @opindex Wno-empty-body
5226 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
5227 while} statement.  This warning is also enabled by @option{-Wextra}.
5229 @item -Wenum-compare
5230 @opindex Wenum-compare
5231 @opindex Wno-enum-compare
5232 Warn about a comparison between values of different enumerated types.
5233 In C++ enumeral mismatches in conditional expressions are also
5234 diagnosed and the warning is enabled by default.  In C this warning is 
5235 enabled by @option{-Wall}.
5237 @item -Wjump-misses-init @r{(C, Objective-C only)}
5238 @opindex Wjump-misses-init
5239 @opindex Wno-jump-misses-init
5240 Warn if a @code{goto} statement or a @code{switch} statement jumps
5241 forward across the initialization of a variable, or jumps backward to a
5242 label after the variable has been initialized.  This only warns about
5243 variables that are initialized when they are declared.  This warning is
5244 only supported for C and Objective-C; in C++ this sort of branch is an
5245 error in any case.
5247 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
5248 can be disabled with the @option{-Wno-jump-misses-init} option.
5250 @item -Wsign-compare
5251 @opindex Wsign-compare
5252 @opindex Wno-sign-compare
5253 @cindex warning for comparison of signed and unsigned values
5254 @cindex comparison of signed and unsigned values, warning
5255 @cindex signed and unsigned values, comparison warning
5256 Warn when a comparison between signed and unsigned values could produce
5257 an incorrect result when the signed value is converted to unsigned.
5258 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
5259 also enabled by @option{-Wextra}.
5261 @item -Wsign-conversion
5262 @opindex Wsign-conversion
5263 @opindex Wno-sign-conversion
5264 Warn for implicit conversions that may change the sign of an integer
5265 value, like assigning a signed integer expression to an unsigned
5266 integer variable. An explicit cast silences the warning. In C, this
5267 option is enabled also by @option{-Wconversion}.
5269 @item -Wfloat-conversion
5270 @opindex Wfloat-conversion
5271 @opindex Wno-float-conversion
5272 Warn for implicit conversions that reduce the precision of a real value.
5273 This includes conversions from real to integer, and from higher precision
5274 real to lower precision real values.  This option is also enabled by
5275 @option{-Wconversion}.
5277 @item -Wno-scalar-storage-order
5278 @opindex -Wno-scalar-storage-order
5279 @opindex -Wscalar-storage-order
5280 Do not warn on suspicious constructs involving reverse scalar storage order.
5282 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
5283 @opindex Wsized-deallocation
5284 @opindex Wno-sized-deallocation
5285 Warn about a definition of an unsized deallocation function
5286 @smallexample
5287 void operator delete (void *) noexcept;
5288 void operator delete[] (void *) noexcept;
5289 @end smallexample
5290 without a definition of the corresponding sized deallocation function
5291 @smallexample
5292 void operator delete (void *, std::size_t) noexcept;
5293 void operator delete[] (void *, std::size_t) noexcept;
5294 @end smallexample
5295 or vice versa.  Enabled by @option{-Wextra} along with
5296 @option{-fsized-deallocation}.
5298 @item -Wsizeof-pointer-memaccess
5299 @opindex Wsizeof-pointer-memaccess
5300 @opindex Wno-sizeof-pointer-memaccess
5301 Warn for suspicious length parameters to certain string and memory built-in
5302 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
5303 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
5304 but a pointer, and suggests a possible fix, or about
5305 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
5306 @option{-Wall}.
5308 @item -Wsizeof-array-argument
5309 @opindex Wsizeof-array-argument
5310 @opindex Wno-sizeof-array-argument
5311 Warn when the @code{sizeof} operator is applied to a parameter that is
5312 declared as an array in a function definition.  This warning is enabled by
5313 default for C and C++ programs.
5315 @item -Wmemset-elt-size
5316 @opindex Wmemset-elt-size
5317 @opindex Wno-memset-elt-size
5318 Warn for suspicious calls to the @code{memset} built-in function, if the
5319 first argument references an array, and the third argument is a number
5320 equal to the number of elements, but not equal to the size of the array
5321 in memory.  This indicates that the user has omitted a multiplication by
5322 the element size.  This warning is enabled by @option{-Wall}.
5324 @item -Wmemset-transposed-args
5325 @opindex Wmemset-transposed-args
5326 @opindex Wno-memset-transposed-args
5327 Warn for suspicious calls to the @code{memset} built-in function, if the
5328 second argument is not zero and the third argument is zero.  This warns e.g.@
5329 about @code{memset (buf, sizeof buf, 0)} where most probably
5330 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
5331 is only emitted if the third argument is literal zero.  If it is some
5332 expression that is folded to zero, a cast of zero to some type, etc., 
5333 it is far less likely that the user has mistakenly exchanged the arguments 
5334 and no warning is emitted.  This warning is enabled by @option{-Wall}.
5336 @item -Waddress
5337 @opindex Waddress
5338 @opindex Wno-address
5339 Warn about suspicious uses of memory addresses. These include using
5340 the address of a function in a conditional expression, such as
5341 @code{void func(void); if (func)}, and comparisons against the memory
5342 address of a string literal, such as @code{if (x == "abc")}.  Such
5343 uses typically indicate a programmer error: the address of a function
5344 always evaluates to true, so their use in a conditional usually
5345 indicate that the programmer forgot the parentheses in a function
5346 call; and comparisons against string literals result in unspecified
5347 behavior and are not portable in C, so they usually indicate that the
5348 programmer intended to use @code{strcmp}.  This warning is enabled by
5349 @option{-Wall}.
5351 @item -Wlogical-op
5352 @opindex Wlogical-op
5353 @opindex Wno-logical-op
5354 Warn about suspicious uses of logical operators in expressions.
5355 This includes using logical operators in contexts where a
5356 bit-wise operator is likely to be expected.  Also warns when
5357 the operands of a logical operator are the same:
5358 @smallexample
5359 extern int a;
5360 if (a < 0 && a < 0) @{ @dots{} @}
5361 @end smallexample
5363 @item -Wlogical-not-parentheses
5364 @opindex Wlogical-not-parentheses
5365 @opindex Wno-logical-not-parentheses
5366 Warn about logical not used on the left hand side operand of a comparison.
5367 This option does not warn if the RHS operand is of a boolean type.  Its
5368 purpose is to detect suspicious code like the following:
5369 @smallexample
5370 int a;
5371 @dots{}
5372 if (!a > 1) @{ @dots{} @}
5373 @end smallexample
5375 It is possible to suppress the warning by wrapping the LHS into
5376 parentheses:
5377 @smallexample
5378 if ((!a) > 1) @{ @dots{} @}
5379 @end smallexample
5381 This warning is enabled by @option{-Wall}.
5383 @item -Waggregate-return
5384 @opindex Waggregate-return
5385 @opindex Wno-aggregate-return
5386 Warn if any functions that return structures or unions are defined or
5387 called.  (In languages where you can return an array, this also elicits
5388 a warning.)
5390 @item -Wno-aggressive-loop-optimizations
5391 @opindex Wno-aggressive-loop-optimizations
5392 @opindex Waggressive-loop-optimizations
5393 Warn if in a loop with constant number of iterations the compiler detects
5394 undefined behavior in some statement during one or more of the iterations.
5396 @item -Wno-attributes
5397 @opindex Wno-attributes
5398 @opindex Wattributes
5399 Do not warn if an unexpected @code{__attribute__} is used, such as
5400 unrecognized attributes, function attributes applied to variables,
5401 etc.  This does not stop errors for incorrect use of supported
5402 attributes.
5404 @item -Wno-builtin-macro-redefined
5405 @opindex Wno-builtin-macro-redefined
5406 @opindex Wbuiltin-macro-redefined
5407 Do not warn if certain built-in macros are redefined.  This suppresses
5408 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
5409 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
5411 @item -Wstrict-prototypes @r{(C and Objective-C only)}
5412 @opindex Wstrict-prototypes
5413 @opindex Wno-strict-prototypes
5414 Warn if a function is declared or defined without specifying the
5415 argument types.  (An old-style function definition is permitted without
5416 a warning if preceded by a declaration that specifies the argument
5417 types.)
5419 @item -Wold-style-declaration @r{(C and Objective-C only)}
5420 @opindex Wold-style-declaration
5421 @opindex Wno-old-style-declaration
5422 Warn for obsolescent usages, according to the C Standard, in a
5423 declaration. For example, warn if storage-class specifiers like
5424 @code{static} are not the first things in a declaration.  This warning
5425 is also enabled by @option{-Wextra}.
5427 @item -Wold-style-definition @r{(C and Objective-C only)}
5428 @opindex Wold-style-definition
5429 @opindex Wno-old-style-definition
5430 Warn if an old-style function definition is used.  A warning is given
5431 even if there is a previous prototype.
5433 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
5434 @opindex Wmissing-parameter-type
5435 @opindex Wno-missing-parameter-type
5436 A function parameter is declared without a type specifier in K&R-style
5437 functions:
5439 @smallexample
5440 void foo(bar) @{ @}
5441 @end smallexample
5443 This warning is also enabled by @option{-Wextra}.
5445 @item -Wmissing-prototypes @r{(C and Objective-C only)}
5446 @opindex Wmissing-prototypes
5447 @opindex Wno-missing-prototypes
5448 Warn if a global function is defined without a previous prototype
5449 declaration.  This warning is issued even if the definition itself
5450 provides a prototype.  Use this option to detect global functions
5451 that do not have a matching prototype declaration in a header file.
5452 This option is not valid for C++ because all function declarations
5453 provide prototypes and a non-matching declaration declares an
5454 overload rather than conflict with an earlier declaration.
5455 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
5457 @item -Wmissing-declarations
5458 @opindex Wmissing-declarations
5459 @opindex Wno-missing-declarations
5460 Warn if a global function is defined without a previous declaration.
5461 Do so even if the definition itself provides a prototype.
5462 Use this option to detect global functions that are not declared in
5463 header files.  In C, no warnings are issued for functions with previous
5464 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
5465 missing prototypes.  In C++, no warnings are issued for function templates,
5466 or for inline functions, or for functions in anonymous namespaces.
5468 @item -Wmissing-field-initializers
5469 @opindex Wmissing-field-initializers
5470 @opindex Wno-missing-field-initializers
5471 @opindex W
5472 @opindex Wextra
5473 @opindex Wno-extra
5474 Warn if a structure's initializer has some fields missing.  For
5475 example, the following code causes such a warning, because
5476 @code{x.h} is implicitly zero:
5478 @smallexample
5479 struct s @{ int f, g, h; @};
5480 struct s x = @{ 3, 4 @};
5481 @end smallexample
5483 This option does not warn about designated initializers, so the following
5484 modification does not trigger a warning:
5486 @smallexample
5487 struct s @{ int f, g, h; @};
5488 struct s x = @{ .f = 3, .g = 4 @};
5489 @end smallexample
5491 In C++ this option does not warn either about the empty @{ @}
5492 initializer, for example:
5494 @smallexample
5495 struct s @{ int f, g, h; @};
5496 s x = @{ @};
5497 @end smallexample
5499 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
5500 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
5502 @item -Wno-multichar
5503 @opindex Wno-multichar
5504 @opindex Wmultichar
5505 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
5506 Usually they indicate a typo in the user's code, as they have
5507 implementation-defined values, and should not be used in portable code.
5509 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
5510 @opindex Wnormalized=
5511 @opindex Wnormalized
5512 @opindex Wno-normalized
5513 @cindex NFC
5514 @cindex NFKC
5515 @cindex character set, input normalization
5516 In ISO C and ISO C++, two identifiers are different if they are
5517 different sequences of characters.  However, sometimes when characters
5518 outside the basic ASCII character set are used, you can have two
5519 different character sequences that look the same.  To avoid confusion,
5520 the ISO 10646 standard sets out some @dfn{normalization rules} which
5521 when applied ensure that two sequences that look the same are turned into
5522 the same sequence.  GCC can warn you if you are using identifiers that
5523 have not been normalized; this option controls that warning.
5525 There are four levels of warning supported by GCC@.  The default is
5526 @option{-Wnormalized=nfc}, which warns about any identifier that is
5527 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
5528 recommended form for most uses.  It is equivalent to
5529 @option{-Wnormalized}.
5531 Unfortunately, there are some characters allowed in identifiers by
5532 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
5533 identifiers.  That is, there's no way to use these symbols in portable
5534 ISO C or C++ and have all your identifiers in NFC@.
5535 @option{-Wnormalized=id} suppresses the warning for these characters.
5536 It is hoped that future versions of the standards involved will correct
5537 this, which is why this option is not the default.
5539 You can switch the warning off for all characters by writing
5540 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
5541 only do this if you are using some other normalization scheme (like
5542 ``D''), because otherwise you can easily create bugs that are
5543 literally impossible to see.
5545 Some characters in ISO 10646 have distinct meanings but look identical
5546 in some fonts or display methodologies, especially once formatting has
5547 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
5548 LETTER N'', displays just like a regular @code{n} that has been
5549 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
5550 normalization scheme to convert all these into a standard form as
5551 well, and GCC warns if your code is not in NFKC if you use
5552 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
5553 about every identifier that contains the letter O because it might be
5554 confused with the digit 0, and so is not the default, but may be
5555 useful as a local coding convention if the programming environment 
5556 cannot be fixed to display these characters distinctly.
5558 @item -Wno-deprecated
5559 @opindex Wno-deprecated
5560 @opindex Wdeprecated
5561 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
5563 @item -Wno-deprecated-declarations
5564 @opindex Wno-deprecated-declarations
5565 @opindex Wdeprecated-declarations
5566 Do not warn about uses of functions (@pxref{Function Attributes}),
5567 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5568 Attributes}) marked as deprecated by using the @code{deprecated}
5569 attribute.
5571 @item -Wno-overflow
5572 @opindex Wno-overflow
5573 @opindex Woverflow
5574 Do not warn about compile-time overflow in constant expressions.
5576 @item -Wno-odr
5577 @opindex Wno-odr
5578 @opindex Wodr
5579 Warn about One Definition Rule violations during link-time optimization.
5580 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5582 @item -Wopenmp-simd
5583 @opindex Wopenm-simd
5584 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5585 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
5586 option can be used to relax the cost model.
5588 @item -Woverride-init @r{(C and Objective-C only)}
5589 @opindex Woverride-init
5590 @opindex Wno-override-init
5591 @opindex W
5592 @opindex Wextra
5593 @opindex Wno-extra
5594 Warn if an initialized field without side effects is overridden when
5595 using designated initializers (@pxref{Designated Inits, , Designated
5596 Initializers}).
5598 This warning is included in @option{-Wextra}.  To get other
5599 @option{-Wextra} warnings without this one, use @option{-Wextra
5600 -Wno-override-init}.
5602 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
5603 @opindex Woverride-init-side-effects
5604 @opindex Wno-override-init-side-effects
5605 Warn if an initialized field with side effects is overridden when
5606 using designated initializers (@pxref{Designated Inits, , Designated
5607 Initializers}).  This warning is enabled by default.
5609 @item -Wpacked
5610 @opindex Wpacked
5611 @opindex Wno-packed
5612 Warn if a structure is given the packed attribute, but the packed
5613 attribute has no effect on the layout or size of the structure.
5614 Such structures may be mis-aligned for little benefit.  For
5615 instance, in this code, the variable @code{f.x} in @code{struct bar}
5616 is misaligned even though @code{struct bar} does not itself
5617 have the packed attribute:
5619 @smallexample
5620 @group
5621 struct foo @{
5622   int x;
5623   char a, b, c, d;
5624 @} __attribute__((packed));
5625 struct bar @{
5626   char z;
5627   struct foo f;
5629 @end group
5630 @end smallexample
5632 @item -Wpacked-bitfield-compat
5633 @opindex Wpacked-bitfield-compat
5634 @opindex Wno-packed-bitfield-compat
5635 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5636 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5637 the change can lead to differences in the structure layout.  GCC
5638 informs you when the offset of such a field has changed in GCC 4.4.
5639 For example there is no longer a 4-bit padding between field @code{a}
5640 and @code{b} in this structure:
5642 @smallexample
5643 struct foo
5645   char a:4;
5646   char b:8;
5647 @} __attribute__ ((packed));
5648 @end smallexample
5650 This warning is enabled by default.  Use
5651 @option{-Wno-packed-bitfield-compat} to disable this warning.
5653 @item -Wpadded
5654 @opindex Wpadded
5655 @opindex Wno-padded
5656 Warn if padding is included in a structure, either to align an element
5657 of the structure or to align the whole structure.  Sometimes when this
5658 happens it is possible to rearrange the fields of the structure to
5659 reduce the padding and so make the structure smaller.
5661 @item -Wredundant-decls
5662 @opindex Wredundant-decls
5663 @opindex Wno-redundant-decls
5664 Warn if anything is declared more than once in the same scope, even in
5665 cases where multiple declaration is valid and changes nothing.
5667 @item -Wnested-externs @r{(C and Objective-C only)}
5668 @opindex Wnested-externs
5669 @opindex Wno-nested-externs
5670 Warn if an @code{extern} declaration is encountered within a function.
5672 @item -Wno-inherited-variadic-ctor
5673 @opindex Winherited-variadic-ctor
5674 @opindex Wno-inherited-variadic-ctor
5675 Suppress warnings about use of C++11 inheriting constructors when the
5676 base class inherited from has a C variadic constructor; the warning is
5677 on by default because the ellipsis is not inherited.
5679 @item -Winline
5680 @opindex Winline
5681 @opindex Wno-inline
5682 Warn if a function that is declared as inline cannot be inlined.
5683 Even with this option, the compiler does not warn about failures to
5684 inline functions declared in system headers.
5686 The compiler uses a variety of heuristics to determine whether or not
5687 to inline a function.  For example, the compiler takes into account
5688 the size of the function being inlined and the amount of inlining
5689 that has already been done in the current function.  Therefore,
5690 seemingly insignificant changes in the source program can cause the
5691 warnings produced by @option{-Winline} to appear or disappear.
5693 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5694 @opindex Wno-invalid-offsetof
5695 @opindex Winvalid-offsetof
5696 Suppress warnings from applying the @code{offsetof} macro to a non-POD
5697 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
5698 to a non-standard-layout type is undefined.  In existing C++ implementations,
5699 however, @code{offsetof} typically gives meaningful results.
5700 This flag is for users who are aware that they are
5701 writing nonportable code and who have deliberately chosen to ignore the
5702 warning about it.
5704 The restrictions on @code{offsetof} may be relaxed in a future version
5705 of the C++ standard.
5707 @item -Wno-int-to-pointer-cast
5708 @opindex Wno-int-to-pointer-cast
5709 @opindex Wint-to-pointer-cast
5710 Suppress warnings from casts to pointer type of an integer of a
5711 different size. In C++, casting to a pointer type of smaller size is
5712 an error. @option{Wint-to-pointer-cast} is enabled by default.
5715 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5716 @opindex Wno-pointer-to-int-cast
5717 @opindex Wpointer-to-int-cast
5718 Suppress warnings from casts from a pointer to an integer type of a
5719 different size.
5721 @item -Winvalid-pch
5722 @opindex Winvalid-pch
5723 @opindex Wno-invalid-pch
5724 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5725 the search path but can't be used.
5727 @item -Wlong-long
5728 @opindex Wlong-long
5729 @opindex Wno-long-long
5730 Warn if @code{long long} type is used.  This is enabled by either
5731 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5732 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5734 @item -Wvariadic-macros
5735 @opindex Wvariadic-macros
5736 @opindex Wno-variadic-macros
5737 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5738 alternate syntax is used in ISO C99 mode.  This is enabled by either
5739 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5740 messages, use @option{-Wno-variadic-macros}.
5742 @item -Wvarargs
5743 @opindex Wvarargs
5744 @opindex Wno-varargs
5745 Warn upon questionable usage of the macros used to handle variable
5746 arguments like @code{va_start}.  This is default.  To inhibit the
5747 warning messages, use @option{-Wno-varargs}.
5749 @item -Wvector-operation-performance
5750 @opindex Wvector-operation-performance
5751 @opindex Wno-vector-operation-performance
5752 Warn if vector operation is not implemented via SIMD capabilities of the
5753 architecture.  Mainly useful for the performance tuning.
5754 Vector operation can be implemented @code{piecewise}, which means that the
5755 scalar operation is performed on every vector element; 
5756 @code{in parallel}, which means that the vector operation is implemented
5757 using scalars of wider type, which normally is more performance efficient;
5758 and @code{as a single scalar}, which means that vector fits into a
5759 scalar type.
5761 @item -Wno-virtual-move-assign
5762 @opindex Wvirtual-move-assign
5763 @opindex Wno-virtual-move-assign
5764 Suppress warnings about inheriting from a virtual base with a
5765 non-trivial C++11 move assignment operator.  This is dangerous because
5766 if the virtual base is reachable along more than one path, it is
5767 moved multiple times, which can mean both objects end up in the
5768 moved-from state.  If the move assignment operator is written to avoid
5769 moving from a moved-from object, this warning can be disabled.
5771 @item -Wvla
5772 @opindex Wvla
5773 @opindex Wno-vla
5774 Warn if variable length array is used in the code.
5775 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5776 the variable length array.
5778 @item -Wvolatile-register-var
5779 @opindex Wvolatile-register-var
5780 @opindex Wno-volatile-register-var
5781 Warn if a register variable is declared volatile.  The volatile
5782 modifier does not inhibit all optimizations that may eliminate reads
5783 and/or writes to register variables.  This warning is enabled by
5784 @option{-Wall}.
5786 @item -Wdisabled-optimization
5787 @opindex Wdisabled-optimization
5788 @opindex Wno-disabled-optimization
5789 Warn if a requested optimization pass is disabled.  This warning does
5790 not generally indicate that there is anything wrong with your code; it
5791 merely indicates that GCC's optimizers are unable to handle the code
5792 effectively.  Often, the problem is that your code is too big or too
5793 complex; GCC refuses to optimize programs when the optimization
5794 itself is likely to take inordinate amounts of time.
5796 @item -Wpointer-sign @r{(C and Objective-C only)}
5797 @opindex Wpointer-sign
5798 @opindex Wno-pointer-sign
5799 Warn for pointer argument passing or assignment with different signedness.
5800 This option is only supported for C and Objective-C@.  It is implied by
5801 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5802 @option{-Wno-pointer-sign}.
5804 @item -Wstack-protector
5805 @opindex Wstack-protector
5806 @opindex Wno-stack-protector
5807 This option is only active when @option{-fstack-protector} is active.  It
5808 warns about functions that are not protected against stack smashing.
5810 @item -Woverlength-strings
5811 @opindex Woverlength-strings
5812 @opindex Wno-overlength-strings
5813 Warn about string constants that are longer than the ``minimum
5814 maximum'' length specified in the C standard.  Modern compilers
5815 generally allow string constants that are much longer than the
5816 standard's minimum limit, but very portable programs should avoid
5817 using longer strings.
5819 The limit applies @emph{after} string constant concatenation, and does
5820 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5821 C99, it was raised to 4095.  C++98 does not specify a normative
5822 minimum maximum, so we do not diagnose overlength strings in C++@.
5824 This option is implied by @option{-Wpedantic}, and can be disabled with
5825 @option{-Wno-overlength-strings}.
5827 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5828 @opindex Wunsuffixed-float-constants
5830 Issue a warning for any floating constant that does not have
5831 a suffix.  When used together with @option{-Wsystem-headers} it
5832 warns about such constants in system header files.  This can be useful
5833 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5834 from the decimal floating-point extension to C99.
5836 @item -Wno-designated-init @r{(C and Objective-C only)}
5837 Suppress warnings when a positional initializer is used to initialize
5838 a structure that has been marked with the @code{designated_init}
5839 attribute.
5841 @item -Whsa
5842 Issue a warning when HSAIL cannot be emitted for the compiled function or
5843 OpenMP construct.
5845 @end table
5847 @node Debugging Options
5848 @section Options for Debugging Your Program
5849 @cindex options, debugging
5850 @cindex debugging information options
5852 To tell GCC to emit extra information for use by a debugger, in almost 
5853 all cases you need only to add @option{-g} to your other options.
5855 GCC allows you to use @option{-g} with
5856 @option{-O}.  The shortcuts taken by optimized code may occasionally
5857 be surprising: some variables you declared may not exist
5858 at all; flow of control may briefly move where you did not expect it;
5859 some statements may not be executed because they compute constant
5860 results or their values are already at hand; some statements may
5861 execute in different places because they have been moved out of loops.
5862 Nevertheless it is possible to debug optimized output.  This makes
5863 it reasonable to use the optimizer for programs that might have bugs.
5865 If you are not using some other optimization option, consider
5866 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
5867 With no @option{-O} option at all, some compiler passes that collect
5868 information useful for debugging do not run at all, so that
5869 @option{-Og} may result in a better debugging experience.
5871 @table @gcctabopt
5872 @item -g
5873 @opindex g
5874 Produce debugging information in the operating system's native format
5875 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
5876 information.
5878 On most systems that use stabs format, @option{-g} enables use of extra
5879 debugging information that only GDB can use; this extra information
5880 makes debugging work better in GDB but probably makes other debuggers
5881 crash or
5882 refuse to read the program.  If you want to control for certain whether
5883 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5884 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5886 @item -ggdb
5887 @opindex ggdb
5888 Produce debugging information for use by GDB@.  This means to use the
5889 most expressive format available (DWARF, stabs, or the native format
5890 if neither of those are supported), including GDB extensions if at all
5891 possible.
5893 @item -gdwarf
5894 @itemx -gdwarf-@var{version}
5895 @opindex gdwarf
5896 Produce debugging information in DWARF format (if that is supported).
5897 The value of @var{version} may be either 2, 3, 4 or 5; the default version
5898 for most targets is 4.  DWARF Version 5 is only experimental.
5900 Note that with DWARF Version 2, some ports require and always
5901 use some non-conflicting DWARF 3 extensions in the unwind tables.
5903 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5904 for maximum benefit.
5906 GCC no longer supports DWARF Version 1, which is substantially
5907 different than Version 2 and later.  For historical reasons, some
5908 other DWARF-related options (including @option{-feliminate-dwarf2-dups} 
5909 and @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
5910 in their names, but apply to all currently-supported versions of DWARF.
5912 @item -gstabs
5913 @opindex gstabs
5914 Produce debugging information in stabs format (if that is supported),
5915 without GDB extensions.  This is the format used by DBX on most BSD
5916 systems.  On MIPS, Alpha and System V Release 4 systems this option
5917 produces stabs debugging output that is not understood by DBX or SDB@.
5918 On System V Release 4 systems this option requires the GNU assembler.
5920 @item -gstabs+
5921 @opindex gstabs+
5922 Produce debugging information in stabs format (if that is supported),
5923 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5924 use of these extensions is likely to make other debuggers crash or
5925 refuse to read the program.
5927 @item -gcoff
5928 @opindex gcoff
5929 Produce debugging information in COFF format (if that is supported).
5930 This is the format used by SDB on most System V systems prior to
5931 System V Release 4.
5933 @item -gxcoff
5934 @opindex gxcoff
5935 Produce debugging information in XCOFF format (if that is supported).
5936 This is the format used by the DBX debugger on IBM RS/6000 systems.
5938 @item -gxcoff+
5939 @opindex gxcoff+
5940 Produce debugging information in XCOFF format (if that is supported),
5941 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5942 use of these extensions is likely to make other debuggers crash or
5943 refuse to read the program, and may cause assemblers other than the GNU
5944 assembler (GAS) to fail with an error.
5946 @item -gvms
5947 @opindex gvms
5948 Produce debugging information in Alpha/VMS debug format (if that is
5949 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5951 @item -g@var{level}
5952 @itemx -ggdb@var{level}
5953 @itemx -gstabs@var{level}
5954 @itemx -gcoff@var{level}
5955 @itemx -gxcoff@var{level}
5956 @itemx -gvms@var{level}
5957 Request debugging information and also use @var{level} to specify how
5958 much information.  The default level is 2.
5960 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5961 @option{-g}.
5963 Level 1 produces minimal information, enough for making backtraces in
5964 parts of the program that you don't plan to debug.  This includes
5965 descriptions of functions and external variables, and line number
5966 tables, but no information about local variables.
5968 Level 3 includes extra information, such as all the macro definitions
5969 present in the program.  Some debuggers support macro expansion when
5970 you use @option{-g3}.
5972 @option{-gdwarf} does not accept a concatenated debug level, to avoid
5973 confusion with @option{-gdwarf-@var{level}}.
5974 Instead use an additional @option{-g@var{level}} option to change the
5975 debug level for DWARF.
5977 @item -feliminate-unused-debug-symbols
5978 @opindex feliminate-unused-debug-symbols
5979 Produce debugging information in stabs format (if that is supported),
5980 for only symbols that are actually used.
5982 @item -femit-class-debug-always
5983 @opindex femit-class-debug-always
5984 Instead of emitting debugging information for a C++ class in only one
5985 object file, emit it in all object files using the class.  This option
5986 should be used only with debuggers that are unable to handle the way GCC
5987 normally emits debugging information for classes because using this
5988 option increases the size of debugging information by as much as a
5989 factor of two.
5991 @item -fno-merge-debug-strings
5992 @opindex fmerge-debug-strings
5993 @opindex fno-merge-debug-strings
5994 Direct the linker to not merge together strings in the debugging
5995 information that are identical in different object files.  Merging is
5996 not supported by all assemblers or linkers.  Merging decreases the size
5997 of the debug information in the output file at the cost of increasing
5998 link processing time.  Merging is enabled by default.
6000 @item -fdebug-prefix-map=@var{old}=@var{new}
6001 @opindex fdebug-prefix-map
6002 When compiling files in directory @file{@var{old}}, record debugging
6003 information describing them as in @file{@var{new}} instead.
6005 @item -fvar-tracking
6006 @opindex fvar-tracking
6007 Run variable tracking pass.  It computes where variables are stored at each
6008 position in code.  Better debugging information is then generated
6009 (if the debugging information format supports this information).
6011 It is enabled by default when compiling with optimization (@option{-Os},
6012 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
6013 the debug info format supports it.
6015 @item -fvar-tracking-assignments
6016 @opindex fvar-tracking-assignments
6017 @opindex fno-var-tracking-assignments
6018 Annotate assignments to user variables early in the compilation and
6019 attempt to carry the annotations over throughout the compilation all the
6020 way to the end, in an attempt to improve debug information while
6021 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
6023 It can be enabled even if var-tracking is disabled, in which case
6024 annotations are created and maintained, but discarded at the end.
6025 By default, this flag is enabled together with @option{-fvar-tracking},
6026 except when selective scheduling is enabled.
6028 @item -gsplit-dwarf
6029 @opindex gsplit-dwarf
6030 Separate as much DWARF debugging information as possible into a
6031 separate output file with the extension @file{.dwo}.  This option allows
6032 the build system to avoid linking files with debug information.  To
6033 be useful, this option requires a debugger capable of reading @file{.dwo}
6034 files.
6036 @item -gpubnames
6037 @opindex gpubnames
6038 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
6040 @item -ggnu-pubnames
6041 @opindex ggnu-pubnames
6042 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
6043 suitable for conversion into a GDB@ index.  This option is only useful
6044 with a linker that can produce GDB@ index version 7.
6046 @item -fdebug-types-section
6047 @opindex fdebug-types-section
6048 @opindex fno-debug-types-section
6049 When using DWARF Version 4 or higher, type DIEs can be put into
6050 their own @code{.debug_types} section instead of making them part of the
6051 @code{.debug_info} section.  It is more efficient to put them in a separate
6052 comdat sections since the linker can then remove duplicates.
6053 But not all DWARF consumers support @code{.debug_types} sections yet
6054 and on some objects @code{.debug_types} produces larger instead of smaller
6055 debugging information.
6057 @item -grecord-gcc-switches
6058 @item -gno-record-gcc-switches
6059 @opindex grecord-gcc-switches
6060 @opindex gno-record-gcc-switches
6061 This switch causes the command-line options used to invoke the
6062 compiler that may affect code generation to be appended to the
6063 DW_AT_producer attribute in DWARF debugging information.  The options
6064 are concatenated with spaces separating them from each other and from
6065 the compiler version.  
6066 It is enabled by default.
6067 See also @option{-frecord-gcc-switches} for another
6068 way of storing compiler options into the object file.  
6070 @item -gstrict-dwarf
6071 @opindex gstrict-dwarf
6072 Disallow using extensions of later DWARF standard version than selected
6073 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
6074 DWARF extensions from later standard versions is allowed.
6076 @item -gno-strict-dwarf
6077 @opindex gno-strict-dwarf
6078 Allow using extensions of later DWARF standard version than selected with
6079 @option{-gdwarf-@var{version}}.
6081 @item -gz@r{[}=@var{type}@r{]}
6082 @opindex gz
6083 Produce compressed debug sections in DWARF format, if that is supported.
6084 If @var{type} is not given, the default type depends on the capabilities
6085 of the assembler and linker used.  @var{type} may be one of
6086 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
6087 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
6088 compression in traditional GNU format).  If the linker doesn't support
6089 writing compressed debug sections, the option is rejected.  Otherwise,
6090 if the assembler does not support them, @option{-gz} is silently ignored
6091 when producing object files.
6093 @item -feliminate-dwarf2-dups
6094 @opindex feliminate-dwarf2-dups
6095 Compress DWARF debugging information by eliminating duplicated
6096 information about each symbol.  This option only makes sense when
6097 generating DWARF debugging information.
6099 @item -femit-struct-debug-baseonly
6100 @opindex femit-struct-debug-baseonly
6101 Emit debug information for struct-like types
6102 only when the base name of the compilation source file
6103 matches the base name of file in which the struct is defined.
6105 This option substantially reduces the size of debugging information,
6106 but at significant potential loss in type information to the debugger.
6107 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6108 See @option{-femit-struct-debug-detailed} for more detailed control.
6110 This option works only with DWARF debug output.
6112 @item -femit-struct-debug-reduced
6113 @opindex femit-struct-debug-reduced
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 type is defined,
6117 unless the struct is a template or defined in a system header.
6119 This option significantly reduces the size of debugging information,
6120 with some potential loss in type information to the debugger.
6121 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6122 See @option{-femit-struct-debug-detailed} for more detailed control.
6124 This option works only with DWARF debug output.
6126 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6127 @opindex femit-struct-debug-detailed
6128 Specify the struct-like types
6129 for which the compiler generates debug information.
6130 The intent is to reduce duplicate struct debug information
6131 between different object files within the same program.
6133 This option is a detailed version of
6134 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6135 which serves for most needs.
6137 A specification has the syntax@*
6138 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6140 The optional first word limits the specification to
6141 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6142 A struct type is used directly when it is the type of a variable, member.
6143 Indirect uses arise through pointers to structs.
6144 That is, when use of an incomplete struct is valid, the use is indirect.
6145 An example is
6146 @samp{struct one direct; struct two * indirect;}.
6148 The optional second word limits the specification to
6149 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6150 Generic structs are a bit complicated to explain.
6151 For C++, these are non-explicit specializations of template classes,
6152 or non-template classes within the above.
6153 Other programming languages have generics,
6154 but @option{-femit-struct-debug-detailed} does not yet implement them.
6156 The third word specifies the source files for those
6157 structs for which the compiler should emit debug information.
6158 The values @samp{none} and @samp{any} have the normal meaning.
6159 The value @samp{base} means that
6160 the base of name of the file in which the type declaration appears
6161 must match the base of the name of the main compilation file.
6162 In practice, this means that when compiling @file{foo.c}, debug information
6163 is generated for types declared in that file and @file{foo.h},
6164 but not other header files.
6165 The value @samp{sys} means those types satisfying @samp{base}
6166 or declared in system or compiler headers.
6168 You may need to experiment to determine the best settings for your application.
6170 The default is @option{-femit-struct-debug-detailed=all}.
6172 This option works only with DWARF debug output.
6174 @item -fno-dwarf2-cfi-asm
6175 @opindex fdwarf2-cfi-asm
6176 @opindex fno-dwarf2-cfi-asm
6177 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
6178 instead of using GAS @code{.cfi_*} directives.
6180 @item -fno-eliminate-unused-debug-types
6181 @opindex feliminate-unused-debug-types
6182 @opindex fno-eliminate-unused-debug-types
6183 Normally, when producing DWARF output, GCC avoids producing debug symbol 
6184 output for types that are nowhere used in the source file being compiled.
6185 Sometimes it is useful to have GCC emit debugging
6186 information for all types declared in a compilation
6187 unit, regardless of whether or not they are actually used
6188 in that compilation unit, for example 
6189 if, in the debugger, you want to cast a value to a type that is
6190 not actually used in your program (but is declared).  More often,
6191 however, this results in a significant amount of wasted space.
6192 @end table
6194 @node Optimize Options
6195 @section Options That Control Optimization
6196 @cindex optimize options
6197 @cindex options, optimization
6199 These options control various sorts of optimizations.
6201 Without any optimization option, the compiler's goal is to reduce the
6202 cost of compilation and to make debugging produce the expected
6203 results.  Statements are independent: if you stop the program with a
6204 breakpoint between statements, you can then assign a new value to any
6205 variable or change the program counter to any other statement in the
6206 function and get exactly the results you expect from the source
6207 code.
6209 Turning on optimization flags makes the compiler attempt to improve
6210 the performance and/or code size at the expense of compilation time
6211 and possibly the ability to debug the program.
6213 The compiler performs optimization based on the knowledge it has of the
6214 program.  Compiling multiple files at once to a single output file mode allows
6215 the compiler to use information gained from all of the files when compiling
6216 each of them.
6218 Not all optimizations are controlled directly by a flag.  Only
6219 optimizations that have a flag are listed in this section.
6221 Most optimizations are only enabled if an @option{-O} level is set on
6222 the command line.  Otherwise they are disabled, even if individual
6223 optimization flags are specified.
6225 Depending on the target and how GCC was configured, a slightly different
6226 set of optimizations may be enabled at each @option{-O} level than
6227 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6228 to find out the exact set of optimizations that are enabled at each level.
6229 @xref{Overall Options}, for examples.
6231 @table @gcctabopt
6232 @item -O
6233 @itemx -O1
6234 @opindex O
6235 @opindex O1
6236 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6237 more memory for a large function.
6239 With @option{-O}, the compiler tries to reduce code size and execution
6240 time, without performing any optimizations that take a great deal of
6241 compilation time.
6243 @option{-O} turns on the following optimization flags:
6244 @gccoptlist{
6245 -fauto-inc-dec @gol
6246 -fbranch-count-reg @gol
6247 -fcombine-stack-adjustments @gol
6248 -fcompare-elim @gol
6249 -fcprop-registers @gol
6250 -fdce @gol
6251 -fdefer-pop @gol
6252 -fdelayed-branch @gol
6253 -fdse @gol
6254 -fforward-propagate @gol
6255 -fguess-branch-probability @gol
6256 -fif-conversion2 @gol
6257 -fif-conversion @gol
6258 -finline-functions-called-once @gol
6259 -fipa-pure-const @gol
6260 -fipa-profile @gol
6261 -fipa-reference @gol
6262 -fmerge-constants @gol
6263 -fmove-loop-invariants @gol
6264 -freorder-blocks @gol
6265 -fshrink-wrap @gol
6266 -fsplit-wide-types @gol
6267 -fssa-backprop @gol
6268 -fssa-phiopt @gol
6269 -ftree-bit-ccp @gol
6270 -ftree-ccp @gol
6271 -ftree-ch @gol
6272 -ftree-coalesce-vars @gol
6273 -ftree-copy-prop @gol
6274 -ftree-dce @gol
6275 -ftree-dominator-opts @gol
6276 -ftree-dse @gol
6277 -ftree-forwprop @gol
6278 -ftree-fre @gol
6279 -ftree-phiprop @gol
6280 -ftree-sink @gol
6281 -ftree-slsr @gol
6282 -ftree-sra @gol
6283 -ftree-pta @gol
6284 -ftree-ter @gol
6285 -funit-at-a-time}
6287 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6288 where doing so does not interfere with debugging.
6290 @item -O2
6291 @opindex O2
6292 Optimize even more.  GCC performs nearly all supported optimizations
6293 that do not involve a space-speed tradeoff.
6294 As compared to @option{-O}, this option increases both compilation time
6295 and the performance of the generated code.
6297 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6298 also turns on the following optimization flags:
6299 @gccoptlist{-fthread-jumps @gol
6300 -falign-functions  -falign-jumps @gol
6301 -falign-loops  -falign-labels @gol
6302 -fcaller-saves @gol
6303 -fcrossjumping @gol
6304 -fcse-follow-jumps  -fcse-skip-blocks @gol
6305 -fdelete-null-pointer-checks @gol
6306 -fdevirtualize -fdevirtualize-speculatively @gol
6307 -fexpensive-optimizations @gol
6308 -fgcse  -fgcse-lm  @gol
6309 -fhoist-adjacent-loads @gol
6310 -finline-small-functions @gol
6311 -findirect-inlining @gol
6312 -fipa-cp @gol
6313 -fipa-cp-alignment @gol
6314 -fipa-sra @gol
6315 -fipa-icf @gol
6316 -fisolate-erroneous-paths-dereference @gol
6317 -flra-remat @gol
6318 -foptimize-sibling-calls @gol
6319 -foptimize-strlen @gol
6320 -fpartial-inlining @gol
6321 -fpeephole2 @gol
6322 -freorder-blocks-algorithm=stc @gol
6323 -freorder-blocks-and-partition -freorder-functions @gol
6324 -frerun-cse-after-loop  @gol
6325 -fsched-interblock  -fsched-spec @gol
6326 -fschedule-insns  -fschedule-insns2 @gol
6327 -fstrict-aliasing -fstrict-overflow @gol
6328 -ftree-builtin-call-dce @gol
6329 -ftree-switch-conversion -ftree-tail-merge @gol
6330 -ftree-pre @gol
6331 -ftree-vrp @gol
6332 -fipa-ra}
6334 Please note the warning under @option{-fgcse} about
6335 invoking @option{-O2} on programs that use computed gotos.
6337 @item -O3
6338 @opindex O3
6339 Optimize yet more.  @option{-O3} turns on all optimizations specified
6340 by @option{-O2} and also turns on the @option{-finline-functions},
6341 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6342 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
6343 @option{-ftree-loop-distribute-patterns}, @option{-fsplit-paths}
6344 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
6345 @option{-ftree-partial-pre}, @option{-fpeel-loops}
6346 and @option{-fipa-cp-clone} options.
6348 @item -O0
6349 @opindex O0
6350 Reduce compilation time and make debugging produce the expected
6351 results.  This is the default.
6353 @item -Os
6354 @opindex Os
6355 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6356 do not typically increase code size.  It also performs further
6357 optimizations designed to reduce code size.
6359 @option{-Os} disables the following optimization flags:
6360 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6361 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
6362 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
6364 @item -Ofast
6365 @opindex Ofast
6366 Disregard strict standards compliance.  @option{-Ofast} enables all
6367 @option{-O3} optimizations.  It also enables optimizations that are not
6368 valid for all standard-compliant programs.
6369 It turns on @option{-ffast-math} and the Fortran-specific
6370 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6372 @item -Og
6373 @opindex Og
6374 Optimize debugging experience.  @option{-Og} enables optimizations
6375 that do not interfere with debugging. It should be the optimization
6376 level of choice for the standard edit-compile-debug cycle, offering
6377 a reasonable level of optimization while maintaining fast compilation
6378 and a good debugging experience.
6379 @end table
6381 If you use multiple @option{-O} options, with or without level numbers,
6382 the last such option is the one that is effective.
6384 Options of the form @option{-f@var{flag}} specify machine-independent
6385 flags.  Most flags have both positive and negative forms; the negative
6386 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6387 below, only one of the forms is listed---the one you typically 
6388 use.  You can figure out the other form by either removing @samp{no-}
6389 or adding it.
6391 The following options control specific optimizations.  They are either
6392 activated by @option{-O} options or are related to ones that are.  You
6393 can use the following flags in the rare cases when ``fine-tuning'' of
6394 optimizations to be performed is desired.
6396 @table @gcctabopt
6397 @item -fno-defer-pop
6398 @opindex fno-defer-pop
6399 Always pop the arguments to each function call as soon as that function
6400 returns.  For machines that must pop arguments after a function call,
6401 the compiler normally lets arguments accumulate on the stack for several
6402 function calls and pops them all at once.
6404 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6406 @item -fforward-propagate
6407 @opindex fforward-propagate
6408 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6409 instructions and checks if the result can be simplified.  If loop unrolling
6410 is active, two passes are performed and the second is scheduled after
6411 loop unrolling.
6413 This option is enabled by default at optimization levels @option{-O},
6414 @option{-O2}, @option{-O3}, @option{-Os}.
6416 @item -ffp-contract=@var{style}
6417 @opindex ffp-contract
6418 @option{-ffp-contract=off} disables floating-point expression contraction.
6419 @option{-ffp-contract=fast} enables floating-point expression contraction
6420 such as forming of fused multiply-add operations if the target has
6421 native support for them.
6422 @option{-ffp-contract=on} enables floating-point expression contraction
6423 if allowed by the language standard.  This is currently not implemented
6424 and treated equal to @option{-ffp-contract=off}.
6426 The default is @option{-ffp-contract=fast}.
6428 @item -fomit-frame-pointer
6429 @opindex fomit-frame-pointer
6430 Don't keep the frame pointer in a register for functions that
6431 don't need one.  This avoids the instructions to save, set up and
6432 restore frame pointers; it also makes an extra register available
6433 in many functions.  @strong{It also makes debugging impossible on
6434 some machines.}
6436 On some machines, such as the VAX, this flag has no effect, because
6437 the standard calling sequence automatically handles the frame pointer
6438 and nothing is saved by pretending it doesn't exist.  The
6439 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6440 whether a target machine supports this flag.  @xref{Registers,,Register
6441 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6443 The default setting (when not optimizing for
6444 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
6445 @option{-fomit-frame-pointer}.  You can configure GCC with the
6446 @option{--enable-frame-pointer} configure option to change the default.
6448 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6450 @item -foptimize-sibling-calls
6451 @opindex foptimize-sibling-calls
6452 Optimize sibling and tail recursive calls.
6454 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6456 @item -foptimize-strlen
6457 @opindex foptimize-strlen
6458 Optimize various standard C string functions (e.g. @code{strlen},
6459 @code{strchr} or @code{strcpy}) and
6460 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
6462 Enabled at levels @option{-O2}, @option{-O3}.
6464 @item -fno-inline
6465 @opindex fno-inline
6466 Do not expand any functions inline apart from those marked with
6467 the @code{always_inline} attribute.  This is the default when not
6468 optimizing.
6470 Single functions can be exempted from inlining by marking them
6471 with the @code{noinline} attribute.
6473 @item -finline-small-functions
6474 @opindex finline-small-functions
6475 Integrate functions into their callers when their body is smaller than expected
6476 function call code (so overall size of program gets smaller).  The compiler
6477 heuristically decides which functions are simple enough to be worth integrating
6478 in this way.  This inlining applies to all functions, even those not declared
6479 inline.
6481 Enabled at level @option{-O2}.
6483 @item -findirect-inlining
6484 @opindex findirect-inlining
6485 Inline also indirect calls that are discovered to be known at compile
6486 time thanks to previous inlining.  This option has any effect only
6487 when inlining itself is turned on by the @option{-finline-functions}
6488 or @option{-finline-small-functions} options.
6490 Enabled at level @option{-O2}.
6492 @item -finline-functions
6493 @opindex finline-functions
6494 Consider all functions for inlining, even if they are not declared inline.
6495 The compiler heuristically decides which functions are worth integrating
6496 in this way.
6498 If all calls to a given function are integrated, and the function is
6499 declared @code{static}, then the function is normally not output as
6500 assembler code in its own right.
6502 Enabled at level @option{-O3}.
6504 @item -finline-functions-called-once
6505 @opindex finline-functions-called-once
6506 Consider all @code{static} functions called once for inlining into their
6507 caller even if they are not marked @code{inline}.  If a call to a given
6508 function is integrated, then the function is not output as assembler code
6509 in its own right.
6511 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6513 @item -fearly-inlining
6514 @opindex fearly-inlining
6515 Inline functions marked by @code{always_inline} and functions whose body seems
6516 smaller than the function call overhead early before doing
6517 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6518 makes profiling significantly cheaper and usually inlining faster on programs
6519 having large chains of nested wrapper functions.
6521 Enabled by default.
6523 @item -fipa-sra
6524 @opindex fipa-sra
6525 Perform interprocedural scalar replacement of aggregates, removal of
6526 unused parameters and replacement of parameters passed by reference
6527 by parameters passed by value.
6529 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6531 @item -finline-limit=@var{n}
6532 @opindex finline-limit
6533 By default, GCC limits the size of functions that can be inlined.  This flag
6534 allows coarse control of this limit.  @var{n} is the size of functions that
6535 can be inlined in number of pseudo instructions.
6537 Inlining is actually controlled by a number of parameters, which may be
6538 specified individually by using @option{--param @var{name}=@var{value}}.
6539 The @option{-finline-limit=@var{n}} option sets some of these parameters
6540 as follows:
6542 @table @gcctabopt
6543 @item max-inline-insns-single
6544 is set to @var{n}/2.
6545 @item max-inline-insns-auto
6546 is set to @var{n}/2.
6547 @end table
6549 See below for a documentation of the individual
6550 parameters controlling inlining and for the defaults of these parameters.
6552 @emph{Note:} there may be no value to @option{-finline-limit} that results
6553 in default behavior.
6555 @emph{Note:} pseudo instruction represents, in this particular context, an
6556 abstract measurement of function's size.  In no way does it represent a count
6557 of assembly instructions and as such its exact meaning might change from one
6558 release to an another.
6560 @item -fno-keep-inline-dllexport
6561 @opindex fno-keep-inline-dllexport
6562 This is a more fine-grained version of @option{-fkeep-inline-functions},
6563 which applies only to functions that are declared using the @code{dllexport}
6564 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6565 Functions}.)
6567 @item -fkeep-inline-functions
6568 @opindex fkeep-inline-functions
6569 In C, emit @code{static} functions that are declared @code{inline}
6570 into the object file, even if the function has been inlined into all
6571 of its callers.  This switch does not affect functions using the
6572 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6573 inline functions into the object file.
6575 @item -fkeep-static-functions
6576 @opindex fkeep-static-functions
6577 Emit @code{static} functions into the object file, even if the function
6578 is never used.
6580 @item -fkeep-static-consts
6581 @opindex fkeep-static-consts
6582 Emit variables declared @code{static const} when optimization isn't turned
6583 on, even if the variables aren't referenced.
6585 GCC enables this option by default.  If you want to force the compiler to
6586 check if a variable is referenced, regardless of whether or not
6587 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6589 @item -fmerge-constants
6590 @opindex fmerge-constants
6591 Attempt to merge identical constants (string constants and floating-point
6592 constants) across compilation units.
6594 This option is the default for optimized compilation if the assembler and
6595 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6596 behavior.
6598 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6600 @item -fmerge-all-constants
6601 @opindex fmerge-all-constants
6602 Attempt to merge identical constants and identical variables.
6604 This option implies @option{-fmerge-constants}.  In addition to
6605 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6606 arrays or initialized constant variables with integral or floating-point
6607 types.  Languages like C or C++ require each variable, including multiple
6608 instances of the same variable in recursive calls, to have distinct locations,
6609 so using this option results in non-conforming
6610 behavior.
6612 @item -fmodulo-sched
6613 @opindex fmodulo-sched
6614 Perform swing modulo scheduling immediately before the first scheduling
6615 pass.  This pass looks at innermost loops and reorders their
6616 instructions by overlapping different iterations.
6618 @item -fmodulo-sched-allow-regmoves
6619 @opindex fmodulo-sched-allow-regmoves
6620 Perform more aggressive SMS-based modulo scheduling with register moves
6621 allowed.  By setting this flag certain anti-dependences edges are
6622 deleted, which triggers the generation of reg-moves based on the
6623 life-range analysis.  This option is effective only with
6624 @option{-fmodulo-sched} enabled.
6626 @item -fno-branch-count-reg
6627 @opindex fno-branch-count-reg
6628 Avoid running a pass scanning for opportunities to use ``decrement and
6629 branch'' instructions on a count register instead of generating sequences
6630 of instructions that decrement a register, compare it against zero, and
6631 then branch based upon the result.  This option is only meaningful on
6632 architectures that support such instructions, which include x86, PowerPC,
6633 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
6634 doesn't remove the decrement and branch instructions from the generated
6635 instruction stream introduced by other optimization passes.
6637 Enabled by default at @option{-O1} and higher.
6639 The default is @option{-fbranch-count-reg}.
6641 @item -fno-function-cse
6642 @opindex fno-function-cse
6643 Do not put function addresses in registers; make each instruction that
6644 calls a constant function contain the function's address explicitly.
6646 This option results in less efficient code, but some strange hacks
6647 that alter the assembler output may be confused by the optimizations
6648 performed when this option is not used.
6650 The default is @option{-ffunction-cse}
6652 @item -fno-zero-initialized-in-bss
6653 @opindex fno-zero-initialized-in-bss
6654 If the target supports a BSS section, GCC by default puts variables that
6655 are initialized to zero into BSS@.  This can save space in the resulting
6656 code.
6658 This option turns off this behavior because some programs explicitly
6659 rely on variables going to the data section---e.g., so that the
6660 resulting executable can find the beginning of that section and/or make
6661 assumptions based on that.
6663 The default is @option{-fzero-initialized-in-bss}.
6665 @item -fthread-jumps
6666 @opindex fthread-jumps
6667 Perform optimizations that check to see if a jump branches to a
6668 location where another comparison subsumed by the first is found.  If
6669 so, the first branch is redirected to either the destination of the
6670 second branch or a point immediately following it, depending on whether
6671 the condition is known to be true or false.
6673 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6675 @item -fsplit-wide-types
6676 @opindex fsplit-wide-types
6677 When using a type that occupies multiple registers, such as @code{long
6678 long} on a 32-bit system, split the registers apart and allocate them
6679 independently.  This normally generates better code for those types,
6680 but may make debugging more difficult.
6682 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6683 @option{-Os}.
6685 @item -fcse-follow-jumps
6686 @opindex fcse-follow-jumps
6687 In common subexpression elimination (CSE), scan through jump instructions
6688 when the target of the jump is not reached by any other path.  For
6689 example, when CSE encounters an @code{if} statement with an
6690 @code{else} clause, CSE follows the jump when the condition
6691 tested is false.
6693 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6695 @item -fcse-skip-blocks
6696 @opindex fcse-skip-blocks
6697 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6698 follow jumps that conditionally skip over blocks.  When CSE
6699 encounters a simple @code{if} statement with no else clause,
6700 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6701 body of the @code{if}.
6703 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6705 @item -frerun-cse-after-loop
6706 @opindex frerun-cse-after-loop
6707 Re-run common subexpression elimination after loop optimizations are
6708 performed.
6710 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6712 @item -fgcse
6713 @opindex fgcse
6714 Perform a global common subexpression elimination pass.
6715 This pass also performs global constant and copy propagation.
6717 @emph{Note:} When compiling a program using computed gotos, a GCC
6718 extension, you may get better run-time performance if you disable
6719 the global common subexpression elimination pass by adding
6720 @option{-fno-gcse} to the command line.
6722 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6724 @item -fgcse-lm
6725 @opindex fgcse-lm
6726 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6727 attempts to move loads that are only killed by stores into themselves.  This
6728 allows a loop containing a load/store sequence to be changed to a load outside
6729 the loop, and a copy/store within the loop.
6731 Enabled by default when @option{-fgcse} is enabled.
6733 @item -fgcse-sm
6734 @opindex fgcse-sm
6735 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6736 global common subexpression elimination.  This pass attempts to move
6737 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6738 loops containing a load/store sequence can be changed to a load before
6739 the loop and a store after the loop.
6741 Not enabled at any optimization level.
6743 @item -fgcse-las
6744 @opindex fgcse-las
6745 When @option{-fgcse-las} is enabled, the global common subexpression
6746 elimination pass eliminates redundant loads that come after stores to the
6747 same memory location (both partial and full redundancies).
6749 Not enabled at any optimization level.
6751 @item -fgcse-after-reload
6752 @opindex fgcse-after-reload
6753 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6754 pass is performed after reload.  The purpose of this pass is to clean up
6755 redundant spilling.
6757 @item -faggressive-loop-optimizations
6758 @opindex faggressive-loop-optimizations
6759 This option tells the loop optimizer to use language constraints to
6760 derive bounds for the number of iterations of a loop.  This assumes that
6761 loop code does not invoke undefined behavior by for example causing signed
6762 integer overflows or out-of-bound array accesses.  The bounds for the
6763 number of iterations of a loop are used to guide loop unrolling and peeling
6764 and loop exit test optimizations.
6765 This option is enabled by default.
6767 @item -funsafe-loop-optimizations
6768 @opindex funsafe-loop-optimizations
6769 This option tells the loop optimizer to assume that loop indices do not
6770 overflow, and that loops with nontrivial exit condition are not
6771 infinite.  This enables a wider range of loop optimizations even if
6772 the loop optimizer itself cannot prove that these assumptions are valid.
6773 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
6774 if it finds this kind of loop.
6776 @item -funconstrained-commons
6777 @opindex funconstrained-commons
6778 This option tells the compiler that variables declared in common blocks
6779 (e.g. Fortran) may later be overridden with longer trailing arrays. This
6780 prevents certain optimizations that depend on knowing the array bounds.
6782 @item -fcrossjumping
6783 @opindex fcrossjumping
6784 Perform cross-jumping transformation.
6785 This transformation unifies equivalent code and saves code size.  The
6786 resulting code may or may not perform better than without cross-jumping.
6788 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6790 @item -fauto-inc-dec
6791 @opindex fauto-inc-dec
6792 Combine increments or decrements of addresses with memory accesses.
6793 This pass is always skipped on architectures that do not have
6794 instructions to support this.  Enabled by default at @option{-O} and
6795 higher on architectures that support this.
6797 @item -fdce
6798 @opindex fdce
6799 Perform dead code elimination (DCE) on RTL@.
6800 Enabled by default at @option{-O} and higher.
6802 @item -fdse
6803 @opindex fdse
6804 Perform dead store elimination (DSE) on RTL@.
6805 Enabled by default at @option{-O} and higher.
6807 @item -fif-conversion
6808 @opindex fif-conversion
6809 Attempt to transform conditional jumps into branch-less equivalents.  This
6810 includes use of conditional moves, min, max, set flags and abs instructions, and
6811 some tricks doable by standard arithmetics.  The use of conditional execution
6812 on chips where it is available is controlled by @option{-fif-conversion2}.
6814 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6816 @item -fif-conversion2
6817 @opindex fif-conversion2
6818 Use conditional execution (where available) to transform conditional jumps into
6819 branch-less equivalents.
6821 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6823 @item -fdeclone-ctor-dtor
6824 @opindex fdeclone-ctor-dtor
6825 The C++ ABI requires multiple entry points for constructors and
6826 destructors: one for a base subobject, one for a complete object, and
6827 one for a virtual destructor that calls operator delete afterwards.
6828 For a hierarchy with virtual bases, the base and complete variants are
6829 clones, which means two copies of the function.  With this option, the
6830 base and complete variants are changed to be thunks that call a common
6831 implementation.
6833 Enabled by @option{-Os}.
6835 @item -fdelete-null-pointer-checks
6836 @opindex fdelete-null-pointer-checks
6837 Assume that programs cannot safely dereference null pointers, and that
6838 no code or data element resides at address zero.
6839 This option enables simple constant
6840 folding optimizations at all optimization levels.  In addition, other
6841 optimization passes in GCC use this flag to control global dataflow
6842 analyses that eliminate useless checks for null pointers; these assume
6843 that a memory access to address zero always results in a trap, so
6844 that if a pointer is checked after it has already been dereferenced,
6845 it cannot be null.
6847 Note however that in some environments this assumption is not true.
6848 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6849 for programs that depend on that behavior.
6851 This option is enabled by default on most targets.  On Nios II ELF, it
6852 defaults to off.  On AVR and CR16, this option is completely disabled.  
6854 Passes that use the dataflow information
6855 are enabled independently at different optimization levels.
6857 @item -fdevirtualize
6858 @opindex fdevirtualize
6859 Attempt to convert calls to virtual functions to direct calls.  This
6860 is done both within a procedure and interprocedurally as part of
6861 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
6862 propagation (@option{-fipa-cp}).
6863 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6865 @item -fdevirtualize-speculatively
6866 @opindex fdevirtualize-speculatively
6867 Attempt to convert calls to virtual functions to speculative direct calls.
6868 Based on the analysis of the type inheritance graph, determine for a given call
6869 the set of likely targets. If the set is small, preferably of size 1, change
6870 the call into a conditional deciding between direct and indirect calls.  The
6871 speculative calls enable more optimizations, such as inlining.  When they seem
6872 useless after further optimization, they are converted back into original form.
6874 @item -fdevirtualize-at-ltrans
6875 @opindex fdevirtualize-at-ltrans
6876 Stream extra information needed for aggressive devirtualization when running
6877 the link-time optimizer in local transformation mode.  
6878 This option enables more devirtualization but
6879 significantly increases the size of streamed data. For this reason it is
6880 disabled by default.
6882 @item -fexpensive-optimizations
6883 @opindex fexpensive-optimizations
6884 Perform a number of minor optimizations that are relatively expensive.
6886 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6888 @item -free
6889 @opindex free
6890 Attempt to remove redundant extension instructions.  This is especially
6891 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
6892 registers after writing to their lower 32-bit half.
6894 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
6895 @option{-O3}, @option{-Os}.
6897 @item -fno-lifetime-dse
6898 @opindex fno-lifetime-dse
6899 In C++ the value of an object is only affected by changes within its
6900 lifetime: when the constructor begins, the object has an indeterminate
6901 value, and any changes during the lifetime of the object are dead when
6902 the object is destroyed.  Normally dead store elimination will take
6903 advantage of this; if your code relies on the value of the object
6904 storage persisting beyond the lifetime of the object, you can use this
6905 flag to disable this optimization.  To preserve stores before the
6906 constructor starts (e.g. because your operator new clears the object
6907 storage) but still treat the object as dead after the destructor you,
6908 can use @option{-flifetime-dse=1}.  The default behavior can be
6909 explicitly selected with @option{-flifetime-dse=2}.
6910 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
6912 @item -flive-range-shrinkage
6913 @opindex flive-range-shrinkage
6914 Attempt to decrease register pressure through register live range
6915 shrinkage.  This is helpful for fast processors with small or moderate
6916 size register sets.
6918 @item -fira-algorithm=@var{algorithm}
6919 @opindex fira-algorithm
6920 Use the specified coloring algorithm for the integrated register
6921 allocator.  The @var{algorithm} argument can be @samp{priority}, which
6922 specifies Chow's priority coloring, or @samp{CB}, which specifies
6923 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
6924 for all architectures, but for those targets that do support it, it is
6925 the default because it generates better code.
6927 @item -fira-region=@var{region}
6928 @opindex fira-region
6929 Use specified regions for the integrated register allocator.  The
6930 @var{region} argument should be one of the following:
6932 @table @samp
6934 @item all
6935 Use all loops as register allocation regions.
6936 This can give the best results for machines with a small and/or
6937 irregular register set.
6939 @item mixed
6940 Use all loops except for loops with small register pressure 
6941 as the regions.  This value usually gives
6942 the best results in most cases and for most architectures,
6943 and is enabled by default when compiling with optimization for speed
6944 (@option{-O}, @option{-O2}, @dots{}).
6946 @item one
6947 Use all functions as a single region.  
6948 This typically results in the smallest code size, and is enabled by default for
6949 @option{-Os} or @option{-O0}.
6951 @end table
6953 @item -fira-hoist-pressure
6954 @opindex fira-hoist-pressure
6955 Use IRA to evaluate register pressure in the code hoisting pass for
6956 decisions to hoist expressions.  This option usually results in smaller
6957 code, but it can slow the compiler down.
6959 This option is enabled at level @option{-Os} for all targets.
6961 @item -fira-loop-pressure
6962 @opindex fira-loop-pressure
6963 Use IRA to evaluate register pressure in loops for decisions to move
6964 loop invariants.  This option usually results in generation
6965 of faster and smaller code on machines with large register files (>= 32
6966 registers), but it can slow the compiler down.
6968 This option is enabled at level @option{-O3} for some targets.
6970 @item -fno-ira-share-save-slots
6971 @opindex fno-ira-share-save-slots
6972 Disable sharing of stack slots used for saving call-used hard
6973 registers living through a call.  Each hard register gets a
6974 separate stack slot, and as a result function stack frames are
6975 larger.
6977 @item -fno-ira-share-spill-slots
6978 @opindex fno-ira-share-spill-slots
6979 Disable sharing of stack slots allocated for pseudo-registers.  Each
6980 pseudo-register that does not get a hard register gets a separate
6981 stack slot, and as a result function stack frames are larger.
6983 @item -flra-remat
6984 @opindex flra-remat
6985 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
6986 values of spilled pseudos, LRA tries to rematerialize (recalculate)
6987 values if it is profitable.
6989 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6991 @item -fdelayed-branch
6992 @opindex fdelayed-branch
6993 If supported for the target machine, attempt to reorder instructions
6994 to exploit instruction slots available after delayed branch
6995 instructions.
6997 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6999 @item -fschedule-insns
7000 @opindex fschedule-insns
7001 If supported for the target machine, attempt to reorder instructions to
7002 eliminate execution stalls due to required data being unavailable.  This
7003 helps machines that have slow floating point or memory load instructions
7004 by allowing other instructions to be issued until the result of the load
7005 or floating-point instruction is required.
7007 Enabled at levels @option{-O2}, @option{-O3}.
7009 @item -fschedule-insns2
7010 @opindex fschedule-insns2
7011 Similar to @option{-fschedule-insns}, but requests an additional pass of
7012 instruction scheduling after register allocation has been done.  This is
7013 especially useful on machines with a relatively small number of
7014 registers and where memory load instructions take more than one cycle.
7016 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7018 @item -fno-sched-interblock
7019 @opindex fno-sched-interblock
7020 Don't schedule instructions across basic blocks.  This is normally
7021 enabled by default when scheduling before register allocation, i.e.@:
7022 with @option{-fschedule-insns} or at @option{-O2} or higher.
7024 @item -fno-sched-spec
7025 @opindex fno-sched-spec
7026 Don't allow speculative motion of non-load instructions.  This is normally
7027 enabled by default when scheduling before register allocation, i.e.@:
7028 with @option{-fschedule-insns} or at @option{-O2} or higher.
7030 @item -fsched-pressure
7031 @opindex fsched-pressure
7032 Enable register pressure sensitive insn scheduling before register
7033 allocation.  This only makes sense when scheduling before register
7034 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
7035 @option{-O2} or higher.  Usage of this option can improve the
7036 generated code and decrease its size by preventing register pressure
7037 increase above the number of available hard registers and subsequent
7038 spills in register allocation.
7040 @item -fsched-spec-load
7041 @opindex fsched-spec-load
7042 Allow speculative motion of some load instructions.  This only makes
7043 sense when scheduling before register allocation, i.e.@: with
7044 @option{-fschedule-insns} or at @option{-O2} or higher.
7046 @item -fsched-spec-load-dangerous
7047 @opindex fsched-spec-load-dangerous
7048 Allow speculative motion of more load instructions.  This only makes
7049 sense when scheduling before register allocation, i.e.@: with
7050 @option{-fschedule-insns} or at @option{-O2} or higher.
7052 @item -fsched-stalled-insns
7053 @itemx -fsched-stalled-insns=@var{n}
7054 @opindex fsched-stalled-insns
7055 Define how many insns (if any) can be moved prematurely from the queue
7056 of stalled insns into the ready list during the second scheduling pass.
7057 @option{-fno-sched-stalled-insns} means that no insns are moved
7058 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7059 on how many queued insns can be moved prematurely.
7060 @option{-fsched-stalled-insns} without a value is equivalent to
7061 @option{-fsched-stalled-insns=1}.
7063 @item -fsched-stalled-insns-dep
7064 @itemx -fsched-stalled-insns-dep=@var{n}
7065 @opindex fsched-stalled-insns-dep
7066 Define how many insn groups (cycles) are examined for a dependency
7067 on a stalled insn that is a candidate for premature removal from the queue
7068 of stalled insns.  This has an effect only during the second scheduling pass,
7069 and only if @option{-fsched-stalled-insns} is used.
7070 @option{-fno-sched-stalled-insns-dep} is equivalent to
7071 @option{-fsched-stalled-insns-dep=0}.
7072 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7073 @option{-fsched-stalled-insns-dep=1}.
7075 @item -fsched2-use-superblocks
7076 @opindex fsched2-use-superblocks
7077 When scheduling after register allocation, use superblock scheduling.
7078 This allows motion across basic block boundaries,
7079 resulting in faster schedules.  This option is experimental, as not all machine
7080 descriptions used by GCC model the CPU closely enough to avoid unreliable
7081 results from the algorithm.
7083 This only makes sense when scheduling after register allocation, i.e.@: with
7084 @option{-fschedule-insns2} or at @option{-O2} or higher.
7086 @item -fsched-group-heuristic
7087 @opindex fsched-group-heuristic
7088 Enable the group heuristic in the scheduler.  This heuristic favors
7089 the instruction that belongs to a schedule group.  This is enabled
7090 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7091 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7093 @item -fsched-critical-path-heuristic
7094 @opindex fsched-critical-path-heuristic
7095 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7096 instructions on the critical path.  This is enabled by default when
7097 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7098 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7100 @item -fsched-spec-insn-heuristic
7101 @opindex fsched-spec-insn-heuristic
7102 Enable the speculative instruction heuristic in the scheduler.  This
7103 heuristic favors speculative instructions with greater dependency weakness.
7104 This is enabled by default when scheduling is enabled, i.e.@:
7105 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7106 or at @option{-O2} or higher.
7108 @item -fsched-rank-heuristic
7109 @opindex fsched-rank-heuristic
7110 Enable the rank heuristic in the scheduler.  This heuristic favors
7111 the instruction belonging to a basic block with greater size or frequency.
7112 This is enabled by default when scheduling is enabled, i.e.@:
7113 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7114 at @option{-O2} or higher.
7116 @item -fsched-last-insn-heuristic
7117 @opindex fsched-last-insn-heuristic
7118 Enable the last-instruction heuristic in the scheduler.  This heuristic
7119 favors the instruction that is less dependent on the last instruction
7120 scheduled.  This is enabled by default when scheduling is enabled,
7121 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7122 at @option{-O2} or higher.
7124 @item -fsched-dep-count-heuristic
7125 @opindex fsched-dep-count-heuristic
7126 Enable the dependent-count heuristic in the scheduler.  This heuristic
7127 favors the instruction that has more instructions depending on it.
7128 This is enabled by default when scheduling is enabled, i.e.@:
7129 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7130 at @option{-O2} or higher.
7132 @item -freschedule-modulo-scheduled-loops
7133 @opindex freschedule-modulo-scheduled-loops
7134 Modulo scheduling is performed before traditional scheduling.  If a loop
7135 is modulo scheduled, later scheduling passes may change its schedule.  
7136 Use this option to control that behavior.
7138 @item -fselective-scheduling
7139 @opindex fselective-scheduling
7140 Schedule instructions using selective scheduling algorithm.  Selective
7141 scheduling runs instead of the first scheduler pass.
7143 @item -fselective-scheduling2
7144 @opindex fselective-scheduling2
7145 Schedule instructions using selective scheduling algorithm.  Selective
7146 scheduling runs instead of the second scheduler pass.
7148 @item -fsel-sched-pipelining
7149 @opindex fsel-sched-pipelining
7150 Enable software pipelining of innermost loops during selective scheduling.
7151 This option has no effect unless one of @option{-fselective-scheduling} or
7152 @option{-fselective-scheduling2} is turned on.
7154 @item -fsel-sched-pipelining-outer-loops
7155 @opindex fsel-sched-pipelining-outer-loops
7156 When pipelining loops during selective scheduling, also pipeline outer loops.
7157 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7159 @item -fsemantic-interposition
7160 @opindex fsemantic-interposition
7161 Some object formats, like ELF, allow interposing of symbols by the 
7162 dynamic linker.
7163 This means that for symbols exported from the DSO, the compiler cannot perform
7164 interprocedural propagation, inlining and other optimizations in anticipation
7165 that the function or variable in question may change. While this feature is
7166 useful, for example, to rewrite memory allocation functions by a debugging
7167 implementation, it is expensive in the terms of code quality.
7168 With @option{-fno-semantic-interposition} the compiler assumes that 
7169 if interposition happens for functions the overwriting function will have 
7170 precisely the same semantics (and side effects). 
7171 Similarly if interposition happens
7172 for variables, the constructor of the variable will be the same. The flag
7173 has no effect for functions explicitly declared inline 
7174 (where it is never allowed for interposition to change semantics) 
7175 and for symbols explicitly declared weak.
7177 @item -fshrink-wrap
7178 @opindex fshrink-wrap
7179 Emit function prologues only before parts of the function that need it,
7180 rather than at the top of the function.  This flag is enabled by default at
7181 @option{-O} and higher.
7183 @item -fcaller-saves
7184 @opindex fcaller-saves
7185 Enable allocation of values to registers that are clobbered by
7186 function calls, by emitting extra instructions to save and restore the
7187 registers around such calls.  Such allocation is done only when it
7188 seems to result in better code.
7190 This option is always enabled by default on certain machines, usually
7191 those which have no call-preserved registers to use instead.
7193 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7195 @item -fcombine-stack-adjustments
7196 @opindex fcombine-stack-adjustments
7197 Tracks stack adjustments (pushes and pops) and stack memory references
7198 and then tries to find ways to combine them.
7200 Enabled by default at @option{-O1} and higher.
7202 @item -fipa-ra
7203 @opindex fipa-ra
7204 Use caller save registers for allocation if those registers are not used by
7205 any called function.  In that case it is not necessary to save and restore
7206 them around calls.  This is only possible if called functions are part of
7207 same compilation unit as current function and they are compiled before it.
7209 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7211 @item -fconserve-stack
7212 @opindex fconserve-stack
7213 Attempt to minimize stack usage.  The compiler attempts to use less
7214 stack space, even if that makes the program slower.  This option
7215 implies setting the @option{large-stack-frame} parameter to 100
7216 and the @option{large-stack-frame-growth} parameter to 400.
7218 @item -ftree-reassoc
7219 @opindex ftree-reassoc
7220 Perform reassociation on trees.  This flag is enabled by default
7221 at @option{-O} and higher.
7223 @item -ftree-pre
7224 @opindex ftree-pre
7225 Perform partial redundancy elimination (PRE) on trees.  This flag is
7226 enabled by default at @option{-O2} and @option{-O3}.
7228 @item -ftree-partial-pre
7229 @opindex ftree-partial-pre
7230 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7231 enabled by default at @option{-O3}.
7233 @item -ftree-forwprop
7234 @opindex ftree-forwprop
7235 Perform forward propagation on trees.  This flag is enabled by default
7236 at @option{-O} and higher.
7238 @item -ftree-fre
7239 @opindex ftree-fre
7240 Perform full redundancy elimination (FRE) on trees.  The difference
7241 between FRE and PRE is that FRE only considers expressions
7242 that are computed on all paths leading to the redundant computation.
7243 This analysis is faster than PRE, though it exposes fewer redundancies.
7244 This flag is enabled by default at @option{-O} and higher.
7246 @item -ftree-phiprop
7247 @opindex ftree-phiprop
7248 Perform hoisting of loads from conditional pointers on trees.  This
7249 pass is enabled by default at @option{-O} and higher.
7251 @item -fhoist-adjacent-loads
7252 @opindex fhoist-adjacent-loads
7253 Speculatively hoist loads from both branches of an if-then-else if the
7254 loads are from adjacent locations in the same structure and the target
7255 architecture has a conditional move instruction.  This flag is enabled
7256 by default at @option{-O2} and higher.
7258 @item -ftree-copy-prop
7259 @opindex ftree-copy-prop
7260 Perform copy propagation on trees.  This pass eliminates unnecessary
7261 copy operations.  This flag is enabled by default at @option{-O} and
7262 higher.
7264 @item -fipa-pure-const
7265 @opindex fipa-pure-const
7266 Discover which functions are pure or constant.
7267 Enabled by default at @option{-O} and higher.
7269 @item -fipa-reference
7270 @opindex fipa-reference
7271 Discover which static variables do not escape the
7272 compilation unit.
7273 Enabled by default at @option{-O} and higher.
7275 @item -fipa-pta
7276 @opindex fipa-pta
7277 Perform interprocedural pointer analysis and interprocedural modification
7278 and reference analysis.  This option can cause excessive memory and
7279 compile-time usage on large compilation units.  It is not enabled by
7280 default at any optimization level.
7282 @item -fipa-profile
7283 @opindex fipa-profile
7284 Perform interprocedural profile propagation.  The functions called only from
7285 cold functions are marked as cold. Also functions executed once (such as
7286 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7287 functions and loop less parts of functions executed once are then optimized for
7288 size.
7289 Enabled by default at @option{-O} and higher.
7291 @item -fipa-cp
7292 @opindex fipa-cp
7293 Perform interprocedural constant propagation.
7294 This optimization analyzes the program to determine when values passed
7295 to functions are constants and then optimizes accordingly.
7296 This optimization can substantially increase performance
7297 if the application has constants passed to functions.
7298 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7300 @item -fipa-cp-clone
7301 @opindex fipa-cp-clone
7302 Perform function cloning to make interprocedural constant propagation stronger.
7303 When enabled, interprocedural constant propagation performs function cloning
7304 when externally visible function can be called with constant arguments.
7305 Because this optimization can create multiple copies of functions,
7306 it may significantly increase code size
7307 (see @option{--param ipcp-unit-growth=@var{value}}).
7308 This flag is enabled by default at @option{-O3}.
7310 @item -fipa-cp-alignment
7311 @opindex -fipa-cp-alignment
7312 When enabled, this optimization propagates alignment of function
7313 parameters to support better vectorization and string operations.
7315 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
7316 requires that @option{-fipa-cp} is enabled.
7318 @item -fipa-icf
7319 @opindex fipa-icf
7320 Perform Identical Code Folding for functions and read-only variables.
7321 The optimization reduces code size and may disturb unwind stacks by replacing
7322 a function by equivalent one with a different name. The optimization works
7323 more effectively with link time optimization enabled.
7325 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
7326 works on different levels and thus the optimizations are not same - there are
7327 equivalences that are found only by GCC and equivalences found only by Gold.
7329 This flag is enabled by default at @option{-O2} and @option{-Os}.
7331 @item -fisolate-erroneous-paths-dereference
7332 @opindex fisolate-erroneous-paths-dereference
7333 Detect paths that trigger erroneous or undefined behavior due to
7334 dereferencing a null pointer.  Isolate those paths from the main control
7335 flow and turn the statement with erroneous or undefined behavior into a trap.
7336 This flag is enabled by default at @option{-O2} and higher and depends on
7337 @option{-fdelete-null-pointer-checks} also being enabled.
7339 @item -fisolate-erroneous-paths-attribute
7340 @opindex fisolate-erroneous-paths-attribute
7341 Detect paths that trigger erroneous or undefined behavior due a null value
7342 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
7343 attribute.  Isolate those paths from the main control flow and turn the
7344 statement with erroneous or undefined behavior into a trap.  This is not
7345 currently enabled, but may be enabled by @option{-O2} in the future.
7347 @item -ftree-sink
7348 @opindex ftree-sink
7349 Perform forward store motion on trees.  This flag is
7350 enabled by default at @option{-O} and higher.
7352 @item -ftree-bit-ccp
7353 @opindex ftree-bit-ccp
7354 Perform sparse conditional bit constant propagation on trees and propagate
7355 pointer alignment information.
7356 This pass only operates on local scalar variables and is enabled by default
7357 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7359 @item -ftree-ccp
7360 @opindex ftree-ccp
7361 Perform sparse conditional constant propagation (CCP) on trees.  This
7362 pass only operates on local scalar variables and is enabled by default
7363 at @option{-O} and higher.
7365 @item -fssa-backprop
7366 @opindex fssa-backprop
7367 Propagate information about uses of a value up the definition chain
7368 in order to simplify the definitions.  For example, this pass strips
7369 sign operations if the sign of a value never matters.  The flag is
7370 enabled by default at @option{-O} and higher.
7372 @item -fssa-phiopt
7373 @opindex fssa-phiopt
7374 Perform pattern matching on SSA PHI nodes to optimize conditional
7375 code.  This pass is enabled by default at @option{-O} and higher.
7377 @item -ftree-switch-conversion
7378 @opindex ftree-switch-conversion
7379 Perform conversion of simple initializations in a switch to
7380 initializations from a scalar array.  This flag is enabled by default
7381 at @option{-O2} and higher.
7383 @item -ftree-tail-merge
7384 @opindex ftree-tail-merge
7385 Look for identical code sequences.  When found, replace one with a jump to the
7386 other.  This optimization is known as tail merging or cross jumping.  This flag
7387 is enabled by default at @option{-O2} and higher.  The compilation time
7388 in this pass can
7389 be limited using @option{max-tail-merge-comparisons} parameter and
7390 @option{max-tail-merge-iterations} parameter.
7392 @item -ftree-dce
7393 @opindex ftree-dce
7394 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7395 default at @option{-O} and higher.
7397 @item -ftree-builtin-call-dce
7398 @opindex ftree-builtin-call-dce
7399 Perform conditional dead code elimination (DCE) for calls to built-in functions
7400 that may set @code{errno} but are otherwise side-effect free.  This flag is
7401 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7402 specified.
7404 @item -ftree-dominator-opts
7405 @opindex ftree-dominator-opts
7406 Perform a variety of simple scalar cleanups (constant/copy
7407 propagation, redundancy elimination, range propagation and expression
7408 simplification) based on a dominator tree traversal.  This also
7409 performs jump threading (to reduce jumps to jumps). This flag is
7410 enabled by default at @option{-O} and higher.
7412 @item -ftree-dse
7413 @opindex ftree-dse
7414 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7415 a memory location that is later overwritten by another store without
7416 any intervening loads.  In this case the earlier store can be deleted.  This
7417 flag is enabled by default at @option{-O} and higher.
7419 @item -ftree-ch
7420 @opindex ftree-ch
7421 Perform loop header copying on trees.  This is beneficial since it increases
7422 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7423 is enabled by default at @option{-O} and higher.  It is not enabled
7424 for @option{-Os}, since it usually increases code size.
7426 @item -ftree-loop-optimize
7427 @opindex ftree-loop-optimize
7428 Perform loop optimizations on trees.  This flag is enabled by default
7429 at @option{-O} and higher.
7431 @item -ftree-loop-linear
7432 @itemx -floop-interchange
7433 @itemx -floop-strip-mine
7434 @itemx -floop-block
7435 @itemx -floop-unroll-and-jam
7436 @opindex ftree-loop-linear
7437 @opindex floop-interchange
7438 @opindex floop-strip-mine
7439 @opindex floop-block
7440 @opindex floop-unroll-and-jam
7441 Perform loop nest optimizations.  Same as
7442 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
7443 to be configured with @option{--with-isl} to enable the Graphite loop
7444 transformation infrastructure.
7446 @item -fgraphite-identity
7447 @opindex fgraphite-identity
7448 Enable the identity transformation for graphite.  For every SCoP we generate
7449 the polyhedral representation and transform it back to gimple.  Using
7450 @option{-fgraphite-identity} we can check the costs or benefits of the
7451 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7452 are also performed by the code generator isl, like index splitting and
7453 dead code elimination in loops.
7455 @item -floop-nest-optimize
7456 @opindex floop-nest-optimize
7457 Enable the isl based loop nest optimizer.  This is a generic loop nest
7458 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7459 structure optimized for data-locality and parallelism.  This option
7460 is experimental.
7462 @item -floop-parallelize-all
7463 @opindex floop-parallelize-all
7464 Use the Graphite data dependence analysis to identify loops that can
7465 be parallelized.  Parallelize all the loops that can be analyzed to
7466 not contain loop carried dependences without checking that it is
7467 profitable to parallelize the loops.
7469 @item -ftree-coalesce-vars
7470 @opindex ftree-coalesce-vars
7471 While transforming the program out of the SSA representation, attempt to
7472 reduce copying by coalescing versions of different user-defined
7473 variables, instead of just compiler temporaries.  This may severely
7474 limit the ability to debug an optimized program compiled with
7475 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
7476 prevents SSA coalescing of user variables.  This option is enabled by
7477 default if optimization is enabled, and it does very little otherwise.
7479 @item -ftree-loop-if-convert
7480 @opindex ftree-loop-if-convert
7481 Attempt to transform conditional jumps in the innermost loops to
7482 branch-less equivalents.  The intent is to remove control-flow from
7483 the innermost loops in order to improve the ability of the
7484 vectorization pass to handle these loops.  This is enabled by default
7485 if vectorization is enabled.
7487 @item -ftree-loop-if-convert-stores
7488 @opindex ftree-loop-if-convert-stores
7489 Attempt to also if-convert conditional jumps containing memory writes.
7490 This transformation can be unsafe for multi-threaded programs as it
7491 transforms conditional memory writes into unconditional memory writes.
7492 For example,
7493 @smallexample
7494 for (i = 0; i < N; i++)
7495   if (cond)
7496     A[i] = expr;
7497 @end smallexample
7498 is transformed to
7499 @smallexample
7500 for (i = 0; i < N; i++)
7501   A[i] = cond ? expr : A[i];
7502 @end smallexample
7503 potentially producing data races.
7505 @item -ftree-loop-distribution
7506 @opindex ftree-loop-distribution
7507 Perform loop distribution.  This flag can improve cache performance on
7508 big loop bodies and allow further loop optimizations, like
7509 parallelization or vectorization, to take place.  For example, the loop
7510 @smallexample
7511 DO I = 1, N
7512   A(I) = B(I) + C
7513   D(I) = E(I) * F
7514 ENDDO
7515 @end smallexample
7516 is transformed to
7517 @smallexample
7518 DO I = 1, N
7519    A(I) = B(I) + C
7520 ENDDO
7521 DO I = 1, N
7522    D(I) = E(I) * F
7523 ENDDO
7524 @end smallexample
7526 @item -ftree-loop-distribute-patterns
7527 @opindex ftree-loop-distribute-patterns
7528 Perform loop distribution of patterns that can be code generated with
7529 calls to a library.  This flag is enabled by default at @option{-O3}.
7531 This pass distributes the initialization loops and generates a call to
7532 memset zero.  For example, the loop
7533 @smallexample
7534 DO I = 1, N
7535   A(I) = 0
7536   B(I) = A(I) + I
7537 ENDDO
7538 @end smallexample
7539 is transformed to
7540 @smallexample
7541 DO I = 1, N
7542    A(I) = 0
7543 ENDDO
7544 DO I = 1, N
7545    B(I) = A(I) + I
7546 ENDDO
7547 @end smallexample
7548 and the initialization loop is transformed into a call to memset zero.
7550 @item -ftree-loop-im
7551 @opindex ftree-loop-im
7552 Perform loop invariant motion on trees.  This pass moves only invariants that
7553 are hard to handle at RTL level (function calls, operations that expand to
7554 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7555 operands of conditions that are invariant out of the loop, so that we can use
7556 just trivial invariantness analysis in loop unswitching.  The pass also includes
7557 store motion.
7559 @item -ftree-loop-ivcanon
7560 @opindex ftree-loop-ivcanon
7561 Create a canonical counter for number of iterations in loops for which
7562 determining number of iterations requires complicated analysis.  Later
7563 optimizations then may determine the number easily.  Useful especially
7564 in connection with unrolling.
7566 @item -fivopts
7567 @opindex fivopts
7568 Perform induction variable optimizations (strength reduction, induction
7569 variable merging and induction variable elimination) on trees.
7571 @item -ftree-parallelize-loops=n
7572 @opindex ftree-parallelize-loops
7573 Parallelize loops, i.e., split their iteration space to run in n threads.
7574 This is only possible for loops whose iterations are independent
7575 and can be arbitrarily reordered.  The optimization is only
7576 profitable on multiprocessor machines, for loops that are CPU-intensive,
7577 rather than constrained e.g.@: by memory bandwidth.  This option
7578 implies @option{-pthread}, and thus is only supported on targets
7579 that have support for @option{-pthread}.
7581 @item -ftree-pta
7582 @opindex ftree-pta
7583 Perform function-local points-to analysis on trees.  This flag is
7584 enabled by default at @option{-O} and higher.
7586 @item -ftree-sra
7587 @opindex ftree-sra
7588 Perform scalar replacement of aggregates.  This pass replaces structure
7589 references with scalars to prevent committing structures to memory too
7590 early.  This flag is enabled by default at @option{-O} and higher.
7592 @item -ftree-ter
7593 @opindex ftree-ter
7594 Perform temporary expression replacement during the SSA->normal phase.  Single
7595 use/single def temporaries are replaced at their use location with their
7596 defining expression.  This results in non-GIMPLE code, but gives the expanders
7597 much more complex trees to work on resulting in better RTL generation.  This is
7598 enabled by default at @option{-O} and higher.
7600 @item -ftree-slsr
7601 @opindex ftree-slsr
7602 Perform straight-line strength reduction on trees.  This recognizes related
7603 expressions involving multiplications and replaces them by less expensive
7604 calculations when possible.  This is enabled by default at @option{-O} and
7605 higher.
7607 @item -ftree-vectorize
7608 @opindex ftree-vectorize
7609 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
7610 and @option{-ftree-slp-vectorize} if not explicitly specified.
7612 @item -ftree-loop-vectorize
7613 @opindex ftree-loop-vectorize
7614 Perform loop vectorization on trees. This flag is enabled by default at
7615 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7617 @item -ftree-slp-vectorize
7618 @opindex ftree-slp-vectorize
7619 Perform basic block vectorization on trees. This flag is enabled by default at
7620 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7622 @item -fvect-cost-model=@var{model}
7623 @opindex fvect-cost-model
7624 Alter the cost model used for vectorization.  The @var{model} argument
7625 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
7626 With the @samp{unlimited} model the vectorized code-path is assumed
7627 to be profitable while with the @samp{dynamic} model a runtime check
7628 guards the vectorized code-path to enable it only for iteration
7629 counts that will likely execute faster than when executing the original
7630 scalar loop.  The @samp{cheap} model disables vectorization of
7631 loops where doing so would be cost prohibitive for example due to
7632 required runtime checks for data dependence or alignment but otherwise
7633 is equal to the @samp{dynamic} model.
7634 The default cost model depends on other optimization flags and is
7635 either @samp{dynamic} or @samp{cheap}.
7637 @item -fsimd-cost-model=@var{model}
7638 @opindex fsimd-cost-model
7639 Alter the cost model used for vectorization of loops marked with the OpenMP
7640 or Cilk Plus simd directive.  The @var{model} argument should be one of
7641 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
7642 have the same meaning as described in @option{-fvect-cost-model} and by
7643 default a cost model defined with @option{-fvect-cost-model} is used.
7645 @item -ftree-vrp
7646 @opindex ftree-vrp
7647 Perform Value Range Propagation on trees.  This is similar to the
7648 constant propagation pass, but instead of values, ranges of values are
7649 propagated.  This allows the optimizers to remove unnecessary range
7650 checks like array bound checks and null pointer checks.  This is
7651 enabled by default at @option{-O2} and higher.  Null pointer check
7652 elimination is only done if @option{-fdelete-null-pointer-checks} is
7653 enabled.
7655 @item -fsplit-paths
7656 @opindex fsplit-paths
7657 Split paths leading to loop backedges.  This can improve dead code
7658 elimination and common subexpression elimination.  This is enabled by
7659 default at @option{-O2} and above.
7661 @item -fsplit-ivs-in-unroller
7662 @opindex fsplit-ivs-in-unroller
7663 Enables expression of values of induction variables in later iterations
7664 of the unrolled loop using the value in the first iteration.  This breaks
7665 long dependency chains, thus improving efficiency of the scheduling passes.
7667 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7668 same effect.  However, that is not reliable in cases where the loop body
7669 is more complicated than a single basic block.  It also does not work at all
7670 on some architectures due to restrictions in the CSE pass.
7672 This optimization is enabled by default.
7674 @item -fvariable-expansion-in-unroller
7675 @opindex fvariable-expansion-in-unroller
7676 With this option, the compiler creates multiple copies of some
7677 local variables when unrolling a loop, which can result in superior code.
7679 @item -fpartial-inlining
7680 @opindex fpartial-inlining
7681 Inline parts of functions.  This option has any effect only
7682 when inlining itself is turned on by the @option{-finline-functions}
7683 or @option{-finline-small-functions} options.
7685 Enabled at level @option{-O2}.
7687 @item -fpredictive-commoning
7688 @opindex fpredictive-commoning
7689 Perform predictive commoning optimization, i.e., reusing computations
7690 (especially memory loads and stores) performed in previous
7691 iterations of loops.
7693 This option is enabled at level @option{-O3}.
7695 @item -fprefetch-loop-arrays
7696 @opindex fprefetch-loop-arrays
7697 If supported by the target machine, generate instructions to prefetch
7698 memory to improve the performance of loops that access large arrays.
7700 This option may generate better or worse code; results are highly
7701 dependent on the structure of loops within the source code.
7703 Disabled at level @option{-Os}.
7705 @item -fno-peephole
7706 @itemx -fno-peephole2
7707 @opindex fno-peephole
7708 @opindex fno-peephole2
7709 Disable any machine-specific peephole optimizations.  The difference
7710 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7711 are implemented in the compiler; some targets use one, some use the
7712 other, a few use both.
7714 @option{-fpeephole} is enabled by default.
7715 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7717 @item -fno-guess-branch-probability
7718 @opindex fno-guess-branch-probability
7719 Do not guess branch probabilities using heuristics.
7721 GCC uses heuristics to guess branch probabilities if they are
7722 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7723 heuristics are based on the control flow graph.  If some branch probabilities
7724 are specified by @code{__builtin_expect}, then the heuristics are
7725 used to guess branch probabilities for the rest of the control flow graph,
7726 taking the @code{__builtin_expect} info into account.  The interactions
7727 between the heuristics and @code{__builtin_expect} can be complex, and in
7728 some cases, it may be useful to disable the heuristics so that the effects
7729 of @code{__builtin_expect} are easier to understand.
7731 The default is @option{-fguess-branch-probability} at levels
7732 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7734 @item -freorder-blocks
7735 @opindex freorder-blocks
7736 Reorder basic blocks in the compiled function in order to reduce number of
7737 taken branches and improve code locality.
7739 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7741 @item -freorder-blocks-algorithm=@var{algorithm}
7742 @opindex freorder-blocks-algorithm
7743 Use the specified algorithm for basic block reordering.  The
7744 @var{algorithm} argument can be @samp{simple}, which does not increase
7745 code size (except sometimes due to secondary effects like alignment),
7746 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
7747 put all often executed code together, minimizing the number of branches
7748 executed by making extra copies of code.
7750 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
7751 @samp{stc} at levels @option{-O2}, @option{-O3}.
7753 @item -freorder-blocks-and-partition
7754 @opindex freorder-blocks-and-partition
7755 In addition to reordering basic blocks in the compiled function, in order
7756 to reduce number of taken branches, partitions hot and cold basic blocks
7757 into separate sections of the assembly and @file{.o} files, to improve
7758 paging and cache locality performance.
7760 This optimization is automatically turned off in the presence of
7761 exception handling, for linkonce sections, for functions with a user-defined
7762 section attribute and on any architecture that does not support named
7763 sections.
7765 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7767 @item -freorder-functions
7768 @opindex freorder-functions
7769 Reorder functions in the object file in order to
7770 improve code locality.  This is implemented by using special
7771 subsections @code{.text.hot} for most frequently executed functions and
7772 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7773 the linker so object file format must support named sections and linker must
7774 place them in a reasonable way.
7776 Also profile feedback must be available to make this option effective.  See
7777 @option{-fprofile-arcs} for details.
7779 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7781 @item -fstrict-aliasing
7782 @opindex fstrict-aliasing
7783 Allow the compiler to assume the strictest aliasing rules applicable to
7784 the language being compiled.  For C (and C++), this activates
7785 optimizations based on the type of expressions.  In particular, an
7786 object of one type is assumed never to reside at the same address as an
7787 object of a different type, unless the types are almost the same.  For
7788 example, an @code{unsigned int} can alias an @code{int}, but not a
7789 @code{void*} or a @code{double}.  A character type may alias any other
7790 type.
7792 @anchor{Type-punning}Pay special attention to code like this:
7793 @smallexample
7794 union a_union @{
7795   int i;
7796   double d;
7799 int f() @{
7800   union a_union t;
7801   t.d = 3.0;
7802   return t.i;
7804 @end smallexample
7805 The practice of reading from a different union member than the one most
7806 recently written to (called ``type-punning'') is common.  Even with
7807 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7808 is accessed through the union type.  So, the code above works as
7809 expected.  @xref{Structures unions enumerations and bit-fields
7810 implementation}.  However, this code might not:
7811 @smallexample
7812 int f() @{
7813   union a_union t;
7814   int* ip;
7815   t.d = 3.0;
7816   ip = &t.i;
7817   return *ip;
7819 @end smallexample
7821 Similarly, access by taking the address, casting the resulting pointer
7822 and dereferencing the result has undefined behavior, even if the cast
7823 uses a union type, e.g.:
7824 @smallexample
7825 int f() @{
7826   double d = 3.0;
7827   return ((union a_union *) &d)->i;
7829 @end smallexample
7831 The @option{-fstrict-aliasing} option is enabled at levels
7832 @option{-O2}, @option{-O3}, @option{-Os}.
7834 @item -fstrict-overflow
7835 @opindex fstrict-overflow
7836 Allow the compiler to assume strict signed overflow rules, depending
7837 on the language being compiled.  For C (and C++) this means that
7838 overflow when doing arithmetic with signed numbers is undefined, which
7839 means that the compiler may assume that it does not happen.  This
7840 permits various optimizations.  For example, the compiler assumes
7841 that an expression like @code{i + 10 > i} is always true for
7842 signed @code{i}.  This assumption is only valid if signed overflow is
7843 undefined, as the expression is false if @code{i + 10} overflows when
7844 using twos complement arithmetic.  When this option is in effect any
7845 attempt to determine whether an operation on signed numbers 
7846 overflows must be written carefully to not actually involve overflow.
7848 This option also allows the compiler to assume strict pointer
7849 semantics: given a pointer to an object, if adding an offset to that
7850 pointer does not produce a pointer to the same object, the addition is
7851 undefined.  This permits the compiler to conclude that @code{p + u >
7852 p} is always true for a pointer @code{p} and unsigned integer
7853 @code{u}.  This assumption is only valid because pointer wraparound is
7854 undefined, as the expression is false if @code{p + u} overflows using
7855 twos complement arithmetic.
7857 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7858 that integer signed overflow is fully defined: it wraps.  When
7859 @option{-fwrapv} is used, there is no difference between
7860 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7861 integers.  With @option{-fwrapv} certain types of overflow are
7862 permitted.  For example, if the compiler gets an overflow when doing
7863 arithmetic on constants, the overflowed value can still be used with
7864 @option{-fwrapv}, but not otherwise.
7866 The @option{-fstrict-overflow} option is enabled at levels
7867 @option{-O2}, @option{-O3}, @option{-Os}.
7869 @item -falign-functions
7870 @itemx -falign-functions=@var{n}
7871 @opindex falign-functions
7872 Align the start of functions to the next power-of-two greater than
7873 @var{n}, skipping up to @var{n} bytes.  For instance,
7874 @option{-falign-functions=32} aligns functions to the next 32-byte
7875 boundary, but @option{-falign-functions=24} aligns to the next
7876 32-byte boundary only if this can be done by skipping 23 bytes or less.
7878 @option{-fno-align-functions} and @option{-falign-functions=1} are
7879 equivalent and mean that functions are not aligned.
7881 Some assemblers only support this flag when @var{n} is a power of two;
7882 in that case, it is rounded up.
7884 If @var{n} is not specified or is zero, use a machine-dependent default.
7886 Enabled at levels @option{-O2}, @option{-O3}.
7888 @item -falign-labels
7889 @itemx -falign-labels=@var{n}
7890 @opindex falign-labels
7891 Align all branch targets to a power-of-two boundary, skipping up to
7892 @var{n} bytes like @option{-falign-functions}.  This option can easily
7893 make code slower, because it must insert dummy operations for when the
7894 branch target is reached in the usual flow of the code.
7896 @option{-fno-align-labels} and @option{-falign-labels=1} are
7897 equivalent and mean that labels are not aligned.
7899 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7900 are greater than this value, then their values are used instead.
7902 If @var{n} is not specified or is zero, use a machine-dependent default
7903 which is very likely to be @samp{1}, meaning no alignment.
7905 Enabled at levels @option{-O2}, @option{-O3}.
7907 @item -falign-loops
7908 @itemx -falign-loops=@var{n}
7909 @opindex falign-loops
7910 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7911 like @option{-falign-functions}.  If the loops are
7912 executed many times, this makes up for any execution of the dummy
7913 operations.
7915 @option{-fno-align-loops} and @option{-falign-loops=1} are
7916 equivalent and mean that loops are not aligned.
7918 If @var{n} is not specified or is zero, use a machine-dependent default.
7920 Enabled at levels @option{-O2}, @option{-O3}.
7922 @item -falign-jumps
7923 @itemx -falign-jumps=@var{n}
7924 @opindex falign-jumps
7925 Align branch targets to a power-of-two boundary, for branch targets
7926 where the targets can only be reached by jumping, skipping up to @var{n}
7927 bytes like @option{-falign-functions}.  In this case, no dummy operations
7928 need be executed.
7930 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7931 equivalent and mean that loops are not aligned.
7933 If @var{n} is not specified or is zero, use a machine-dependent default.
7935 Enabled at levels @option{-O2}, @option{-O3}.
7937 @item -funit-at-a-time
7938 @opindex funit-at-a-time
7939 This option is left for compatibility reasons. @option{-funit-at-a-time}
7940 has no effect, while @option{-fno-unit-at-a-time} implies
7941 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7943 Enabled by default.
7945 @item -fno-toplevel-reorder
7946 @opindex fno-toplevel-reorder
7947 Do not reorder top-level functions, variables, and @code{asm}
7948 statements.  Output them in the same order that they appear in the
7949 input file.  When this option is used, unreferenced static variables
7950 are not removed.  This option is intended to support existing code
7951 that relies on a particular ordering.  For new code, it is better to
7952 use attributes when possible.
7954 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
7955 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
7956 targets.
7958 @item -fweb
7959 @opindex fweb
7960 Constructs webs as commonly used for register allocation purposes and assign
7961 each web individual pseudo register.  This allows the register allocation pass
7962 to operate on pseudos directly, but also strengthens several other optimization
7963 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7964 however, make debugging impossible, since variables no longer stay in a
7965 ``home register''.
7967 Enabled by default with @option{-funroll-loops}.
7969 @item -fwhole-program
7970 @opindex fwhole-program
7971 Assume that the current compilation unit represents the whole program being
7972 compiled.  All public functions and variables with the exception of @code{main}
7973 and those merged by attribute @code{externally_visible} become static functions
7974 and in effect are optimized more aggressively by interprocedural optimizers.
7976 This option should not be used in combination with @option{-flto}.
7977 Instead relying on a linker plugin should provide safer and more precise
7978 information.
7980 @item -flto[=@var{n}]
7981 @opindex flto
7982 This option runs the standard link-time optimizer.  When invoked
7983 with source code, it generates GIMPLE (one of GCC's internal
7984 representations) and writes it to special ELF sections in the object
7985 file.  When the object files are linked together, all the function
7986 bodies are read from these ELF sections and instantiated as if they
7987 had been part of the same translation unit.
7989 To use the link-time optimizer, @option{-flto} and optimization
7990 options should be specified at compile time and during the final link.
7991 It is recommended that you compile all the files participating in the
7992 same link with the same options and also specify those options at
7993 link time.  
7994 For example:
7996 @smallexample
7997 gcc -c -O2 -flto foo.c
7998 gcc -c -O2 -flto bar.c
7999 gcc -o myprog -flto -O2 foo.o bar.o
8000 @end smallexample
8002 The first two invocations to GCC save a bytecode representation
8003 of GIMPLE into special ELF sections inside @file{foo.o} and
8004 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
8005 @file{foo.o} and @file{bar.o}, merges the two files into a single
8006 internal image, and compiles the result as usual.  Since both
8007 @file{foo.o} and @file{bar.o} are merged into a single image, this
8008 causes all the interprocedural analyses and optimizations in GCC to
8009 work across the two files as if they were a single one.  This means,
8010 for example, that the inliner is able to inline functions in
8011 @file{bar.o} into functions in @file{foo.o} and vice-versa.
8013 Another (simpler) way to enable link-time optimization is:
8015 @smallexample
8016 gcc -o myprog -flto -O2 foo.c bar.c
8017 @end smallexample
8019 The above generates bytecode for @file{foo.c} and @file{bar.c},
8020 merges them together into a single GIMPLE representation and optimizes
8021 them as usual to produce @file{myprog}.
8023 The only important thing to keep in mind is that to enable link-time
8024 optimizations you need to use the GCC driver to perform the link step.
8025 GCC then automatically performs link-time optimization if any of the
8026 objects involved were compiled with the @option{-flto} command-line option.  
8027 You generally
8028 should specify the optimization options to be used for link-time
8029 optimization though GCC tries to be clever at guessing an
8030 optimization level to use from the options used at compile time
8031 if you fail to specify one at link time.  You can always override
8032 the automatic decision to do link-time optimization at link time
8033 by passing @option{-fno-lto} to the link command.
8035 To make whole program optimization effective, it is necessary to make
8036 certain whole program assumptions.  The compiler needs to know
8037 what functions and variables can be accessed by libraries and runtime
8038 outside of the link-time optimized unit.  When supported by the linker,
8039 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8040 to the compiler about used and externally visible symbols.  When
8041 the linker plugin is not available, @option{-fwhole-program} should be
8042 used to allow the compiler to make these assumptions, which leads
8043 to more aggressive optimization decisions.
8045 When @option{-fuse-linker-plugin} is not enabled, when a file is
8046 compiled with @option{-flto}, the generated object file is larger than
8047 a regular object file because it contains GIMPLE bytecodes and the usual
8048 final code (see @option{-ffat-lto-objects}.  This means that
8049 object files with LTO information can be linked as normal object
8050 files; if @option{-fno-lto} is passed to the linker, no
8051 interprocedural optimizations are applied.  Note that when
8052 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
8053 but you cannot perform a regular, non-LTO link on them.
8055 Additionally, the optimization flags used to compile individual files
8056 are not necessarily related to those used at link time.  For instance,
8058 @smallexample
8059 gcc -c -O0 -ffat-lto-objects -flto foo.c
8060 gcc -c -O0 -ffat-lto-objects -flto bar.c
8061 gcc -o myprog -O3 foo.o bar.o
8062 @end smallexample
8064 This produces individual object files with unoptimized assembler
8065 code, but the resulting binary @file{myprog} is optimized at
8066 @option{-O3}.  If, instead, the final binary is generated with
8067 @option{-fno-lto}, then @file{myprog} is not optimized.
8069 When producing the final binary, GCC only
8070 applies link-time optimizations to those files that contain bytecode.
8071 Therefore, you can mix and match object files and libraries with
8072 GIMPLE bytecodes and final object code.  GCC automatically selects
8073 which files to optimize in LTO mode and which files to link without
8074 further processing.
8076 There are some code generation flags preserved by GCC when
8077 generating bytecodes, as they need to be used during the final link
8078 stage.  Generally options specified at link time override those
8079 specified at compile time.
8081 If you do not specify an optimization level option @option{-O} at
8082 link time, then GCC uses the highest optimization level 
8083 used when compiling the object files.
8085 Currently, the following options and their settings are taken from
8086 the first object file that explicitly specifies them: 
8087 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8088 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8089 and all the @option{-m} target flags.
8091 Certain ABI-changing flags are required to match in all compilation units,
8092 and trying to override this at link time with a conflicting value
8093 is ignored.  This includes options such as @option{-freg-struct-return}
8094 and @option{-fpcc-struct-return}. 
8096 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8097 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8098 are passed through to the link stage and merged conservatively for
8099 conflicting translation units.  Specifically
8100 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8101 precedence; and for example @option{-ffp-contract=off} takes precedence
8102 over @option{-ffp-contract=fast}.  You can override them at link time.
8104 If LTO encounters objects with C linkage declared with incompatible
8105 types in separate translation units to be linked together (undefined
8106 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8107 issued.  The behavior is still undefined at run time.  Similar
8108 diagnostics may be raised for other languages.
8110 Another feature of LTO is that it is possible to apply interprocedural
8111 optimizations on files written in different languages:
8113 @smallexample
8114 gcc -c -flto foo.c
8115 g++ -c -flto bar.cc
8116 gfortran -c -flto baz.f90
8117 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8118 @end smallexample
8120 Notice that the final link is done with @command{g++} to get the C++
8121 runtime libraries and @option{-lgfortran} is added to get the Fortran
8122 runtime libraries.  In general, when mixing languages in LTO mode, you
8123 should use the same link command options as when mixing languages in a
8124 regular (non-LTO) compilation.
8126 If object files containing GIMPLE bytecode are stored in a library archive, say
8127 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8128 are using a linker with plugin support.  To create static libraries suitable
8129 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8130 and @command{ranlib}; 
8131 to show the symbols of object files with GIMPLE bytecode, use
8132 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8133 and @command{nm} have been compiled with plugin support.  At link time, use the the
8134 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8135 the LTO optimization process:
8137 @smallexample
8138 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8139 @end smallexample
8141 With the linker plugin enabled, the linker extracts the needed
8142 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8143 to make them part of the aggregated GIMPLE image to be optimized.
8145 If you are not using a linker with plugin support and/or do not
8146 enable the linker plugin, then the objects inside @file{libfoo.a}
8147 are extracted and linked as usual, but they do not participate
8148 in the LTO optimization process.  In order to make a static library suitable
8149 for both LTO optimization and usual linkage, compile its object files with
8150 @option{-flto} @option{-ffat-lto-objects}.
8152 Link-time optimizations do not require the presence of the whole program to
8153 operate.  If the program does not require any symbols to be exported, it is
8154 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8155 the interprocedural optimizers to use more aggressive assumptions which may
8156 lead to improved optimization opportunities.
8157 Use of @option{-fwhole-program} is not needed when linker plugin is
8158 active (see @option{-fuse-linker-plugin}).
8160 The current implementation of LTO makes no
8161 attempt to generate bytecode that is portable between different
8162 types of hosts.  The bytecode files are versioned and there is a
8163 strict version check, so bytecode files generated in one version of
8164 GCC do not work with an older or newer version of GCC.
8166 Link-time optimization does not work well with generation of debugging
8167 information.  Combining @option{-flto} with
8168 @option{-g} is currently experimental and expected to produce unexpected
8169 results.
8171 If you specify the optional @var{n}, the optimization and code
8172 generation done at link time is executed in parallel using @var{n}
8173 parallel jobs by utilizing an installed @command{make} program.  The
8174 environment variable @env{MAKE} may be used to override the program
8175 used.  The default value for @var{n} is 1.
8177 You can also specify @option{-flto=jobserver} to use GNU make's
8178 job server mode to determine the number of parallel jobs. This
8179 is useful when the Makefile calling GCC is already executing in parallel.
8180 You must prepend a @samp{+} to the command recipe in the parent Makefile
8181 for this to work.  This option likely only works if @env{MAKE} is
8182 GNU make.
8184 @item -flto-partition=@var{alg}
8185 @opindex flto-partition
8186 Specify the partitioning algorithm used by the link-time optimizer.
8187 The value is either @samp{1to1} to specify a partitioning mirroring
8188 the original source files or @samp{balanced} to specify partitioning
8189 into equally sized chunks (whenever possible) or @samp{max} to create
8190 new partition for every symbol where possible.  Specifying @samp{none}
8191 as an algorithm disables partitioning and streaming completely. 
8192 The default value is @samp{balanced}. While @samp{1to1} can be used
8193 as an workaround for various code ordering issues, the @samp{max}
8194 partitioning is intended for internal testing only.
8195 The value @samp{one} specifies that exactly one partition should be
8196 used while the value @samp{none} bypasses partitioning and executes
8197 the link-time optimization step directly from the WPA phase.
8199 @item -flto-odr-type-merging
8200 @opindex flto-odr-type-merging
8201 Enable streaming of mangled types names of C++ types and their unification
8202 at link time.  This increases size of LTO object files, but enables
8203 diagnostics about One Definition Rule violations.
8205 @item -flto-compression-level=@var{n}
8206 @opindex flto-compression-level
8207 This option specifies the level of compression used for intermediate
8208 language written to LTO object files, and is only meaningful in
8209 conjunction with LTO mode (@option{-flto}).  Valid
8210 values are 0 (no compression) to 9 (maximum compression).  Values
8211 outside this range are clamped to either 0 or 9.  If the option is not
8212 given, a default balanced compression setting is used.
8214 @item -fuse-linker-plugin
8215 @opindex fuse-linker-plugin
8216 Enables the use of a linker plugin during link-time optimization.  This
8217 option relies on plugin support in the linker, which is available in gold
8218 or in GNU ld 2.21 or newer.
8220 This option enables the extraction of object files with GIMPLE bytecode out
8221 of library archives. This improves the quality of optimization by exposing
8222 more code to the link-time optimizer.  This information specifies what
8223 symbols can be accessed externally (by non-LTO object or during dynamic
8224 linking).  Resulting code quality improvements on binaries (and shared
8225 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
8226 See @option{-flto} for a description of the effect of this flag and how to
8227 use it.
8229 This option is enabled by default when LTO support in GCC is enabled
8230 and GCC was configured for use with
8231 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8233 @item -ffat-lto-objects
8234 @opindex ffat-lto-objects
8235 Fat LTO objects are object files that contain both the intermediate language
8236 and the object code. This makes them usable for both LTO linking and normal
8237 linking. This option is effective only when compiling with @option{-flto}
8238 and is ignored at link time.
8240 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8241 requires the complete toolchain to be aware of LTO. It requires a linker with
8242 linker plugin support for basic functionality.  Additionally,
8243 @command{nm}, @command{ar} and @command{ranlib}
8244 need to support linker plugins to allow a full-featured build environment
8245 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8246 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8247 to these tools. With non fat LTO makefiles need to be modified to use them.
8249 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
8250 support.
8252 @item -fcompare-elim
8253 @opindex fcompare-elim
8254 After register allocation and post-register allocation instruction splitting,
8255 identify arithmetic instructions that compute processor flags similar to a
8256 comparison operation based on that arithmetic.  If possible, eliminate the
8257 explicit comparison operation.
8259 This pass only applies to certain targets that cannot explicitly represent
8260 the comparison operation before register allocation is complete.
8262 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8264 @item -fcprop-registers
8265 @opindex fcprop-registers
8266 After register allocation and post-register allocation instruction splitting,
8267 perform a copy-propagation pass to try to reduce scheduling dependencies
8268 and occasionally eliminate the copy.
8270 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8272 @item -fprofile-correction
8273 @opindex fprofile-correction
8274 Profiles collected using an instrumented binary for multi-threaded programs may
8275 be inconsistent due to missed counter updates. When this option is specified,
8276 GCC uses heuristics to correct or smooth out such inconsistencies. By
8277 default, GCC emits an error message when an inconsistent profile is detected.
8279 @item -fprofile-use
8280 @itemx -fprofile-use=@var{path}
8281 @opindex fprofile-use
8282 Enable profile feedback-directed optimizations, 
8283 and the following optimizations
8284 which are generally profitable only with profile feedback available:
8285 @option{-fbranch-probabilities}, @option{-fvpt},
8286 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8287 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
8289 Before you can use this option, you must first generate profiling information.
8290 @xref{Optimize Options}, for information about the @option{-fprofile-generate}
8291 option.
8293 By default, GCC emits an error message if the feedback profiles do not
8294 match the source code.  This error can be turned into a warning by using
8295 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8296 code.
8298 If @var{path} is specified, GCC looks at the @var{path} to find
8299 the profile feedback data files. See @option{-fprofile-dir}.
8301 @item -fauto-profile
8302 @itemx -fauto-profile=@var{path}
8303 @opindex fauto-profile
8304 Enable sampling-based feedback-directed optimizations, 
8305 and the following optimizations
8306 which are generally profitable only with profile feedback available:
8307 @option{-fbranch-probabilities}, @option{-fvpt},
8308 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8309 @option{-ftree-vectorize},
8310 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
8311 @option{-fpredictive-commoning}, @option{-funswitch-loops},
8312 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
8314 @var{path} is the name of a file containing AutoFDO profile information.
8315 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
8317 Producing an AutoFDO profile data file requires running your program
8318 with the @command{perf} utility on a supported GNU/Linux target system.
8319 For more information, see @uref{https://perf.wiki.kernel.org/}.
8321 E.g.
8322 @smallexample
8323 perf record -e br_inst_retired:near_taken -b -o perf.data \
8324     -- your_program
8325 @end smallexample
8327 Then use the @command{create_gcov} tool to convert the raw profile data
8328 to a format that can be used by GCC.@  You must also supply the 
8329 unstripped binary for your program to this tool.  
8330 See @uref{https://github.com/google/autofdo}.
8332 E.g.
8333 @smallexample
8334 create_gcov --binary=your_program.unstripped --profile=perf.data \
8335     --gcov=profile.afdo
8336 @end smallexample
8337 @end table
8339 The following options control compiler behavior regarding floating-point 
8340 arithmetic.  These options trade off between speed and
8341 correctness.  All must be specifically enabled.
8343 @table @gcctabopt
8344 @item -ffloat-store
8345 @opindex ffloat-store
8346 Do not store floating-point variables in registers, and inhibit other
8347 options that might change whether a floating-point value is taken from a
8348 register or memory.
8350 @cindex floating-point precision
8351 This option prevents undesirable excess precision on machines such as
8352 the 68000 where the floating registers (of the 68881) keep more
8353 precision than a @code{double} is supposed to have.  Similarly for the
8354 x86 architecture.  For most programs, the excess precision does only
8355 good, but a few programs rely on the precise definition of IEEE floating
8356 point.  Use @option{-ffloat-store} for such programs, after modifying
8357 them to store all pertinent intermediate computations into variables.
8359 @item -fexcess-precision=@var{style}
8360 @opindex fexcess-precision
8361 This option allows further control over excess precision on machines
8362 where floating-point registers have more precision than the IEEE
8363 @code{float} and @code{double} types and the processor does not
8364 support operations rounding to those types.  By default,
8365 @option{-fexcess-precision=fast} is in effect; this means that
8366 operations are carried out in the precision of the registers and that
8367 it is unpredictable when rounding to the types specified in the source
8368 code takes place.  When compiling C, if
8369 @option{-fexcess-precision=standard} is specified then excess
8370 precision follows the rules specified in ISO C99; in particular,
8371 both casts and assignments cause values to be rounded to their
8372 semantic types (whereas @option{-ffloat-store} only affects
8373 assignments).  This option is enabled by default for C if a strict
8374 conformance option such as @option{-std=c99} is used.
8376 @opindex mfpmath
8377 @option{-fexcess-precision=standard} is not implemented for languages
8378 other than C, and has no effect if
8379 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8380 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8381 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8382 semantics apply without excess precision, and in the latter, rounding
8383 is unpredictable.
8385 @item -ffast-math
8386 @opindex ffast-math
8387 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8388 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8389 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8391 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8393 This option is not turned on by any @option{-O} option besides
8394 @option{-Ofast} since it can result in incorrect output for programs
8395 that depend on an exact implementation of IEEE or ISO rules/specifications
8396 for math functions. It may, however, yield faster code for programs
8397 that do not require the guarantees of these specifications.
8399 @item -fno-math-errno
8400 @opindex fno-math-errno
8401 Do not set @code{errno} after calling math functions that are executed
8402 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8403 IEEE exceptions for math error handling may want to use this flag
8404 for speed while maintaining IEEE arithmetic compatibility.
8406 This option is not turned on by any @option{-O} option since
8407 it can result in incorrect output for programs that depend on
8408 an exact implementation of IEEE or ISO rules/specifications for
8409 math functions. It may, however, yield faster code for programs
8410 that do not require the guarantees of these specifications.
8412 The default is @option{-fmath-errno}.
8414 On Darwin systems, the math library never sets @code{errno}.  There is
8415 therefore no reason for the compiler to consider the possibility that
8416 it might, and @option{-fno-math-errno} is the default.
8418 @item -funsafe-math-optimizations
8419 @opindex funsafe-math-optimizations
8421 Allow optimizations for floating-point arithmetic that (a) assume
8422 that arguments and results are valid and (b) may violate IEEE or
8423 ANSI standards.  When used at link time, it may include libraries
8424 or startup files that change the default FPU control word or other
8425 similar optimizations.
8427 This option is not turned on by any @option{-O} option since
8428 it can result in incorrect output for programs that depend on
8429 an exact implementation of IEEE or ISO rules/specifications for
8430 math functions. It may, however, yield faster code for programs
8431 that do not require the guarantees of these specifications.
8432 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8433 @option{-fassociative-math} and @option{-freciprocal-math}.
8435 The default is @option{-fno-unsafe-math-optimizations}.
8437 @item -fassociative-math
8438 @opindex fassociative-math
8440 Allow re-association of operands in series of floating-point operations.
8441 This violates the ISO C and C++ language standard by possibly changing
8442 computation result.  NOTE: re-ordering may change the sign of zero as
8443 well as ignore NaNs and inhibit or create underflow or overflow (and
8444 thus cannot be used on code that relies on rounding behavior like
8445 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8446 and thus may not be used when ordered comparisons are required.
8447 This option requires that both @option{-fno-signed-zeros} and
8448 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8449 much sense with @option{-frounding-math}. For Fortran the option
8450 is automatically enabled when both @option{-fno-signed-zeros} and
8451 @option{-fno-trapping-math} are in effect.
8453 The default is @option{-fno-associative-math}.
8455 @item -freciprocal-math
8456 @opindex freciprocal-math
8458 Allow the reciprocal of a value to be used instead of dividing by
8459 the value if this enables optimizations.  For example @code{x / y}
8460 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8461 is subject to common subexpression elimination.  Note that this loses
8462 precision and increases the number of flops operating on the value.
8464 The default is @option{-fno-reciprocal-math}.
8466 @item -ffinite-math-only
8467 @opindex ffinite-math-only
8468 Allow optimizations for floating-point arithmetic that assume
8469 that arguments and results are not NaNs or +-Infs.
8471 This option is not turned on by any @option{-O} option since
8472 it can result in incorrect output for programs that depend on
8473 an exact implementation of IEEE or ISO rules/specifications for
8474 math functions. It may, however, yield faster code for programs
8475 that do not require the guarantees of these specifications.
8477 The default is @option{-fno-finite-math-only}.
8479 @item -fno-signed-zeros
8480 @opindex fno-signed-zeros
8481 Allow optimizations for floating-point arithmetic that ignore the
8482 signedness of zero.  IEEE arithmetic specifies the behavior of
8483 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8484 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8485 This option implies that the sign of a zero result isn't significant.
8487 The default is @option{-fsigned-zeros}.
8489 @item -fno-trapping-math
8490 @opindex fno-trapping-math
8491 Compile code assuming that floating-point operations cannot generate
8492 user-visible traps.  These traps include division by zero, overflow,
8493 underflow, inexact result and invalid operation.  This option requires
8494 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8495 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8497 This option should never be turned on by any @option{-O} option since
8498 it can result in incorrect output for programs that depend on
8499 an exact implementation of IEEE or ISO rules/specifications for
8500 math functions.
8502 The default is @option{-ftrapping-math}.
8504 @item -frounding-math
8505 @opindex frounding-math
8506 Disable transformations and optimizations that assume default floating-point
8507 rounding behavior.  This is round-to-zero for all floating point
8508 to integer conversions, and round-to-nearest for all other arithmetic
8509 truncations.  This option should be specified for programs that change
8510 the FP rounding mode dynamically, or that may be executed with a
8511 non-default rounding mode.  This option disables constant folding of
8512 floating-point expressions at compile time (which may be affected by
8513 rounding mode) and arithmetic transformations that are unsafe in the
8514 presence of sign-dependent rounding modes.
8516 The default is @option{-fno-rounding-math}.
8518 This option is experimental and does not currently guarantee to
8519 disable all GCC optimizations that are affected by rounding mode.
8520 Future versions of GCC may provide finer control of this setting
8521 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8522 will be used to specify the default state for @code{FENV_ACCESS}.
8524 @item -fsignaling-nans
8525 @opindex fsignaling-nans
8526 Compile code assuming that IEEE signaling NaNs may generate user-visible
8527 traps during floating-point operations.  Setting this option disables
8528 optimizations that may change the number of exceptions visible with
8529 signaling NaNs.  This option implies @option{-ftrapping-math}.
8531 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8532 be defined.
8534 The default is @option{-fno-signaling-nans}.
8536 This option is experimental and does not currently guarantee to
8537 disable all GCC optimizations that affect signaling NaN behavior.
8539 @item -fno-fp-int-builtin-inexact
8540 @opindex fno-fp-int-builtin-inexact
8541 Do not allow the built-in functions @code{ceil}, @code{floor},
8542 @code{round} and @code{trunc}, and their @code{float} and @code{long
8543 double} variants, to generate code that raises the ``inexact''
8544 floating-point exception for noninteger arguments.  ISO C99 and C11
8545 allow these functions to raise the ``inexact'' exception, but ISO/IEC
8546 TS 18661-1:2014, the C bindings to IEEE 754-2008, does not allow these
8547 functions to do so.
8549 The default is @option{-ffp-int-builtin-inexact}, allowing the
8550 exception to be raised.  This option does nothing unless
8551 @option{-ftrapping-math} is in effect.
8553 Even if @option{-fno-fp-int-builtin-inexact} is used, if the functions
8554 generate a call to a library function then the ``inexact'' exception
8555 may be raised if the library implementation does not follow TS 18661.
8557 @item -fsingle-precision-constant
8558 @opindex fsingle-precision-constant
8559 Treat floating-point constants as single precision instead of
8560 implicitly converting them to double-precision constants.
8562 @item -fcx-limited-range
8563 @opindex fcx-limited-range
8564 When enabled, this option states that a range reduction step is not
8565 needed when performing complex division.  Also, there is no checking
8566 whether the result of a complex multiplication or division is @code{NaN
8567 + I*NaN}, with an attempt to rescue the situation in that case.  The
8568 default is @option{-fno-cx-limited-range}, but is enabled by
8569 @option{-ffast-math}.
8571 This option controls the default setting of the ISO C99
8572 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8573 all languages.
8575 @item -fcx-fortran-rules
8576 @opindex fcx-fortran-rules
8577 Complex multiplication and division follow Fortran rules.  Range
8578 reduction is done as part of complex division, but 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.
8582 The default is @option{-fno-cx-fortran-rules}.
8584 @end table
8586 The following options control optimizations that may improve
8587 performance, but are not enabled by any @option{-O} options.  This
8588 section includes experimental options that may produce broken code.
8590 @table @gcctabopt
8591 @item -fbranch-probabilities
8592 @opindex fbranch-probabilities
8593 After running a program compiled with @option{-fprofile-arcs}
8594 (@pxref{Instrumentation Options}),
8595 you can compile it a second time using
8596 @option{-fbranch-probabilities}, to improve optimizations based on
8597 the number of times each branch was taken.  When a program
8598 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8599 counts to a file called @file{@var{sourcename}.gcda} for each source
8600 file.  The information in this data file is very dependent on the
8601 structure of the generated code, so you must use the same source code
8602 and the same optimization options for both compilations.
8604 With @option{-fbranch-probabilities}, GCC puts a
8605 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8606 These can be used to improve optimization.  Currently, they are only
8607 used in one place: in @file{reorg.c}, instead of guessing which path a
8608 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8609 exactly determine which path is taken more often.
8611 @item -fprofile-values
8612 @opindex fprofile-values
8613 If combined with @option{-fprofile-arcs}, it adds code so that some
8614 data about values of expressions in the program is gathered.
8616 With @option{-fbranch-probabilities}, it reads back the data gathered
8617 from profiling values of expressions for usage in optimizations.
8619 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8621 @item -fprofile-reorder-functions
8622 @opindex fprofile-reorder-functions
8623 Function reordering based on profile instrumentation collects
8624 first time of execution of a function and orders these functions
8625 in ascending order.
8627 Enabled with @option{-fprofile-use}.
8629 @item -fvpt
8630 @opindex fvpt
8631 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8632 to add code to gather information about values of expressions.
8634 With @option{-fbranch-probabilities}, it reads back the data gathered
8635 and actually performs the optimizations based on them.
8636 Currently the optimizations include specialization of division operations
8637 using the knowledge about the value of the denominator.
8639 @item -frename-registers
8640 @opindex frename-registers
8641 Attempt to avoid false dependencies in scheduled code by making use
8642 of registers left over after register allocation.  This optimization
8643 most benefits processors with lots of registers.  Depending on the
8644 debug information format adopted by the target, however, it can
8645 make debugging impossible, since variables no longer stay in
8646 a ``home register''.
8648 Enabled by default with @option{-funroll-loops}.
8650 @item -fschedule-fusion
8651 @opindex fschedule-fusion
8652 Performs a target dependent pass over the instruction stream to schedule
8653 instructions of same type together because target machine can execute them
8654 more efficiently if they are adjacent to each other in the instruction flow.
8656 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8658 @item -ftracer
8659 @opindex ftracer
8660 Perform tail duplication to enlarge superblock size.  This transformation
8661 simplifies the control flow of the function allowing other optimizations to do
8662 a better job.
8664 Enabled with @option{-fprofile-use}.
8666 @item -funroll-loops
8667 @opindex funroll-loops
8668 Unroll loops whose number of iterations can be determined at compile time or
8669 upon entry to the loop.  @option{-funroll-loops} implies
8670 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8671 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8672 a small constant number of iterations).  This option makes code larger, and may
8673 or may not make it run faster.
8675 Enabled with @option{-fprofile-use}.
8677 @item -funroll-all-loops
8678 @opindex funroll-all-loops
8679 Unroll all loops, even if their number of iterations is uncertain when
8680 the loop is entered.  This usually makes programs run more slowly.
8681 @option{-funroll-all-loops} implies the same options as
8682 @option{-funroll-loops}.
8684 @item -fpeel-loops
8685 @opindex fpeel-loops
8686 Peels loops for which there is enough information that they do not
8687 roll much (from profile feedback or static analysis).  It also turns on
8688 complete loop peeling (i.e.@: complete removal of loops with small constant
8689 number of iterations).
8691 Enabled with @option{-O3} and/or @option{-fprofile-use}.
8693 @item -fmove-loop-invariants
8694 @opindex fmove-loop-invariants
8695 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8696 at level @option{-O1}
8698 @item -funswitch-loops
8699 @opindex funswitch-loops
8700 Move branches with loop invariant conditions out of the loop, with duplicates
8701 of the loop on both branches (modified according to result of the condition).
8703 @item -ffunction-sections
8704 @itemx -fdata-sections
8705 @opindex ffunction-sections
8706 @opindex fdata-sections
8707 Place each function or data item into its own section in the output
8708 file if the target supports arbitrary sections.  The name of the
8709 function or the name of the data item determines the section's name
8710 in the output file.
8712 Use these options on systems where the linker can perform optimizations
8713 to improve locality of reference in the instruction space.  Most systems
8714 using the ELF object format and SPARC processors running Solaris 2 have
8715 linkers with such optimizations.  AIX may have these optimizations in
8716 the future.
8718 Only use these options when there are significant benefits from doing
8719 so.  When you specify these options, the assembler and linker
8720 create larger object and executable files and are also slower.
8721 You cannot use @command{gprof} on all systems if you
8722 specify this option, and you may have problems with debugging if
8723 you specify both this option and @option{-g}.
8725 @item -fbranch-target-load-optimize
8726 @opindex fbranch-target-load-optimize
8727 Perform branch target register load optimization before prologue / epilogue
8728 threading.
8729 The use of target registers can typically be exposed only during reload,
8730 thus hoisting loads out of loops and doing inter-block scheduling needs
8731 a separate optimization pass.
8733 @item -fbranch-target-load-optimize2
8734 @opindex fbranch-target-load-optimize2
8735 Perform branch target register load optimization after prologue / epilogue
8736 threading.
8738 @item -fbtr-bb-exclusive
8739 @opindex fbtr-bb-exclusive
8740 When performing branch target register load optimization, don't reuse
8741 branch target registers within any basic block.
8743 @item -fstdarg-opt
8744 @opindex fstdarg-opt
8745 Optimize the prologue of variadic argument functions with respect to usage of
8746 those arguments.
8748 @item -fsection-anchors
8749 @opindex fsection-anchors
8750 Try to reduce the number of symbolic address calculations by using
8751 shared ``anchor'' symbols to address nearby objects.  This transformation
8752 can help to reduce the number of GOT entries and GOT accesses on some
8753 targets.
8755 For example, the implementation of the following function @code{foo}:
8757 @smallexample
8758 static int a, b, c;
8759 int foo (void) @{ return a + b + c; @}
8760 @end smallexample
8762 @noindent
8763 usually calculates the addresses of all three variables, but if you
8764 compile it with @option{-fsection-anchors}, it accesses the variables
8765 from a common anchor point instead.  The effect is similar to the
8766 following pseudocode (which isn't valid C):
8768 @smallexample
8769 int foo (void)
8771   register int *xr = &x;
8772   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8774 @end smallexample
8776 Not all targets support this option.
8778 @item --param @var{name}=@var{value}
8779 @opindex param
8780 In some places, GCC uses various constants to control the amount of
8781 optimization that is done.  For example, GCC does not inline functions
8782 that contain more than a certain number of instructions.  You can
8783 control some of these constants on the command line using the
8784 @option{--param} option.
8786 The names of specific parameters, and the meaning of the values, are
8787 tied to the internals of the compiler, and are subject to change
8788 without notice in future releases.
8790 In each case, the @var{value} is an integer.  The allowable choices for
8791 @var{name} are:
8793 @table @gcctabopt
8794 @item predictable-branch-outcome
8795 When branch is predicted to be taken with probability lower than this threshold
8796 (in percent), then it is considered well predictable. The default is 10.
8798 @item max-rtl-if-conversion-insns
8799 RTL if-conversion tries to remove conditional branches around a block and
8800 replace them with conditionally executed instructions.  This parameter
8801 gives the maximum number of instructions in a block which should be
8802 considered for if-conversion.  The default is 10, though the compiler will
8803 also use other heuristics to decide whether if-conversion is likely to be
8804 profitable.
8806 @item max-crossjump-edges
8807 The maximum number of incoming edges to consider for cross-jumping.
8808 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8809 the number of edges incoming to each block.  Increasing values mean
8810 more aggressive optimization, making the compilation time increase with
8811 probably small improvement in executable size.
8813 @item min-crossjump-insns
8814 The minimum number of instructions that must be matched at the end
8815 of two blocks before cross-jumping is performed on them.  This
8816 value is ignored in the case where all instructions in the block being
8817 cross-jumped from are matched.  The default value is 5.
8819 @item max-grow-copy-bb-insns
8820 The maximum code size expansion factor when copying basic blocks
8821 instead of jumping.  The expansion is relative to a jump instruction.
8822 The default value is 8.
8824 @item max-goto-duplication-insns
8825 The maximum number of instructions to duplicate to a block that jumps
8826 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8827 passes, GCC factors computed gotos early in the compilation process,
8828 and unfactors them as late as possible.  Only computed jumps at the
8829 end of a basic blocks with no more than max-goto-duplication-insns are
8830 unfactored.  The default value is 8.
8832 @item max-delay-slot-insn-search
8833 The maximum number of instructions to consider when looking for an
8834 instruction to fill a delay slot.  If more than this arbitrary number of
8835 instructions are searched, the time savings from filling the delay slot
8836 are minimal, so stop searching.  Increasing values mean more
8837 aggressive optimization, making the compilation time increase with probably
8838 small improvement in execution time.
8840 @item max-delay-slot-live-search
8841 When trying to fill delay slots, the maximum number of instructions to
8842 consider when searching for a block with valid live register
8843 information.  Increasing this arbitrarily chosen value means more
8844 aggressive optimization, increasing the compilation time.  This parameter
8845 should be removed when the delay slot code is rewritten to maintain the
8846 control-flow graph.
8848 @item max-gcse-memory
8849 The approximate maximum amount of memory that can be allocated in
8850 order to perform the global common subexpression elimination
8851 optimization.  If more memory than specified is required, the
8852 optimization is not done.
8854 @item max-gcse-insertion-ratio
8855 If the ratio of expression insertions to deletions is larger than this value
8856 for any expression, then RTL PRE inserts or removes the expression and thus
8857 leaves partially redundant computations in the instruction stream.  The default value is 20.
8859 @item max-pending-list-length
8860 The maximum number of pending dependencies scheduling allows
8861 before flushing the current state and starting over.  Large functions
8862 with few branches or calls can create excessively large lists which
8863 needlessly consume memory and resources.
8865 @item max-modulo-backtrack-attempts
8866 The maximum number of backtrack attempts the scheduler should make
8867 when modulo scheduling a loop.  Larger values can exponentially increase
8868 compilation time.
8870 @item max-inline-insns-single
8871 Several parameters control the tree inliner used in GCC@.
8872 This number sets the maximum number of instructions (counted in GCC's
8873 internal representation) in a single function that the tree inliner
8874 considers for inlining.  This only affects functions declared
8875 inline and methods implemented in a class declaration (C++).
8876 The default value is 400.
8878 @item max-inline-insns-auto
8879 When you use @option{-finline-functions} (included in @option{-O3}),
8880 a lot of functions that would otherwise not be considered for inlining
8881 by the compiler are investigated.  To those functions, a different
8882 (more restrictive) limit compared to functions declared inline can
8883 be applied.
8884 The default value is 40.
8886 @item inline-min-speedup
8887 When estimated performance improvement of caller + callee runtime exceeds this
8888 threshold (in precent), the function can be inlined regardless the limit on
8889 @option{--param max-inline-insns-single} and @option{--param
8890 max-inline-insns-auto}.
8892 @item large-function-insns
8893 The limit specifying really large functions.  For functions larger than this
8894 limit after inlining, inlining is constrained by
8895 @option{--param large-function-growth}.  This parameter is useful primarily
8896 to avoid extreme compilation time caused by non-linear algorithms used by the
8897 back end.
8898 The default value is 2700.
8900 @item large-function-growth
8901 Specifies maximal growth of large function caused by inlining in percents.
8902 The default value is 100 which limits large function growth to 2.0 times
8903 the original size.
8905 @item large-unit-insns
8906 The limit specifying large translation unit.  Growth caused by inlining of
8907 units larger than this limit is limited by @option{--param inline-unit-growth}.
8908 For small units this might be too tight.
8909 For example, consider a unit consisting of function A
8910 that is inline and B that just calls A three times.  If B is small relative to
8911 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8912 large units consisting of small inlineable functions, however, the overall unit
8913 growth limit is needed to avoid exponential explosion of code size.  Thus for
8914 smaller units, the size is increased to @option{--param large-unit-insns}
8915 before applying @option{--param inline-unit-growth}.  The default is 10000.
8917 @item inline-unit-growth
8918 Specifies maximal overall growth of the compilation unit caused by inlining.
8919 The default value is 20 which limits unit growth to 1.2 times the original
8920 size. Cold functions (either marked cold via an attribute or by profile
8921 feedback) are not accounted into the unit size.
8923 @item ipcp-unit-growth
8924 Specifies maximal overall growth of the compilation unit caused by
8925 interprocedural constant propagation.  The default value is 10 which limits
8926 unit growth to 1.1 times the original size.
8928 @item large-stack-frame
8929 The limit specifying large stack frames.  While inlining the algorithm is trying
8930 to not grow past this limit too much.  The default value is 256 bytes.
8932 @item large-stack-frame-growth
8933 Specifies maximal growth of large stack frames caused by inlining in percents.
8934 The default value is 1000 which limits large stack frame growth to 11 times
8935 the original size.
8937 @item max-inline-insns-recursive
8938 @itemx max-inline-insns-recursive-auto
8939 Specifies the maximum number of instructions an out-of-line copy of a
8940 self-recursive inline
8941 function can grow into by performing recursive inlining.
8943 @option{--param max-inline-insns-recursive} applies to functions
8944 declared inline.
8945 For functions not declared inline, recursive inlining
8946 happens only when @option{-finline-functions} (included in @option{-O3}) is
8947 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
8948 default value is 450.
8950 @item max-inline-recursive-depth
8951 @itemx max-inline-recursive-depth-auto
8952 Specifies the maximum recursion depth used for recursive inlining.
8954 @option{--param max-inline-recursive-depth} applies to functions
8955 declared inline.  For functions not declared inline, recursive inlining
8956 happens only when @option{-finline-functions} (included in @option{-O3}) is
8957 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
8958 default value is 8.
8960 @item min-inline-recursive-probability
8961 Recursive inlining is profitable only for function having deep recursion
8962 in average and can hurt for function having little recursion depth by
8963 increasing the prologue size or complexity of function body to other
8964 optimizers.
8966 When profile feedback is available (see @option{-fprofile-generate}) the actual
8967 recursion depth can be guessed from probability that function recurses via a
8968 given call expression.  This parameter limits inlining only to call expressions
8969 whose probability exceeds the given threshold (in percents).
8970 The default value is 10.
8972 @item early-inlining-insns
8973 Specify growth that the early inliner can make.  In effect it increases
8974 the amount of inlining for code having a large abstraction penalty.
8975 The default value is 14.
8977 @item max-early-inliner-iterations
8978 Limit of iterations of the early inliner.  This basically bounds
8979 the number of nested indirect calls the early inliner can resolve.
8980 Deeper chains are still handled by late inlining.
8982 @item comdat-sharing-probability
8983 Probability (in percent) that C++ inline function with comdat visibility
8984 are shared across multiple compilation units.  The default value is 20.
8986 @item profile-func-internal-id
8987 A parameter to control whether to use function internal id in profile
8988 database lookup. If the value is 0, the compiler uses an id that
8989 is based on function assembler name and filename, which makes old profile
8990 data more tolerant to source changes such as function reordering etc.
8991 The default value is 0.
8993 @item min-vect-loop-bound
8994 The minimum number of iterations under which loops are not vectorized
8995 when @option{-ftree-vectorize} is used.  The number of iterations after
8996 vectorization needs to be greater than the value specified by this option
8997 to allow vectorization.  The default value is 0.
8999 @item gcse-cost-distance-ratio
9000 Scaling factor in calculation of maximum distance an expression
9001 can be moved by GCSE optimizations.  This is currently supported only in the
9002 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
9003 is with simple expressions, i.e., the expressions that have cost
9004 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
9005 hoisting of simple expressions.  The default value is 10.
9007 @item gcse-unrestricted-cost
9008 Cost, roughly measured as the cost of a single typical machine
9009 instruction, at which GCSE optimizations do not constrain
9010 the distance an expression can travel.  This is currently
9011 supported only in the code hoisting pass.  The lesser the cost,
9012 the more aggressive code hoisting is.  Specifying 0 
9013 allows all expressions to travel unrestricted distances.
9014 The default value is 3.
9016 @item max-hoist-depth
9017 The depth of search in the dominator tree for expressions to hoist.
9018 This is used to avoid quadratic behavior in hoisting algorithm.
9019 The value of 0 does not limit on the search, but may slow down compilation
9020 of huge functions.  The default value is 30.
9022 @item max-tail-merge-comparisons
9023 The maximum amount of similar bbs to compare a bb with.  This is used to
9024 avoid quadratic behavior in tree tail merging.  The default value is 10.
9026 @item max-tail-merge-iterations
9027 The maximum amount of iterations of the pass over the function.  This is used to
9028 limit compilation time in tree tail merging.  The default value is 2.
9030 @item max-unrolled-insns
9031 The maximum number of instructions that a loop may have to be unrolled.
9032 If a loop is unrolled, this parameter also determines how many times
9033 the loop code is unrolled.
9035 @item max-average-unrolled-insns
9036 The maximum number of instructions biased by probabilities of their execution
9037 that a loop may have to be unrolled.  If a loop is unrolled,
9038 this parameter also determines how many times the loop code is unrolled.
9040 @item max-unroll-times
9041 The maximum number of unrollings of a single loop.
9043 @item max-peeled-insns
9044 The maximum number of instructions that a loop may have to be peeled.
9045 If a loop is peeled, this parameter also determines how many times
9046 the loop code is peeled.
9048 @item max-peel-times
9049 The maximum number of peelings of a single loop.
9051 @item max-peel-branches
9052 The maximum number of branches on the hot path through the peeled sequence.
9054 @item max-completely-peeled-insns
9055 The maximum number of insns of a completely peeled loop.
9057 @item max-completely-peel-times
9058 The maximum number of iterations of a loop to be suitable for complete peeling.
9060 @item max-completely-peel-loop-nest-depth
9061 The maximum depth of a loop nest suitable for complete peeling.
9063 @item max-unswitch-insns
9064 The maximum number of insns of an unswitched loop.
9066 @item max-unswitch-level
9067 The maximum number of branches unswitched in a single loop.
9069 @item lim-expensive
9070 The minimum cost of an expensive expression in the loop invariant motion.
9072 @item iv-consider-all-candidates-bound
9073 Bound on number of candidates for induction variables, below which
9074 all candidates are considered for each use in induction variable
9075 optimizations.  If there are more candidates than this,
9076 only the most relevant ones are considered to avoid quadratic time complexity.
9078 @item iv-max-considered-uses
9079 The induction variable optimizations give up on loops that contain more
9080 induction variable uses.
9082 @item iv-always-prune-cand-set-bound
9083 If the number of candidates in the set is smaller than this value,
9084 always try to remove unnecessary ivs from the set
9085 when adding a new one.
9087 @item scev-max-expr-size
9088 Bound on size of expressions used in the scalar evolutions analyzer.
9089 Large expressions slow the analyzer.
9091 @item scev-max-expr-complexity
9092 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9093 Complex expressions slow the analyzer.
9095 @item max-tree-if-conversion-phi-args
9096 Maximum number of arguments in a PHI supported by TREE if conversion
9097 unless the loop is marked with simd pragma.
9099 @item vect-max-version-for-alignment-checks
9100 The maximum number of run-time checks that can be performed when
9101 doing loop versioning for alignment in the vectorizer.
9103 @item vect-max-version-for-alias-checks
9104 The maximum number of run-time checks that can be performed when
9105 doing loop versioning for alias in the vectorizer.
9107 @item vect-max-peeling-for-alignment
9108 The maximum number of loop peels to enhance access alignment
9109 for vectorizer. Value -1 means no limit.
9111 @item max-iterations-to-track
9112 The maximum number of iterations of a loop the brute-force algorithm
9113 for analysis of the number of iterations of the loop tries to evaluate.
9115 @item hot-bb-count-ws-permille
9116 A basic block profile count is considered hot if it contributes to 
9117 the given permillage (i.e. 0...1000) of the entire profiled execution.
9119 @item hot-bb-frequency-fraction
9120 Select fraction of the entry block frequency of executions of basic block in
9121 function given basic block needs to have to be considered hot.
9123 @item max-predicted-iterations
9124 The maximum number of loop iterations we predict statically.  This is useful
9125 in cases where a function contains a single loop with known bound and
9126 another loop with unknown bound.
9127 The known number of iterations is predicted correctly, while
9128 the unknown number of iterations average to roughly 10.  This means that the
9129 loop without bounds appears artificially cold relative to the other one.
9131 @item builtin-expect-probability
9132 Control the probability of the expression having the specified value. This
9133 parameter takes a percentage (i.e. 0 ... 100) as input.
9134 The default probability of 90 is obtained empirically.
9136 @item align-threshold
9138 Select fraction of the maximal frequency of executions of a basic block in
9139 a function to align the basic block.
9141 @item align-loop-iterations
9143 A loop expected to iterate at least the selected number of iterations is
9144 aligned.
9146 @item tracer-dynamic-coverage
9147 @itemx tracer-dynamic-coverage-feedback
9149 This value is used to limit superblock formation once the given percentage of
9150 executed instructions is covered.  This limits unnecessary code size
9151 expansion.
9153 The @option{tracer-dynamic-coverage-feedback} parameter
9154 is used only when profile
9155 feedback is available.  The real profiles (as opposed to statically estimated
9156 ones) are much less balanced allowing the threshold to be larger value.
9158 @item tracer-max-code-growth
9159 Stop tail duplication once code growth has reached given percentage.  This is
9160 a rather artificial limit, as most of the duplicates are eliminated later in
9161 cross jumping, so it may be set to much higher values than is the desired code
9162 growth.
9164 @item tracer-min-branch-ratio
9166 Stop reverse growth when the reverse probability of best edge is less than this
9167 threshold (in percent).
9169 @item tracer-min-branch-probability
9170 @itemx tracer-min-branch-probability-feedback
9172 Stop forward growth if the best edge has probability lower than this
9173 threshold.
9175 Similarly to @option{tracer-dynamic-coverage} two parameters are
9176 provided.  @option{tracer-min-branch-probability-feedback} is used for
9177 compilation with profile feedback and @option{tracer-min-branch-probability}
9178 compilation without.  The value for compilation with profile feedback
9179 needs to be more conservative (higher) in order to make tracer
9180 effective.
9182 @item max-cse-path-length
9184 The maximum number of basic blocks on path that CSE considers.
9185 The default is 10.
9187 @item max-cse-insns
9188 The maximum number of instructions CSE processes before flushing.
9189 The default is 1000.
9191 @item ggc-min-expand
9193 GCC uses a garbage collector to manage its own memory allocation.  This
9194 parameter specifies the minimum percentage by which the garbage
9195 collector's heap should be allowed to expand between collections.
9196 Tuning this may improve compilation speed; it has no effect on code
9197 generation.
9199 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9200 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9201 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9202 GCC is not able to calculate RAM on a particular platform, the lower
9203 bound of 30% is used.  Setting this parameter and
9204 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9205 every opportunity.  This is extremely slow, but can be useful for
9206 debugging.
9208 @item ggc-min-heapsize
9210 Minimum size of the garbage collector's heap before it begins bothering
9211 to collect garbage.  The first collection occurs after the heap expands
9212 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9213 tuning this may improve compilation speed, and has no effect on code
9214 generation.
9216 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9217 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9218 with a lower bound of 4096 (four megabytes) and an upper bound of
9219 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9220 particular platform, the lower bound is used.  Setting this parameter
9221 very large effectively disables garbage collection.  Setting this
9222 parameter and @option{ggc-min-expand} to zero causes a full collection
9223 to occur at every opportunity.
9225 @item max-reload-search-insns
9226 The maximum number of instruction reload should look backward for equivalent
9227 register.  Increasing values mean more aggressive optimization, making the
9228 compilation time increase with probably slightly better performance.
9229 The default value is 100.
9231 @item max-cselib-memory-locations
9232 The maximum number of memory locations cselib should take into account.
9233 Increasing values mean more aggressive optimization, making the compilation time
9234 increase with probably slightly better performance.  The default value is 500.
9236 @item max-sched-ready-insns
9237 The maximum number of instructions ready to be issued the scheduler should
9238 consider at any given time during the first scheduling pass.  Increasing
9239 values mean more thorough searches, making the compilation time increase
9240 with probably little benefit.  The default value is 100.
9242 @item max-sched-region-blocks
9243 The maximum number of blocks in a region to be considered for
9244 interblock scheduling.  The default value is 10.
9246 @item max-pipeline-region-blocks
9247 The maximum number of blocks in a region to be considered for
9248 pipelining in the selective scheduler.  The default value is 15.
9250 @item max-sched-region-insns
9251 The maximum number of insns in a region to be considered for
9252 interblock scheduling.  The default value is 100.
9254 @item max-pipeline-region-insns
9255 The maximum number of insns in a region to be considered for
9256 pipelining in the selective scheduler.  The default value is 200.
9258 @item min-spec-prob
9259 The minimum probability (in percents) of reaching a source block
9260 for interblock speculative scheduling.  The default value is 40.
9262 @item max-sched-extend-regions-iters
9263 The maximum number of iterations through CFG to extend regions.
9264 A value of 0 (the default) disables region extensions.
9266 @item max-sched-insn-conflict-delay
9267 The maximum conflict delay for an insn to be considered for speculative motion.
9268 The default value is 3.
9270 @item sched-spec-prob-cutoff
9271 The minimal probability of speculation success (in percents), so that
9272 speculative insns are scheduled.
9273 The default value is 40.
9275 @item sched-state-edge-prob-cutoff
9276 The minimum probability an edge must have for the scheduler to save its
9277 state across it.
9278 The default value is 10.
9280 @item sched-mem-true-dep-cost
9281 Minimal distance (in CPU cycles) between store and load targeting same
9282 memory locations.  The default value is 1.
9284 @item selsched-max-lookahead
9285 The maximum size of the lookahead window of selective scheduling.  It is a
9286 depth of search for available instructions.
9287 The default value is 50.
9289 @item selsched-max-sched-times
9290 The maximum number of times that an instruction is scheduled during
9291 selective scheduling.  This is the limit on the number of iterations
9292 through which the instruction may be pipelined.  The default value is 2.
9294 @item selsched-insns-to-rename
9295 The maximum number of best instructions in the ready list that are considered
9296 for renaming in the selective scheduler.  The default value is 2.
9298 @item sms-min-sc
9299 The minimum value of stage count that swing modulo scheduler
9300 generates.  The default value is 2.
9302 @item max-last-value-rtl
9303 The maximum size measured as number of RTLs that can be recorded in an expression
9304 in combiner for a pseudo register as last known value of that register.  The default
9305 is 10000.
9307 @item max-combine-insns
9308 The maximum number of instructions the RTL combiner tries to combine.
9309 The default value is 2 at @option{-Og} and 4 otherwise.
9311 @item integer-share-limit
9312 Small integer constants can use a shared data structure, reducing the
9313 compiler's memory usage and increasing its speed.  This sets the maximum
9314 value of a shared integer constant.  The default value is 256.
9316 @item ssp-buffer-size
9317 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9318 protection when @option{-fstack-protection} is used.
9320 @item min-size-for-stack-sharing
9321 The minimum size of variables taking part in stack slot sharing when not
9322 optimizing. The default value is 32.
9324 @item max-jump-thread-duplication-stmts
9325 Maximum number of statements allowed in a block that needs to be
9326 duplicated when threading jumps.
9328 @item max-fields-for-field-sensitive
9329 Maximum number of fields in a structure treated in
9330 a field sensitive manner during pointer analysis.  The default is zero
9331 for @option{-O0} and @option{-O1},
9332 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9334 @item prefetch-latency
9335 Estimate on average number of instructions that are executed before
9336 prefetch finishes.  The distance prefetched ahead is proportional
9337 to this constant.  Increasing this number may also lead to less
9338 streams being prefetched (see @option{simultaneous-prefetches}).
9340 @item simultaneous-prefetches
9341 Maximum number of prefetches that can run at the same time.
9343 @item l1-cache-line-size
9344 The size of cache line in L1 cache, in bytes.
9346 @item l1-cache-size
9347 The size of L1 cache, in kilobytes.
9349 @item l2-cache-size
9350 The size of L2 cache, in kilobytes.
9352 @item min-insn-to-prefetch-ratio
9353 The minimum ratio between the number of instructions and the
9354 number of prefetches to enable prefetching in a loop.
9356 @item prefetch-min-insn-to-mem-ratio
9357 The minimum ratio between the number of instructions and the
9358 number of memory references to enable prefetching in a loop.
9360 @item use-canonical-types
9361 Whether the compiler should use the ``canonical'' type system.  By
9362 default, this should always be 1, which uses a more efficient internal
9363 mechanism for comparing types in C++ and Objective-C++.  However, if
9364 bugs in the canonical type system are causing compilation failures,
9365 set this value to 0 to disable canonical types.
9367 @item switch-conversion-max-branch-ratio
9368 Switch initialization conversion refuses to create arrays that are
9369 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9370 branches in the switch.
9372 @item max-partial-antic-length
9373 Maximum length of the partial antic set computed during the tree
9374 partial redundancy elimination optimization (@option{-ftree-pre}) when
9375 optimizing at @option{-O3} and above.  For some sorts of source code
9376 the enhanced partial redundancy elimination optimization can run away,
9377 consuming all of the memory available on the host machine.  This
9378 parameter sets a limit on the length of the sets that are computed,
9379 which prevents the runaway behavior.  Setting a value of 0 for
9380 this parameter allows an unlimited set length.
9382 @item sccvn-max-scc-size
9383 Maximum size of a strongly connected component (SCC) during SCCVN
9384 processing.  If this limit is hit, SCCVN processing for the whole
9385 function is not done and optimizations depending on it are
9386 disabled.  The default maximum SCC size is 10000.
9388 @item sccvn-max-alias-queries-per-access
9389 Maximum number of alias-oracle queries we perform when looking for
9390 redundancies for loads and stores.  If this limit is hit the search
9391 is aborted and the load or store is not considered redundant.  The
9392 number of queries is algorithmically limited to the number of
9393 stores on all paths from the load to the function entry.
9394 The default maximum number of queries is 1000.
9396 @item ira-max-loops-num
9397 IRA uses regional register allocation by default.  If a function
9398 contains more loops than the number given by this parameter, only at most
9399 the given number of the most frequently-executed loops form regions
9400 for regional register allocation.  The default value of the
9401 parameter is 100.
9403 @item ira-max-conflict-table-size 
9404 Although IRA uses a sophisticated algorithm to compress the conflict
9405 table, the table can still require excessive amounts of memory for
9406 huge functions.  If the conflict table for a function could be more
9407 than the size in MB given by this parameter, the register allocator
9408 instead uses a faster, simpler, and lower-quality
9409 algorithm that does not require building a pseudo-register conflict table.  
9410 The default value of the parameter is 2000.
9412 @item ira-loop-reserved-regs
9413 IRA can be used to evaluate more accurate register pressure in loops
9414 for decisions to move loop invariants (see @option{-O3}).  The number
9415 of available registers reserved for some other purposes is given
9416 by this parameter.  The default value of the parameter is 2, which is
9417 the minimal number of registers needed by typical instructions.
9418 This value is the best found from numerous experiments.
9420 @item lra-inheritance-ebb-probability-cutoff
9421 LRA tries to reuse values reloaded in registers in subsequent insns.
9422 This optimization is called inheritance.  EBB is used as a region to
9423 do this optimization.  The parameter defines a minimal fall-through
9424 edge probability in percentage used to add BB to inheritance EBB in
9425 LRA.  The default value of the parameter is 40.  The value was chosen
9426 from numerous runs of SPEC2000 on x86-64.
9428 @item loop-invariant-max-bbs-in-loop
9429 Loop invariant motion can be very expensive, both in compilation time and
9430 in amount of needed compile-time memory, with very large loops.  Loops
9431 with more basic blocks than this parameter won't have loop invariant
9432 motion optimization performed on them.  The default value of the
9433 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9435 @item loop-max-datarefs-for-datadeps
9436 Building data dependencies is expensive for very large loops.  This
9437 parameter limits the number of data references in loops that are
9438 considered for data dependence analysis.  These large loops are no
9439 handled by the optimizations using loop data dependencies.
9440 The default value is 1000.
9442 @item max-vartrack-size
9443 Sets a maximum number of hash table slots to use during variable
9444 tracking dataflow analysis of any function.  If this limit is exceeded
9445 with variable tracking at assignments enabled, analysis for that
9446 function is retried without it, after removing all debug insns from
9447 the function.  If the limit is exceeded even without debug insns, var
9448 tracking analysis is completely disabled for the function.  Setting
9449 the parameter to zero makes it unlimited.
9451 @item max-vartrack-expr-depth
9452 Sets a maximum number of recursion levels when attempting to map
9453 variable names or debug temporaries to value expressions.  This trades
9454 compilation time for more complete debug information.  If this is set too
9455 low, value expressions that are available and could be represented in
9456 debug information may end up not being used; setting this higher may
9457 enable the compiler to find more complex debug expressions, but compile
9458 time and memory use may grow.  The default is 12.
9460 @item min-nondebug-insn-uid
9461 Use uids starting at this parameter for nondebug insns.  The range below
9462 the parameter is reserved exclusively for debug insns created by
9463 @option{-fvar-tracking-assignments}, but debug insns may get
9464 (non-overlapping) uids above it if the reserved range is exhausted.
9466 @item ipa-sra-ptr-growth-factor
9467 IPA-SRA replaces a pointer to an aggregate with one or more new
9468 parameters only when their cumulative size is less or equal to
9469 @option{ipa-sra-ptr-growth-factor} times the size of the original
9470 pointer parameter.
9472 @item sra-max-scalarization-size-Ospeed
9473 @item sra-max-scalarization-size-Osize
9474 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
9475 replace scalar parts of aggregates with uses of independent scalar
9476 variables.  These parameters control the maximum size, in storage units,
9477 of aggregate which is considered for replacement when compiling for
9478 speed
9479 (@option{sra-max-scalarization-size-Ospeed}) or size
9480 (@option{sra-max-scalarization-size-Osize}) respectively.
9482 @item tm-max-aggregate-size
9483 When making copies of thread-local variables in a transaction, this
9484 parameter specifies the size in bytes after which variables are
9485 saved with the logging functions as opposed to save/restore code
9486 sequence pairs.  This option only applies when using
9487 @option{-fgnu-tm}.
9489 @item graphite-max-nb-scop-params
9490 To avoid exponential effects in the Graphite loop transforms, the
9491 number of parameters in a Static Control Part (SCoP) is bounded.  The
9492 default value is 10 parameters.  A variable whose value is unknown at
9493 compilation time and defined outside a SCoP is a parameter of the SCoP.
9495 @item graphite-max-bbs-per-function
9496 To avoid exponential effects in the detection of SCoPs, the size of
9497 the functions analyzed by Graphite is bounded.  The default value is
9498 100 basic blocks.
9500 @item loop-block-tile-size
9501 Loop blocking or strip mining transforms, enabled with
9502 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9503 loop in the loop nest by a given number of iterations.  The strip
9504 length can be changed using the @option{loop-block-tile-size}
9505 parameter.  The default value is 51 iterations.
9507 @item loop-unroll-jam-size
9508 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
9509 default value is 4.
9511 @item loop-unroll-jam-depth
9512 Specify the dimension to be unrolled (counting from the most inner loop)
9513 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
9515 @item ipa-cp-value-list-size
9516 IPA-CP attempts to track all possible values and types passed to a function's
9517 parameter in order to propagate them and perform devirtualization.
9518 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9519 stores per one formal parameter of a function.
9521 @item ipa-cp-eval-threshold
9522 IPA-CP calculates its own score of cloning profitability heuristics
9523 and performs those cloning opportunities with scores that exceed
9524 @option{ipa-cp-eval-threshold}.
9526 @item ipa-cp-recursion-penalty
9527 Percentage penalty the recursive functions will receive when they
9528 are evaluated for cloning.
9530 @item ipa-cp-single-call-penalty
9531 Percentage penalty functions containg a single call to another
9532 function will receive when they are evaluated for cloning.
9535 @item ipa-max-agg-items
9536 IPA-CP is also capable to propagate a number of scalar values passed
9537 in an aggregate. @option{ipa-max-agg-items} controls the maximum
9538 number of such values per one parameter.
9540 @item ipa-cp-loop-hint-bonus
9541 When IPA-CP determines that a cloning candidate would make the number
9542 of iterations of a loop known, it adds a bonus of
9543 @option{ipa-cp-loop-hint-bonus} to the profitability score of
9544 the candidate.
9546 @item ipa-cp-array-index-hint-bonus
9547 When IPA-CP determines that a cloning candidate would make the index of
9548 an array access known, it adds a bonus of
9549 @option{ipa-cp-array-index-hint-bonus} to the profitability
9550 score of the candidate.
9552 @item ipa-max-aa-steps
9553 During its analysis of function bodies, IPA-CP employs alias analysis
9554 in order to track values pointed to by function parameters.  In order
9555 not spend too much time analyzing huge functions, it gives up and
9556 consider all memory clobbered after examining
9557 @option{ipa-max-aa-steps} statements modifying memory.
9559 @item lto-partitions
9560 Specify desired number of partitions produced during WHOPR compilation.
9561 The number of partitions should exceed the number of CPUs used for compilation.
9562 The default value is 32.
9564 @item lto-min-partition
9565 Size of minimal partition for WHOPR (in estimated instructions).
9566 This prevents expenses of splitting very small programs into too many
9567 partitions.
9569 @item lto-max-partition
9570 Size of max partition for WHOPR (in estimated instructions).
9571 to provide an upper bound for individual size of partition.
9572 Meant to be used only with balanced partitioning.
9574 @item cxx-max-namespaces-for-diagnostic-help
9575 The maximum number of namespaces to consult for suggestions when C++
9576 name lookup fails for an identifier.  The default is 1000.
9578 @item sink-frequency-threshold
9579 The maximum relative execution frequency (in percents) of the target block
9580 relative to a statement's original block to allow statement sinking of a
9581 statement.  Larger numbers result in more aggressive statement sinking.
9582 The default value is 75.  A small positive adjustment is applied for
9583 statements with memory operands as those are even more profitable so sink.
9585 @item max-stores-to-sink
9586 The maximum number of conditional store pairs that can be sunk.  Set to 0
9587 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9588 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9590 @item allow-store-data-races
9591 Allow optimizers to introduce new data races on stores.
9592 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9593 at optimization level @option{-Ofast}.
9595 @item case-values-threshold
9596 The smallest number of different values for which it is best to use a
9597 jump-table instead of a tree of conditional branches.  If the value is
9598 0, use the default for the machine.  The default is 0.
9600 @item tree-reassoc-width
9601 Set the maximum number of instructions executed in parallel in
9602 reassociated tree. This parameter overrides target dependent
9603 heuristics used by default if has non zero value.
9605 @item sched-pressure-algorithm
9606 Choose between the two available implementations of
9607 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9608 and is the more likely to prevent instructions from being reordered.
9609 Algorithm 2 was designed to be a compromise between the relatively
9610 conservative approach taken by algorithm 1 and the rather aggressive
9611 approach taken by the default scheduler.  It relies more heavily on
9612 having a regular register file and accurate register pressure classes.
9613 See @file{haifa-sched.c} in the GCC sources for more details.
9615 The default choice depends on the target.
9617 @item max-slsr-cand-scan
9618 Set the maximum number of existing candidates that are considered when
9619 seeking a basis for a new straight-line strength reduction candidate.
9621 @item asan-globals
9622 Enable buffer overflow detection for global objects.  This kind
9623 of protection is enabled by default if you are using
9624 @option{-fsanitize=address} option.
9625 To disable global objects protection use @option{--param asan-globals=0}.
9627 @item asan-stack
9628 Enable buffer overflow detection for stack objects.  This kind of
9629 protection is enabled by default when using @option{-fsanitize=address}.
9630 To disable stack protection use @option{--param asan-stack=0} option.
9632 @item asan-instrument-reads
9633 Enable buffer overflow detection for memory reads.  This kind of
9634 protection is enabled by default when using @option{-fsanitize=address}.
9635 To disable memory reads protection use
9636 @option{--param asan-instrument-reads=0}.
9638 @item asan-instrument-writes
9639 Enable buffer overflow detection for memory writes.  This kind of
9640 protection is enabled by default when using @option{-fsanitize=address}.
9641 To disable memory writes protection use
9642 @option{--param asan-instrument-writes=0} option.
9644 @item asan-memintrin
9645 Enable detection for built-in functions.  This kind of protection
9646 is enabled by default when using @option{-fsanitize=address}.
9647 To disable built-in functions protection use
9648 @option{--param asan-memintrin=0}.
9650 @item asan-use-after-return
9651 Enable detection of use-after-return.  This kind of protection
9652 is enabled by default when using @option{-fsanitize=address} option.
9653 To disable use-after-return detection use 
9654 @option{--param asan-use-after-return=0}.
9656 @item asan-instrumentation-with-call-threshold
9657 If number of memory accesses in function being instrumented
9658 is greater or equal to this number, use callbacks instead of inline checks.
9659 E.g. to disable inline code use
9660 @option{--param asan-instrumentation-with-call-threshold=0}.
9662 @item chkp-max-ctor-size
9663 Static constructors generated by Pointer Bounds Checker may become very
9664 large and significantly increase compile time at optimization level
9665 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
9666 in a single generated constructor.  Default value is 5000.
9668 @item max-fsm-thread-path-insns
9669 Maximum number of instructions to copy when duplicating blocks on a
9670 finite state automaton jump thread path.  The default is 100.
9672 @item max-fsm-thread-length
9673 Maximum number of basic blocks on a finite state automaton jump thread
9674 path.  The default is 10.
9676 @item max-fsm-thread-paths
9677 Maximum number of new jump thread paths to create for a finite state
9678 automaton.  The default is 50.
9680 @item parloops-chunk-size
9681 Chunk size of omp schedule for loops parallelized by parloops.  The default
9682 is 0.
9684 @item parloops-schedule
9685 Schedule type of omp schedule for loops parallelized by parloops (static,
9686 dynamic, guided, auto, runtime).  The default is static.
9688 @item max-ssa-name-query-depth
9689 Maximum depth of recursion when querying properties of SSA names in things
9690 like fold routines.  One level of recursion corresponds to following a
9691 use-def chain.
9693 @item hsa-gen-debug-stores
9694 Enable emission of special debug stores within HSA kernels which are
9695 then read and reported by libgomp plugin.  Generation of these stores
9696 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
9697 enable it.
9699 @item max-speculative-devirt-maydefs
9700 The maximum number of may-defs we analyze when looking for a must-def
9701 specifying the dynamic type of an object that invokes a virtual call
9702 we may be able to devirtualize speculatively.
9703 @end table
9704 @end table
9706 @node Instrumentation Options
9707 @section Program Instrumentation Options
9708 @cindex instrumentation options
9709 @cindex program instrumentation options
9710 @cindex run-time error checking options
9711 @cindex profiling options
9712 @cindex options, program instrumentation
9713 @cindex options, run-time error checking
9714 @cindex options, profiling
9716 GCC supports a number of command-line options that control adding
9717 run-time instrumentation to the code it normally generates.  
9718 For example, one purpose of instrumentation is collect profiling
9719 statistics for use in finding program hot spots, code coverage
9720 analysis, or profile-guided optimizations.
9721 Another class of program instrumentation is adding run-time checking 
9722 to detect programming errors like invalid pointer
9723 dereferences or out-of-bounds array accesses, as well as deliberately
9724 hostile attacks such as stack smashing or C++ vtable hijacking.
9725 There is also a general hook which can be used to implement other
9726 forms of tracing or function-level instrumentation for debug or
9727 program analysis purposes.
9729 @table @gcctabopt
9730 @cindex @command{prof}
9731 @item -p
9732 @opindex p
9733 Generate extra code to write profile information suitable for the
9734 analysis program @command{prof}.  You must use this option when compiling
9735 the source files you want data about, and you must also use it when
9736 linking.
9738 @cindex @command{gprof}
9739 @item -pg
9740 @opindex pg
9741 Generate extra code to write profile information suitable for the
9742 analysis program @command{gprof}.  You must use this option when compiling
9743 the source files you want data about, and you must also use it when
9744 linking.
9746 @item -fprofile-arcs
9747 @opindex fprofile-arcs
9748 Add code so that program flow @dfn{arcs} are instrumented.  During
9749 execution the program records how many times each branch and call is
9750 executed and how many times it is taken or returns.  When the compiled
9751 program exits it saves this data to a file called
9752 @file{@var{auxname}.gcda} for each source file.  The data may be used for
9753 profile-directed optimizations (@option{-fbranch-probabilities}), or for
9754 test coverage analysis (@option{-ftest-coverage}).  Each object file's
9755 @var{auxname} is generated from the name of the output file, if
9756 explicitly specified and it is not the final executable, otherwise it is
9757 the basename of the source file.  In both cases any suffix is removed
9758 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
9759 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
9760 @xref{Cross-profiling}.
9762 @cindex @command{gcov}
9763 @item --coverage
9764 @opindex coverage
9766 This option is used to compile and link code instrumented for coverage
9767 analysis.  The option is a synonym for @option{-fprofile-arcs}
9768 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
9769 linking).  See the documentation for those options for more details.
9771 @itemize
9773 @item
9774 Compile the source files with @option{-fprofile-arcs} plus optimization
9775 and code generation options.  For test coverage analysis, use the
9776 additional @option{-ftest-coverage} option.  You do not need to profile
9777 every source file in a program.
9779 @item
9780 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
9781 (the latter implies the former).
9783 @item
9784 Run the program on a representative workload to generate the arc profile
9785 information.  This may be repeated any number of times.  You can run
9786 concurrent instances of your program, and provided that the file system
9787 supports locking, the data files will be correctly updated.  Also
9788 @code{fork} calls are detected and correctly handled (double counting
9789 will not happen).
9791 @item
9792 For profile-directed optimizations, compile the source files again with
9793 the same optimization and code generation options plus
9794 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
9795 Control Optimization}).
9797 @item
9798 For test coverage analysis, use @command{gcov} to produce human readable
9799 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
9800 @command{gcov} documentation for further information.
9802 @end itemize
9804 With @option{-fprofile-arcs}, for each function of your program GCC
9805 creates a program flow graph, then finds a spanning tree for the graph.
9806 Only arcs that are not on the spanning tree have to be instrumented: the
9807 compiler adds code to count the number of times that these arcs are
9808 executed.  When an arc is the only exit or only entrance to a block, the
9809 instrumentation code can be added to the block; otherwise, a new basic
9810 block must be created to hold the instrumentation code.
9812 @need 2000
9813 @item -ftest-coverage
9814 @opindex ftest-coverage
9815 Produce a notes file that the @command{gcov} code-coverage utility
9816 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
9817 show program coverage.  Each source file's note file is called
9818 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
9819 above for a description of @var{auxname} and instructions on how to
9820 generate test coverage data.  Coverage data matches the source files
9821 more closely if you do not optimize.
9823 @item -fprofile-dir=@var{path}
9824 @opindex fprofile-dir
9826 Set the directory to search for the profile data files in to @var{path}.
9827 This option affects only the profile data generated by
9828 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9829 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9830 and its related options.  Both absolute and relative paths can be used.
9831 By default, GCC uses the current directory as @var{path}, thus the
9832 profile data file appears in the same directory as the object file.
9834 @item -fprofile-generate
9835 @itemx -fprofile-generate=@var{path}
9836 @opindex fprofile-generate
9838 Enable options usually used for instrumenting application to produce
9839 profile useful for later recompilation with profile feedback based
9840 optimization.  You must use @option{-fprofile-generate} both when
9841 compiling and when linking your program.
9843 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
9845 If @var{path} is specified, GCC looks at the @var{path} to find
9846 the profile feedback data files. See @option{-fprofile-dir}.
9848 To optimize the program based on the collected profile information, use
9849 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
9851 @item -fsanitize=address
9852 @opindex fsanitize=address
9853 Enable AddressSanitizer, a fast memory error detector.
9854 Memory access instructions are instrumented to detect
9855 out-of-bounds and use-after-free bugs.
9856 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
9857 more details.  The run-time behavior can be influenced using the
9858 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
9859 the available options are shown at startup of the instrumented program.  See
9860 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
9861 for a list of supported options.
9863 @item -fsanitize=kernel-address
9864 @opindex fsanitize=kernel-address
9865 Enable AddressSanitizer for Linux kernel.
9866 See @uref{https://github.com/google/kasan/wiki} for more details.
9868 @item -fsanitize=thread
9869 @opindex fsanitize=thread
9870 Enable ThreadSanitizer, a fast data race detector.
9871 Memory access instructions are instrumented to detect
9872 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
9873 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
9874 environment variable; see
9875 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
9876 supported options.
9878 @item -fsanitize=leak
9879 @opindex fsanitize=leak
9880 Enable LeakSanitizer, a memory leak detector.
9881 This option only matters for linking of executables and if neither
9882 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
9883 case the executable is linked against a library that overrides @code{malloc}
9884 and other allocator functions.  See
9885 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
9886 details.  The run-time behavior can be influenced using the
9887 @env{LSAN_OPTIONS} environment variable.
9889 @item -fsanitize=undefined
9890 @opindex fsanitize=undefined
9891 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
9892 Various computations are instrumented to detect undefined behavior
9893 at runtime.  Current suboptions are:
9895 @table @gcctabopt
9897 @item -fsanitize=shift
9898 @opindex fsanitize=shift
9899 This option enables checking that the result of a shift operation is
9900 not undefined.  Note that what exactly is considered undefined differs
9901 slightly between C and C++, as well as between ISO C90 and C99, etc.
9903 @item -fsanitize=integer-divide-by-zero
9904 @opindex fsanitize=integer-divide-by-zero
9905 Detect integer division by zero as well as @code{INT_MIN / -1} division.
9907 @item -fsanitize=unreachable
9908 @opindex fsanitize=unreachable
9909 With this option, the compiler turns the @code{__builtin_unreachable}
9910 call into a diagnostics message call instead.  When reaching the
9911 @code{__builtin_unreachable} call, the behavior is undefined.
9913 @item -fsanitize=vla-bound
9914 @opindex fsanitize=vla-bound
9915 This option instructs the compiler to check that the size of a variable
9916 length array is positive.
9918 @item -fsanitize=null
9919 @opindex fsanitize=null
9920 This option enables pointer checking.  Particularly, the application
9921 built with this option turned on will issue an error message when it
9922 tries to dereference a NULL pointer, or if a reference (possibly an
9923 rvalue reference) is bound to a NULL pointer, or if a method is invoked
9924 on an object pointed by a NULL pointer.
9926 @item -fsanitize=return
9927 @opindex fsanitize=return
9928 This option enables return statement checking.  Programs
9929 built with this option turned on will issue an error message
9930 when the end of a non-void function is reached without actually
9931 returning a value.  This option works in C++ only.
9933 @item -fsanitize=signed-integer-overflow
9934 @opindex fsanitize=signed-integer-overflow
9935 This option enables signed integer overflow checking.  We check that
9936 the result of @code{+}, @code{*}, and both unary and binary @code{-}
9937 does not overflow in the signed arithmetics.  Note, integer promotion
9938 rules must be taken into account.  That is, the following is not an
9939 overflow:
9940 @smallexample
9941 signed char a = SCHAR_MAX;
9942 a++;
9943 @end smallexample
9945 @item -fsanitize=bounds
9946 @opindex fsanitize=bounds
9947 This option enables instrumentation of array bounds.  Various out of bounds
9948 accesses are detected.  Flexible array members, flexible array member-like
9949 arrays, and initializers of variables with static storage are not instrumented.
9951 @item -fsanitize=bounds-strict
9952 @opindex fsanitize=bounds-strict
9953 This option enables strict instrumentation of array bounds.  Most out of bounds
9954 accesses are detected, including flexible array members and flexible array
9955 member-like arrays.  Initializers of variables with static storage are not
9956 instrumented.
9958 @item -fsanitize=alignment
9959 @opindex fsanitize=alignment
9961 This option enables checking of alignment of pointers when they are
9962 dereferenced, or when a reference is bound to insufficiently aligned target,
9963 or when a method or constructor is invoked on insufficiently aligned object.
9965 @item -fsanitize=object-size
9966 @opindex fsanitize=object-size
9967 This option enables instrumentation of memory references using the
9968 @code{__builtin_object_size} function.  Various out of bounds pointer
9969 accesses are detected.
9971 @item -fsanitize=float-divide-by-zero
9972 @opindex fsanitize=float-divide-by-zero
9973 Detect floating-point division by zero.  Unlike other similar options,
9974 @option{-fsanitize=float-divide-by-zero} is not enabled by
9975 @option{-fsanitize=undefined}, since floating-point division by zero can
9976 be a legitimate way of obtaining infinities and NaNs.
9978 @item -fsanitize=float-cast-overflow
9979 @opindex fsanitize=float-cast-overflow
9980 This option enables floating-point type to integer conversion checking.
9981 We check that the result of the conversion does not overflow.
9982 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
9983 not enabled by @option{-fsanitize=undefined}.
9984 This option does not work well with @code{FE_INVALID} exceptions enabled.
9986 @item -fsanitize=nonnull-attribute
9987 @opindex fsanitize=nonnull-attribute
9989 This option enables instrumentation of calls, checking whether null values
9990 are not passed to arguments marked as requiring a non-null value by the
9991 @code{nonnull} function attribute.
9993 @item -fsanitize=returns-nonnull-attribute
9994 @opindex fsanitize=returns-nonnull-attribute
9996 This option enables instrumentation of return statements in functions
9997 marked with @code{returns_nonnull} function attribute, to detect returning
9998 of null values from such functions.
10000 @item -fsanitize=bool
10001 @opindex fsanitize=bool
10003 This option enables instrumentation of loads from bool.  If a value other
10004 than 0/1 is loaded, a run-time error is issued.
10006 @item -fsanitize=enum
10007 @opindex fsanitize=enum
10009 This option enables instrumentation of loads from an enum type.  If
10010 a value outside the range of values for the enum type is loaded,
10011 a run-time error is issued.
10013 @item -fsanitize=vptr
10014 @opindex fsanitize=vptr
10016 This option enables instrumentation of C++ member function calls, member
10017 accesses and some conversions between pointers to base and derived classes,
10018 to verify the referenced object has the correct dynamic type.
10020 @end table
10022 While @option{-ftrapv} causes traps for signed overflows to be emitted,
10023 @option{-fsanitize=undefined} gives a diagnostic message.
10024 This currently works only for the C family of languages.
10026 @item -fno-sanitize=all
10027 @opindex fno-sanitize=all
10029 This option disables all previously enabled sanitizers.
10030 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
10031 together.
10033 @item -fasan-shadow-offset=@var{number}
10034 @opindex fasan-shadow-offset
10035 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
10036 It is useful for experimenting with different shadow memory layouts in
10037 Kernel AddressSanitizer.
10039 @item -fsanitize-sections=@var{s1},@var{s2},...
10040 @opindex fsanitize-sections
10041 Sanitize global variables in selected user-defined sections.  @var{si} may
10042 contain wildcards.
10044 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
10045 @opindex fsanitize-recover
10046 @opindex fno-sanitize-recover
10047 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
10048 mentioned in comma-separated list of @var{opts}.  Enabling this option
10049 for a sanitizer component causes it to attempt to continue
10050 running the program as if no error happened.  This means multiple
10051 runtime errors can be reported in a single program run, and the exit
10052 code of the program may indicate success even when errors
10053 have been reported.  The @option{-fno-sanitize-recover=} option
10054 can be used to alter
10055 this behavior: only the first detected error is reported
10056 and program then exits with a non-zero exit code.
10058 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
10059 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
10060 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
10061 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
10062 For these sanitizers error recovery is turned on by default, except @option{-fsanitize=address},
10063 for which this feature is experimental.
10064 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
10065 accepted, the former enables recovery for all sanitizers that support it,
10066 the latter disables recovery for all sanitizers that support it.
10068 Even if a recovery mode is turned on the compiler side, it needs to be also
10069 enabled on the runtime library side, otherwise the failures are still fatal.
10070 The runtime library defaults to @code{halt_on_error=0} for
10071 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
10072 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
10073 setting the @code{halt_on_error} flag in the corresponding environment variable.
10075 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
10076 @smallexample
10077 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
10078 @end smallexample
10079 @noindent
10080 Similarly @option{-fno-sanitize-recover} is equivalent to
10081 @smallexample
10082 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
10083 @end smallexample
10085 @item -fsanitize-undefined-trap-on-error
10086 @opindex fsanitize-undefined-trap-on-error
10087 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
10088 report undefined behavior using @code{__builtin_trap} rather than
10089 a @code{libubsan} library routine.  The advantage of this is that the
10090 @code{libubsan} library is not needed and is not linked in, so this
10091 is usable even in freestanding environments.
10093 @item -fsanitize-coverage=trace-pc
10094 @opindex fsanitize-coverage=trace-pc
10095 Enable coverage-guided fuzzing code instrumentation.
10096 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
10098 @item -fbounds-check
10099 @opindex fbounds-check
10100 For front ends that support it, generate additional code to check that
10101 indices used to access arrays are within the declared range.  This is
10102 currently only supported by the Java and Fortran front ends, where
10103 this option defaults to true and false respectively.
10105 @item -fcheck-pointer-bounds
10106 @opindex fcheck-pointer-bounds
10107 @opindex fno-check-pointer-bounds
10108 @cindex Pointer Bounds Checker options
10109 Enable Pointer Bounds Checker instrumentation.  Each memory reference
10110 is instrumented with checks of the pointer used for memory access against
10111 bounds associated with that pointer.  
10113 Currently there
10114 is only an implementation for Intel MPX available, thus x86 GNU/Linux target
10115 and @option{-mmpx} are required to enable this feature.  
10116 MPX-based instrumentation requires
10117 a runtime library to enable MPX in hardware and handle bounds
10118 violation signals.  By default when @option{-fcheck-pointer-bounds}
10119 and @option{-mmpx} options are used to link a program, the GCC driver
10120 links against the @file{libmpx} and @file{libmpxwrappers} libraries.
10121 Bounds checking on calls to dynamic libraries requires a linker
10122 with @option{-z bndplt} support; if GCC was configured with a linker
10123 without support for this option (including the Gold linker and older
10124 versions of ld), a warning is given if you link with @option{-mmpx}
10125 without also specifying @option{-static}, since the overall effectiveness
10126 of the bounds checking protection is reduced.
10127 See also @option{-static-libmpxwrappers}.
10129 MPX-based instrumentation
10130 may be used for debugging and also may be included in production code
10131 to increase program security.  Depending on usage, you may
10132 have different requirements for the runtime library.  The current version
10133 of the MPX runtime library is more oriented for use as a debugging
10134 tool.  MPX runtime library usage implies @option{-lpthread}.  See
10135 also @option{-static-libmpx}.  The runtime library  behavior can be
10136 influenced using various @env{CHKP_RT_*} environment variables.  See
10137 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
10138 for more details.
10140 Generated instrumentation may be controlled by various
10141 @option{-fchkp-*} options and by the @code{bnd_variable_size}
10142 structure field attribute (@pxref{Type Attributes}) and
10143 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
10144 (@pxref{Function Attributes}).  GCC also provides a number of built-in
10145 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
10146 Bounds Checker builtins}, for more information.
10148 @item -fchkp-check-incomplete-type
10149 @opindex fchkp-check-incomplete-type
10150 @opindex fno-chkp-check-incomplete-type
10151 Generate pointer bounds checks for variables with incomplete type.
10152 Enabled by default.
10154 @item -fchkp-narrow-bounds
10155 @opindex fchkp-narrow-bounds
10156 @opindex fno-chkp-narrow-bounds
10157 Controls bounds used by Pointer Bounds Checker for pointers to object
10158 fields.  If narrowing is enabled then field bounds are used.  Otherwise
10159 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
10160 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
10162 @item -fchkp-first-field-has-own-bounds
10163 @opindex fchkp-first-field-has-own-bounds
10164 @opindex fno-chkp-first-field-has-own-bounds
10165 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
10166 first field in the structure.  By default a pointer to the first field has
10167 the same bounds as a pointer to the whole structure.
10169 @item -fchkp-narrow-to-innermost-array
10170 @opindex fchkp-narrow-to-innermost-array
10171 @opindex fno-chkp-narrow-to-innermost-array
10172 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
10173 case of nested static array access.  By default this option is disabled and
10174 bounds of the outermost array are used.
10176 @item -fchkp-optimize
10177 @opindex fchkp-optimize
10178 @opindex fno-chkp-optimize
10179 Enables Pointer Bounds Checker optimizations.  Enabled by default at
10180 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
10182 @item -fchkp-use-fast-string-functions
10183 @opindex fchkp-use-fast-string-functions
10184 @opindex fno-chkp-use-fast-string-functions
10185 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
10186 by Pointer Bounds Checker.  Disabled by default.
10188 @item -fchkp-use-nochk-string-functions
10189 @opindex fchkp-use-nochk-string-functions
10190 @opindex fno-chkp-use-nochk-string-functions
10191 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
10192 by Pointer Bounds Checker.  Disabled by default.
10194 @item -fchkp-use-static-bounds
10195 @opindex fchkp-use-static-bounds
10196 @opindex fno-chkp-use-static-bounds
10197 Allow Pointer Bounds Checker to generate static bounds holding
10198 bounds of static variables.  Enabled by default.
10200 @item -fchkp-use-static-const-bounds
10201 @opindex fchkp-use-static-const-bounds
10202 @opindex fno-chkp-use-static-const-bounds
10203 Use statically-initialized bounds for constant bounds instead of
10204 generating them each time they are required.  By default enabled when
10205 @option{-fchkp-use-static-bounds} is enabled.
10207 @item -fchkp-treat-zero-dynamic-size-as-infinite
10208 @opindex fchkp-treat-zero-dynamic-size-as-infinite
10209 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
10210 With this option, objects with incomplete type whose
10211 dynamically-obtained size is zero are treated as having infinite size
10212 instead by Pointer Bounds
10213 Checker.  This option may be helpful if a program is linked with a library
10214 missing size information for some symbols.  Disabled by default.
10216 @item -fchkp-check-read
10217 @opindex fchkp-check-read
10218 @opindex fno-chkp-check-read
10219 Instructs Pointer Bounds Checker to generate checks for all read
10220 accesses to memory.  Enabled by default.
10222 @item -fchkp-check-write
10223 @opindex fchkp-check-write
10224 @opindex fno-chkp-check-write
10225 Instructs Pointer Bounds Checker to generate checks for all write
10226 accesses to memory.  Enabled by default.
10228 @item -fchkp-store-bounds
10229 @opindex fchkp-store-bounds
10230 @opindex fno-chkp-store-bounds
10231 Instructs Pointer Bounds Checker to generate bounds stores for
10232 pointer writes.  Enabled by default.
10234 @item -fchkp-instrument-calls
10235 @opindex fchkp-instrument-calls
10236 @opindex fno-chkp-instrument-calls
10237 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
10238 Enabled by default.
10240 @item -fchkp-instrument-marked-only
10241 @opindex fchkp-instrument-marked-only
10242 @opindex fno-chkp-instrument-marked-only
10243 Instructs Pointer Bounds Checker to instrument only functions
10244 marked with the @code{bnd_instrument} attribute
10245 (@pxref{Function Attributes}).  Disabled by default.
10247 @item -fchkp-use-wrappers
10248 @opindex fchkp-use-wrappers
10249 @opindex fno-chkp-use-wrappers
10250 Allows Pointer Bounds Checker to replace calls to built-in functions
10251 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
10252 is used to link a program, the GCC driver automatically links
10253 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
10254 Enabled by default.
10256 @item -fstack-protector
10257 @opindex fstack-protector
10258 Emit extra code to check for buffer overflows, such as stack smashing
10259 attacks.  This is done by adding a guard variable to functions with
10260 vulnerable objects.  This includes functions that call @code{alloca}, and
10261 functions with buffers larger than 8 bytes.  The guards are initialized
10262 when a function is entered and then checked when the function exits.
10263 If a guard check fails, an error message is printed and the program exits.
10265 @item -fstack-protector-all
10266 @opindex fstack-protector-all
10267 Like @option{-fstack-protector} except that all functions are protected.
10269 @item -fstack-protector-strong
10270 @opindex fstack-protector-strong
10271 Like @option{-fstack-protector} but includes additional functions to
10272 be protected --- those that have local array definitions, or have
10273 references to local frame addresses.
10275 @item -fstack-protector-explicit
10276 @opindex fstack-protector-explicit
10277 Like @option{-fstack-protector} but only protects those functions which
10278 have the @code{stack_protect} attribute.
10280 @item -fstack-check
10281 @opindex fstack-check
10282 Generate code to verify that you do not go beyond the boundary of the
10283 stack.  You should specify this flag if you are running in an
10284 environment with multiple threads, but you only rarely need to specify it in
10285 a single-threaded environment since stack overflow is automatically
10286 detected on nearly all systems if there is only one stack.
10288 Note that this switch does not actually cause checking to be done; the
10289 operating system or the language runtime must do that.  The switch causes
10290 generation of code to ensure that they see the stack being extended.
10292 You can additionally specify a string parameter: @samp{no} means no
10293 checking, @samp{generic} means force the use of old-style checking,
10294 @samp{specific} means use the best checking method and is equivalent
10295 to bare @option{-fstack-check}.
10297 Old-style checking is a generic mechanism that requires no specific
10298 target support in the compiler but comes with the following drawbacks:
10300 @enumerate
10301 @item
10302 Modified allocation strategy for large objects: they are always
10303 allocated dynamically if their size exceeds a fixed threshold.
10305 @item
10306 Fixed limit on the size of the static frame of functions: when it is
10307 topped by a particular function, stack checking is not reliable and
10308 a warning is issued by the compiler.
10310 @item
10311 Inefficiency: because of both the modified allocation strategy and the
10312 generic implementation, code performance is hampered.
10313 @end enumerate
10315 Note that old-style stack checking is also the fallback method for
10316 @samp{specific} if no target support has been added in the compiler.
10318 @item -fstack-limit-register=@var{reg}
10319 @itemx -fstack-limit-symbol=@var{sym}
10320 @itemx -fno-stack-limit
10321 @opindex fstack-limit-register
10322 @opindex fstack-limit-symbol
10323 @opindex fno-stack-limit
10324 Generate code to ensure that the stack does not grow beyond a certain value,
10325 either the value of a register or the address of a symbol.  If a larger
10326 stack is required, a signal is raised at run time.  For most targets,
10327 the signal is raised before the stack overruns the boundary, so
10328 it is possible to catch the signal without taking special precautions.
10330 For instance, if the stack starts at absolute address @samp{0x80000000}
10331 and grows downwards, you can use the flags
10332 @option{-fstack-limit-symbol=__stack_limit} and
10333 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
10334 of 128KB@.  Note that this may only work with the GNU linker.
10336 You can locally override stack limit checking by using the
10337 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
10339 @item -fsplit-stack
10340 @opindex fsplit-stack
10341 Generate code to automatically split the stack before it overflows.
10342 The resulting program has a discontiguous stack which can only
10343 overflow if the program is unable to allocate any more memory.  This
10344 is most useful when running threaded programs, as it is no longer
10345 necessary to calculate a good stack size to use for each thread.  This
10346 is currently only implemented for the x86 targets running
10347 GNU/Linux.
10349 When code compiled with @option{-fsplit-stack} calls code compiled
10350 without @option{-fsplit-stack}, there may not be much stack space
10351 available for the latter code to run.  If compiling all code,
10352 including library code, with @option{-fsplit-stack} is not an option,
10353 then the linker can fix up these calls so that the code compiled
10354 without @option{-fsplit-stack} always has a large stack.  Support for
10355 this is implemented in the gold linker in GNU binutils release 2.21
10356 and later.
10358 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
10359 @opindex fvtable-verify
10360 This option is only available when compiling C++ code.
10361 It turns on (or off, if using @option{-fvtable-verify=none}) the security
10362 feature that verifies at run time, for every virtual call, that
10363 the vtable pointer through which the call is made is valid for the type of
10364 the object, and has not been corrupted or overwritten.  If an invalid vtable
10365 pointer is detected at run time, an error is reported and execution of the
10366 program is immediately halted.
10368 This option causes run-time data structures to be built at program startup,
10369 which are used for verifying the vtable pointers.  
10370 The options @samp{std} and @samp{preinit}
10371 control the timing of when these data structures are built.  In both cases the
10372 data structures are built before execution reaches @code{main}.  Using
10373 @option{-fvtable-verify=std} causes the data structures to be built after
10374 shared libraries have been loaded and initialized.
10375 @option{-fvtable-verify=preinit} causes them to be built before shared
10376 libraries have been loaded and initialized.
10378 If this option appears multiple times in the command line with different
10379 values specified, @samp{none} takes highest priority over both @samp{std} and
10380 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
10382 @item -fvtv-debug
10383 @opindex fvtv-debug
10384 When used in conjunction with @option{-fvtable-verify=std} or 
10385 @option{-fvtable-verify=preinit}, causes debug versions of the 
10386 runtime functions for the vtable verification feature to be called.  
10387 This flag also causes the compiler to log information about which 
10388 vtable pointers it finds for each class.
10389 This information is written to a file named @file{vtv_set_ptr_data.log} 
10390 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
10391 if that is defined or the current working directory otherwise.
10393 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
10394 file, be sure to delete any existing one.
10396 @item -fvtv-counts
10397 @opindex fvtv-counts
10398 This is a debugging flag.  When used in conjunction with
10399 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
10400 causes the compiler to keep track of the total number of virtual calls
10401 it encounters and the number of verifications it inserts.  It also
10402 counts the number of calls to certain run-time library functions
10403 that it inserts and logs this information for each compilation unit.
10404 The compiler writes this information to a file named
10405 @file{vtv_count_data.log} in the directory named by the environment
10406 variable @env{VTV_LOGS_DIR} if that is defined or the current working
10407 directory otherwise.  It also counts the size of the vtable pointer sets
10408 for each class, and writes this information to @file{vtv_class_set_sizes.log}
10409 in the same directory.
10411 Note:  This feature @emph{appends} data to the log files.  To get fresh log
10412 files, be sure to delete any existing ones.
10414 @item -finstrument-functions
10415 @opindex finstrument-functions
10416 Generate instrumentation calls for entry and exit to functions.  Just
10417 after function entry and just before function exit, the following
10418 profiling functions are called with the address of the current
10419 function and its call site.  (On some platforms,
10420 @code{__builtin_return_address} does not work beyond the current
10421 function, so the call site information may not be available to the
10422 profiling functions otherwise.)
10424 @smallexample
10425 void __cyg_profile_func_enter (void *this_fn,
10426                                void *call_site);
10427 void __cyg_profile_func_exit  (void *this_fn,
10428                                void *call_site);
10429 @end smallexample
10431 The first argument is the address of the start of the current function,
10432 which may be looked up exactly in the symbol table.
10434 This instrumentation is also done for functions expanded inline in other
10435 functions.  The profiling calls indicate where, conceptually, the
10436 inline function is entered and exited.  This means that addressable
10437 versions of such functions must be available.  If all your uses of a
10438 function are expanded inline, this may mean an additional expansion of
10439 code size.  If you use @code{extern inline} in your C code, an
10440 addressable version of such functions must be provided.  (This is
10441 normally the case anyway, but if you get lucky and the optimizer always
10442 expands the functions inline, you might have gotten away without
10443 providing static copies.)
10445 A function may be given the attribute @code{no_instrument_function}, in
10446 which case this instrumentation is not done.  This can be used, for
10447 example, for the profiling functions listed above, high-priority
10448 interrupt routines, and any functions from which the profiling functions
10449 cannot safely be called (perhaps signal handlers, if the profiling
10450 routines generate output or allocate memory).
10452 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
10453 @opindex finstrument-functions-exclude-file-list
10455 Set the list of functions that are excluded from instrumentation (see
10456 the description of @option{-finstrument-functions}).  If the file that
10457 contains a function definition matches with one of @var{file}, then
10458 that function is not instrumented.  The match is done on substrings:
10459 if the @var{file} parameter is a substring of the file name, it is
10460 considered to be a match.
10462 For example:
10464 @smallexample
10465 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
10466 @end smallexample
10468 @noindent
10469 excludes any inline function defined in files whose pathnames
10470 contain @file{/bits/stl} or @file{include/sys}.
10472 If, for some reason, you want to include letter @samp{,} in one of
10473 @var{sym}, write @samp{\,}. For example,
10474 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
10475 (note the single quote surrounding the option).
10477 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
10478 @opindex finstrument-functions-exclude-function-list
10480 This is similar to @option{-finstrument-functions-exclude-file-list},
10481 but this option sets the list of function names to be excluded from
10482 instrumentation.  The function name to be matched is its user-visible
10483 name, such as @code{vector<int> blah(const vector<int> &)}, not the
10484 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
10485 match is done on substrings: if the @var{sym} parameter is a substring
10486 of the function name, it is considered to be a match.  For C99 and C++
10487 extended identifiers, the function name must be given in UTF-8, not
10488 using universal character names.
10490 @end table
10493 @node Preprocessor Options
10494 @section Options Controlling the Preprocessor
10495 @cindex preprocessor options
10496 @cindex options, preprocessor
10498 These options control the C preprocessor, which is run on each C source
10499 file before actual compilation.
10501 If you use the @option{-E} option, nothing is done except preprocessing.
10502 Some of these options make sense only together with @option{-E} because
10503 they cause the preprocessor output to be unsuitable for actual
10504 compilation.
10506 @table @gcctabopt
10507 @item -Wp,@var{option}
10508 @opindex Wp
10509 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10510 and pass @var{option} directly through to the preprocessor.  If
10511 @var{option} contains commas, it is split into multiple options at the
10512 commas.  However, many options are modified, translated or interpreted
10513 by the compiler driver before being passed to the preprocessor, and
10514 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10515 interface is undocumented and subject to change, so whenever possible
10516 you should avoid using @option{-Wp} and let the driver handle the
10517 options instead.
10519 @item -Xpreprocessor @var{option}
10520 @opindex Xpreprocessor
10521 Pass @var{option} as an option to the preprocessor.  You can use this to
10522 supply system-specific preprocessor options that GCC does not 
10523 recognize.
10525 If you want to pass an option that takes an argument, you must use
10526 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10528 @item -no-integrated-cpp
10529 @opindex no-integrated-cpp
10530 Perform preprocessing as a separate pass before compilation.
10531 By default, GCC performs preprocessing as an integrated part of
10532 input tokenization and parsing.
10533 If this option is provided, the appropriate language front end
10534 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10535 and Objective-C, respectively) is instead invoked twice,
10536 once for preprocessing only and once for actual compilation
10537 of the preprocessed input.
10538 This option may be useful in conjunction with the @option{-B} or
10539 @option{-wrapper} options to specify an alternate preprocessor or
10540 perform additional processing of the program source between
10541 normal preprocessing and compilation.
10542 @end table
10544 @include cppopts.texi
10546 @node Assembler Options
10547 @section Passing Options to the Assembler
10549 @c prevent bad page break with this line
10550 You can pass options to the assembler.
10552 @table @gcctabopt
10553 @item -Wa,@var{option}
10554 @opindex Wa
10555 Pass @var{option} as an option to the assembler.  If @var{option}
10556 contains commas, it is split into multiple options at the commas.
10558 @item -Xassembler @var{option}
10559 @opindex Xassembler
10560 Pass @var{option} as an option to the assembler.  You can use this to
10561 supply system-specific assembler options that GCC does not
10562 recognize.
10564 If you want to pass an option that takes an argument, you must use
10565 @option{-Xassembler} twice, once for the option and once for the argument.
10567 @end table
10569 @node Link Options
10570 @section Options for Linking
10571 @cindex link options
10572 @cindex options, linking
10574 These options come into play when the compiler links object files into
10575 an executable output file.  They are meaningless if the compiler is
10576 not doing a link step.
10578 @table @gcctabopt
10579 @cindex file names
10580 @item @var{object-file-name}
10581 A file name that does not end in a special recognized suffix is
10582 considered to name an object file or library.  (Object files are
10583 distinguished from libraries by the linker according to the file
10584 contents.)  If linking is done, these object files are used as input
10585 to the linker.
10587 @item -c
10588 @itemx -S
10589 @itemx -E
10590 @opindex c
10591 @opindex S
10592 @opindex E
10593 If any of these options is used, then the linker is not run, and
10594 object file names should not be used as arguments.  @xref{Overall
10595 Options}.
10597 @item -fuse-ld=bfd
10598 @opindex fuse-ld=bfd
10599 Use the @command{bfd} linker instead of the default linker.
10601 @item -fuse-ld=gold
10602 @opindex fuse-ld=gold
10603 Use the @command{gold} linker instead of the default linker.
10605 @cindex Libraries
10606 @item -l@var{library}
10607 @itemx -l @var{library}
10608 @opindex l
10609 Search the library named @var{library} when linking.  (The second
10610 alternative with the library as a separate argument is only for
10611 POSIX compliance and is not recommended.)
10613 It makes a difference where in the command you write this option; the
10614 linker searches and processes libraries and object files in the order they
10615 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10616 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10617 to functions in @samp{z}, those functions may not be loaded.
10619 The linker searches a standard list of directories for the library,
10620 which is actually a file named @file{lib@var{library}.a}.  The linker
10621 then uses this file as if it had been specified precisely by name.
10623 The directories searched include several standard system directories
10624 plus any that you specify with @option{-L}.
10626 Normally the files found this way are library files---archive files
10627 whose members are object files.  The linker handles an archive file by
10628 scanning through it for members which define symbols that have so far
10629 been referenced but not defined.  But if the file that is found is an
10630 ordinary object file, it is linked in the usual fashion.  The only
10631 difference between using an @option{-l} option and specifying a file name
10632 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10633 and searches several directories.
10635 @item -lobjc
10636 @opindex lobjc
10637 You need this special case of the @option{-l} option in order to
10638 link an Objective-C or Objective-C++ program.
10640 @item -nostartfiles
10641 @opindex nostartfiles
10642 Do not use the standard system startup files when linking.
10643 The standard system libraries are used normally, unless @option{-nostdlib}
10644 or @option{-nodefaultlibs} is used.
10646 @item -nodefaultlibs
10647 @opindex nodefaultlibs
10648 Do not use the standard system libraries when linking.
10649 Only the libraries you specify are passed to the linker, and options
10650 specifying linkage of the system libraries, such as @option{-static-libgcc}
10651 or @option{-shared-libgcc}, are ignored.  
10652 The standard startup files are used normally, unless @option{-nostartfiles}
10653 is used.  
10655 The compiler may generate calls to @code{memcmp},
10656 @code{memset}, @code{memcpy} and @code{memmove}.
10657 These entries are usually resolved by entries in
10658 libc.  These entry points should be supplied through some other
10659 mechanism when this option is specified.
10661 @item -nostdlib
10662 @opindex nostdlib
10663 Do not use the standard system startup files or libraries when linking.
10664 No startup files and only the libraries you specify are passed to
10665 the linker, and options specifying linkage of the system libraries, such as
10666 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
10668 The compiler may generate calls to @code{memcmp}, @code{memset},
10669 @code{memcpy} and @code{memmove}.
10670 These entries are usually resolved by entries in
10671 libc.  These entry points should be supplied through some other
10672 mechanism when this option is specified.
10674 @cindex @option{-lgcc}, use with @option{-nostdlib}
10675 @cindex @option{-nostdlib} and unresolved references
10676 @cindex unresolved references and @option{-nostdlib}
10677 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10678 @cindex @option{-nodefaultlibs} and unresolved references
10679 @cindex unresolved references and @option{-nodefaultlibs}
10680 One of the standard libraries bypassed by @option{-nostdlib} and
10681 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10682 which GCC uses to overcome shortcomings of particular machines, or special
10683 needs for some languages.
10684 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10685 Collection (GCC) Internals},
10686 for more discussion of @file{libgcc.a}.)
10687 In most cases, you need @file{libgcc.a} even when you want to avoid
10688 other standard libraries.  In other words, when you specify @option{-nostdlib}
10689 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10690 This ensures that you have no unresolved references to internal GCC
10691 library subroutines.
10692 (An example of such an internal subroutine is @code{__main}, used to ensure C++
10693 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10694 GNU Compiler Collection (GCC) Internals}.)
10696 @item -pie
10697 @opindex pie
10698 Produce a position independent executable on targets that support it.
10699 For predictable results, you must also specify the same set of options
10700 used for compilation (@option{-fpie}, @option{-fPIE},
10701 or model suboptions) when you specify this linker option.
10703 @item -no-pie
10704 @opindex no-pie
10705 Don't produce a position independent executable.
10707 @item -rdynamic
10708 @opindex rdynamic
10709 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10710 that support it. This instructs the linker to add all symbols, not
10711 only used ones, to the dynamic symbol table. This option is needed
10712 for some uses of @code{dlopen} or to allow obtaining backtraces
10713 from within a program.
10715 @item -s
10716 @opindex s
10717 Remove all symbol table and relocation information from the executable.
10719 @item -static
10720 @opindex static
10721 On systems that support dynamic linking, this prevents linking with the shared
10722 libraries.  On other systems, this option has no effect.
10724 @item -shared
10725 @opindex shared
10726 Produce a shared object which can then be linked with other objects to
10727 form an executable.  Not all systems support this option.  For predictable
10728 results, you must also specify the same set of options used for compilation
10729 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10730 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10731 needs to build supplementary stub code for constructors to work.  On
10732 multi-libbed systems, @samp{gcc -shared} must select the correct support
10733 libraries to link against.  Failing to supply the correct flags may lead
10734 to subtle defects.  Supplying them in cases where they are not necessary
10735 is innocuous.}
10737 @item -shared-libgcc
10738 @itemx -static-libgcc
10739 @opindex shared-libgcc
10740 @opindex static-libgcc
10741 On systems that provide @file{libgcc} as a shared library, these options
10742 force the use of either the shared or static version, respectively.
10743 If no shared version of @file{libgcc} was built when the compiler was
10744 configured, these options have no effect.
10746 There are several situations in which an application should use the
10747 shared @file{libgcc} instead of the static version.  The most common
10748 of these is when the application wishes to throw and catch exceptions
10749 across different shared libraries.  In that case, each of the libraries
10750 as well as the application itself should use the shared @file{libgcc}.
10752 Therefore, the G++ and GCJ drivers automatically add
10753 @option{-shared-libgcc} whenever you build a shared library or a main
10754 executable, because C++ and Java programs typically use exceptions, so
10755 this is the right thing to do.
10757 If, instead, you use the GCC driver to create shared libraries, you may
10758 find that they are not always linked with the shared @file{libgcc}.
10759 If GCC finds, at its configuration time, that you have a non-GNU linker
10760 or a GNU linker that does not support option @option{--eh-frame-hdr},
10761 it links the shared version of @file{libgcc} into shared libraries
10762 by default.  Otherwise, it takes advantage of the linker and optimizes
10763 away the linking with the shared version of @file{libgcc}, linking with
10764 the static version of libgcc by default.  This allows exceptions to
10765 propagate through such shared libraries, without incurring relocation
10766 costs at library load time.
10768 However, if a library or main executable is supposed to throw or catch
10769 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10770 for the languages used in the program, or using the option
10771 @option{-shared-libgcc}, such that it is linked with the shared
10772 @file{libgcc}.
10774 @item -static-libasan
10775 @opindex static-libasan
10776 When the @option{-fsanitize=address} option is used to link a program,
10777 the GCC driver automatically links against @option{libasan}.  If
10778 @file{libasan} is available as a shared library, and the @option{-static}
10779 option is not used, then this links against the shared version of
10780 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10781 driver to link @file{libasan} statically, without necessarily linking
10782 other libraries statically.
10784 @item -static-libtsan
10785 @opindex static-libtsan
10786 When the @option{-fsanitize=thread} option is used to link a program,
10787 the GCC driver automatically links against @option{libtsan}.  If
10788 @file{libtsan} is available as a shared library, and the @option{-static}
10789 option is not used, then this links against the shared version of
10790 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10791 driver to link @file{libtsan} statically, without necessarily linking
10792 other libraries statically.
10794 @item -static-liblsan
10795 @opindex static-liblsan
10796 When the @option{-fsanitize=leak} option is used to link a program,
10797 the GCC driver automatically links against @option{liblsan}.  If
10798 @file{liblsan} is available as a shared library, and the @option{-static}
10799 option is not used, then this links against the shared version of
10800 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10801 driver to link @file{liblsan} statically, without necessarily linking
10802 other libraries statically.
10804 @item -static-libubsan
10805 @opindex static-libubsan
10806 When the @option{-fsanitize=undefined} option is used to link a program,
10807 the GCC driver automatically links against @option{libubsan}.  If
10808 @file{libubsan} is available as a shared library, and the @option{-static}
10809 option is not used, then this links against the shared version of
10810 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10811 driver to link @file{libubsan} statically, without necessarily linking
10812 other libraries statically.
10814 @item -static-libmpx
10815 @opindex static-libmpx
10816 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
10817 used to link a program, the GCC driver automatically links against
10818 @file{libmpx}.  If @file{libmpx} is available as a shared library,
10819 and the @option{-static} option is not used, then this links against
10820 the shared version of @file{libmpx}.  The @option{-static-libmpx}
10821 option directs the GCC driver to link @file{libmpx} statically,
10822 without necessarily linking other libraries statically.
10824 @item -static-libmpxwrappers
10825 @opindex static-libmpxwrappers
10826 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
10827 to link a program without also using @option{-fno-chkp-use-wrappers}, the
10828 GCC driver automatically links against @file{libmpxwrappers}.  If
10829 @file{libmpxwrappers} is available as a shared library, and the
10830 @option{-static} option is not used, then this links against the shared
10831 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
10832 option directs the GCC driver to link @file{libmpxwrappers} statically,
10833 without necessarily linking other libraries statically.
10835 @item -static-libstdc++
10836 @opindex static-libstdc++
10837 When the @command{g++} program is used to link a C++ program, it
10838 normally automatically links against @option{libstdc++}.  If
10839 @file{libstdc++} is available as a shared library, and the
10840 @option{-static} option is not used, then this links against the
10841 shared version of @file{libstdc++}.  That is normally fine.  However, it
10842 is sometimes useful to freeze the version of @file{libstdc++} used by
10843 the program without going all the way to a fully static link.  The
10844 @option{-static-libstdc++} option directs the @command{g++} driver to
10845 link @file{libstdc++} statically, without necessarily linking other
10846 libraries statically.
10848 @item -symbolic
10849 @opindex symbolic
10850 Bind references to global symbols when building a shared object.  Warn
10851 about any unresolved references (unless overridden by the link editor
10852 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10853 this option.
10855 @item -T @var{script}
10856 @opindex T
10857 @cindex linker script
10858 Use @var{script} as the linker script.  This option is supported by most
10859 systems using the GNU linker.  On some targets, such as bare-board
10860 targets without an operating system, the @option{-T} option may be required
10861 when linking to avoid references to undefined symbols.
10863 @item -Xlinker @var{option}
10864 @opindex Xlinker
10865 Pass @var{option} as an option to the linker.  You can use this to
10866 supply system-specific linker options that GCC does not recognize.
10868 If you want to pass an option that takes a separate argument, you must use
10869 @option{-Xlinker} twice, once for the option and once for the argument.
10870 For example, to pass @option{-assert definitions}, you must write
10871 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10872 @option{-Xlinker "-assert definitions"}, because this passes the entire
10873 string as a single argument, which is not what the linker expects.
10875 When using the GNU linker, it is usually more convenient to pass
10876 arguments to linker options using the @option{@var{option}=@var{value}}
10877 syntax than as separate arguments.  For example, you can specify
10878 @option{-Xlinker -Map=output.map} rather than
10879 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10880 this syntax for command-line options.
10882 @item -Wl,@var{option}
10883 @opindex Wl
10884 Pass @var{option} as an option to the linker.  If @var{option} contains
10885 commas, it is split into multiple options at the commas.  You can use this
10886 syntax to pass an argument to the option.
10887 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10888 linker.  When using the GNU linker, you can also get the same effect with
10889 @option{-Wl,-Map=output.map}.
10891 @item -u @var{symbol}
10892 @opindex u
10893 Pretend the symbol @var{symbol} is undefined, to force linking of
10894 library modules to define it.  You can use @option{-u} multiple times with
10895 different symbols to force loading of additional library modules.
10897 @item -z @var{keyword}
10898 @opindex z
10899 @option{-z} is passed directly on to the linker along with the keyword
10900 @var{keyword}. See the section in the documentation of your linker for
10901 permitted values and their meanings.
10902 @end table
10904 @node Directory Options
10905 @section Options for Directory Search
10906 @cindex directory options
10907 @cindex options, directory search
10908 @cindex search path
10910 These options specify directories to search for header files, for
10911 libraries and for parts of the compiler:
10913 @table @gcctabopt
10914 @item -I@var{dir}
10915 @opindex I
10916 Add the directory @var{dir} to the head of the list of directories to be
10917 searched for header files.  This can be used to override a system header
10918 file, substituting your own version, since these directories are
10919 searched before the system header file directories.  However, you should
10920 not use this option to add directories that contain vendor-supplied
10921 system header files (use @option{-isystem} for that).  If you use more than
10922 one @option{-I} option, the directories are scanned in left-to-right
10923 order; the standard system directories come after.
10925 If a standard system include directory, or a directory specified with
10926 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10927 option is ignored.  The directory is still searched but as a
10928 system directory at its normal position in the system include chain.
10929 This is to ensure that GCC's procedure to fix buggy system headers and
10930 the ordering for the @code{include_next} directive are not inadvertently changed.
10931 If you really need to change the search order for system directories,
10932 use the @option{-nostdinc} and/or @option{-isystem} options.
10934 @item -iplugindir=@var{dir}
10935 @opindex iplugindir=
10936 Set the directory to search for plugins that are passed
10937 by @option{-fplugin=@var{name}} instead of
10938 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10939 to be used by the user, but only passed by the driver.
10941 @item -iquote@var{dir}
10942 @opindex iquote
10943 Add the directory @var{dir} to the head of the list of directories to
10944 be searched for header files only for the case of @code{#include
10945 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
10946 otherwise just like @option{-I}.
10948 @item -L@var{dir}
10949 @opindex L
10950 Add directory @var{dir} to the list of directories to be searched
10951 for @option{-l}.
10953 @item -B@var{prefix}
10954 @opindex B
10955 This option specifies where to find the executables, libraries,
10956 include files, and data files of the compiler itself.
10958 The compiler driver program runs one or more of the subprograms
10959 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10960 @var{prefix} as a prefix for each program it tries to run, both with and
10961 without @samp{@var{machine}/@var{version}/} for the corresponding target
10962 machine and compiler version.
10964 For each subprogram to be run, the compiler driver first tries the
10965 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10966 is not specified, the driver tries two standard prefixes, 
10967 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10968 those results in a file name that is found, the unmodified program
10969 name is searched for using the directories specified in your
10970 @env{PATH} environment variable.
10972 The compiler checks to see if the path provided by @option{-B}
10973 refers to a directory, and if necessary it adds a directory
10974 separator character at the end of the path.
10976 @option{-B} prefixes that effectively specify directory names also apply
10977 to libraries in the linker, because the compiler translates these
10978 options into @option{-L} options for the linker.  They also apply to
10979 include files in the preprocessor, because the compiler translates these
10980 options into @option{-isystem} options for the preprocessor.  In this case,
10981 the compiler appends @samp{include} to the prefix.
10983 The runtime support file @file{libgcc.a} can also be searched for using
10984 the @option{-B} prefix, if needed.  If it is not found there, the two
10985 standard prefixes above are tried, and that is all.  The file is left
10986 out of the link if it is not found by those means.
10988 Another way to specify a prefix much like the @option{-B} prefix is to use
10989 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10990 Variables}.
10992 As a special kludge, if the path provided by @option{-B} is
10993 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10994 9, then it is replaced by @file{[dir/]include}.  This is to help
10995 with boot-strapping the compiler.
10997 @item -no-canonical-prefixes
10998 @opindex no-canonical-prefixes
10999 Do not expand any symbolic links, resolve references to @samp{/../}
11000 or @samp{/./}, or make the path absolute when generating a relative
11001 prefix.
11003 @item --sysroot=@var{dir}
11004 @opindex sysroot
11005 Use @var{dir} as the logical root directory for headers and libraries.
11006 For example, if the compiler normally searches for headers in
11007 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
11008 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
11010 If you use both this option and the @option{-isysroot} option, then
11011 the @option{--sysroot} option applies to libraries, but the
11012 @option{-isysroot} option applies to header files.
11014 The GNU linker (beginning with version 2.16) has the necessary support
11015 for this option.  If your linker does not support this option, the
11016 header file aspect of @option{--sysroot} still works, but the
11017 library aspect does not.
11019 @item --no-sysroot-suffix
11020 @opindex no-sysroot-suffix
11021 For some targets, a suffix is added to the root directory specified
11022 with @option{--sysroot}, depending on the other options used, so that
11023 headers may for example be found in
11024 @file{@var{dir}/@var{suffix}/usr/include} instead of
11025 @file{@var{dir}/usr/include}.  This option disables the addition of
11026 such a suffix.
11028 @item -I-
11029 @opindex I-
11030 This option has been deprecated.  Please use @option{-iquote} instead for
11031 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
11032 option.
11033 Any directories you specify with @option{-I} options before the @option{-I-}
11034 option are searched only for the case of @code{#include "@var{file}"};
11035 they are not searched for @code{#include <@var{file}>}.
11037 If additional directories are specified with @option{-I} options after
11038 the @option{-I-} option, these directories are searched for all @code{#include}
11039 directives.  (Ordinarily @emph{all} @option{-I} directories are used
11040 this way.)
11042 In addition, the @option{-I-} option inhibits the use of the current
11043 directory (where the current input file came from) as the first search
11044 directory for @code{#include "@var{file}"}.  There is no way to
11045 override this effect of @option{-I-}.  With @option{-I.} you can specify
11046 searching the directory that is current when the compiler is
11047 invoked.  That is not exactly the same as what the preprocessor does
11048 by default, but it is often satisfactory.
11050 @option{-I-} does not inhibit the use of the standard system directories
11051 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
11052 independent.
11053 @end table
11055 @node Code Gen Options
11056 @section Options for Code Generation Conventions
11057 @cindex code generation conventions
11058 @cindex options, code generation
11059 @cindex run-time options
11061 These machine-independent options control the interface conventions
11062 used in code generation.
11064 Most of them have both positive and negative forms; the negative form
11065 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
11066 one of the forms is listed---the one that is not the default.  You
11067 can figure out the other form by either removing @samp{no-} or adding
11070 @table @gcctabopt
11071 @item -fstack-reuse=@var{reuse-level}
11072 @opindex fstack_reuse
11073 This option controls stack space reuse for user declared local/auto variables
11074 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
11075 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
11076 local variables and temporaries, @samp{named_vars} enables the reuse only for
11077 user defined local variables with names, and @samp{none} disables stack reuse
11078 completely. The default value is @samp{all}. The option is needed when the
11079 program extends the lifetime of a scoped local variable or a compiler generated
11080 temporary beyond the end point defined by the language.  When a lifetime of
11081 a variable ends, and if the variable lives in memory, the optimizing compiler
11082 has the freedom to reuse its stack space with other temporaries or scoped
11083 local variables whose live range does not overlap with it. Legacy code extending
11084 local lifetime is likely to break with the stack reuse optimization.
11086 For example,
11088 @smallexample
11089    int *p;
11090    @{
11091      int local1;
11093      p = &local1;
11094      local1 = 10;
11095      ....
11096    @}
11097    @{
11098       int local2;
11099       local2 = 20;
11100       ...
11101    @}
11103    if (*p == 10)  // out of scope use of local1
11104      @{
11106      @}
11107 @end smallexample
11109 Another example:
11110 @smallexample
11112    struct A
11113    @{
11114        A(int k) : i(k), j(k) @{ @}
11115        int i;
11116        int j;
11117    @};
11119    A *ap;
11121    void foo(const A& ar)
11122    @{
11123       ap = &ar;
11124    @}
11126    void bar()
11127    @{
11128       foo(A(10)); // temp object's lifetime ends when foo returns
11130       @{
11131         A a(20);
11132         ....
11133       @}
11134       ap->i+= 10;  // ap references out of scope temp whose space
11135                    // is reused with a. What is the value of ap->i?
11136    @}
11138 @end smallexample
11140 The lifetime of a compiler generated temporary is well defined by the C++
11141 standard. When a lifetime of a temporary ends, and if the temporary lives
11142 in memory, the optimizing compiler has the freedom to reuse its stack
11143 space with other temporaries or scoped local variables whose live range
11144 does not overlap with it. However some of the legacy code relies on
11145 the behavior of older compilers in which temporaries' stack space is
11146 not reused, the aggressive stack reuse can lead to runtime errors. This
11147 option is used to control the temporary stack reuse optimization.
11149 @item -ftrapv
11150 @opindex ftrapv
11151 This option generates traps for signed overflow on addition, subtraction,
11152 multiplication operations.
11153 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11154 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11155 @option{-fwrapv} being effective.  Note that only active options override, so
11156 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11157 results in @option{-ftrapv} being effective.
11159 @item -fwrapv
11160 @opindex fwrapv
11161 This option instructs the compiler to assume that signed arithmetic
11162 overflow of addition, subtraction and multiplication wraps around
11163 using twos-complement representation.  This flag enables some optimizations
11164 and disables others.  This option is enabled by default for the Java
11165 front end, as required by the Java language specification.
11166 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11167 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11168 @option{-fwrapv} being effective.  Note that only active options override, so
11169 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11170 results in @option{-ftrapv} being effective.
11172 @item -fexceptions
11173 @opindex fexceptions
11174 Enable exception handling.  Generates extra code needed to propagate
11175 exceptions.  For some targets, this implies GCC generates frame
11176 unwind information for all functions, which can produce significant data
11177 size overhead, although it does not affect execution.  If you do not
11178 specify this option, GCC enables it by default for languages like
11179 C++ that normally require exception handling, and disables it for
11180 languages like C that do not normally require it.  However, you may need
11181 to enable this option when compiling C code that needs to interoperate
11182 properly with exception handlers written in C++.  You may also wish to
11183 disable this option if you are compiling older C++ programs that don't
11184 use exception handling.
11186 @item -fnon-call-exceptions
11187 @opindex fnon-call-exceptions
11188 Generate code that allows trapping instructions to throw exceptions.
11189 Note that this requires platform-specific runtime support that does
11190 not exist everywhere.  Moreover, it only allows @emph{trapping}
11191 instructions to throw exceptions, i.e.@: memory references or floating-point
11192 instructions.  It does not allow exceptions to be thrown from
11193 arbitrary signal handlers such as @code{SIGALRM}.
11195 @item -fdelete-dead-exceptions
11196 @opindex fdelete-dead-exceptions
11197 Consider that instructions that may throw exceptions but don't otherwise
11198 contribute to the execution of the program can be optimized away.
11199 This option is enabled by default for the Ada front end, as permitted by
11200 the Ada language specification.
11201 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
11203 @item -funwind-tables
11204 @opindex funwind-tables
11205 Similar to @option{-fexceptions}, except that it just generates any needed
11206 static data, but does not affect the generated code in any other way.
11207 You normally do not need to enable this option; instead, a language processor
11208 that needs this handling enables it on your behalf.
11210 @item -fasynchronous-unwind-tables
11211 @opindex fasynchronous-unwind-tables
11212 Generate unwind table in DWARF format, if supported by target machine.  The
11213 table is exact at each instruction boundary, so it can be used for stack
11214 unwinding from asynchronous events (such as debugger or garbage collector).
11216 @item -fno-gnu-unique
11217 @opindex fno-gnu-unique
11218 On systems with recent GNU assembler and C library, the C++ compiler
11219 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
11220 of template static data members and static local variables in inline
11221 functions are unique even in the presence of @code{RTLD_LOCAL}; this
11222 is necessary to avoid problems with a library used by two different
11223 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
11224 therefore disagreeing with the other one about the binding of the
11225 symbol.  But this causes @code{dlclose} to be ignored for affected
11226 DSOs; if your program relies on reinitialization of a DSO via
11227 @code{dlclose} and @code{dlopen}, you can use
11228 @option{-fno-gnu-unique}.
11230 @item -fpcc-struct-return
11231 @opindex fpcc-struct-return
11232 Return ``short'' @code{struct} and @code{union} values in memory like
11233 longer ones, rather than in registers.  This convention is less
11234 efficient, but it has the advantage of allowing intercallability between
11235 GCC-compiled files and files compiled with other compilers, particularly
11236 the Portable C Compiler (pcc).
11238 The precise convention for returning structures in memory depends
11239 on the target configuration macros.
11241 Short structures and unions are those whose size and alignment match
11242 that of some integer type.
11244 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
11245 switch is not binary compatible with code compiled with the
11246 @option{-freg-struct-return} switch.
11247 Use it to conform to a non-default application binary interface.
11249 @item -freg-struct-return
11250 @opindex freg-struct-return
11251 Return @code{struct} and @code{union} values in registers when possible.
11252 This is more efficient for small structures than
11253 @option{-fpcc-struct-return}.
11255 If you specify neither @option{-fpcc-struct-return} nor
11256 @option{-freg-struct-return}, GCC defaults to whichever convention is
11257 standard for the target.  If there is no standard convention, GCC
11258 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
11259 the principal compiler.  In those cases, we can choose the standard, and
11260 we chose the more efficient register return alternative.
11262 @strong{Warning:} code compiled with the @option{-freg-struct-return}
11263 switch is not binary compatible with code compiled with the
11264 @option{-fpcc-struct-return} switch.
11265 Use it to conform to a non-default application binary interface.
11267 @item -fshort-enums
11268 @opindex fshort-enums
11269 Allocate to an @code{enum} type only as many bytes as it needs for the
11270 declared range of possible values.  Specifically, the @code{enum} type
11271 is equivalent to the smallest integer type that has enough room.
11273 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
11274 code that is not binary compatible with code generated without that switch.
11275 Use it to conform to a non-default application binary interface.
11277 @item -fshort-wchar
11278 @opindex fshort-wchar
11279 Override the underlying type for @code{wchar_t} to be @code{short
11280 unsigned int} instead of the default for the target.  This option is
11281 useful for building programs to run under WINE@.
11283 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
11284 code that is not binary compatible with code generated without that switch.
11285 Use it to conform to a non-default application binary interface.
11287 @item -fno-common
11288 @opindex fno-common
11289 In C code, controls the placement of uninitialized global variables.
11290 Unix C compilers have traditionally permitted multiple definitions of
11291 such variables in different compilation units by placing the variables
11292 in a common block.
11293 This is the behavior specified by @option{-fcommon}, and is the default
11294 for GCC on most targets.
11295 On the other hand, this behavior is not required by ISO C, and on some
11296 targets may carry a speed or code size penalty on variable references.
11297 The @option{-fno-common} option specifies that the compiler should place
11298 uninitialized global variables in the data section of the object file,
11299 rather than generating them as common blocks.
11300 This has the effect that if the same variable is declared
11301 (without @code{extern}) in two different compilations,
11302 you get a multiple-definition error when you link them.
11303 In this case, you must compile with @option{-fcommon} instead.
11304 Compiling with @option{-fno-common} is useful on targets for which
11305 it provides better performance, or if you wish to verify that the
11306 program will work on other systems that always treat uninitialized
11307 variable declarations this way.
11309 @item -fno-ident
11310 @opindex fno-ident
11311 Ignore the @code{#ident} directive.
11313 @item -finhibit-size-directive
11314 @opindex finhibit-size-directive
11315 Don't output a @code{.size} assembler directive, or anything else that
11316 would cause trouble if the function is split in the middle, and the
11317 two halves are placed at locations far apart in memory.  This option is
11318 used when compiling @file{crtstuff.c}; you should not need to use it
11319 for anything else.
11321 @item -fverbose-asm
11322 @opindex fverbose-asm
11323 Put extra commentary information in the generated assembly code to
11324 make it more readable.  This option is generally only of use to those
11325 who actually need to read the generated assembly code (perhaps while
11326 debugging the compiler itself).
11328 @option{-fno-verbose-asm}, the default, causes the
11329 extra information to be omitted and is useful when comparing two assembler
11330 files.
11332 @item -frecord-gcc-switches
11333 @opindex frecord-gcc-switches
11334 This switch causes the command line used to invoke the
11335 compiler to be recorded into the object file that is being created.
11336 This switch is only implemented on some targets and the exact format
11337 of the recording is target and binary file format dependent, but it
11338 usually takes the form of a section containing ASCII text.  This
11339 switch is related to the @option{-fverbose-asm} switch, but that
11340 switch only records information in the assembler output file as
11341 comments, so it never reaches the object file.
11342 See also @option{-grecord-gcc-switches} for another
11343 way of storing compiler options into the object file.
11345 @item -fpic
11346 @opindex fpic
11347 @cindex global offset table
11348 @cindex PIC
11349 Generate position-independent code (PIC) suitable for use in a shared
11350 library, if supported for the target machine.  Such code accesses all
11351 constant addresses through a global offset table (GOT)@.  The dynamic
11352 loader resolves the GOT entries when the program starts (the dynamic
11353 loader is not part of GCC; it is part of the operating system).  If
11354 the GOT size for the linked executable exceeds a machine-specific
11355 maximum size, you get an error message from the linker indicating that
11356 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
11357 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
11358 on the m68k and RS/6000.  The x86 has no such limit.)
11360 Position-independent code requires special support, and therefore works
11361 only on certain machines.  For the x86, GCC supports PIC for System V
11362 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
11363 position-independent.
11365 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
11366 are defined to 1.
11368 @item -fPIC
11369 @opindex fPIC
11370 If supported for the target machine, emit position-independent code,
11371 suitable for dynamic linking and avoiding any limit on the size of the
11372 global offset table.  This option makes a difference on AArch64, m68k,
11373 PowerPC and SPARC@.
11375 Position-independent code requires special support, and therefore works
11376 only on certain machines.
11378 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
11379 are defined to 2.
11381 @item -fpie
11382 @itemx -fPIE
11383 @opindex fpie
11384 @opindex fPIE
11385 These options are similar to @option{-fpic} and @option{-fPIC}, but
11386 generated position independent code can be only linked into executables.
11387 Usually these options are used when @option{-pie} GCC option is
11388 used during linking.
11390 @option{-fpie} and @option{-fPIE} both define the macros
11391 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
11392 for @option{-fpie} and 2 for @option{-fPIE}.
11394 @item -fno-plt
11395 @opindex fno-plt
11396 Do not use the PLT for external function calls in position-independent code.
11397 Instead, load the callee address at call sites from the GOT and branch to it.
11398 This leads to more efficient code by eliminating PLT stubs and exposing
11399 GOT loads to optimizations.  On architectures such as 32-bit x86 where
11400 PLT stubs expect the GOT pointer in a specific register, this gives more
11401 register allocation freedom to the compiler.
11402 Lazy binding requires use of the PLT; 
11403 with @option{-fno-plt} all external symbols are resolved at load time.
11405 Alternatively, the function attribute @code{noplt} can be used to avoid calls
11406 through the PLT for specific external functions.
11408 In position-dependent code, a few targets also convert calls to
11409 functions that are marked to not use the PLT to use the GOT instead.
11411 @item -fno-jump-tables
11412 @opindex fno-jump-tables
11413 Do not use jump tables for switch statements even where it would be
11414 more efficient than other code generation strategies.  This option is
11415 of use in conjunction with @option{-fpic} or @option{-fPIC} for
11416 building code that forms part of a dynamic linker and cannot
11417 reference the address of a jump table.  On some targets, jump tables
11418 do not require a GOT and this option is not needed.
11420 @item -ffixed-@var{reg}
11421 @opindex ffixed
11422 Treat the register named @var{reg} as a fixed register; generated code
11423 should never refer to it (except perhaps as a stack pointer, frame
11424 pointer or in some other fixed role).
11426 @var{reg} must be the name of a register.  The register names accepted
11427 are machine-specific and are defined in the @code{REGISTER_NAMES}
11428 macro in the machine description macro file.
11430 This flag does not have a negative form, because it specifies a
11431 three-way choice.
11433 @item -fcall-used-@var{reg}
11434 @opindex fcall-used
11435 Treat the register named @var{reg} as an allocable register that is
11436 clobbered by function calls.  It may be allocated for temporaries or
11437 variables that do not live across a call.  Functions compiled this way
11438 do not save and restore the register @var{reg}.
11440 It is an error to use this flag with the frame pointer or stack pointer.
11441 Use of this flag for other registers that have fixed pervasive roles in
11442 the machine's execution model produces disastrous results.
11444 This flag does not have a negative form, because it specifies a
11445 three-way choice.
11447 @item -fcall-saved-@var{reg}
11448 @opindex fcall-saved
11449 Treat the register named @var{reg} as an allocable register saved by
11450 functions.  It may be allocated even for temporaries or variables that
11451 live across a call.  Functions compiled this way save and restore
11452 the register @var{reg} if they use it.
11454 It is an error to use this flag with the frame pointer or stack pointer.
11455 Use of this flag for other registers that have fixed pervasive roles in
11456 the machine's execution model produces disastrous results.
11458 A different sort of disaster results from the use of this flag for
11459 a register in which function values may be returned.
11461 This flag does not have a negative form, because it specifies a
11462 three-way choice.
11464 @item -fpack-struct[=@var{n}]
11465 @opindex fpack-struct
11466 Without a value specified, pack all structure members together without
11467 holes.  When a value is specified (which must be a small power of two), pack
11468 structure members according to this value, representing the maximum
11469 alignment (that is, objects with default alignment requirements larger than
11470 this are output potentially unaligned at the next fitting location.
11472 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
11473 code that is not binary compatible with code generated without that switch.
11474 Additionally, it makes the code suboptimal.
11475 Use it to conform to a non-default application binary interface.
11477 @item -fleading-underscore
11478 @opindex fleading-underscore
11479 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
11480 change the way C symbols are represented in the object file.  One use
11481 is to help link with legacy assembly code.
11483 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
11484 generate code that is not binary compatible with code generated without that
11485 switch.  Use it to conform to a non-default application binary interface.
11486 Not all targets provide complete support for this switch.
11488 @item -ftls-model=@var{model}
11489 @opindex ftls-model
11490 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
11491 The @var{model} argument should be one of @samp{global-dynamic},
11492 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
11493 Note that the choice is subject to optimization: the compiler may use
11494 a more efficient model for symbols not visible outside of the translation
11495 unit, or if @option{-fpic} is not given on the command line.
11497 The default without @option{-fpic} is @samp{initial-exec}; with
11498 @option{-fpic} the default is @samp{global-dynamic}.
11500 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
11501 @opindex fvisibility
11502 Set the default ELF image symbol visibility to the specified option---all
11503 symbols are marked with this unless overridden within the code.
11504 Using this feature can very substantially improve linking and
11505 load times of shared object libraries, produce more optimized
11506 code, provide near-perfect API export and prevent symbol clashes.
11507 It is @strong{strongly} recommended that you use this in any shared objects
11508 you distribute.
11510 Despite the nomenclature, @samp{default} always means public; i.e.,
11511 available to be linked against from outside the shared object.
11512 @samp{protected} and @samp{internal} are pretty useless in real-world
11513 usage so the only other commonly used option is @samp{hidden}.
11514 The default if @option{-fvisibility} isn't specified is
11515 @samp{default}, i.e., make every symbol public.
11517 A good explanation of the benefits offered by ensuring ELF
11518 symbols have the correct visibility is given by ``How To Write
11519 Shared Libraries'' by Ulrich Drepper (which can be found at
11520 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
11521 solution made possible by this option to marking things hidden when
11522 the default is public is to make the default hidden and mark things
11523 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
11524 and @code{__attribute__ ((visibility("default")))} instead of
11525 @code{__declspec(dllexport)} you get almost identical semantics with
11526 identical syntax.  This is a great boon to those working with
11527 cross-platform projects.
11529 For those adding visibility support to existing code, you may find
11530 @code{#pragma GCC visibility} of use.  This works by you enclosing
11531 the declarations you wish to set visibility for with (for example)
11532 @code{#pragma GCC visibility push(hidden)} and
11533 @code{#pragma GCC visibility pop}.
11534 Bear in mind that symbol visibility should be viewed @strong{as
11535 part of the API interface contract} and thus all new code should
11536 always specify visibility when it is not the default; i.e., declarations
11537 only for use within the local DSO should @strong{always} be marked explicitly
11538 as hidden as so to avoid PLT indirection overheads---making this
11539 abundantly clear also aids readability and self-documentation of the code.
11540 Note that due to ISO C++ specification requirements, @code{operator new} and
11541 @code{operator delete} must always be of default visibility.
11543 Be aware that headers from outside your project, in particular system
11544 headers and headers from any other library you use, may not be
11545 expecting to be compiled with visibility other than the default.  You
11546 may need to explicitly say @code{#pragma GCC visibility push(default)}
11547 before including any such headers.
11549 @code{extern} declarations are not affected by @option{-fvisibility}, so
11550 a lot of code can be recompiled with @option{-fvisibility=hidden} with
11551 no modifications.  However, this means that calls to @code{extern}
11552 functions with no explicit visibility use the PLT, so it is more
11553 effective to use @code{__attribute ((visibility))} and/or
11554 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
11555 declarations should be treated as hidden.
11557 Note that @option{-fvisibility} does affect C++ vague linkage
11558 entities. This means that, for instance, an exception class that is
11559 be thrown between DSOs must be explicitly marked with default
11560 visibility so that the @samp{type_info} nodes are unified between
11561 the DSOs.
11563 An overview of these techniques, their benefits and how to use them
11564 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
11566 @item -fstrict-volatile-bitfields
11567 @opindex fstrict-volatile-bitfields
11568 This option should be used if accesses to volatile bit-fields (or other
11569 structure fields, although the compiler usually honors those types
11570 anyway) should use a single access of the width of the
11571 field's type, aligned to a natural alignment if possible.  For
11572 example, targets with memory-mapped peripheral registers might require
11573 all such accesses to be 16 bits wide; with this flag you can
11574 declare all peripheral bit-fields as @code{unsigned short} (assuming short
11575 is 16 bits on these targets) to force GCC to use 16-bit accesses
11576 instead of, perhaps, a more efficient 32-bit access.
11578 If this option is disabled, the compiler uses the most efficient
11579 instruction.  In the previous example, that might be a 32-bit load
11580 instruction, even though that accesses bytes that do not contain
11581 any portion of the bit-field, or memory-mapped registers unrelated to
11582 the one being updated.
11584 In some cases, such as when the @code{packed} attribute is applied to a 
11585 structure field, it may not be possible to access the field with a single
11586 read or write that is correctly aligned for the target machine.  In this
11587 case GCC falls back to generating multiple accesses rather than code that 
11588 will fault or truncate the result at run time.
11590 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
11591 not allowed to touch non bit-field members.  It is therefore recommended
11592 to define all bits of the field's type as bit-field members.
11594 The default value of this option is determined by the application binary
11595 interface for the target processor.
11597 @item -fsync-libcalls
11598 @opindex fsync-libcalls
11599 This option controls whether any out-of-line instance of the @code{__sync}
11600 family of functions may be used to implement the C++11 @code{__atomic}
11601 family of functions.
11603 The default value of this option is enabled, thus the only useful form
11604 of the option is @option{-fno-sync-libcalls}.  This option is used in
11605 the implementation of the @file{libatomic} runtime library.
11607 @end table
11609 @node Developer Options
11610 @section GCC Developer Options
11611 @cindex developer options
11612 @cindex debugging GCC
11613 @cindex debug dump options
11614 @cindex dump options
11615 @cindex compilation statistics
11617 This section describes command-line options that are primarily of
11618 interest to GCC developers, including options to support compiler
11619 testing and investigation of compiler bugs and compile-time
11620 performance problems.  This includes options that produce debug dumps
11621 at various points in the compilation; that print statistics such as
11622 memory use and execution time; and that print information about GCC's
11623 configuration, such as where it searches for libraries.  You should
11624 rarely need to use any of these options for ordinary compilation and
11625 linking tasks.
11627 @table @gcctabopt
11629 @item -d@var{letters}
11630 @itemx -fdump-rtl-@var{pass}
11631 @itemx -fdump-rtl-@var{pass}=@var{filename}
11632 @opindex d
11633 @opindex fdump-rtl-@var{pass}
11634 Says to make debugging dumps during compilation at times specified by
11635 @var{letters}.  This is used for debugging the RTL-based passes of the
11636 compiler.  The file names for most of the dumps are made by appending
11637 a pass number and a word to the @var{dumpname}, and the files are
11638 created in the directory of the output file.  In case of
11639 @option{=@var{filename}} option, the dump is output on the given file
11640 instead of the pass numbered dump files.  Note that the pass number is
11641 assigned as passes are registered into the pass manager.  Most passes
11642 are registered in the order that they will execute and for these passes
11643 the number corresponds to the pass execution order.  However, passes
11644 registered by plugins, passes specific to compilation targets, or
11645 passes that are otherwise registered after all the other passes are
11646 numbered higher than a pass named "final", even if they are executed
11647 earlier.  @var{dumpname} is generated from the name of the output
11648 file if explicitly specified and not an executable, otherwise it is
11649 the basename of the source file.  These switches may have different
11650 effects when @option{-E} is used for preprocessing.
11652 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
11653 @option{-d} option @var{letters}.  Here are the possible
11654 letters for use in @var{pass} and @var{letters}, and their meanings:
11656 @table @gcctabopt
11658 @item -fdump-rtl-alignments
11659 @opindex fdump-rtl-alignments
11660 Dump after branch alignments have been computed.
11662 @item -fdump-rtl-asmcons
11663 @opindex fdump-rtl-asmcons
11664 Dump after fixing rtl statements that have unsatisfied in/out constraints.
11666 @item -fdump-rtl-auto_inc_dec
11667 @opindex fdump-rtl-auto_inc_dec
11668 Dump after auto-inc-dec discovery.  This pass is only run on
11669 architectures that have auto inc or auto dec instructions.
11671 @item -fdump-rtl-barriers
11672 @opindex fdump-rtl-barriers
11673 Dump after cleaning up the barrier instructions.
11675 @item -fdump-rtl-bbpart
11676 @opindex fdump-rtl-bbpart
11677 Dump after partitioning hot and cold basic blocks.
11679 @item -fdump-rtl-bbro
11680 @opindex fdump-rtl-bbro
11681 Dump after block reordering.
11683 @item -fdump-rtl-btl1
11684 @itemx -fdump-rtl-btl2
11685 @opindex fdump-rtl-btl2
11686 @opindex fdump-rtl-btl2
11687 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
11688 after the two branch
11689 target load optimization passes.
11691 @item -fdump-rtl-bypass
11692 @opindex fdump-rtl-bypass
11693 Dump after jump bypassing and control flow optimizations.
11695 @item -fdump-rtl-combine
11696 @opindex fdump-rtl-combine
11697 Dump after the RTL instruction combination pass.
11699 @item -fdump-rtl-compgotos
11700 @opindex fdump-rtl-compgotos
11701 Dump after duplicating the computed gotos.
11703 @item -fdump-rtl-ce1
11704 @itemx -fdump-rtl-ce2
11705 @itemx -fdump-rtl-ce3
11706 @opindex fdump-rtl-ce1
11707 @opindex fdump-rtl-ce2
11708 @opindex fdump-rtl-ce3
11709 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
11710 @option{-fdump-rtl-ce3} enable dumping after the three
11711 if conversion passes.
11713 @item -fdump-rtl-cprop_hardreg
11714 @opindex fdump-rtl-cprop_hardreg
11715 Dump after hard register copy propagation.
11717 @item -fdump-rtl-csa
11718 @opindex fdump-rtl-csa
11719 Dump after combining stack adjustments.
11721 @item -fdump-rtl-cse1
11722 @itemx -fdump-rtl-cse2
11723 @opindex fdump-rtl-cse1
11724 @opindex fdump-rtl-cse2
11725 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
11726 the two common subexpression elimination passes.
11728 @item -fdump-rtl-dce
11729 @opindex fdump-rtl-dce
11730 Dump after the standalone dead code elimination passes.
11732 @item -fdump-rtl-dbr
11733 @opindex fdump-rtl-dbr
11734 Dump after delayed branch scheduling.
11736 @item -fdump-rtl-dce1
11737 @itemx -fdump-rtl-dce2
11738 @opindex fdump-rtl-dce1
11739 @opindex fdump-rtl-dce2
11740 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
11741 the two dead store elimination passes.
11743 @item -fdump-rtl-eh
11744 @opindex fdump-rtl-eh
11745 Dump after finalization of EH handling code.
11747 @item -fdump-rtl-eh_ranges
11748 @opindex fdump-rtl-eh_ranges
11749 Dump after conversion of EH handling range regions.
11751 @item -fdump-rtl-expand
11752 @opindex fdump-rtl-expand
11753 Dump after RTL generation.
11755 @item -fdump-rtl-fwprop1
11756 @itemx -fdump-rtl-fwprop2
11757 @opindex fdump-rtl-fwprop1
11758 @opindex fdump-rtl-fwprop2
11759 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
11760 dumping after the two forward propagation passes.
11762 @item -fdump-rtl-gcse1
11763 @itemx -fdump-rtl-gcse2
11764 @opindex fdump-rtl-gcse1
11765 @opindex fdump-rtl-gcse2
11766 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
11767 after global common subexpression elimination.
11769 @item -fdump-rtl-init-regs
11770 @opindex fdump-rtl-init-regs
11771 Dump after the initialization of the registers.
11773 @item -fdump-rtl-initvals
11774 @opindex fdump-rtl-initvals
11775 Dump after the computation of the initial value sets.
11777 @item -fdump-rtl-into_cfglayout
11778 @opindex fdump-rtl-into_cfglayout
11779 Dump after converting to cfglayout mode.
11781 @item -fdump-rtl-ira
11782 @opindex fdump-rtl-ira
11783 Dump after iterated register allocation.
11785 @item -fdump-rtl-jump
11786 @opindex fdump-rtl-jump
11787 Dump after the second jump optimization.
11789 @item -fdump-rtl-loop2
11790 @opindex fdump-rtl-loop2
11791 @option{-fdump-rtl-loop2} enables dumping after the rtl
11792 loop optimization passes.
11794 @item -fdump-rtl-mach
11795 @opindex fdump-rtl-mach
11796 Dump after performing the machine dependent reorganization pass, if that
11797 pass exists.
11799 @item -fdump-rtl-mode_sw
11800 @opindex fdump-rtl-mode_sw
11801 Dump after removing redundant mode switches.
11803 @item -fdump-rtl-rnreg
11804 @opindex fdump-rtl-rnreg
11805 Dump after register renumbering.
11807 @item -fdump-rtl-outof_cfglayout
11808 @opindex fdump-rtl-outof_cfglayout
11809 Dump after converting from cfglayout mode.
11811 @item -fdump-rtl-peephole2
11812 @opindex fdump-rtl-peephole2
11813 Dump after the peephole pass.
11815 @item -fdump-rtl-postreload
11816 @opindex fdump-rtl-postreload
11817 Dump after post-reload optimizations.
11819 @item -fdump-rtl-pro_and_epilogue
11820 @opindex fdump-rtl-pro_and_epilogue
11821 Dump after generating the function prologues and epilogues.
11823 @item -fdump-rtl-sched1
11824 @itemx -fdump-rtl-sched2
11825 @opindex fdump-rtl-sched1
11826 @opindex fdump-rtl-sched2
11827 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
11828 after the basic block scheduling passes.
11830 @item -fdump-rtl-ree
11831 @opindex fdump-rtl-ree
11832 Dump after sign/zero extension elimination.
11834 @item -fdump-rtl-seqabstr
11835 @opindex fdump-rtl-seqabstr
11836 Dump after common sequence discovery.
11838 @item -fdump-rtl-shorten
11839 @opindex fdump-rtl-shorten
11840 Dump after shortening branches.
11842 @item -fdump-rtl-sibling
11843 @opindex fdump-rtl-sibling
11844 Dump after sibling call optimizations.
11846 @item -fdump-rtl-split1
11847 @itemx -fdump-rtl-split2
11848 @itemx -fdump-rtl-split3
11849 @itemx -fdump-rtl-split4
11850 @itemx -fdump-rtl-split5
11851 @opindex fdump-rtl-split1
11852 @opindex fdump-rtl-split2
11853 @opindex fdump-rtl-split3
11854 @opindex fdump-rtl-split4
11855 @opindex fdump-rtl-split5
11856 These options enable dumping after five rounds of
11857 instruction splitting.
11859 @item -fdump-rtl-sms
11860 @opindex fdump-rtl-sms
11861 Dump after modulo scheduling.  This pass is only run on some
11862 architectures.
11864 @item -fdump-rtl-stack
11865 @opindex fdump-rtl-stack
11866 Dump after conversion from GCC's ``flat register file'' registers to the
11867 x87's stack-like registers.  This pass is only run on x86 variants.
11869 @item -fdump-rtl-subreg1
11870 @itemx -fdump-rtl-subreg2
11871 @opindex fdump-rtl-subreg1
11872 @opindex fdump-rtl-subreg2
11873 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
11874 the two subreg expansion passes.
11876 @item -fdump-rtl-unshare
11877 @opindex fdump-rtl-unshare
11878 Dump after all rtl has been unshared.
11880 @item -fdump-rtl-vartrack
11881 @opindex fdump-rtl-vartrack
11882 Dump after variable tracking.
11884 @item -fdump-rtl-vregs
11885 @opindex fdump-rtl-vregs
11886 Dump after converting virtual registers to hard registers.
11888 @item -fdump-rtl-web
11889 @opindex fdump-rtl-web
11890 Dump after live range splitting.
11892 @item -fdump-rtl-regclass
11893 @itemx -fdump-rtl-subregs_of_mode_init
11894 @itemx -fdump-rtl-subregs_of_mode_finish
11895 @itemx -fdump-rtl-dfinit
11896 @itemx -fdump-rtl-dfinish
11897 @opindex fdump-rtl-regclass
11898 @opindex fdump-rtl-subregs_of_mode_init
11899 @opindex fdump-rtl-subregs_of_mode_finish
11900 @opindex fdump-rtl-dfinit
11901 @opindex fdump-rtl-dfinish
11902 These dumps are defined but always produce empty files.
11904 @item -da
11905 @itemx -fdump-rtl-all
11906 @opindex da
11907 @opindex fdump-rtl-all
11908 Produce all the dumps listed above.
11910 @item -dA
11911 @opindex dA
11912 Annotate the assembler output with miscellaneous debugging information.
11914 @item -dD
11915 @opindex dD
11916 Dump all macro definitions, at the end of preprocessing, in addition to
11917 normal output.
11919 @item -dH
11920 @opindex dH
11921 Produce a core dump whenever an error occurs.
11923 @item -dp
11924 @opindex dp
11925 Annotate the assembler output with a comment indicating which
11926 pattern and alternative is used.  The length of each instruction is
11927 also printed.
11929 @item -dP
11930 @opindex dP
11931 Dump the RTL in the assembler output as a comment before each instruction.
11932 Also turns on @option{-dp} annotation.
11934 @item -dx
11935 @opindex dx
11936 Just generate RTL for a function instead of compiling it.  Usually used
11937 with @option{-fdump-rtl-expand}.
11938 @end table
11940 @item -fdump-noaddr
11941 @opindex fdump-noaddr
11942 When doing debugging dumps, suppress address output.  This makes it more
11943 feasible to use diff on debugging dumps for compiler invocations with
11944 different compiler binaries and/or different
11945 text / bss / data / heap / stack / dso start locations.
11947 @item -freport-bug
11948 @opindex freport-bug
11949 Collect and dump debug information into a temporary file if an
11950 internal compiler error (ICE) occurs.
11952 @item -fdump-unnumbered
11953 @opindex fdump-unnumbered
11954 When doing debugging dumps, suppress instruction numbers and address output.
11955 This makes it more feasible to use diff on debugging dumps for compiler
11956 invocations with different options, in particular with and without
11957 @option{-g}.
11959 @item -fdump-unnumbered-links
11960 @opindex fdump-unnumbered-links
11961 When doing debugging dumps (see @option{-d} option above), suppress
11962 instruction numbers for the links to the previous and next instructions
11963 in a sequence.
11965 @item -fdump-translation-unit @r{(C++ only)}
11966 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
11967 @opindex fdump-translation-unit
11968 Dump a representation of the tree structure for the entire translation
11969 unit to a file.  The file name is made by appending @file{.tu} to the
11970 source file name, and the file is created in the same directory as the
11971 output file.  If the @samp{-@var{options}} form is used, @var{options}
11972 controls the details of the dump as described for the
11973 @option{-fdump-tree} options.
11975 @item -fdump-class-hierarchy @r{(C++ only)}
11976 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
11977 @opindex fdump-class-hierarchy
11978 Dump a representation of each class's hierarchy and virtual function
11979 table layout to a file.  The file name is made by appending
11980 @file{.class} to the source file name, and the file is created in the
11981 same directory as the output file.  If the @samp{-@var{options}} form
11982 is used, @var{options} controls the details of the dump as described
11983 for the @option{-fdump-tree} options.
11985 @item -fdump-ipa-@var{switch}
11986 @opindex fdump-ipa
11987 Control the dumping at various stages of inter-procedural analysis
11988 language tree to a file.  The file name is generated by appending a
11989 switch specific suffix to the source file name, and the file is created
11990 in the same directory as the output file.  The following dumps are
11991 possible:
11993 @table @samp
11994 @item all
11995 Enables all inter-procedural analysis dumps.
11997 @item cgraph
11998 Dumps information about call-graph optimization, unused function removal,
11999 and inlining decisions.
12001 @item inline
12002 Dump after function inlining.
12004 @end table
12006 @item -fdump-passes
12007 @opindex fdump-passes
12008 Dump the list of optimization passes that are turned on and off by
12009 the current command-line options.
12011 @item -fdump-statistics-@var{option}
12012 @opindex fdump-statistics
12013 Enable and control dumping of pass statistics in a separate file.  The
12014 file name is generated by appending a suffix ending in
12015 @samp{.statistics} to the source file name, and the file is created in
12016 the same directory as the output file.  If the @samp{-@var{option}}
12017 form is used, @samp{-stats} causes counters to be summed over the
12018 whole compilation unit while @samp{-details} dumps every event as
12019 the passes generate them.  The default with no option is to sum
12020 counters for each function compiled.
12022 @item -fdump-tree-@var{switch}
12023 @itemx -fdump-tree-@var{switch}-@var{options}
12024 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
12025 @opindex fdump-tree
12026 Control the dumping at various stages of processing the intermediate
12027 language tree to a file.  The file name is generated by appending a
12028 switch-specific suffix to the source file name, and the file is
12029 created in the same directory as the output file. In case of
12030 @option{=@var{filename}} option, the dump is output on the given file
12031 instead of the auto named dump files.  If the @samp{-@var{options}}
12032 form is used, @var{options} is a list of @samp{-} separated options
12033 which control the details of the dump.  Not all options are applicable
12034 to all dumps; those that are not meaningful are ignored.  The
12035 following options are available
12037 @table @samp
12038 @item address
12039 Print the address of each node.  Usually this is not meaningful as it
12040 changes according to the environment and source file.  Its primary use
12041 is for tying up a dump file with a debug environment.
12042 @item asmname
12043 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
12044 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
12045 use working backward from mangled names in the assembly file.
12046 @item slim
12047 When dumping front-end intermediate representations, inhibit dumping
12048 of members of a scope or body of a function merely because that scope
12049 has been reached.  Only dump such items when they are directly reachable
12050 by some other path.
12052 When dumping pretty-printed trees, this option inhibits dumping the
12053 bodies of control structures.
12055 When dumping RTL, print the RTL in slim (condensed) form instead of
12056 the default LISP-like representation.
12057 @item raw
12058 Print a raw representation of the tree.  By default, trees are
12059 pretty-printed into a C-like representation.
12060 @item details
12061 Enable more detailed dumps (not honored by every dump option). Also
12062 include information from the optimization passes.
12063 @item stats
12064 Enable dumping various statistics about the pass (not honored by every dump
12065 option).
12066 @item blocks
12067 Enable showing basic block boundaries (disabled in raw dumps).
12068 @item graph
12069 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
12070 dump a representation of the control flow graph suitable for viewing with
12071 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
12072 the file is pretty-printed as a subgraph, so that GraphViz can render them
12073 all in a single plot.
12075 This option currently only works for RTL dumps, and the RTL is always
12076 dumped in slim form.
12077 @item vops
12078 Enable showing virtual operands for every statement.
12079 @item lineno
12080 Enable showing line numbers for statements.
12081 @item uid
12082 Enable showing the unique ID (@code{DECL_UID}) for each variable.
12083 @item verbose
12084 Enable showing the tree dump for each statement.
12085 @item eh
12086 Enable showing the EH region number holding each statement.
12087 @item scev
12088 Enable showing scalar evolution analysis details.
12089 @item optimized
12090 Enable showing optimization information (only available in certain
12091 passes).
12092 @item missed
12093 Enable showing missed optimization information (only available in certain
12094 passes).
12095 @item note
12096 Enable other detailed optimization information (only available in
12097 certain passes).
12098 @item =@var{filename}
12099 Instead of an auto named dump file, output into the given file
12100 name. The file names @file{stdout} and @file{stderr} are treated
12101 specially and are considered already open standard streams. For
12102 example,
12104 @smallexample
12105 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
12106      -fdump-tree-pre=stderr file.c
12107 @end smallexample
12109 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
12110 output on to @file{stderr}. If two conflicting dump filenames are
12111 given for the same pass, then the latter option overrides the earlier
12112 one.
12114 @item split-paths
12115 @opindex fdump-tree-split-paths
12116 Dump each function after splitting paths to loop backedges.  The file
12117 name is made by appending @file{.split-paths} to the source file name.
12119 @item all
12120 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
12121 and @option{lineno}.
12123 @item optall
12124 Turn on all optimization options, i.e., @option{optimized},
12125 @option{missed}, and @option{note}.
12126 @end table
12128 The following tree dumps are possible:
12129 @table @samp
12131 @item original
12132 @opindex fdump-tree-original
12133 Dump before any tree based optimization, to @file{@var{file}.original}.
12135 @item optimized
12136 @opindex fdump-tree-optimized
12137 Dump after all tree based optimization, to @file{@var{file}.optimized}.
12139 @item gimple
12140 @opindex fdump-tree-gimple
12141 Dump each function before and after the gimplification pass to a file.  The
12142 file name is made by appending @file{.gimple} to the source file name.
12144 @item cfg
12145 @opindex fdump-tree-cfg
12146 Dump the control flow graph of each function to a file.  The file name is
12147 made by appending @file{.cfg} to the source file name.
12149 @item ch
12150 @opindex fdump-tree-ch
12151 Dump each function after copying loop headers.  The file name is made by
12152 appending @file{.ch} to the source file name.
12154 @item ssa
12155 @opindex fdump-tree-ssa
12156 Dump SSA related information to a file.  The file name is made by appending
12157 @file{.ssa} to the source file name.
12159 @item alias
12160 @opindex fdump-tree-alias
12161 Dump aliasing information for each function.  The file name is made by
12162 appending @file{.alias} to the source file name.
12164 @item ccp
12165 @opindex fdump-tree-ccp
12166 Dump each function after CCP@.  The file name is made by appending
12167 @file{.ccp} to the source file name.
12169 @item storeccp
12170 @opindex fdump-tree-storeccp
12171 Dump each function after STORE-CCP@.  The file name is made by appending
12172 @file{.storeccp} to the source file name.
12174 @item pre
12175 @opindex fdump-tree-pre
12176 Dump trees after partial redundancy elimination.  The file name is made
12177 by appending @file{.pre} to the source file name.
12179 @item fre
12180 @opindex fdump-tree-fre
12181 Dump trees after full redundancy elimination.  The file name is made
12182 by appending @file{.fre} to the source file name.
12184 @item copyprop
12185 @opindex fdump-tree-copyprop
12186 Dump trees after copy propagation.  The file name is made
12187 by appending @file{.copyprop} to the source file name.
12189 @item store_copyprop
12190 @opindex fdump-tree-store_copyprop
12191 Dump trees after store copy-propagation.  The file name is made
12192 by appending @file{.store_copyprop} to the source file name.
12194 @item dce
12195 @opindex fdump-tree-dce
12196 Dump each function after dead code elimination.  The file name is made by
12197 appending @file{.dce} to the source file name.
12199 @item sra
12200 @opindex fdump-tree-sra
12201 Dump each function after performing scalar replacement of aggregates.  The
12202 file name is made by appending @file{.sra} to the source file name.
12204 @item sink
12205 @opindex fdump-tree-sink
12206 Dump each function after performing code sinking.  The file name is made
12207 by appending @file{.sink} to the source file name.
12209 @item dom
12210 @opindex fdump-tree-dom
12211 Dump each function after applying dominator tree optimizations.  The file
12212 name is made by appending @file{.dom} to the source file name.
12214 @item dse
12215 @opindex fdump-tree-dse
12216 Dump each function after applying dead store elimination.  The file
12217 name is made by appending @file{.dse} to the source file name.
12219 @item phiopt
12220 @opindex fdump-tree-phiopt
12221 Dump each function after optimizing PHI nodes into straightline code.  The file
12222 name is made by appending @file{.phiopt} to the source file name.
12224 @item backprop
12225 @opindex fdump-tree-backprop
12226 Dump each function after back-propagating use information up the definition
12227 chain.  The file name is made by appending @file{.backprop} to the
12228 source file name.
12230 @item forwprop
12231 @opindex fdump-tree-forwprop
12232 Dump each function after forward propagating single use variables.  The file
12233 name is made by appending @file{.forwprop} to the source file name.
12235 @item nrv
12236 @opindex fdump-tree-nrv
12237 Dump each function after applying the named return value optimization on
12238 generic trees.  The file name is made by appending @file{.nrv} to the source
12239 file name.
12241 @item vect
12242 @opindex fdump-tree-vect
12243 Dump each function after applying vectorization of loops.  The file name is
12244 made by appending @file{.vect} to the source file name.
12246 @item slp
12247 @opindex fdump-tree-slp
12248 Dump each function after applying vectorization of basic blocks.  The file name
12249 is made by appending @file{.slp} to the source file name.
12251 @item vrp
12252 @opindex fdump-tree-vrp
12253 Dump each function after Value Range Propagation (VRP).  The file name
12254 is made by appending @file{.vrp} to the source file name.
12256 @item oaccdevlow
12257 @opindex fdump-tree-oaccdevlow
12258 Dump each function after applying device-specific OpenACC transformations.
12259 The file name is made by appending @file{.oaccdevlow} to the source file name.
12261 @item all
12262 @opindex fdump-tree-all
12263 Enable all the available tree dumps with the flags provided in this option.
12264 @end table
12266 @item -fopt-info
12267 @itemx -fopt-info-@var{options}
12268 @itemx -fopt-info-@var{options}=@var{filename}
12269 @opindex fopt-info
12270 Controls optimization dumps from various optimization passes. If the
12271 @samp{-@var{options}} form is used, @var{options} is a list of
12272 @samp{-} separated option keywords to select the dump details and
12273 optimizations.  
12275 The @var{options} can be divided into two groups: options describing the
12276 verbosity of the dump, and options describing which optimizations
12277 should be included. The options from both the groups can be freely
12278 mixed as they are non-overlapping. However, in case of any conflicts,
12279 the later options override the earlier options on the command
12280 line. 
12282 The following options control the dump verbosity:
12284 @table @samp
12285 @item optimized
12286 Print information when an optimization is successfully applied. It is
12287 up to a pass to decide which information is relevant. For example, the
12288 vectorizer passes print the source location of loops which are
12289 successfully vectorized.
12290 @item missed
12291 Print information about missed optimizations. Individual passes
12292 control which information to include in the output. 
12293 @item note
12294 Print verbose information about optimizations, such as certain
12295 transformations, more detailed messages about decisions etc.
12296 @item all
12297 Print detailed optimization information. This includes
12298 @samp{optimized}, @samp{missed}, and @samp{note}.
12299 @end table
12301 One or more of the following option keywords can be used to describe a
12302 group of optimizations:
12304 @table @samp
12305 @item ipa
12306 Enable dumps from all interprocedural optimizations.
12307 @item loop
12308 Enable dumps from all loop optimizations.
12309 @item inline
12310 Enable dumps from all inlining optimizations.
12311 @item vec
12312 Enable dumps from all vectorization optimizations.
12313 @item optall
12314 Enable dumps from all optimizations. This is a superset of
12315 the optimization groups listed above.
12316 @end table
12318 If @var{options} is
12319 omitted, it defaults to @samp{optimized-optall}, which means to dump all
12320 info about successful optimizations from all the passes.  
12322 If the @var{filename} is provided, then the dumps from all the
12323 applicable optimizations are concatenated into the @var{filename}.
12324 Otherwise the dump is output onto @file{stderr}. Though multiple
12325 @option{-fopt-info} options are accepted, only one of them can include
12326 a @var{filename}. If other filenames are provided then all but the
12327 first such option are ignored.
12329 Note that the output @var{filename} is overwritten
12330 in case of multiple translation units. If a combined output from
12331 multiple translation units is desired, @file{stderr} should be used
12332 instead.
12334 In the following example, the optimization info is output to
12335 @file{stderr}:
12337 @smallexample
12338 gcc -O3 -fopt-info
12339 @end smallexample
12341 This example:
12342 @smallexample
12343 gcc -O3 -fopt-info-missed=missed.all
12344 @end smallexample
12346 @noindent
12347 outputs missed optimization report from all the passes into
12348 @file{missed.all}, and this one:
12350 @smallexample
12351 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
12352 @end smallexample
12354 @noindent
12355 prints information about missed optimization opportunities from
12356 vectorization passes on @file{stderr}.  
12357 Note that @option{-fopt-info-vec-missed} is equivalent to 
12358 @option{-fopt-info-missed-vec}.
12360 As another example,
12361 @smallexample
12362 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
12363 @end smallexample
12365 @noindent
12366 outputs information about missed optimizations as well as
12367 optimized locations from all the inlining passes into
12368 @file{inline.txt}.
12370 Finally, consider:
12372 @smallexample
12373 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
12374 @end smallexample
12376 @noindent
12377 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
12378 in conflict since only one output file is allowed. In this case, only
12379 the first option takes effect and the subsequent options are
12380 ignored. Thus only @file{vec.miss} is produced which contains
12381 dumps from the vectorizer about missed opportunities.
12383 @item -fsched-verbose=@var{n}
12384 @opindex fsched-verbose
12385 On targets that use instruction scheduling, this option controls the
12386 amount of debugging output the scheduler prints to the dump files.
12388 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
12389 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
12390 For @var{n} greater than one, it also output basic block probabilities,
12391 detailed ready list information and unit/insn info.  For @var{n} greater
12392 than two, it includes RTL at abort point, control-flow and regions info.
12393 And for @var{n} over four, @option{-fsched-verbose} also includes
12394 dependence info.
12398 @item -fenable-@var{kind}-@var{pass}
12399 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
12400 @opindex fdisable-
12401 @opindex fenable-
12403 This is a set of options that are used to explicitly disable/enable
12404 optimization passes.  These options are intended for use for debugging GCC.
12405 Compiler users should use regular options for enabling/disabling
12406 passes instead.
12408 @table @gcctabopt
12410 @item -fdisable-ipa-@var{pass}
12411 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
12412 statically invoked in the compiler multiple times, the pass name should be
12413 appended with a sequential number starting from 1.
12415 @item -fdisable-rtl-@var{pass}
12416 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
12417 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
12418 statically invoked in the compiler multiple times, the pass name should be
12419 appended with a sequential number starting from 1.  @var{range-list} is a 
12420 comma-separated list of function ranges or assembler names.  Each range is a number
12421 pair separated by a colon.  The range is inclusive in both ends.  If the range
12422 is trivial, the number pair can be simplified as a single number.  If the
12423 function's call graph node's @var{uid} falls within one of the specified ranges,
12424 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
12425 function header of a dump file, and the pass names can be dumped by using
12426 option @option{-fdump-passes}.
12428 @item -fdisable-tree-@var{pass}
12429 @itemx -fdisable-tree-@var{pass}=@var{range-list}
12430 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
12431 option arguments.
12433 @item -fenable-ipa-@var{pass}
12434 Enable IPA 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.
12438 @item -fenable-rtl-@var{pass}
12439 @itemx -fenable-rtl-@var{pass}=@var{range-list}
12440 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
12441 description and examples.
12443 @item -fenable-tree-@var{pass}
12444 @itemx -fenable-tree-@var{pass}=@var{range-list}
12445 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
12446 of option arguments.
12448 @end table
12450 Here are some examples showing uses of these options.
12452 @smallexample
12454 # disable ccp1 for all functions
12455    -fdisable-tree-ccp1
12456 # disable complete unroll for function whose cgraph node uid is 1
12457    -fenable-tree-cunroll=1
12458 # disable gcse2 for functions at the following ranges [1,1],
12459 # [300,400], and [400,1000]
12460 # disable gcse2 for functions foo and foo2
12461    -fdisable-rtl-gcse2=foo,foo2
12462 # disable early inlining
12463    -fdisable-tree-einline
12464 # disable ipa inlining
12465    -fdisable-ipa-inline
12466 # enable tree full unroll
12467    -fenable-tree-unroll
12469 @end smallexample
12471 @item -fchecking
12472 @itemx -fchecking=@var{n}
12473 @opindex fchecking
12474 @opindex fno-checking
12475 Enable internal consistency checking.  The default depends on
12476 the compiler configuration.  @option{-fchecking=2} enables further
12477 internal consistency checking that might affect code generation.
12479 @item -frandom-seed=@var{string}
12480 @opindex frandom-seed
12481 This option provides a seed that GCC uses in place of
12482 random numbers in generating certain symbol names
12483 that have to be different in every compiled file.  It is also used to
12484 place unique stamps in coverage data files and the object files that
12485 produce them.  You can use the @option{-frandom-seed} option to produce
12486 reproducibly identical object files.
12488 The @var{string} can either be a number (decimal, octal or hex) or an
12489 arbitrary string (in which case it's converted to a number by
12490 computing CRC32).
12492 The @var{string} should be different for every file you compile.
12494 @item -save-temps
12495 @itemx -save-temps=cwd
12496 @opindex save-temps
12497 Store the usual ``temporary'' intermediate files permanently; place them
12498 in the current directory and name them based on the source file.  Thus,
12499 compiling @file{foo.c} with @option{-c -save-temps} produces files
12500 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
12501 preprocessed @file{foo.i} output file even though the compiler now
12502 normally uses an integrated preprocessor.
12504 When used in combination with the @option{-x} command-line option,
12505 @option{-save-temps} is sensible enough to avoid over writing an
12506 input source file with the same extension as an intermediate file.
12507 The corresponding intermediate file may be obtained by renaming the
12508 source file before using @option{-save-temps}.
12510 If you invoke GCC in parallel, compiling several different source
12511 files that share a common base name in different subdirectories or the
12512 same source file compiled for multiple output destinations, it is
12513 likely that the different parallel compilers will interfere with each
12514 other, and overwrite the temporary files.  For instance:
12516 @smallexample
12517 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
12518 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
12519 @end smallexample
12521 may result in @file{foo.i} and @file{foo.o} being written to
12522 simultaneously by both compilers.
12524 @item -save-temps=obj
12525 @opindex save-temps=obj
12526 Store the usual ``temporary'' intermediate files permanently.  If the
12527 @option{-o} option is used, the temporary files are based on the
12528 object file.  If the @option{-o} option is not used, the
12529 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
12531 For example:
12533 @smallexample
12534 gcc -save-temps=obj -c foo.c
12535 gcc -save-temps=obj -c bar.c -o dir/xbar.o
12536 gcc -save-temps=obj foobar.c -o dir2/yfoobar
12537 @end smallexample
12539 @noindent
12540 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
12541 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
12542 @file{dir2/yfoobar.o}.
12544 @item -time@r{[}=@var{file}@r{]}
12545 @opindex time
12546 Report the CPU time taken by each subprocess in the compilation
12547 sequence.  For C source files, this is the compiler proper and assembler
12548 (plus the linker if linking is done).
12550 Without the specification of an output file, the output looks like this:
12552 @smallexample
12553 # cc1 0.12 0.01
12554 # as 0.00 0.01
12555 @end smallexample
12557 The first number on each line is the ``user time'', that is time spent
12558 executing the program itself.  The second number is ``system time'',
12559 time spent executing operating system routines on behalf of the program.
12560 Both numbers are in seconds.
12562 With the specification of an output file, the output is appended to the
12563 named file, and it looks like this:
12565 @smallexample
12566 0.12 0.01 cc1 @var{options}
12567 0.00 0.01 as @var{options}
12568 @end smallexample
12570 The ``user time'' and the ``system time'' are moved before the program
12571 name, and the options passed to the program are displayed, so that one
12572 can later tell what file was being compiled, and with which options.
12574 @item -fdump-final-insns@r{[}=@var{file}@r{]}
12575 @opindex fdump-final-insns
12576 Dump the final internal representation (RTL) to @var{file}.  If the
12577 optional argument is omitted (or if @var{file} is @code{.}), the name
12578 of the dump file is determined by appending @code{.gkd} to the
12579 compilation output file name.
12581 @item -fcompare-debug@r{[}=@var{opts}@r{]}
12582 @opindex fcompare-debug
12583 @opindex fno-compare-debug
12584 If no error occurs during compilation, run the compiler a second time,
12585 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
12586 passed to the second compilation.  Dump the final internal
12587 representation in both compilations, and print an error if they differ.
12589 If the equal sign is omitted, the default @option{-gtoggle} is used.
12591 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
12592 and nonzero, implicitly enables @option{-fcompare-debug}.  If
12593 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
12594 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
12595 is used.
12597 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
12598 is equivalent to @option{-fno-compare-debug}, which disables the dumping
12599 of the final representation and the second compilation, preventing even
12600 @env{GCC_COMPARE_DEBUG} from taking effect.
12602 To verify full coverage during @option{-fcompare-debug} testing, set
12603 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
12604 which GCC rejects as an invalid option in any actual compilation
12605 (rather than preprocessing, assembly or linking).  To get just a
12606 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
12607 not overridden} will do.
12609 @item -fcompare-debug-second
12610 @opindex fcompare-debug-second
12611 This option is implicitly passed to the compiler for the second
12612 compilation requested by @option{-fcompare-debug}, along with options to
12613 silence warnings, and omitting other options that would cause
12614 side-effect compiler outputs to files or to the standard output.  Dump
12615 files and preserved temporary files are renamed so as to contain the
12616 @code{.gk} additional extension during the second compilation, to avoid
12617 overwriting those generated by the first.
12619 When this option is passed to the compiler driver, it causes the
12620 @emph{first} compilation to be skipped, which makes it useful for little
12621 other than debugging the compiler proper.
12623 @item -gtoggle
12624 @opindex gtoggle
12625 Turn off generation of debug info, if leaving out this option
12626 generates it, or turn it on at level 2 otherwise.  The position of this
12627 argument in the command line does not matter; it takes effect after all
12628 other options are processed, and it does so only once, no matter how
12629 many times it is given.  This is mainly intended to be used with
12630 @option{-fcompare-debug}.
12632 @item -fvar-tracking-assignments-toggle
12633 @opindex fvar-tracking-assignments-toggle
12634 @opindex fno-var-tracking-assignments-toggle
12635 Toggle @option{-fvar-tracking-assignments}, in the same way that
12636 @option{-gtoggle} toggles @option{-g}.
12638 @item -Q
12639 @opindex Q
12640 Makes the compiler print out each function name as it is compiled, and
12641 print some statistics about each pass when it finishes.
12643 @item -ftime-report
12644 @opindex ftime-report
12645 Makes the compiler print some statistics about the time consumed by each
12646 pass when it finishes.
12648 @item -fira-verbose=@var{n}
12649 @opindex fira-verbose
12650 Control the verbosity of the dump file for the integrated register allocator.
12651 The default value is 5.  If the value @var{n} is greater or equal to 10,
12652 the dump output is sent to stderr using the same format as @var{n} minus 10.
12654 @item -flto-report
12655 @opindex flto-report
12656 Prints a report with internal details on the workings of the link-time
12657 optimizer.  The contents of this report vary from version to version.
12658 It is meant to be useful to GCC developers when processing object
12659 files in LTO mode (via @option{-flto}).
12661 Disabled by default.
12663 @item -flto-report-wpa
12664 @opindex flto-report-wpa
12665 Like @option{-flto-report}, but only print for the WPA phase of Link
12666 Time Optimization.
12668 @item -fmem-report
12669 @opindex fmem-report
12670 Makes the compiler print some statistics about permanent memory
12671 allocation when it finishes.
12673 @item -fmem-report-wpa
12674 @opindex fmem-report-wpa
12675 Makes the compiler print some statistics about permanent memory
12676 allocation for the WPA phase only.
12678 @item -fpre-ipa-mem-report
12679 @opindex fpre-ipa-mem-report
12680 @item -fpost-ipa-mem-report
12681 @opindex fpost-ipa-mem-report
12682 Makes the compiler print some statistics about permanent memory
12683 allocation before or after interprocedural optimization.
12685 @item -fprofile-report
12686 @opindex fprofile-report
12687 Makes the compiler print some statistics about consistency of the
12688 (estimated) profile and effect of individual passes.
12690 @item -fstack-usage
12691 @opindex fstack-usage
12692 Makes the compiler output stack usage information for the program, on a
12693 per-function basis.  The filename for the dump is made by appending
12694 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
12695 the output file, if explicitly specified and it is not an executable,
12696 otherwise it is the basename of the source file.  An entry is made up
12697 of three fields:
12699 @itemize
12700 @item
12701 The name of the function.
12702 @item
12703 A number of bytes.
12704 @item
12705 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
12706 @end itemize
12708 The qualifier @code{static} means that the function manipulates the stack
12709 statically: a fixed number of bytes are allocated for the frame on function
12710 entry and released on function exit; no stack adjustments are otherwise made
12711 in the function.  The second field is this fixed number of bytes.
12713 The qualifier @code{dynamic} means that the function manipulates the stack
12714 dynamically: in addition to the static allocation described above, stack
12715 adjustments are made in the body of the function, for example to push/pop
12716 arguments around function calls.  If the qualifier @code{bounded} is also
12717 present, the amount of these adjustments is bounded at compile time and
12718 the second field is an upper bound of the total amount of stack used by
12719 the function.  If it is not present, the amount of these adjustments is
12720 not bounded at compile time and the second field only represents the
12721 bounded part.
12723 @item -fstats
12724 @opindex fstats
12725 Emit statistics about front-end processing at the end of the compilation.
12726 This option is supported only by the C++ front end, and
12727 the information is generally only useful to the G++ development team.
12729 @item -fdbg-cnt-list
12730 @opindex fdbg-cnt-list
12731 Print the name and the counter upper bound for all debug counters.
12734 @item -fdbg-cnt=@var{counter-value-list}
12735 @opindex fdbg-cnt
12736 Set the internal debug counter upper bound.  @var{counter-value-list}
12737 is a comma-separated list of @var{name}:@var{value} pairs
12738 which sets the upper bound of each debug counter @var{name} to @var{value}.
12739 All debug counters have the initial upper bound of @code{UINT_MAX};
12740 thus @code{dbg_cnt} returns true always unless the upper bound
12741 is set by this option.
12742 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
12743 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
12745 @item -print-file-name=@var{library}
12746 @opindex print-file-name
12747 Print the full absolute name of the library file @var{library} that
12748 would be used when linking---and don't do anything else.  With this
12749 option, GCC does not compile or link anything; it just prints the
12750 file name.
12752 @item -print-multi-directory
12753 @opindex print-multi-directory
12754 Print the directory name corresponding to the multilib selected by any
12755 other switches present in the command line.  This directory is supposed
12756 to exist in @env{GCC_EXEC_PREFIX}.
12758 @item -print-multi-lib
12759 @opindex print-multi-lib
12760 Print the mapping from multilib directory names to compiler switches
12761 that enable them.  The directory name is separated from the switches by
12762 @samp{;}, and each switch starts with an @samp{@@} instead of the
12763 @samp{-}, without spaces between multiple switches.  This is supposed to
12764 ease shell processing.
12766 @item -print-multi-os-directory
12767 @opindex print-multi-os-directory
12768 Print the path to OS libraries for the selected
12769 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
12770 present in the @file{lib} subdirectory and no multilibs are used, this is
12771 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
12772 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
12773 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
12774 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
12776 @item -print-multiarch
12777 @opindex print-multiarch
12778 Print the path to OS libraries for the selected multiarch,
12779 relative to some @file{lib} subdirectory.
12781 @item -print-prog-name=@var{program}
12782 @opindex print-prog-name
12783 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
12785 @item -print-libgcc-file-name
12786 @opindex print-libgcc-file-name
12787 Same as @option{-print-file-name=libgcc.a}.
12789 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
12790 but you do want to link with @file{libgcc.a}.  You can do:
12792 @smallexample
12793 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
12794 @end smallexample
12796 @item -print-search-dirs
12797 @opindex print-search-dirs
12798 Print the name of the configured installation directory and a list of
12799 program and library directories @command{gcc} searches---and don't do anything else.
12801 This is useful when @command{gcc} prints the error message
12802 @samp{installation problem, cannot exec cpp0: No such file or directory}.
12803 To resolve this you either need to put @file{cpp0} and the other compiler
12804 components where @command{gcc} expects to find them, or you can set the environment
12805 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
12806 Don't forget the trailing @samp{/}.
12807 @xref{Environment Variables}.
12809 @item -print-sysroot
12810 @opindex print-sysroot
12811 Print the target sysroot directory that is used during
12812 compilation.  This is the target sysroot specified either at configure
12813 time or using the @option{--sysroot} option, possibly with an extra
12814 suffix that depends on compilation options.  If no target sysroot is
12815 specified, the option prints nothing.
12817 @item -print-sysroot-headers-suffix
12818 @opindex print-sysroot-headers-suffix
12819 Print the suffix added to the target sysroot when searching for
12820 headers, or give an error if the compiler is not configured with such
12821 a suffix---and don't do anything else.
12823 @item -dumpmachine
12824 @opindex dumpmachine
12825 Print the compiler's target machine (for example,
12826 @samp{i686-pc-linux-gnu})---and don't do anything else.
12828 @item -dumpversion
12829 @opindex dumpversion
12830 Print the compiler version (for example, @code{3.0})---and don't do
12831 anything else.
12833 @item -dumpspecs
12834 @opindex dumpspecs
12835 Print the compiler's built-in specs---and don't do anything else.  (This
12836 is used when GCC itself is being built.)  @xref{Spec Files}.
12837 @end table
12839 @node Submodel Options
12840 @section Machine-Dependent Options
12841 @cindex submodel options
12842 @cindex specifying hardware config
12843 @cindex hardware models and configurations, specifying
12844 @cindex target-dependent options
12845 @cindex machine-dependent options
12847 Each target machine supported by GCC can have its own options---for
12848 example, to allow you to compile for a particular processor variant or
12849 ABI, or to control optimizations specific to that machine.  By
12850 convention, the names of machine-specific options start with
12851 @samp{-m}.
12853 Some configurations of the compiler also support additional target-specific
12854 options, usually for compatibility with other compilers on the same
12855 platform.
12857 @c This list is ordered alphanumerically by subsection name.
12858 @c It should be the same order and spelling as these options are listed
12859 @c in Machine Dependent Options
12861 @menu
12862 * AArch64 Options::
12863 * Adapteva Epiphany Options::
12864 * ARC Options::
12865 * ARM Options::
12866 * AVR Options::
12867 * Blackfin Options::
12868 * C6X Options::
12869 * CRIS Options::
12870 * CR16 Options::
12871 * Darwin Options::
12872 * DEC Alpha Options::
12873 * FR30 Options::
12874 * FT32 Options::
12875 * FRV Options::
12876 * GNU/Linux Options::
12877 * H8/300 Options::
12878 * HPPA Options::
12879 * IA-64 Options::
12880 * LM32 Options::
12881 * M32C Options::
12882 * M32R/D Options::
12883 * M680x0 Options::
12884 * MCore Options::
12885 * MeP Options::
12886 * MicroBlaze Options::
12887 * MIPS Options::
12888 * MMIX Options::
12889 * MN10300 Options::
12890 * Moxie Options::
12891 * MSP430 Options::
12892 * NDS32 Options::
12893 * Nios II Options::
12894 * Nvidia PTX Options::
12895 * PDP-11 Options::
12896 * picoChip Options::
12897 * PowerPC Options::
12898 * RL78 Options::
12899 * RS/6000 and PowerPC Options::
12900 * RX Options::
12901 * S/390 and zSeries Options::
12902 * Score Options::
12903 * SH Options::
12904 * Solaris 2 Options::
12905 * SPARC Options::
12906 * SPU Options::
12907 * System V Options::
12908 * TILE-Gx Options::
12909 * TILEPro Options::
12910 * V850 Options::
12911 * VAX Options::
12912 * Visium Options::
12913 * VMS Options::
12914 * VxWorks Options::
12915 * x86 Options::
12916 * x86 Windows Options::
12917 * Xstormy16 Options::
12918 * Xtensa Options::
12919 * zSeries Options::
12920 @end menu
12922 @node AArch64 Options
12923 @subsection AArch64 Options
12924 @cindex AArch64 Options
12926 These options are defined for AArch64 implementations:
12928 @table @gcctabopt
12930 @item -mabi=@var{name}
12931 @opindex mabi
12932 Generate code for the specified data model.  Permissible values
12933 are @samp{ilp32} for SysV-like data model where int, long int and pointers
12934 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
12935 but long int and pointers are 64 bits.
12937 The default depends on the specific target configuration.  Note that
12938 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
12939 entire program with the same ABI, and link with a compatible set of libraries.
12941 @item -mbig-endian
12942 @opindex mbig-endian
12943 Generate big-endian code.  This is the default when GCC is configured for an
12944 @samp{aarch64_be-*-*} target.
12946 @item -mgeneral-regs-only
12947 @opindex mgeneral-regs-only
12948 Generate code which uses only the general-purpose registers.  This will prevent
12949 the compiler from using floating-point and Advanced SIMD registers but will not
12950 impose any restrictions on the assembler.
12952 @item -mlittle-endian
12953 @opindex mlittle-endian
12954 Generate little-endian code.  This is the default when GCC is configured for an
12955 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
12957 @item -mcmodel=tiny
12958 @opindex mcmodel=tiny
12959 Generate code for the tiny code model.  The program and its statically defined
12960 symbols must be within 1MB of each other.  Programs can be statically or
12961 dynamically linked.
12963 @item -mcmodel=small
12964 @opindex mcmodel=small
12965 Generate code for the small code model.  The program and its statically defined
12966 symbols must be within 4GB of each other.  Programs can be statically or
12967 dynamically linked.  This is the default code model.
12969 @item -mcmodel=large
12970 @opindex mcmodel=large
12971 Generate code for the large code model.  This makes no assumptions about
12972 addresses and sizes of sections.  Programs can be statically linked only.
12974 @item -mstrict-align
12975 @opindex mstrict-align
12976 Avoid generating memory accesses that may not be aligned on a natural object
12977 boundary as described in the architecture specification.
12979 @item -momit-leaf-frame-pointer
12980 @itemx -mno-omit-leaf-frame-pointer
12981 @opindex momit-leaf-frame-pointer
12982 @opindex mno-omit-leaf-frame-pointer
12983 Omit or keep the frame pointer in leaf functions.  The former behavior is the
12984 default.
12986 @item -mtls-dialect=desc
12987 @opindex mtls-dialect=desc
12988 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
12989 of TLS variables.  This is the default.
12991 @item -mtls-dialect=traditional
12992 @opindex mtls-dialect=traditional
12993 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
12994 of TLS variables.
12996 @item -mtls-size=@var{size}
12997 @opindex mtls-size
12998 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
12999 This option requires binutils 2.26 or newer.
13001 @item -mfix-cortex-a53-835769
13002 @itemx -mno-fix-cortex-a53-835769
13003 @opindex mfix-cortex-a53-835769
13004 @opindex mno-fix-cortex-a53-835769
13005 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
13006 This involves inserting a NOP instruction between memory instructions and
13007 64-bit integer multiply-accumulate instructions.
13009 @item -mfix-cortex-a53-843419
13010 @itemx -mno-fix-cortex-a53-843419
13011 @opindex mfix-cortex-a53-843419
13012 @opindex mno-fix-cortex-a53-843419
13013 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
13014 This erratum workaround is made at link time and this will only pass the
13015 corresponding flag to the linker.
13017 @item -mlow-precision-recip-sqrt
13018 @item -mno-low-precision-recip-sqrt
13019 @opindex mlow-precision-recip-sqrt
13020 @opindex mno-low-precision-recip-sqrt
13021 Enable or disable reciprocal square root approximation.
13022 This option only has an effect if @option{-ffast-math} or
13023 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
13024 precision of reciprocal square root results to about 16 bits for
13025 single precision and to 32 bits for double precision.
13027 @item -march=@var{name}
13028 @opindex march
13029 Specify the name of the target architecture and, optionally, one or
13030 more feature modifiers.  This option has the form
13031 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
13033 The permissible values for @var{arch} are @samp{armv8-a},
13034 @samp{armv8.1-a} or @var{native}.
13036 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
13037 support for the ARMv8.1 architecture extension.  In particular, it
13038 enables the @samp{+crc} and @samp{+lse} features.
13040 The value @samp{native} is available on native AArch64 GNU/Linux and
13041 causes the compiler to pick the architecture of the host system.  This
13042 option has no effect if the compiler is unable to recognize the
13043 architecture of the host system,
13045 The permissible values for @var{feature} are listed in the sub-section
13046 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13047 Feature Modifiers}.  Where conflicting feature modifiers are
13048 specified, the right-most feature is used.
13050 GCC uses @var{name} to determine what kind of instructions it can emit
13051 when generating assembly code.  If @option{-march} is specified
13052 without either of @option{-mtune} or @option{-mcpu} also being
13053 specified, the code is tuned to perform well across a range of target
13054 processors implementing the target architecture.
13056 @item -mtune=@var{name}
13057 @opindex mtune
13058 Specify the name of the target processor for which GCC should tune the
13059 performance of the code.  Permissible values for this option are:
13060 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
13061 @samp{cortex-a72}, @samp{exynos-m1}, @samp{qdf24xx}, @samp{thunderx},
13062 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
13063 @samp{native}.
13065 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}
13066 specify that GCC should tune for a big.LITTLE system.
13068 Additionally on native AArch64 GNU/Linux systems the value
13069 @samp{native} tunes performance to the host system.  This option has no effect
13070 if the compiler is unable to recognize the processor of the host system.
13072 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
13073 are specified, the code is tuned to perform well across a range
13074 of target processors.
13076 This option cannot be suffixed by feature modifiers.
13078 @item -mcpu=@var{name}
13079 @opindex mcpu
13080 Specify the name of the target processor, optionally suffixed by one
13081 or more feature modifiers.  This option has the form
13082 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
13083 the permissible values for @var{cpu} are the same as those available
13084 for @option{-mtune}.  The permissible values for @var{feature} are
13085 documented in the sub-section on
13086 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13087 Feature Modifiers}.  Where conflicting feature modifiers are
13088 specified, the right-most feature is used.
13090 GCC uses @var{name} to determine what kind of instructions it can emit when
13091 generating assembly code (as if by @option{-march}) and to determine
13092 the target processor for which to tune for performance (as if
13093 by @option{-mtune}).  Where this option is used in conjunction
13094 with @option{-march} or @option{-mtune}, those options take precedence
13095 over the appropriate part of this option.
13097 @item -moverride=@var{string}
13098 @opindex moverride
13099 Override tuning decisions made by the back-end in response to a
13100 @option{-mtune=} switch.  The syntax, semantics, and accepted values
13101 for @var{string} in this option are not guaranteed to be consistent
13102 across releases.
13104 This option is only intended to be useful when developing GCC.
13106 @item -mpc-relative-literal-loads
13107 @opindex mpc-relative-literal-loads
13108 Enable PC-relative literal loads.  With this option literal pools are
13109 accessed using a single instruction and emitted after each function.  This
13110 limits the maximum size of functions to 1MB.  This is enabled by default for
13111 @option{-mcmodel=tiny}.
13113 @end table
13115 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
13116 @anchor{aarch64-feature-modifiers}
13117 @cindex @option{-march} feature modifiers
13118 @cindex @option{-mcpu} feature modifiers
13119 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
13120 the following and their inverses @option{no@var{feature}}:
13122 @table @samp
13123 @item crc
13124 Enable CRC extension.  This is on by default for
13125 @option{-march=armv8.1-a}.
13126 @item crypto
13127 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
13128 instructions.
13129 @item fp
13130 Enable floating-point instructions.  This is on by default for all possible
13131 values for options @option{-march} and @option{-mcpu}.
13132 @item simd
13133 Enable Advanced SIMD instructions.  This also enables floating-point
13134 instructions.  This is on by default for all possible values for options
13135 @option{-march} and @option{-mcpu}.
13136 @item lse
13137 Enable Large System Extension instructions.  This is on by default for
13138 @option{-march=armv8.1-a}.
13140 @end table
13142 Feature @option{crypto} implies @option{simd}, which implies @option{fp}.
13143 Conversely, @option{nofp} implies @option{nosimd}, which implies
13144 @option{nocrypto}.
13146 @node Adapteva Epiphany Options
13147 @subsection Adapteva Epiphany Options
13149 These @samp{-m} options are defined for Adapteva Epiphany:
13151 @table @gcctabopt
13152 @item -mhalf-reg-file
13153 @opindex mhalf-reg-file
13154 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
13155 That allows code to run on hardware variants that lack these registers.
13157 @item -mprefer-short-insn-regs
13158 @opindex mprefer-short-insn-regs
13159 Preferentially allocate registers that allow short instruction generation.
13160 This can result in increased instruction count, so this may either reduce or
13161 increase overall code size.
13163 @item -mbranch-cost=@var{num}
13164 @opindex mbranch-cost
13165 Set the cost of branches to roughly @var{num} ``simple'' instructions.
13166 This cost is only a heuristic and is not guaranteed to produce
13167 consistent results across releases.
13169 @item -mcmove
13170 @opindex mcmove
13171 Enable the generation of conditional moves.
13173 @item -mnops=@var{num}
13174 @opindex mnops
13175 Emit @var{num} NOPs before every other generated instruction.
13177 @item -mno-soft-cmpsf
13178 @opindex mno-soft-cmpsf
13179 For single-precision floating-point comparisons, emit an @code{fsub} instruction
13180 and test the flags.  This is faster than a software comparison, but can
13181 get incorrect results in the presence of NaNs, or when two different small
13182 numbers are compared such that their difference is calculated as zero.
13183 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
13184 software comparisons.
13186 @item -mstack-offset=@var{num}
13187 @opindex mstack-offset
13188 Set the offset between the top of the stack and the stack pointer.
13189 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
13190 can be used by leaf functions without stack allocation.
13191 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
13192 Note also that this option changes the ABI; compiling a program with a
13193 different stack offset than the libraries have been compiled with
13194 generally does not work.
13195 This option can be useful if you want to evaluate if a different stack
13196 offset would give you better code, but to actually use a different stack
13197 offset to build working programs, it is recommended to configure the
13198 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
13200 @item -mno-round-nearest
13201 @opindex mno-round-nearest
13202 Make the scheduler assume that the rounding mode has been set to
13203 truncating.  The default is @option{-mround-nearest}.
13205 @item -mlong-calls
13206 @opindex mlong-calls
13207 If not otherwise specified by an attribute, assume all calls might be beyond
13208 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
13209 function address into a register before performing a (otherwise direct) call.
13210 This is the default.
13212 @item -mshort-calls
13213 @opindex short-calls
13214 If not otherwise specified by an attribute, assume all direct calls are
13215 in the range of the @code{b} / @code{bl} instructions, so use these instructions
13216 for direct calls.  The default is @option{-mlong-calls}.
13218 @item -msmall16
13219 @opindex msmall16
13220 Assume addresses can be loaded as 16-bit unsigned values.  This does not
13221 apply to function addresses for which @option{-mlong-calls} semantics
13222 are in effect.
13224 @item -mfp-mode=@var{mode}
13225 @opindex mfp-mode
13226 Set the prevailing mode of the floating-point unit.
13227 This determines the floating-point mode that is provided and expected
13228 at function call and return time.  Making this mode match the mode you
13229 predominantly need at function start can make your programs smaller and
13230 faster by avoiding unnecessary mode switches.
13232 @var{mode} can be set to one the following values:
13234 @table @samp
13235 @item caller
13236 Any mode at function entry is valid, and retained or restored when
13237 the function returns, and when it calls other functions.
13238 This mode is useful for compiling libraries or other compilation units
13239 you might want to incorporate into different programs with different
13240 prevailing FPU modes, and the convenience of being able to use a single
13241 object file outweighs the size and speed overhead for any extra
13242 mode switching that might be needed, compared with what would be needed
13243 with a more specific choice of prevailing FPU mode.
13245 @item truncate
13246 This is the mode used for floating-point calculations with
13247 truncating (i.e.@: round towards zero) rounding mode.  That includes
13248 conversion from floating point to integer.
13250 @item round-nearest
13251 This is the mode used for floating-point calculations with
13252 round-to-nearest-or-even rounding mode.
13254 @item int
13255 This is the mode used to perform integer calculations in the FPU, e.g.@:
13256 integer multiply, or integer multiply-and-accumulate.
13257 @end table
13259 The default is @option{-mfp-mode=caller}
13261 @item -mnosplit-lohi
13262 @itemx -mno-postinc
13263 @itemx -mno-postmodify
13264 @opindex mnosplit-lohi
13265 @opindex mno-postinc
13266 @opindex mno-postmodify
13267 Code generation tweaks that disable, respectively, splitting of 32-bit
13268 loads, generation of post-increment addresses, and generation of
13269 post-modify addresses.  The defaults are @option{msplit-lohi},
13270 @option{-mpost-inc}, and @option{-mpost-modify}.
13272 @item -mnovect-double
13273 @opindex mno-vect-double
13274 Change the preferred SIMD mode to SImode.  The default is
13275 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
13277 @item -max-vect-align=@var{num}
13278 @opindex max-vect-align
13279 The maximum alignment for SIMD vector mode types.
13280 @var{num} may be 4 or 8.  The default is 8.
13281 Note that this is an ABI change, even though many library function
13282 interfaces are unaffected if they don't use SIMD vector modes
13283 in places that affect size and/or alignment of relevant types.
13285 @item -msplit-vecmove-early
13286 @opindex msplit-vecmove-early
13287 Split vector moves into single word moves before reload.  In theory this
13288 can give better register allocation, but so far the reverse seems to be
13289 generally the case.
13291 @item -m1reg-@var{reg}
13292 @opindex m1reg-
13293 Specify a register to hold the constant @minus{}1, which makes loading small negative
13294 constants and certain bitmasks faster.
13295 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
13296 which specify use of that register as a fixed register,
13297 and @samp{none}, which means that no register is used for this
13298 purpose.  The default is @option{-m1reg-none}.
13300 @end table
13302 @node ARC Options
13303 @subsection ARC Options
13304 @cindex ARC options
13306 The following options control the architecture variant for which code
13307 is being compiled:
13309 @c architecture variants
13310 @table @gcctabopt
13312 @item -mbarrel-shifter
13313 @opindex mbarrel-shifter
13314 Generate instructions supported by barrel shifter.  This is the default
13315 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
13317 @item -mcpu=@var{cpu}
13318 @opindex mcpu
13319 Set architecture type, register usage, and instruction scheduling
13320 parameters for @var{cpu}.  There are also shortcut alias options
13321 available for backward compatibility and convenience.  Supported
13322 values for @var{cpu} are
13324 @table @samp
13325 @opindex mA6
13326 @opindex mARC600
13327 @item ARC600
13328 @item arc600
13329 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
13331 @item ARC601
13332 @item arc601
13333 @opindex mARC601
13334 Compile for ARC601.  Alias: @option{-mARC601}.
13336 @item ARC700
13337 @item arc700
13338 @opindex mA7
13339 @opindex mARC700
13340 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
13341 This is the default when configured with @option{--with-cpu=arc700}@.
13343 @item ARCEM
13344 @item arcem
13345 Compile for ARC EM.
13347 @item ARCHS
13348 @item archs
13349 Compile for ARC HS.
13350 @end table
13352 @item -mdpfp
13353 @opindex mdpfp
13354 @itemx -mdpfp-compact
13355 @opindex mdpfp-compact
13356 FPX: Generate Double Precision FPX instructions, tuned for the compact
13357 implementation.
13359 @item -mdpfp-fast
13360 @opindex mdpfp-fast
13361 FPX: Generate Double Precision FPX instructions, tuned for the fast
13362 implementation.
13364 @item -mno-dpfp-lrsr
13365 @opindex mno-dpfp-lrsr
13366 Disable LR and SR instructions from using FPX extension aux registers.
13368 @item -mea
13369 @opindex mea
13370 Generate Extended arithmetic instructions.  Currently only
13371 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
13372 supported.  This is always enabled for @option{-mcpu=ARC700}.
13374 @item -mno-mpy
13375 @opindex mno-mpy
13376 Do not generate mpy instructions for ARC700.
13378 @item -mmul32x16
13379 @opindex mmul32x16
13380 Generate 32x16 bit multiply and mac instructions.
13382 @item -mmul64
13383 @opindex mmul64
13384 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
13386 @item -mnorm
13387 @opindex mnorm
13388 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
13389 is in effect.
13391 @item -mspfp
13392 @opindex mspfp
13393 @itemx -mspfp-compact
13394 @opindex mspfp-compact
13395 FPX: Generate Single Precision FPX instructions, tuned for the compact
13396 implementation.
13398 @item -mspfp-fast
13399 @opindex mspfp-fast
13400 FPX: Generate Single Precision FPX instructions, tuned for the fast
13401 implementation.
13403 @item -msimd
13404 @opindex msimd
13405 Enable generation of ARC SIMD instructions via target-specific
13406 builtins.  Only valid for @option{-mcpu=ARC700}.
13408 @item -msoft-float
13409 @opindex msoft-float
13410 This option ignored; it is provided for compatibility purposes only.
13411 Software floating point code is emitted by default, and this default
13412 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
13413 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
13414 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
13416 @item -mswap
13417 @opindex mswap
13418 Generate swap instructions.
13420 @item -matomic
13421 @opindex matomic
13422 This enables Locked Load/Store Conditional extension to implement
13423 atomic memopry built-in functions.  Not available for ARC 6xx or ARC
13424 EM cores.
13426 @item -mdiv-rem
13427 @opindex mdiv-rem
13428 Enable DIV/REM instructions for ARCv2 cores.
13430 @item -mcode-density
13431 @opindex mcode-density
13432 Enable code density instructions for ARC EM, default on for ARC HS.
13434 @item -mll64
13435 @opindex mll64
13436 Enable double load/store operations for ARC HS cores.
13438 @item -mtp-regno=@var{regno}
13439 @opindex mtp-regno
13440 Specify thread pointer register number.
13442 @item -mmpy-option=@var{multo}
13443 @opindex mmpy-option
13444 Compile ARCv2 code with a multiplier design option.  @samp{wlh1} is
13445 the default value.  The recognized values for @var{multo} are:
13447 @table @samp
13448 @item 0
13449 No multiplier available.
13451 @item 1
13452 @opindex w
13453 The multiply option is set to w: 16x16 multiplier, fully pipelined.
13454 The following instructions are enabled: MPYW, and MPYUW.
13456 @item 2
13457 @opindex wlh1
13458 The multiply option is set to wlh1: 32x32 multiplier, fully
13459 pipelined (1 stage).  The following instructions are additionally
13460 enabled: MPY, MPYU, MPYM, MPYMU, and MPY_S.
13462 @item 3
13463 @opindex wlh2
13464 The multiply option is set to wlh2: 32x32 multiplier, fully pipelined
13465 (2 stages).  The following instructions are additionally enabled: MPY,
13466 MPYU, MPYM, MPYMU, and MPY_S.
13468 @item 4
13469 @opindex wlh3
13470 The multiply option is set to wlh3: Two 16x16 multiplier, blocking,
13471 sequential.  The following instructions are additionally enabled: MPY,
13472 MPYU, MPYM, MPYMU, and MPY_S.
13474 @item 5
13475 @opindex wlh4
13476 The multiply option is set to wlh4: One 16x16 multiplier, blocking,
13477 sequential.  The following instructions are additionally enabled: MPY,
13478 MPYU, MPYM, MPYMU, and MPY_S.
13480 @item 6
13481 @opindex wlh5
13482 The multiply option is set to wlh5: One 32x4 multiplier, blocking,
13483 sequential.  The following instructions are additionally enabled: MPY,
13484 MPYU, MPYM, MPYMU, and MPY_S.
13486 @end table
13488 This option is only available for ARCv2 cores@.
13490 @item -mfpu=@var{fpu}
13491 @opindex mfpu
13492 Enables specific floating-point hardware extension for ARCv2
13493 core.  Supported values for @var{fpu} are:
13495 @table @samp
13497 @item fpus
13498 @opindex fpus
13499 Enables support for single precision floating point hardware
13500 extensions@.
13502 @item fpud
13503 @opindex fpud
13504 Enables support for double precision floating point hardware
13505 extensions.  The single precision floating point extension is also
13506 enabled.  Not available for ARC EM@.
13508 @item fpuda
13509 @opindex fpuda
13510 Enables support for double precision floating point hardware
13511 extensions using double precision assist instructions.  The single
13512 precision floating point extension is also enabled.  This option is
13513 only available for ARC EM@.
13515 @item fpuda_div
13516 @opindex fpuda_div
13517 Enables support for double precision floating point hardware
13518 extensions using double precision assist instructions, and simple
13519 precision square-root and divide hardware extensions.  The single
13520 precision floating point extension is also enabled.  This option is
13521 only available for ARC EM@.
13523 @item fpuda_fma
13524 @opindex fpuda_fma
13525 Enables support for double precision floating point hardware
13526 extensions using double precision assist instructions, and simple
13527 precision fused multiple and add hardware extension.  The single
13528 precision floating point extension is also enabled.  This option is
13529 only available for ARC EM@.
13531 @item fpuda_all
13532 @opindex fpuda_all
13533 Enables support for double precision floating point hardware
13534 extensions using double precision assist instructions, and all simple
13535 precision hardware extensions.  The single precision floating point
13536 extension is also enabled.  This option is only available for ARC EM@.
13538 @item fpus_div
13539 @opindex fpus_div
13540 Enables support for single precision floating point, and single
13541 precision square-root and divide hardware extensions@.
13543 @item fpud_div
13544 @opindex fpud_div
13545 Enables support for double precision floating point, and double
13546 precision square-root and divide hardware extensions.  This option
13547 includes option @samp{fpus_div}. Not available for ARC EM@.
13549 @item fpus_fma
13550 @opindex fpus_fma
13551 Enables support for single precision floating point, and single
13552 precision fused multiple and add hardware extensions@.
13554 @item fpud_fma
13555 @opindex fpud_fma
13556 Enables support for double precision floating point, and double
13557 precision fused multiple and add hardware extensions.  This option
13558 includes option @samp{fpus_fma}.  Not available for ARC EM@.
13560 @item fpus_all
13561 @opindex fpus_all
13562 Enables support for all single precision floating point hardware
13563 extensions@.
13565 @item fpud_all
13566 @opindex fpud_all
13567 Enables support for all single and double precision floating point
13568 hardware extensions.  Not available for ARC EM@.
13570 @end table
13572 @end table
13574 The following options are passed through to the assembler, and also
13575 define preprocessor macro symbols.
13577 @c Flags used by the assembler, but for which we define preprocessor
13578 @c macro symbols as well.
13579 @table @gcctabopt
13580 @item -mdsp-packa
13581 @opindex mdsp-packa
13582 Passed down to the assembler to enable the DSP Pack A extensions.
13583 Also sets the preprocessor symbol @code{__Xdsp_packa}.
13585 @item -mdvbf
13586 @opindex mdvbf
13587 Passed down to the assembler to enable the dual viterbi butterfly
13588 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
13590 @c ARC700 4.10 extension instruction
13591 @item -mlock
13592 @opindex mlock
13593 Passed down to the assembler to enable the Locked Load/Store
13594 Conditional extension.  Also sets the preprocessor symbol
13595 @code{__Xlock}.
13597 @item -mmac-d16
13598 @opindex mmac-d16
13599 Passed down to the assembler.  Also sets the preprocessor symbol
13600 @code{__Xxmac_d16}.
13602 @item -mmac-24
13603 @opindex mmac-24
13604 Passed down to the assembler.  Also sets the preprocessor symbol
13605 @code{__Xxmac_24}.
13607 @c ARC700 4.10 extension instruction
13608 @item -mrtsc
13609 @opindex mrtsc
13610 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
13611 extension instruction.  Also sets the preprocessor symbol
13612 @code{__Xrtsc}.
13614 @c ARC700 4.10 extension instruction
13615 @item -mswape
13616 @opindex mswape
13617 Passed down to the assembler to enable the swap byte ordering
13618 extension instruction.  Also sets the preprocessor symbol
13619 @code{__Xswape}.
13621 @item -mtelephony
13622 @opindex mtelephony
13623 Passed down to the assembler to enable dual and single operand
13624 instructions for telephony.  Also sets the preprocessor symbol
13625 @code{__Xtelephony}.
13627 @item -mxy
13628 @opindex mxy
13629 Passed down to the assembler to enable the XY Memory extension.  Also
13630 sets the preprocessor symbol @code{__Xxy}.
13632 @end table
13634 The following options control how the assembly code is annotated:
13636 @c Assembly annotation options
13637 @table @gcctabopt
13638 @item -misize
13639 @opindex misize
13640 Annotate assembler instructions with estimated addresses.
13642 @item -mannotate-align
13643 @opindex mannotate-align
13644 Explain what alignment considerations lead to the decision to make an
13645 instruction short or long.
13647 @end table
13649 The following options are passed through to the linker:
13651 @c options passed through to the linker
13652 @table @gcctabopt
13653 @item -marclinux
13654 @opindex marclinux
13655 Passed through to the linker, to specify use of the @code{arclinux} emulation.
13656 This option is enabled by default in tool chains built for
13657 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
13658 when profiling is not requested.
13660 @item -marclinux_prof
13661 @opindex marclinux_prof
13662 Passed through to the linker, to specify use of the
13663 @code{arclinux_prof} emulation.  This option is enabled by default in
13664 tool chains built for @w{@code{arc-linux-uclibc}} and
13665 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
13667 @end table
13669 The following options control the semantics of generated code:
13671 @c semantically relevant code generation options
13672 @table @gcctabopt
13673 @item -mlong-calls
13674 @opindex mlong-calls
13675 Generate call insns as register indirect calls, thus providing access
13676 to the full 32-bit address range.
13678 @item -mmedium-calls
13679 @opindex mmedium-calls
13680 Don't use less than 25 bit addressing range for calls, which is the
13681 offset available for an unconditional branch-and-link
13682 instruction.  Conditional execution of function calls is suppressed, to
13683 allow use of the 25-bit range, rather than the 21-bit range with
13684 conditional branch-and-link.  This is the default for tool chains built
13685 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
13687 @item -mno-sdata
13688 @opindex mno-sdata
13689 Do not generate sdata references.  This is the default for tool chains
13690 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
13691 targets.
13693 @item -mucb-mcount
13694 @opindex mucb-mcount
13695 Instrument with mcount calls as used in UCB code.  I.e. do the
13696 counting in the callee, not the caller.  By default ARC instrumentation
13697 counts in the caller.
13699 @item -mvolatile-cache
13700 @opindex mvolatile-cache
13701 Use ordinarily cached memory accesses for volatile references.  This is the
13702 default.
13704 @item -mno-volatile-cache
13705 @opindex mno-volatile-cache
13706 Enable cache bypass for volatile references.
13708 @end table
13710 The following options fine tune code generation:
13711 @c code generation tuning options
13712 @table @gcctabopt
13713 @item -malign-call
13714 @opindex malign-call
13715 Do alignment optimizations for call instructions.
13717 @item -mauto-modify-reg
13718 @opindex mauto-modify-reg
13719 Enable the use of pre/post modify with register displacement.
13721 @item -mbbit-peephole
13722 @opindex mbbit-peephole
13723 Enable bbit peephole2.
13725 @item -mno-brcc
13726 @opindex mno-brcc
13727 This option disables a target-specific pass in @file{arc_reorg} to
13728 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
13729 generation driven by the combiner pass.
13731 @item -mcase-vector-pcrel
13732 @opindex mcase-vector-pcrel
13733 Use pc-relative switch case tables - this enables case table shortening.
13734 This is the default for @option{-Os}.
13736 @item -mcompact-casesi
13737 @opindex mcompact-casesi
13738 Enable compact casesi pattern.
13739 This is the default for @option{-Os}.
13741 @item -mno-cond-exec
13742 @opindex mno-cond-exec
13743 Disable ARCompact specific pass to generate conditional execution instructions.
13744 Due to delay slot scheduling and interactions between operand numbers,
13745 literal sizes, instruction lengths, and the support for conditional execution,
13746 the target-independent pass to generate conditional execution is often lacking,
13747 so the ARC port has kept a special pass around that tries to find more
13748 conditional execution generating opportunities after register allocation,
13749 branch shortening, and delay slot scheduling have been done.  This pass
13750 generally, but not always, improves performance and code size, at the cost of
13751 extra compilation time, which is why there is an option to switch it off.
13752 If you have a problem with call instructions exceeding their allowable
13753 offset range because they are conditionalized, you should consider using
13754 @option{-mmedium-calls} instead.
13756 @item -mearly-cbranchsi
13757 @opindex mearly-cbranchsi
13758 Enable pre-reload use of the cbranchsi pattern.
13760 @item -mexpand-adddi
13761 @opindex mexpand-adddi
13762 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
13763 @code{add.f}, @code{adc} etc.
13765 @item -mindexed-loads
13766 @opindex mindexed-loads
13767 Enable the use of indexed loads.  This can be problematic because some
13768 optimizers then assume that indexed stores exist, which is not
13769 the case.
13771 @opindex mlra
13772 Enable Local Register Allocation.  This is still experimental for ARC,
13773 so by default the compiler uses standard reload
13774 (i.e. @option{-mno-lra}).
13776 @item -mlra-priority-none
13777 @opindex mlra-priority-none
13778 Don't indicate any priority for target registers.
13780 @item -mlra-priority-compact
13781 @opindex mlra-priority-compact
13782 Indicate target register priority for r0..r3 / r12..r15.
13784 @item -mlra-priority-noncompact
13785 @opindex mlra-priority-noncompact
13786 Reduce target register priority for r0..r3 / r12..r15.
13788 @item -mno-millicode
13789 @opindex mno-millicode
13790 When optimizing for size (using @option{-Os}), prologues and epilogues
13791 that have to save or restore a large number of registers are often
13792 shortened by using call to a special function in libgcc; this is
13793 referred to as a @emph{millicode} call.  As these calls can pose
13794 performance issues, and/or cause linking issues when linking in a
13795 nonstandard way, this option is provided to turn off millicode call
13796 generation.
13798 @item -mmixed-code
13799 @opindex mmixed-code
13800 Tweak register allocation to help 16-bit instruction generation.
13801 This generally has the effect of decreasing the average instruction size
13802 while increasing the instruction count.
13804 @item -mq-class
13805 @opindex mq-class
13806 Enable 'q' instruction alternatives.
13807 This is the default for @option{-Os}.
13809 @item -mRcq
13810 @opindex mRcq
13811 Enable Rcq constraint handling - most short code generation depends on this.
13812 This is the default.
13814 @item -mRcw
13815 @opindex mRcw
13816 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
13817 This is the default.
13819 @item -msize-level=@var{level}
13820 @opindex msize-level
13821 Fine-tune size optimization with regards to instruction lengths and alignment.
13822 The recognized values for @var{level} are:
13823 @table @samp
13824 @item 0
13825 No size optimization.  This level is deprecated and treated like @samp{1}.
13827 @item 1
13828 Short instructions are used opportunistically.
13830 @item 2
13831 In addition, alignment of loops and of code after barriers are dropped.
13833 @item 3
13834 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
13836 @end table
13838 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
13839 the behavior when this is not set is equivalent to level @samp{1}.
13841 @item -mtune=@var{cpu}
13842 @opindex mtune
13843 Set instruction scheduling parameters for @var{cpu}, overriding any implied
13844 by @option{-mcpu=}.
13846 Supported values for @var{cpu} are
13848 @table @samp
13849 @item ARC600
13850 Tune for ARC600 cpu.
13852 @item ARC601
13853 Tune for ARC601 cpu.
13855 @item ARC700
13856 Tune for ARC700 cpu with standard multiplier block.
13858 @item ARC700-xmac
13859 Tune for ARC700 cpu with XMAC block.
13861 @item ARC725D
13862 Tune for ARC725D cpu.
13864 @item ARC750D
13865 Tune for ARC750D cpu.
13867 @end table
13869 @item -mmultcost=@var{num}
13870 @opindex mmultcost
13871 Cost to assume for a multiply instruction, with @samp{4} being equal to a
13872 normal instruction.
13874 @item -munalign-prob-threshold=@var{probability}
13875 @opindex munalign-prob-threshold
13876 Set probability threshold for unaligning branches.
13877 When tuning for @samp{ARC700} and optimizing for speed, branches without
13878 filled delay slot are preferably emitted unaligned and long, unless
13879 profiling indicates that the probability for the branch to be taken
13880 is below @var{probability}.  @xref{Cross-profiling}.
13881 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
13883 @end table
13885 The following options are maintained for backward compatibility, but
13886 are now deprecated and will be removed in a future release:
13888 @c Deprecated options
13889 @table @gcctabopt
13891 @item -margonaut
13892 @opindex margonaut
13893 Obsolete FPX.
13895 @item -mbig-endian
13896 @opindex mbig-endian
13897 @itemx -EB
13898 @opindex EB
13899 Compile code for big endian targets.  Use of these options is now
13900 deprecated.  Users wanting big-endian code, should use the
13901 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
13902 building the tool chain, for which big-endian is the default.
13904 @item -mlittle-endian
13905 @opindex mlittle-endian
13906 @itemx -EL
13907 @opindex EL
13908 Compile code for little endian targets.  Use of these options is now
13909 deprecated.  Users wanting little-endian code should use the
13910 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
13911 building the tool chain, for which little-endian is the default.
13913 @item -mbarrel_shifter
13914 @opindex mbarrel_shifter
13915 Replaced by @option{-mbarrel-shifter}.
13917 @item -mdpfp_compact
13918 @opindex mdpfp_compact
13919 Replaced by @option{-mdpfp-compact}.
13921 @item -mdpfp_fast
13922 @opindex mdpfp_fast
13923 Replaced by @option{-mdpfp-fast}.
13925 @item -mdsp_packa
13926 @opindex mdsp_packa
13927 Replaced by @option{-mdsp-packa}.
13929 @item -mEA
13930 @opindex mEA
13931 Replaced by @option{-mea}.
13933 @item -mmac_24
13934 @opindex mmac_24
13935 Replaced by @option{-mmac-24}.
13937 @item -mmac_d16
13938 @opindex mmac_d16
13939 Replaced by @option{-mmac-d16}.
13941 @item -mspfp_compact
13942 @opindex mspfp_compact
13943 Replaced by @option{-mspfp-compact}.
13945 @item -mspfp_fast
13946 @opindex mspfp_fast
13947 Replaced by @option{-mspfp-fast}.
13949 @item -mtune=@var{cpu}
13950 @opindex mtune
13951 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
13952 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
13953 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
13955 @item -multcost=@var{num}
13956 @opindex multcost
13957 Replaced by @option{-mmultcost}.
13959 @end table
13961 @node ARM Options
13962 @subsection ARM Options
13963 @cindex ARM options
13965 These @samp{-m} options are defined for the ARM port:
13967 @table @gcctabopt
13968 @item -mabi=@var{name}
13969 @opindex mabi
13970 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
13971 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
13973 @item -mapcs-frame
13974 @opindex mapcs-frame
13975 Generate a stack frame that is compliant with the ARM Procedure Call
13976 Standard for all functions, even if this is not strictly necessary for
13977 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
13978 with this option causes the stack frames not to be generated for
13979 leaf functions.  The default is @option{-mno-apcs-frame}.
13980 This option is deprecated.
13982 @item -mapcs
13983 @opindex mapcs
13984 This is a synonym for @option{-mapcs-frame} and is deprecated.
13986 @ignore
13987 @c not currently implemented
13988 @item -mapcs-stack-check
13989 @opindex mapcs-stack-check
13990 Generate code to check the amount of stack space available upon entry to
13991 every function (that actually uses some stack space).  If there is
13992 insufficient space available then either the function
13993 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
13994 called, depending upon the amount of stack space required.  The runtime
13995 system is required to provide these functions.  The default is
13996 @option{-mno-apcs-stack-check}, since this produces smaller code.
13998 @c not currently implemented
13999 @item -mapcs-float
14000 @opindex mapcs-float
14001 Pass floating-point arguments using the floating-point registers.  This is
14002 one of the variants of the APCS@.  This option is recommended if the
14003 target hardware has a floating-point unit or if a lot of floating-point
14004 arithmetic is going to be performed by the code.  The default is
14005 @option{-mno-apcs-float}, since the size of integer-only code is 
14006 slightly increased if @option{-mapcs-float} is used.
14008 @c not currently implemented
14009 @item -mapcs-reentrant
14010 @opindex mapcs-reentrant
14011 Generate reentrant, position-independent code.  The default is
14012 @option{-mno-apcs-reentrant}.
14013 @end ignore
14015 @item -mthumb-interwork
14016 @opindex mthumb-interwork
14017 Generate code that supports calling between the ARM and Thumb
14018 instruction sets.  Without this option, on pre-v5 architectures, the
14019 two instruction sets cannot be reliably used inside one program.  The
14020 default is @option{-mno-thumb-interwork}, since slightly larger code
14021 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
14022 configurations this option is meaningless.
14024 @item -mno-sched-prolog
14025 @opindex mno-sched-prolog
14026 Prevent the reordering of instructions in the function prologue, or the
14027 merging of those instruction with the instructions in the function's
14028 body.  This means that all functions start with a recognizable set
14029 of instructions (or in fact one of a choice from a small set of
14030 different function prologues), and this information can be used to
14031 locate the start of functions inside an executable piece of code.  The
14032 default is @option{-msched-prolog}.
14034 @item -mfloat-abi=@var{name}
14035 @opindex mfloat-abi
14036 Specifies which floating-point ABI to use.  Permissible values
14037 are: @samp{soft}, @samp{softfp} and @samp{hard}.
14039 Specifying @samp{soft} causes GCC to generate output containing
14040 library calls for floating-point operations.
14041 @samp{softfp} allows the generation of code using hardware floating-point
14042 instructions, but still uses the soft-float calling conventions.
14043 @samp{hard} allows generation of floating-point instructions
14044 and uses FPU-specific calling conventions.
14046 The default depends on the specific target configuration.  Note that
14047 the hard-float and soft-float ABIs are not link-compatible; you must
14048 compile your entire program with the same ABI, and link with a
14049 compatible set of libraries.
14051 @item -mlittle-endian
14052 @opindex mlittle-endian
14053 Generate code for a processor running in little-endian mode.  This is
14054 the default for all standard configurations.
14056 @item -mbig-endian
14057 @opindex mbig-endian
14058 Generate code for a processor running in big-endian mode; the default is
14059 to compile code for a little-endian processor.
14061 @item -march=@var{name}
14062 @opindex march
14063 This specifies the name of the target ARM architecture.  GCC uses this
14064 name to determine what kind of instructions it can emit when generating
14065 assembly code.  This option can be used in conjunction with or instead
14066 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
14067 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
14068 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
14069 @samp{armv6}, @samp{armv6j},
14070 @samp{armv6t2}, @samp{armv6z}, @samp{armv6kz}, @samp{armv6-m},
14071 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
14072 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc}, @samp{armv8.1-a},
14073 @samp{armv8.1-a+crc}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
14075 Architecture revisions older than @option{armv4t} are deprecated.
14077 @option{-march=armv7ve} is the armv7-a architecture with virtualization
14078 extensions.
14080 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
14081 architecture together with the optional CRC32 extensions.
14083 @option{-march=native} causes the compiler to auto-detect the architecture
14084 of the build computer.  At present, this feature is only supported on
14085 GNU/Linux, and not all architectures are recognized.  If the auto-detect
14086 is unsuccessful the option has no effect.
14088 @item -mtune=@var{name}
14089 @opindex mtune
14090 This option specifies the name of the target ARM processor for
14091 which GCC should tune the performance of the code.
14092 For some ARM implementations better performance can be obtained by using
14093 this option.
14094 Permissible names are: @samp{arm2}, @samp{arm250},
14095 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
14096 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
14097 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
14098 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
14099 @samp{arm720},
14100 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
14101 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
14102 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
14103 @samp{strongarm1110},
14104 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
14105 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
14106 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
14107 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
14108 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
14109 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
14110 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
14111 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
14112 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
14113 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
14114 @samp{cortex-a72}, @samp{cortex-r4},
14115 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
14116 @samp{cortex-m7},
14117 @samp{cortex-m4},
14118 @samp{cortex-m3},
14119 @samp{cortex-m1},
14120 @samp{cortex-m0},
14121 @samp{cortex-m0plus},
14122 @samp{cortex-m1.small-multiply},
14123 @samp{cortex-m0.small-multiply},
14124 @samp{cortex-m0plus.small-multiply},
14125 @samp{exynos-m1},
14126 @samp{qdf24xx},
14127 @samp{marvell-pj4},
14128 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
14129 @samp{fa526}, @samp{fa626},
14130 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
14131 @samp{xgene1}.
14133 Additionally, this option can specify that GCC should tune the performance
14134 of the code for a big.LITTLE system.  Permissible names are:
14135 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
14136 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
14138 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
14139 performance for a blend of processors within architecture @var{arch}.
14140 The aim is to generate code that run well on the current most popular
14141 processors, balancing between optimizations that benefit some CPUs in the
14142 range, and avoiding performance pitfalls of other CPUs.  The effects of
14143 this option may change in future GCC versions as CPU models come and go.
14145 @option{-mtune=native} causes the compiler to auto-detect the CPU
14146 of the build computer.  At present, this feature is only supported on
14147 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
14148 unsuccessful the option has no effect.
14150 @item -mcpu=@var{name}
14151 @opindex mcpu
14152 This specifies the name of the target ARM processor.  GCC uses this name
14153 to derive the name of the target ARM architecture (as if specified
14154 by @option{-march}) and the ARM processor type for which to tune for
14155 performance (as if specified by @option{-mtune}).  Where this option
14156 is used in conjunction with @option{-march} or @option{-mtune},
14157 those options take precedence over the appropriate part of this option.
14159 Permissible names for this option are the same as those for
14160 @option{-mtune}.
14162 @option{-mcpu=generic-@var{arch}} is also permissible, and is
14163 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
14164 See @option{-mtune} for more information.
14166 @option{-mcpu=native} causes the compiler to auto-detect the CPU
14167 of the build computer.  At present, this feature is only supported on
14168 GNU/Linux, and not all architectures are recognized.  If the auto-detect
14169 is unsuccessful the option has no effect.
14171 @item -mfpu=@var{name}
14172 @opindex mfpu
14173 This specifies what floating-point hardware (or hardware emulation) is
14174 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
14175 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
14176 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
14177 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
14178 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
14179 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
14181 If @option{-msoft-float} is specified this specifies the format of
14182 floating-point values.
14184 If the selected floating-point hardware includes the NEON extension
14185 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
14186 operations are not generated by GCC's auto-vectorization pass unless
14187 @option{-funsafe-math-optimizations} is also specified.  This is
14188 because NEON hardware does not fully implement the IEEE 754 standard for
14189 floating-point arithmetic (in particular denormal values are treated as
14190 zero), so the use of NEON instructions may lead to a loss of precision.
14192 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}).
14194 @item -mfp16-format=@var{name}
14195 @opindex mfp16-format
14196 Specify the format of the @code{__fp16} half-precision floating-point type.
14197 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
14198 the default is @samp{none}, in which case the @code{__fp16} type is not
14199 defined.  @xref{Half-Precision}, for more information.
14201 @item -mstructure-size-boundary=@var{n}
14202 @opindex mstructure-size-boundary
14203 The sizes of all structures and unions are rounded up to a multiple
14204 of the number of bits set by this option.  Permissible values are 8, 32
14205 and 64.  The default value varies for different toolchains.  For the COFF
14206 targeted toolchain the default value is 8.  A value of 64 is only allowed
14207 if the underlying ABI supports it.
14209 Specifying a larger number can produce faster, more efficient code, but
14210 can also increase the size of the program.  Different values are potentially
14211 incompatible.  Code compiled with one value cannot necessarily expect to
14212 work with code or libraries compiled with another value, if they exchange
14213 information using structures or unions.
14215 @item -mabort-on-noreturn
14216 @opindex mabort-on-noreturn
14217 Generate a call to the function @code{abort} at the end of a
14218 @code{noreturn} function.  It is executed if the function tries to
14219 return.
14221 @item -mlong-calls
14222 @itemx -mno-long-calls
14223 @opindex mlong-calls
14224 @opindex mno-long-calls
14225 Tells the compiler to perform function calls by first loading the
14226 address of the function into a register and then performing a subroutine
14227 call on this register.  This switch is needed if the target function
14228 lies outside of the 64-megabyte addressing range of the offset-based
14229 version of subroutine call instruction.
14231 Even if this switch is enabled, not all function calls are turned
14232 into long calls.  The heuristic is that static functions, functions
14233 that have the @code{short_call} attribute, functions that are inside
14234 the scope of a @code{#pragma no_long_calls} directive, and functions whose
14235 definitions have already been compiled within the current compilation
14236 unit are not turned into long calls.  The exceptions to this rule are
14237 that weak function definitions, functions with the @code{long_call}
14238 attribute or the @code{section} attribute, and functions that are within
14239 the scope of a @code{#pragma long_calls} directive are always
14240 turned into long calls.
14242 This feature is not enabled by default.  Specifying
14243 @option{-mno-long-calls} restores the default behavior, as does
14244 placing the function calls within the scope of a @code{#pragma
14245 long_calls_off} directive.  Note these switches have no effect on how
14246 the compiler generates code to handle function calls via function
14247 pointers.
14249 @item -msingle-pic-base
14250 @opindex msingle-pic-base
14251 Treat the register used for PIC addressing as read-only, rather than
14252 loading it in the prologue for each function.  The runtime system is
14253 responsible for initializing this register with an appropriate value
14254 before execution begins.
14256 @item -mpic-register=@var{reg}
14257 @opindex mpic-register
14258 Specify the register to be used for PIC addressing.
14259 For standard PIC base case, the default is any suitable register
14260 determined by compiler.  For single PIC base case, the default is
14261 @samp{R9} if target is EABI based or stack-checking is enabled,
14262 otherwise the default is @samp{R10}.
14264 @item -mpic-data-is-text-relative
14265 @opindex mpic-data-is-text-relative
14266 Assume that each data segments are relative to text segment at load time.
14267 Therefore, it permits addressing data using PC-relative operations.
14268 This option is on by default for targets other than VxWorks RTP.
14270 @item -mpoke-function-name
14271 @opindex mpoke-function-name
14272 Write the name of each function into the text section, directly
14273 preceding the function prologue.  The generated code is similar to this:
14275 @smallexample
14276      t0
14277          .ascii "arm_poke_function_name", 0
14278          .align
14279      t1
14280          .word 0xff000000 + (t1 - t0)
14281      arm_poke_function_name
14282          mov     ip, sp
14283          stmfd   sp!, @{fp, ip, lr, pc@}
14284          sub     fp, ip, #4
14285 @end smallexample
14287 When performing a stack backtrace, code can inspect the value of
14288 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
14289 location @code{pc - 12} and the top 8 bits are set, then we know that
14290 there is a function name embedded immediately preceding this location
14291 and has length @code{((pc[-3]) & 0xff000000)}.
14293 @item -mthumb
14294 @itemx -marm
14295 @opindex marm
14296 @opindex mthumb
14298 Select between generating code that executes in ARM and Thumb
14299 states.  The default for most configurations is to generate code
14300 that executes in ARM state, but the default can be changed by
14301 configuring GCC with the @option{--with-mode=}@var{state}
14302 configure option.
14304 You can also override the ARM and Thumb mode for each function
14305 by using the @code{target("thumb")} and @code{target("arm")} function attributes
14306 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
14308 @item -mtpcs-frame
14309 @opindex mtpcs-frame
14310 Generate a stack frame that is compliant with the Thumb Procedure Call
14311 Standard for all non-leaf functions.  (A leaf function is one that does
14312 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
14314 @item -mtpcs-leaf-frame
14315 @opindex mtpcs-leaf-frame
14316 Generate a stack frame that is compliant with the Thumb Procedure Call
14317 Standard for all leaf functions.  (A leaf function is one that does
14318 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
14320 @item -mcallee-super-interworking
14321 @opindex mcallee-super-interworking
14322 Gives all externally visible functions in the file being compiled an ARM
14323 instruction set header which switches to Thumb mode before executing the
14324 rest of the function.  This allows these functions to be called from
14325 non-interworking code.  This option is not valid in AAPCS configurations
14326 because interworking is enabled by default.
14328 @item -mcaller-super-interworking
14329 @opindex mcaller-super-interworking
14330 Allows calls via function pointers (including virtual functions) to
14331 execute correctly regardless of whether the target code has been
14332 compiled for interworking or not.  There is a small overhead in the cost
14333 of executing a function pointer if this option is enabled.  This option
14334 is not valid in AAPCS configurations because interworking is enabled
14335 by default.
14337 @item -mtp=@var{name}
14338 @opindex mtp
14339 Specify the access model for the thread local storage pointer.  The valid
14340 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
14341 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
14342 (supported in the arm6k architecture), and @samp{auto}, which uses the
14343 best available method for the selected processor.  The default setting is
14344 @samp{auto}.
14346 @item -mtls-dialect=@var{dialect}
14347 @opindex mtls-dialect
14348 Specify the dialect to use for accessing thread local storage.  Two
14349 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
14350 @samp{gnu} dialect selects the original GNU scheme for supporting
14351 local and global dynamic TLS models.  The @samp{gnu2} dialect
14352 selects the GNU descriptor scheme, which provides better performance
14353 for shared libraries.  The GNU descriptor scheme is compatible with
14354 the original scheme, but does require new assembler, linker and
14355 library support.  Initial and local exec TLS models are unaffected by
14356 this option and always use the original scheme.
14358 @item -mword-relocations
14359 @opindex mword-relocations
14360 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
14361 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
14362 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
14363 is specified.
14365 @item -mfix-cortex-m3-ldrd
14366 @opindex mfix-cortex-m3-ldrd
14367 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
14368 with overlapping destination and base registers are used.  This option avoids
14369 generating these instructions.  This option is enabled by default when
14370 @option{-mcpu=cortex-m3} is specified.
14372 @item -munaligned-access
14373 @itemx -mno-unaligned-access
14374 @opindex munaligned-access
14375 @opindex mno-unaligned-access
14376 Enables (or disables) reading and writing of 16- and 32- bit values
14377 from addresses that are not 16- or 32- bit aligned.  By default
14378 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
14379 architectures, and enabled for all other architectures.  If unaligned
14380 access is not enabled then words in packed data structures are
14381 accessed a byte at a time.
14383 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
14384 generated object file to either true or false, depending upon the
14385 setting of this option.  If unaligned access is enabled then the
14386 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
14387 defined.
14389 @item -mneon-for-64bits
14390 @opindex mneon-for-64bits
14391 Enables using Neon to handle scalar 64-bits operations. This is
14392 disabled by default since the cost of moving data from core registers
14393 to Neon is high.
14395 @item -mslow-flash-data
14396 @opindex mslow-flash-data
14397 Assume loading data from flash is slower than fetching instruction.
14398 Therefore literal load is minimized for better performance.
14399 This option is only supported when compiling for ARMv7 M-profile and
14400 off by default.
14402 @item -masm-syntax-unified
14403 @opindex masm-syntax-unified
14404 Assume inline assembler is using unified asm syntax.  The default is
14405 currently off which implies divided syntax.  This option has no impact
14406 on Thumb2. However, this may change in future releases of GCC.
14407 Divided syntax should be considered deprecated.
14409 @item -mrestrict-it
14410 @opindex mrestrict-it
14411 Restricts generation of IT blocks to conform to the rules of ARMv8.
14412 IT blocks can only contain a single 16-bit instruction from a select
14413 set of instructions. This option is on by default for ARMv8 Thumb mode.
14415 @item -mprint-tune-info
14416 @opindex mprint-tune-info
14417 Print CPU tuning information as comment in assembler file.  This is
14418 an option used only for regression testing of the compiler and not
14419 intended for ordinary use in compiling code.  This option is disabled
14420 by default.
14421 @end table
14423 @node AVR Options
14424 @subsection AVR Options
14425 @cindex AVR Options
14427 These options are defined for AVR implementations:
14429 @table @gcctabopt
14430 @item -mmcu=@var{mcu}
14431 @opindex mmcu
14432 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
14434 The default for this option is@tie{}@samp{avr2}.
14436 GCC supports the following AVR devices and ISAs:
14438 @include avr-mmcu.texi
14440 @item -maccumulate-args
14441 @opindex maccumulate-args
14442 Accumulate outgoing function arguments and acquire/release the needed
14443 stack space for outgoing function arguments once in function
14444 prologue/epilogue.  Without this option, outgoing arguments are pushed
14445 before calling a function and popped afterwards.
14447 Popping the arguments after the function call can be expensive on
14448 AVR so that accumulating the stack space might lead to smaller
14449 executables because arguments need not to be removed from the
14450 stack after such a function call.
14452 This option can lead to reduced code size for functions that perform
14453 several calls to functions that get their arguments on the stack like
14454 calls to printf-like functions.
14456 @item -mbranch-cost=@var{cost}
14457 @opindex mbranch-cost
14458 Set the branch costs for conditional branch instructions to
14459 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
14460 integers. The default branch cost is 0.
14462 @item -mcall-prologues
14463 @opindex mcall-prologues
14464 Functions prologues/epilogues are expanded as calls to appropriate
14465 subroutines.  Code size is smaller.
14467 @item -mint8
14468 @opindex mint8
14469 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
14470 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
14471 and @code{long long} is 4 bytes.  Please note that this option does not
14472 conform to the C standards, but it results in smaller code
14473 size.
14475 @item -mn-flash=@var{num}
14476 @opindex mn-flash
14477 Assume that the flash memory has a size of 
14478 @var{num} times 64@tie{}KiB.
14480 @item -mno-interrupts
14481 @opindex mno-interrupts
14482 Generated code is not compatible with hardware interrupts.
14483 Code size is smaller.
14485 @item -mrelax
14486 @opindex mrelax
14487 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
14488 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
14489 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
14490 the assembler's command line and the @option{--relax} option to the
14491 linker's command line.
14493 Jump relaxing is performed by the linker because jump offsets are not
14494 known before code is located. Therefore, the assembler code generated by the
14495 compiler is the same, but the instructions in the executable may
14496 differ from instructions in the assembler code.
14498 Relaxing must be turned on if linker stubs are needed, see the
14499 section on @code{EIND} and linker stubs below.
14501 @item -mrmw
14502 @opindex mrmw
14503 Assume that the device supports the Read-Modify-Write
14504 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
14506 @item -msp8
14507 @opindex msp8
14508 Treat the stack pointer register as an 8-bit register,
14509 i.e.@: assume the high byte of the stack pointer is zero.
14510 In general, you don't need to set this option by hand.
14512 This option is used internally by the compiler to select and
14513 build multilibs for architectures @code{avr2} and @code{avr25}.
14514 These architectures mix devices with and without @code{SPH}.
14515 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
14516 the compiler driver adds or removes this option from the compiler
14517 proper's command line, because the compiler then knows if the device
14518 or architecture has an 8-bit stack pointer and thus no @code{SPH}
14519 register or not.
14521 @item -mstrict-X
14522 @opindex mstrict-X
14523 Use address register @code{X} in a way proposed by the hardware.  This means
14524 that @code{X} is only used in indirect, post-increment or
14525 pre-decrement addressing.
14527 Without this option, the @code{X} register may be used in the same way
14528 as @code{Y} or @code{Z} which then is emulated by additional
14529 instructions.  
14530 For example, loading a value with @code{X+const} addressing with a
14531 small non-negative @code{const < 64} to a register @var{Rn} is
14532 performed as
14534 @example
14535 adiw r26, const   ; X += const
14536 ld   @var{Rn}, X        ; @var{Rn} = *X
14537 sbiw r26, const   ; X -= const
14538 @end example
14540 @item -mtiny-stack
14541 @opindex mtiny-stack
14542 Only change the lower 8@tie{}bits of the stack pointer.
14544 @item -nodevicelib
14545 @opindex nodevicelib
14546 Don't link against AVR-LibC's device specific library @code{libdev.a}.
14548 @item -Waddr-space-convert
14549 @opindex Waddr-space-convert
14550 Warn about conversions between address spaces in the case where the
14551 resulting address space is not contained in the incoming address space.
14552 @end table
14554 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
14555 @cindex @code{EIND}
14556 Pointers in the implementation are 16@tie{}bits wide.
14557 The address of a function or label is represented as word address so
14558 that indirect jumps and calls can target any code address in the
14559 range of 64@tie{}Ki words.
14561 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
14562 bytes of program memory space, there is a special function register called
14563 @code{EIND} that serves as most significant part of the target address
14564 when @code{EICALL} or @code{EIJMP} instructions are used.
14566 Indirect jumps and calls on these devices are handled as follows by
14567 the compiler and are subject to some limitations:
14569 @itemize @bullet
14571 @item
14572 The compiler never sets @code{EIND}.
14574 @item
14575 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
14576 instructions or might read @code{EIND} directly in order to emulate an
14577 indirect call/jump by means of a @code{RET} instruction.
14579 @item
14580 The compiler assumes that @code{EIND} never changes during the startup
14581 code or during the application. In particular, @code{EIND} is not
14582 saved/restored in function or interrupt service routine
14583 prologue/epilogue.
14585 @item
14586 For indirect calls to functions and computed goto, the linker
14587 generates @emph{stubs}. Stubs are jump pads sometimes also called
14588 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
14589 The stub contains a direct jump to the desired address.
14591 @item
14592 Linker relaxation must be turned on so that the linker generates
14593 the stubs correctly in all situations. See the compiler option
14594 @option{-mrelax} and the linker option @option{--relax}.
14595 There are corner cases where the linker is supposed to generate stubs
14596 but aborts without relaxation and without a helpful error message.
14598 @item
14599 The default linker script is arranged for code with @code{EIND = 0}.
14600 If code is supposed to work for a setup with @code{EIND != 0}, a custom
14601 linker script has to be used in order to place the sections whose
14602 name start with @code{.trampolines} into the segment where @code{EIND}
14603 points to.
14605 @item
14606 The startup code from libgcc never sets @code{EIND}.
14607 Notice that startup code is a blend of code from libgcc and AVR-LibC.
14608 For the impact of AVR-LibC on @code{EIND}, see the
14609 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
14611 @item
14612 It is legitimate for user-specific startup code to set up @code{EIND}
14613 early, for example by means of initialization code located in
14614 section @code{.init3}. Such code runs prior to general startup code
14615 that initializes RAM and calls constructors, but after the bit
14616 of startup code from AVR-LibC that sets @code{EIND} to the segment
14617 where the vector table is located.
14618 @example
14619 #include <avr/io.h>
14621 static void
14622 __attribute__((section(".init3"),naked,used,no_instrument_function))
14623 init3_set_eind (void)
14625   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
14626                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
14628 @end example
14630 @noindent
14631 The @code{__trampolines_start} symbol is defined in the linker script.
14633 @item
14634 Stubs are generated automatically by the linker if
14635 the following two conditions are met:
14636 @itemize @minus
14638 @item The address of a label is taken by means of the @code{gs} modifier
14639 (short for @emph{generate stubs}) like so:
14640 @example
14641 LDI r24, lo8(gs(@var{func}))
14642 LDI r25, hi8(gs(@var{func}))
14643 @end example
14644 @item The final location of that label is in a code segment
14645 @emph{outside} the segment where the stubs are located.
14646 @end itemize
14648 @item
14649 The compiler emits such @code{gs} modifiers for code labels in the
14650 following situations:
14651 @itemize @minus
14652 @item Taking address of a function or code label.
14653 @item Computed goto.
14654 @item If prologue-save function is used, see @option{-mcall-prologues}
14655 command-line option.
14656 @item Switch/case dispatch tables. If you do not want such dispatch
14657 tables you can specify the @option{-fno-jump-tables} command-line option.
14658 @item C and C++ constructors/destructors called during startup/shutdown.
14659 @item If the tools hit a @code{gs()} modifier explained above.
14660 @end itemize
14662 @item
14663 Jumping to non-symbolic addresses like so is @emph{not} supported:
14665 @example
14666 int main (void)
14668     /* Call function at word address 0x2 */
14669     return ((int(*)(void)) 0x2)();
14671 @end example
14673 Instead, a stub has to be set up, i.e.@: the function has to be called
14674 through a symbol (@code{func_4} in the example):
14676 @example
14677 int main (void)
14679     extern int func_4 (void);
14681     /* Call function at byte address 0x4 */
14682     return func_4();
14684 @end example
14686 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
14687 Alternatively, @code{func_4} can be defined in the linker script.
14688 @end itemize
14690 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
14691 @cindex @code{RAMPD}
14692 @cindex @code{RAMPX}
14693 @cindex @code{RAMPY}
14694 @cindex @code{RAMPZ}
14695 Some AVR devices support memories larger than the 64@tie{}KiB range
14696 that can be accessed with 16-bit pointers.  To access memory locations
14697 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
14698 register is used as high part of the address:
14699 The @code{X}, @code{Y}, @code{Z} address register is concatenated
14700 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
14701 register, respectively, to get a wide address. Similarly,
14702 @code{RAMPD} is used together with direct addressing.
14704 @itemize
14705 @item
14706 The startup code initializes the @code{RAMP} special function
14707 registers with zero.
14709 @item
14710 If a @ref{AVR Named Address Spaces,named address space} other than
14711 generic or @code{__flash} is used, then @code{RAMPZ} is set
14712 as needed before the operation.
14714 @item
14715 If the device supports RAM larger than 64@tie{}KiB and the compiler
14716 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
14717 is reset to zero after the operation.
14719 @item
14720 If the device comes with a specific @code{RAMP} register, the ISR
14721 prologue/epilogue saves/restores that SFR and initializes it with
14722 zero in case the ISR code might (implicitly) use it.
14724 @item
14725 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
14726 If you use inline assembler to read from locations outside the
14727 16-bit address range and change one of the @code{RAMP} registers,
14728 you must reset it to zero after the access.
14730 @end itemize
14732 @subsubsection AVR Built-in Macros
14734 GCC defines several built-in macros so that the user code can test
14735 for the presence or absence of features.  Almost any of the following
14736 built-in macros are deduced from device capabilities and thus
14737 triggered by the @option{-mmcu=} command-line option.
14739 For even more AVR-specific built-in macros see
14740 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
14742 @table @code
14744 @item __AVR_ARCH__
14745 Build-in macro that resolves to a decimal number that identifies the
14746 architecture and depends on the @option{-mmcu=@var{mcu}} option.
14747 Possible values are:
14749 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
14750 @code{4}, @code{5}, @code{51}, @code{6}
14752 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
14753 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
14755 respectively and
14757 @code{100}, @code{102}, @code{104},
14758 @code{105}, @code{106}, @code{107}
14760 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
14761 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
14762 If @var{mcu} specifies a device, this built-in macro is set
14763 accordingly. For example, with @option{-mmcu=atmega8} the macro is
14764 defined to @code{4}.
14766 @item __AVR_@var{Device}__
14767 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
14768 the device's name. For example, @option{-mmcu=atmega8} defines the
14769 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
14770 @code{__AVR_ATtiny261A__}, etc.
14772 The built-in macros' names follow
14773 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
14774 the device name as from the AVR user manual. The difference between
14775 @var{Device} in the built-in macro and @var{device} in
14776 @option{-mmcu=@var{device}} is that the latter is always lowercase.
14778 If @var{device} is not a device but only a core architecture like
14779 @samp{avr51}, this macro is not defined.
14781 @item __AVR_DEVICE_NAME__
14782 Setting @option{-mmcu=@var{device}} defines this built-in macro to
14783 the device's name. For example, with @option{-mmcu=atmega8} the macro
14784 is defined to @code{atmega8}.
14786 If @var{device} is not a device but only a core architecture like
14787 @samp{avr51}, this macro is not defined.
14789 @item __AVR_XMEGA__
14790 The device / architecture belongs to the XMEGA family of devices.
14792 @item __AVR_HAVE_ELPM__
14793 The device has the @code{ELPM} instruction.
14795 @item __AVR_HAVE_ELPMX__
14796 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
14797 R@var{n},Z+} instructions.
14799 @item __AVR_HAVE_MOVW__
14800 The device has the @code{MOVW} instruction to perform 16-bit
14801 register-register moves.
14803 @item __AVR_HAVE_LPMX__
14804 The device has the @code{LPM R@var{n},Z} and
14805 @code{LPM R@var{n},Z+} instructions.
14807 @item __AVR_HAVE_MUL__
14808 The device has a hardware multiplier. 
14810 @item __AVR_HAVE_JMP_CALL__
14811 The device has the @code{JMP} and @code{CALL} instructions.
14812 This is the case for devices with at least 16@tie{}KiB of program
14813 memory.
14815 @item __AVR_HAVE_EIJMP_EICALL__
14816 @itemx __AVR_3_BYTE_PC__
14817 The device has the @code{EIJMP} and @code{EICALL} instructions.
14818 This is the case for devices with more than 128@tie{}KiB of program memory.
14819 This also means that the program counter
14820 (PC) is 3@tie{}bytes wide.
14822 @item __AVR_2_BYTE_PC__
14823 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
14824 with up to 128@tie{}KiB of program memory.
14826 @item __AVR_HAVE_8BIT_SP__
14827 @itemx __AVR_HAVE_16BIT_SP__
14828 The stack pointer (SP) register is treated as 8-bit respectively
14829 16-bit register by the compiler.
14830 The definition of these macros is affected by @option{-mtiny-stack}.
14832 @item __AVR_HAVE_SPH__
14833 @itemx __AVR_SP8__
14834 The device has the SPH (high part of stack pointer) special function
14835 register or has an 8-bit stack pointer, respectively.
14836 The definition of these macros is affected by @option{-mmcu=} and
14837 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
14838 by @option{-msp8}.
14840 @item __AVR_HAVE_RAMPD__
14841 @itemx __AVR_HAVE_RAMPX__
14842 @itemx __AVR_HAVE_RAMPY__
14843 @itemx __AVR_HAVE_RAMPZ__
14844 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
14845 @code{RAMPZ} special function register, respectively.
14847 @item __NO_INTERRUPTS__
14848 This macro reflects the @option{-mno-interrupts} command-line option.
14850 @item __AVR_ERRATA_SKIP__
14851 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
14852 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
14853 instructions because of a hardware erratum.  Skip instructions are
14854 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
14855 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
14856 set.
14858 @item __AVR_ISA_RMW__
14859 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
14861 @item __AVR_SFR_OFFSET__=@var{offset}
14862 Instructions that can address I/O special function registers directly
14863 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
14864 address as if addressed by an instruction to access RAM like @code{LD}
14865 or @code{STS}. This offset depends on the device architecture and has
14866 to be subtracted from the RAM address in order to get the
14867 respective I/O@tie{}address.
14869 @item __WITH_AVRLIBC__
14870 The compiler is configured to be used together with AVR-Libc.
14871 See the @option{--with-avrlibc} configure option.
14873 @end table
14875 @node Blackfin Options
14876 @subsection Blackfin Options
14877 @cindex Blackfin Options
14879 @table @gcctabopt
14880 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
14881 @opindex mcpu=
14882 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
14883 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
14884 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
14885 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
14886 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
14887 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
14888 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
14889 @samp{bf561}, @samp{bf592}.
14891 The optional @var{sirevision} specifies the silicon revision of the target
14892 Blackfin processor.  Any workarounds available for the targeted silicon revision
14893 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
14894 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
14895 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
14896 hexadecimal digits representing the major and minor numbers in the silicon
14897 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
14898 is not defined.  If @var{sirevision} is @samp{any}, the
14899 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
14900 If this optional @var{sirevision} is not used, GCC assumes the latest known
14901 silicon revision of the targeted Blackfin processor.
14903 GCC defines a preprocessor macro for the specified @var{cpu}.
14904 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
14905 provided by libgloss to be linked in if @option{-msim} is not given.
14907 Without this option, @samp{bf532} is used as the processor by default.
14909 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
14910 only the preprocessor macro is defined.
14912 @item -msim
14913 @opindex msim
14914 Specifies that the program will be run on the simulator.  This causes
14915 the simulator BSP provided by libgloss to be linked in.  This option
14916 has effect only for @samp{bfin-elf} toolchain.
14917 Certain other options, such as @option{-mid-shared-library} and
14918 @option{-mfdpic}, imply @option{-msim}.
14920 @item -momit-leaf-frame-pointer
14921 @opindex momit-leaf-frame-pointer
14922 Don't keep the frame pointer in a register for leaf functions.  This
14923 avoids the instructions to save, set up and restore frame pointers and
14924 makes an extra register available in leaf functions.  The option
14925 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
14926 which might make debugging harder.
14928 @item -mspecld-anomaly
14929 @opindex mspecld-anomaly
14930 When enabled, the compiler ensures that the generated code does not
14931 contain speculative loads after jump instructions. If this option is used,
14932 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
14934 @item -mno-specld-anomaly
14935 @opindex mno-specld-anomaly
14936 Don't generate extra code to prevent speculative loads from occurring.
14938 @item -mcsync-anomaly
14939 @opindex mcsync-anomaly
14940 When enabled, the compiler ensures that the generated code does not
14941 contain CSYNC or SSYNC instructions too soon after conditional branches.
14942 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
14944 @item -mno-csync-anomaly
14945 @opindex mno-csync-anomaly
14946 Don't generate extra code to prevent CSYNC or SSYNC instructions from
14947 occurring too soon after a conditional branch.
14949 @item -mlow-64k
14950 @opindex mlow-64k
14951 When enabled, the compiler is free to take advantage of the knowledge that
14952 the entire program fits into the low 64k of memory.
14954 @item -mno-low-64k
14955 @opindex mno-low-64k
14956 Assume that the program is arbitrarily large.  This is the default.
14958 @item -mstack-check-l1
14959 @opindex mstack-check-l1
14960 Do stack checking using information placed into L1 scratchpad memory by the
14961 uClinux kernel.
14963 @item -mid-shared-library
14964 @opindex mid-shared-library
14965 Generate code that supports shared libraries via the library ID method.
14966 This allows for execute in place and shared libraries in an environment
14967 without virtual memory management.  This option implies @option{-fPIC}.
14968 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14970 @item -mno-id-shared-library
14971 @opindex mno-id-shared-library
14972 Generate code that doesn't assume ID-based shared libraries are being used.
14973 This is the default.
14975 @item -mleaf-id-shared-library
14976 @opindex mleaf-id-shared-library
14977 Generate code that supports shared libraries via the library ID method,
14978 but assumes that this library or executable won't link against any other
14979 ID shared libraries.  That allows the compiler to use faster code for jumps
14980 and calls.
14982 @item -mno-leaf-id-shared-library
14983 @opindex mno-leaf-id-shared-library
14984 Do not assume that the code being compiled won't link against any ID shared
14985 libraries.  Slower code is generated for jump and call insns.
14987 @item -mshared-library-id=n
14988 @opindex mshared-library-id
14989 Specifies the identification number of the ID-based shared library being
14990 compiled.  Specifying a value of 0 generates more compact code; specifying
14991 other values forces the allocation of that number to the current
14992 library but is no more space- or time-efficient than omitting this option.
14994 @item -msep-data
14995 @opindex msep-data
14996 Generate code that allows the data segment to be located in a different
14997 area of memory from the text segment.  This allows for execute in place in
14998 an environment without virtual memory management by eliminating relocations
14999 against the text section.
15001 @item -mno-sep-data
15002 @opindex mno-sep-data
15003 Generate code that assumes that the data segment follows the text segment.
15004 This is the default.
15006 @item -mlong-calls
15007 @itemx -mno-long-calls
15008 @opindex mlong-calls
15009 @opindex mno-long-calls
15010 Tells the compiler to perform function calls by first loading the
15011 address of the function into a register and then performing a subroutine
15012 call on this register.  This switch is needed if the target function
15013 lies outside of the 24-bit addressing range of the offset-based
15014 version of subroutine call instruction.
15016 This feature is not enabled by default.  Specifying
15017 @option{-mno-long-calls} restores the default behavior.  Note these
15018 switches have no effect on how the compiler generates code to handle
15019 function calls via function pointers.
15021 @item -mfast-fp
15022 @opindex mfast-fp
15023 Link with the fast floating-point library. This library relaxes some of
15024 the IEEE floating-point standard's rules for checking inputs against
15025 Not-a-Number (NAN), in the interest of performance.
15027 @item -minline-plt
15028 @opindex minline-plt
15029 Enable inlining of PLT entries in function calls to functions that are
15030 not known to bind locally.  It has no effect without @option{-mfdpic}.
15032 @item -mmulticore
15033 @opindex mmulticore
15034 Build a standalone application for multicore Blackfin processors. 
15035 This option causes proper start files and link scripts supporting 
15036 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
15037 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
15039 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
15040 selects the one-application-per-core programming model.  Without
15041 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
15042 programming model is used. In this model, the main function of Core B
15043 should be named as @code{coreb_main}.
15045 If this option is not used, the single-core application programming
15046 model is used.
15048 @item -mcorea
15049 @opindex mcorea
15050 Build a standalone application for Core A of BF561 when using
15051 the one-application-per-core programming model. Proper start files
15052 and link scripts are used to support Core A, and the macro
15053 @code{__BFIN_COREA} is defined.
15054 This option can only be used in conjunction with @option{-mmulticore}.
15056 @item -mcoreb
15057 @opindex mcoreb
15058 Build a standalone application for Core B of BF561 when using
15059 the one-application-per-core programming model. Proper start files
15060 and link scripts are used to support Core B, and the macro
15061 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
15062 should be used instead of @code{main}. 
15063 This option can only be used in conjunction with @option{-mmulticore}.
15065 @item -msdram
15066 @opindex msdram
15067 Build a standalone application for SDRAM. Proper start files and
15068 link scripts are used to put the application into SDRAM, and the macro
15069 @code{__BFIN_SDRAM} is defined.
15070 The loader should initialize SDRAM before loading the application.
15072 @item -micplb
15073 @opindex micplb
15074 Assume that ICPLBs are enabled at run time.  This has an effect on certain
15075 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
15076 are enabled; for standalone applications the default is off.
15077 @end table
15079 @node C6X Options
15080 @subsection C6X Options
15081 @cindex C6X Options
15083 @table @gcctabopt
15084 @item -march=@var{name}
15085 @opindex march
15086 This specifies the name of the target architecture.  GCC uses this
15087 name to determine what kind of instructions it can emit when generating
15088 assembly code.  Permissible names are: @samp{c62x},
15089 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
15091 @item -mbig-endian
15092 @opindex mbig-endian
15093 Generate code for a big-endian target.
15095 @item -mlittle-endian
15096 @opindex mlittle-endian
15097 Generate code for a little-endian target.  This is the default.
15099 @item -msim
15100 @opindex msim
15101 Choose startup files and linker script suitable for the simulator.
15103 @item -msdata=default
15104 @opindex msdata=default
15105 Put small global and static data in the @code{.neardata} section,
15106 which is pointed to by register @code{B14}.  Put small uninitialized
15107 global and static data in the @code{.bss} section, which is adjacent
15108 to the @code{.neardata} section.  Put small read-only data into the
15109 @code{.rodata} section.  The corresponding sections used for large
15110 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
15112 @item -msdata=all
15113 @opindex msdata=all
15114 Put all data, not just small objects, into the sections reserved for
15115 small data, and use addressing relative to the @code{B14} register to
15116 access them.
15118 @item -msdata=none
15119 @opindex msdata=none
15120 Make no use of the sections reserved for small data, and use absolute
15121 addresses to access all data.  Put all initialized global and static
15122 data in the @code{.fardata} section, and all uninitialized data in the
15123 @code{.far} section.  Put all constant data into the @code{.const}
15124 section.
15125 @end table
15127 @node CRIS Options
15128 @subsection CRIS Options
15129 @cindex CRIS Options
15131 These options are defined specifically for the CRIS ports.
15133 @table @gcctabopt
15134 @item -march=@var{architecture-type}
15135 @itemx -mcpu=@var{architecture-type}
15136 @opindex march
15137 @opindex mcpu
15138 Generate code for the specified architecture.  The choices for
15139 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
15140 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
15141 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
15142 @samp{v10}.
15144 @item -mtune=@var{architecture-type}
15145 @opindex mtune
15146 Tune to @var{architecture-type} everything applicable about the generated
15147 code, except for the ABI and the set of available instructions.  The
15148 choices for @var{architecture-type} are the same as for
15149 @option{-march=@var{architecture-type}}.
15151 @item -mmax-stack-frame=@var{n}
15152 @opindex mmax-stack-frame
15153 Warn when the stack frame of a function exceeds @var{n} bytes.
15155 @item -metrax4
15156 @itemx -metrax100
15157 @opindex metrax4
15158 @opindex metrax100
15159 The options @option{-metrax4} and @option{-metrax100} are synonyms for
15160 @option{-march=v3} and @option{-march=v8} respectively.
15162 @item -mmul-bug-workaround
15163 @itemx -mno-mul-bug-workaround
15164 @opindex mmul-bug-workaround
15165 @opindex mno-mul-bug-workaround
15166 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
15167 models where it applies.  This option is active by default.
15169 @item -mpdebug
15170 @opindex mpdebug
15171 Enable CRIS-specific verbose debug-related information in the assembly
15172 code.  This option also has the effect of turning off the @samp{#NO_APP}
15173 formatted-code indicator to the assembler at the beginning of the
15174 assembly file.
15176 @item -mcc-init
15177 @opindex mcc-init
15178 Do not use condition-code results from previous instruction; always emit
15179 compare and test instructions before use of condition codes.
15181 @item -mno-side-effects
15182 @opindex mno-side-effects
15183 Do not emit instructions with side effects in addressing modes other than
15184 post-increment.
15186 @item -mstack-align
15187 @itemx -mno-stack-align
15188 @itemx -mdata-align
15189 @itemx -mno-data-align
15190 @itemx -mconst-align
15191 @itemx -mno-const-align
15192 @opindex mstack-align
15193 @opindex mno-stack-align
15194 @opindex mdata-align
15195 @opindex mno-data-align
15196 @opindex mconst-align
15197 @opindex mno-const-align
15198 These options (@samp{no-} options) arrange (eliminate arrangements) for the
15199 stack frame, individual data and constants to be aligned for the maximum
15200 single data access size for the chosen CPU model.  The default is to
15201 arrange for 32-bit alignment.  ABI details such as structure layout are
15202 not affected by these options.
15204 @item -m32-bit
15205 @itemx -m16-bit
15206 @itemx -m8-bit
15207 @opindex m32-bit
15208 @opindex m16-bit
15209 @opindex m8-bit
15210 Similar to the stack- data- and const-align options above, these options
15211 arrange for stack frame, writable data and constants to all be 32-bit,
15212 16-bit or 8-bit aligned.  The default is 32-bit alignment.
15214 @item -mno-prologue-epilogue
15215 @itemx -mprologue-epilogue
15216 @opindex mno-prologue-epilogue
15217 @opindex mprologue-epilogue
15218 With @option{-mno-prologue-epilogue}, the normal function prologue and
15219 epilogue which set up the stack frame are omitted and no return
15220 instructions or return sequences are generated in the code.  Use this
15221 option only together with visual inspection of the compiled code: no
15222 warnings or errors are generated when call-saved registers must be saved,
15223 or storage for local variables needs to be allocated.
15225 @item -mno-gotplt
15226 @itemx -mgotplt
15227 @opindex mno-gotplt
15228 @opindex mgotplt
15229 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
15230 instruction sequences that load addresses for functions from the PLT part
15231 of the GOT rather than (traditional on other architectures) calls to the
15232 PLT@.  The default is @option{-mgotplt}.
15234 @item -melf
15235 @opindex melf
15236 Legacy no-op option only recognized with the cris-axis-elf and
15237 cris-axis-linux-gnu targets.
15239 @item -mlinux
15240 @opindex mlinux
15241 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
15243 @item -sim
15244 @opindex sim
15245 This option, recognized for the cris-axis-elf, arranges
15246 to link with input-output functions from a simulator library.  Code,
15247 initialized data and zero-initialized data are allocated consecutively.
15249 @item -sim2
15250 @opindex sim2
15251 Like @option{-sim}, but pass linker options to locate initialized data at
15252 0x40000000 and zero-initialized data at 0x80000000.
15253 @end table
15255 @node CR16 Options
15256 @subsection CR16 Options
15257 @cindex CR16 Options
15259 These options are defined specifically for the CR16 ports.
15261 @table @gcctabopt
15263 @item -mmac
15264 @opindex mmac
15265 Enable the use of multiply-accumulate instructions. Disabled by default.
15267 @item -mcr16cplus
15268 @itemx -mcr16c
15269 @opindex mcr16cplus
15270 @opindex mcr16c
15271 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
15272 is default.
15274 @item -msim
15275 @opindex msim
15276 Links the library libsim.a which is in compatible with simulator. Applicable
15277 to ELF compiler only.
15279 @item -mint32
15280 @opindex mint32
15281 Choose integer type as 32-bit wide.
15283 @item -mbit-ops
15284 @opindex mbit-ops
15285 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
15287 @item -mdata-model=@var{model}
15288 @opindex mdata-model
15289 Choose a data model. The choices for @var{model} are @samp{near},
15290 @samp{far} or @samp{medium}. @samp{medium} is default.
15291 However, @samp{far} is not valid with @option{-mcr16c}, as the
15292 CR16C architecture does not support the far data model.
15293 @end table
15295 @node Darwin Options
15296 @subsection Darwin Options
15297 @cindex Darwin options
15299 These options are defined for all architectures running the Darwin operating
15300 system.
15302 FSF GCC on Darwin does not create ``fat'' object files; it creates
15303 an object file for the single architecture that GCC was built to
15304 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
15305 @option{-arch} options are used; it does so by running the compiler or
15306 linker multiple times and joining the results together with
15307 @file{lipo}.
15309 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
15310 @samp{i686}) is determined by the flags that specify the ISA
15311 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
15312 @option{-force_cpusubtype_ALL} option can be used to override this.
15314 The Darwin tools vary in their behavior when presented with an ISA
15315 mismatch.  The assembler, @file{as}, only permits instructions to
15316 be used that are valid for the subtype of the file it is generating,
15317 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
15318 The linker for shared libraries, @file{/usr/bin/libtool}, fails
15319 and prints an error if asked to create a shared library with a less
15320 restrictive subtype than its input files (for instance, trying to put
15321 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
15322 for executables, @command{ld}, quietly gives the executable the most
15323 restrictive subtype of any of its input files.
15325 @table @gcctabopt
15326 @item -F@var{dir}
15327 @opindex F
15328 Add the framework directory @var{dir} to the head of the list of
15329 directories to be searched for header files.  These directories are
15330 interleaved with those specified by @option{-I} options and are
15331 scanned in a left-to-right order.
15333 A framework directory is a directory with frameworks in it.  A
15334 framework is a directory with a @file{Headers} and/or
15335 @file{PrivateHeaders} directory contained directly in it that ends
15336 in @file{.framework}.  The name of a framework is the name of this
15337 directory excluding the @file{.framework}.  Headers associated with
15338 the framework are found in one of those two directories, with
15339 @file{Headers} being searched first.  A subframework is a framework
15340 directory that is in a framework's @file{Frameworks} directory.
15341 Includes of subframework headers can only appear in a header of a
15342 framework that contains the subframework, or in a sibling subframework
15343 header.  Two subframeworks are siblings if they occur in the same
15344 framework.  A subframework should not have the same name as a
15345 framework; a warning is issued if this is violated.  Currently a
15346 subframework cannot have subframeworks; in the future, the mechanism
15347 may be extended to support this.  The standard frameworks can be found
15348 in @file{/System/Library/Frameworks} and
15349 @file{/Library/Frameworks}.  An example include looks like
15350 @code{#include <Framework/header.h>}, where @file{Framework} denotes
15351 the name of the framework and @file{header.h} is found in the
15352 @file{PrivateHeaders} or @file{Headers} directory.
15354 @item -iframework@var{dir}
15355 @opindex iframework
15356 Like @option{-F} except the directory is a treated as a system
15357 directory.  The main difference between this @option{-iframework} and
15358 @option{-F} is that with @option{-iframework} the compiler does not
15359 warn about constructs contained within header files found via
15360 @var{dir}.  This option is valid only for the C family of languages.
15362 @item -gused
15363 @opindex gused
15364 Emit debugging information for symbols that are used.  For stabs
15365 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
15366 This is by default ON@.
15368 @item -gfull
15369 @opindex gfull
15370 Emit debugging information for all symbols and types.
15372 @item -mmacosx-version-min=@var{version}
15373 The earliest version of MacOS X that this executable will run on
15374 is @var{version}.  Typical values of @var{version} include @code{10.1},
15375 @code{10.2}, and @code{10.3.9}.
15377 If the compiler was built to use the system's headers by default,
15378 then the default for this option is the system version on which the
15379 compiler is running, otherwise the default is to make choices that
15380 are compatible with as many systems and code bases as possible.
15382 @item -mkernel
15383 @opindex mkernel
15384 Enable kernel development mode.  The @option{-mkernel} option sets
15385 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
15386 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
15387 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
15388 applicable.  This mode also sets @option{-mno-altivec},
15389 @option{-msoft-float}, @option{-fno-builtin} and
15390 @option{-mlong-branch} for PowerPC targets.
15392 @item -mone-byte-bool
15393 @opindex mone-byte-bool
15394 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
15395 By default @code{sizeof(bool)} is @code{4} when compiling for
15396 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
15397 option has no effect on x86.
15399 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
15400 to generate code that is not binary compatible with code generated
15401 without that switch.  Using this switch may require recompiling all
15402 other modules in a program, including system libraries.  Use this
15403 switch to conform to a non-default data model.
15405 @item -mfix-and-continue
15406 @itemx -ffix-and-continue
15407 @itemx -findirect-data
15408 @opindex mfix-and-continue
15409 @opindex ffix-and-continue
15410 @opindex findirect-data
15411 Generate code suitable for fast turnaround development, such as to
15412 allow GDB to dynamically load @file{.o} files into already-running
15413 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
15414 are provided for backwards compatibility.
15416 @item -all_load
15417 @opindex all_load
15418 Loads all members of static archive libraries.
15419 See man ld(1) for more information.
15421 @item -arch_errors_fatal
15422 @opindex arch_errors_fatal
15423 Cause the errors having to do with files that have the wrong architecture
15424 to be fatal.
15426 @item -bind_at_load
15427 @opindex bind_at_load
15428 Causes the output file to be marked such that the dynamic linker will
15429 bind all undefined references when the file is loaded or launched.
15431 @item -bundle
15432 @opindex bundle
15433 Produce a Mach-o bundle format file.
15434 See man ld(1) for more information.
15436 @item -bundle_loader @var{executable}
15437 @opindex bundle_loader
15438 This option specifies the @var{executable} that will load the build
15439 output file being linked.  See man ld(1) for more information.
15441 @item -dynamiclib
15442 @opindex dynamiclib
15443 When passed this option, GCC produces a dynamic library instead of
15444 an executable when linking, using the Darwin @file{libtool} command.
15446 @item -force_cpusubtype_ALL
15447 @opindex force_cpusubtype_ALL
15448 This causes GCC's output file to have the @samp{ALL} subtype, instead of
15449 one controlled by the @option{-mcpu} or @option{-march} option.
15451 @item -allowable_client  @var{client_name}
15452 @itemx -client_name
15453 @itemx -compatibility_version
15454 @itemx -current_version
15455 @itemx -dead_strip
15456 @itemx -dependency-file
15457 @itemx -dylib_file
15458 @itemx -dylinker_install_name
15459 @itemx -dynamic
15460 @itemx -exported_symbols_list
15461 @itemx -filelist
15462 @need 800
15463 @itemx -flat_namespace
15464 @itemx -force_flat_namespace
15465 @itemx -headerpad_max_install_names
15466 @itemx -image_base
15467 @itemx -init
15468 @itemx -install_name
15469 @itemx -keep_private_externs
15470 @itemx -multi_module
15471 @itemx -multiply_defined
15472 @itemx -multiply_defined_unused
15473 @need 800
15474 @itemx -noall_load
15475 @itemx -no_dead_strip_inits_and_terms
15476 @itemx -nofixprebinding
15477 @itemx -nomultidefs
15478 @itemx -noprebind
15479 @itemx -noseglinkedit
15480 @itemx -pagezero_size
15481 @itemx -prebind
15482 @itemx -prebind_all_twolevel_modules
15483 @itemx -private_bundle
15484 @need 800
15485 @itemx -read_only_relocs
15486 @itemx -sectalign
15487 @itemx -sectobjectsymbols
15488 @itemx -whyload
15489 @itemx -seg1addr
15490 @itemx -sectcreate
15491 @itemx -sectobjectsymbols
15492 @itemx -sectorder
15493 @itemx -segaddr
15494 @itemx -segs_read_only_addr
15495 @need 800
15496 @itemx -segs_read_write_addr
15497 @itemx -seg_addr_table
15498 @itemx -seg_addr_table_filename
15499 @itemx -seglinkedit
15500 @itemx -segprot
15501 @itemx -segs_read_only_addr
15502 @itemx -segs_read_write_addr
15503 @itemx -single_module
15504 @itemx -static
15505 @itemx -sub_library
15506 @need 800
15507 @itemx -sub_umbrella
15508 @itemx -twolevel_namespace
15509 @itemx -umbrella
15510 @itemx -undefined
15511 @itemx -unexported_symbols_list
15512 @itemx -weak_reference_mismatches
15513 @itemx -whatsloaded
15514 @opindex allowable_client
15515 @opindex client_name
15516 @opindex compatibility_version
15517 @opindex current_version
15518 @opindex dead_strip
15519 @opindex dependency-file
15520 @opindex dylib_file
15521 @opindex dylinker_install_name
15522 @opindex dynamic
15523 @opindex exported_symbols_list
15524 @opindex filelist
15525 @opindex flat_namespace
15526 @opindex force_flat_namespace
15527 @opindex headerpad_max_install_names
15528 @opindex image_base
15529 @opindex init
15530 @opindex install_name
15531 @opindex keep_private_externs
15532 @opindex multi_module
15533 @opindex multiply_defined
15534 @opindex multiply_defined_unused
15535 @opindex noall_load
15536 @opindex no_dead_strip_inits_and_terms
15537 @opindex nofixprebinding
15538 @opindex nomultidefs
15539 @opindex noprebind
15540 @opindex noseglinkedit
15541 @opindex pagezero_size
15542 @opindex prebind
15543 @opindex prebind_all_twolevel_modules
15544 @opindex private_bundle
15545 @opindex read_only_relocs
15546 @opindex sectalign
15547 @opindex sectobjectsymbols
15548 @opindex whyload
15549 @opindex seg1addr
15550 @opindex sectcreate
15551 @opindex sectobjectsymbols
15552 @opindex sectorder
15553 @opindex segaddr
15554 @opindex segs_read_only_addr
15555 @opindex segs_read_write_addr
15556 @opindex seg_addr_table
15557 @opindex seg_addr_table_filename
15558 @opindex seglinkedit
15559 @opindex segprot
15560 @opindex segs_read_only_addr
15561 @opindex segs_read_write_addr
15562 @opindex single_module
15563 @opindex static
15564 @opindex sub_library
15565 @opindex sub_umbrella
15566 @opindex twolevel_namespace
15567 @opindex umbrella
15568 @opindex undefined
15569 @opindex unexported_symbols_list
15570 @opindex weak_reference_mismatches
15571 @opindex whatsloaded
15572 These options are passed to the Darwin linker.  The Darwin linker man page
15573 describes them in detail.
15574 @end table
15576 @node DEC Alpha Options
15577 @subsection DEC Alpha Options
15579 These @samp{-m} options are defined for the DEC Alpha implementations:
15581 @table @gcctabopt
15582 @item -mno-soft-float
15583 @itemx -msoft-float
15584 @opindex mno-soft-float
15585 @opindex msoft-float
15586 Use (do not use) the hardware floating-point instructions for
15587 floating-point operations.  When @option{-msoft-float} is specified,
15588 functions in @file{libgcc.a} are used to perform floating-point
15589 operations.  Unless they are replaced by routines that emulate the
15590 floating-point operations, or compiled in such a way as to call such
15591 emulations routines, these routines issue floating-point
15592 operations.   If you are compiling for an Alpha without floating-point
15593 operations, you must ensure that the library is built so as not to call
15594 them.
15596 Note that Alpha implementations without floating-point operations are
15597 required to have floating-point registers.
15599 @item -mfp-reg
15600 @itemx -mno-fp-regs
15601 @opindex mfp-reg
15602 @opindex mno-fp-regs
15603 Generate code that uses (does not use) the floating-point register set.
15604 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
15605 register set is not used, floating-point operands are passed in integer
15606 registers as if they were integers and floating-point results are passed
15607 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
15608 so any function with a floating-point argument or return value called by code
15609 compiled with @option{-mno-fp-regs} must also be compiled with that
15610 option.
15612 A typical use of this option is building a kernel that does not use,
15613 and hence need not save and restore, any floating-point registers.
15615 @item -mieee
15616 @opindex mieee
15617 The Alpha architecture implements floating-point hardware optimized for
15618 maximum performance.  It is mostly compliant with the IEEE floating-point
15619 standard.  However, for full compliance, software assistance is
15620 required.  This option generates code fully IEEE-compliant code
15621 @emph{except} that the @var{inexact-flag} is not maintained (see below).
15622 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
15623 defined during compilation.  The resulting code is less efficient but is
15624 able to correctly support denormalized numbers and exceptional IEEE
15625 values such as not-a-number and plus/minus infinity.  Other Alpha
15626 compilers call this option @option{-ieee_with_no_inexact}.
15628 @item -mieee-with-inexact
15629 @opindex mieee-with-inexact
15630 This is like @option{-mieee} except the generated code also maintains
15631 the IEEE @var{inexact-flag}.  Turning on this option causes the
15632 generated code to implement fully-compliant IEEE math.  In addition to
15633 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
15634 macro.  On some Alpha implementations the resulting code may execute
15635 significantly slower than the code generated by default.  Since there is
15636 very little code that depends on the @var{inexact-flag}, you should
15637 normally not specify this option.  Other Alpha compilers call this
15638 option @option{-ieee_with_inexact}.
15640 @item -mfp-trap-mode=@var{trap-mode}
15641 @opindex mfp-trap-mode
15642 This option controls what floating-point related traps are enabled.
15643 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
15644 The trap mode can be set to one of four values:
15646 @table @samp
15647 @item n
15648 This is the default (normal) setting.  The only traps that are enabled
15649 are the ones that cannot be disabled in software (e.g., division by zero
15650 trap).
15652 @item u
15653 In addition to the traps enabled by @samp{n}, underflow traps are enabled
15654 as well.
15656 @item su
15657 Like @samp{u}, but the instructions are marked to be safe for software
15658 completion (see Alpha architecture manual for details).
15660 @item sui
15661 Like @samp{su}, but inexact traps are enabled as well.
15662 @end table
15664 @item -mfp-rounding-mode=@var{rounding-mode}
15665 @opindex mfp-rounding-mode
15666 Selects the IEEE rounding mode.  Other Alpha compilers call this option
15667 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
15670 @table @samp
15671 @item n
15672 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
15673 the nearest machine number or towards the even machine number in case
15674 of a tie.
15676 @item m
15677 Round towards minus infinity.
15679 @item c
15680 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
15682 @item d
15683 Dynamic rounding mode.  A field in the floating-point control register
15684 (@var{fpcr}, see Alpha architecture reference manual) controls the
15685 rounding mode in effect.  The C library initializes this register for
15686 rounding towards plus infinity.  Thus, unless your program modifies the
15687 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
15688 @end table
15690 @item -mtrap-precision=@var{trap-precision}
15691 @opindex mtrap-precision
15692 In the Alpha architecture, floating-point traps are imprecise.  This
15693 means without software assistance it is impossible to recover from a
15694 floating trap and program execution normally needs to be terminated.
15695 GCC can generate code that can assist operating system trap handlers
15696 in determining the exact location that caused a floating-point trap.
15697 Depending on the requirements of an application, different levels of
15698 precisions can be selected:
15700 @table @samp
15701 @item p
15702 Program precision.  This option is the default and means a trap handler
15703 can only identify which program caused a floating-point exception.
15705 @item f
15706 Function precision.  The trap handler can determine the function that
15707 caused a floating-point exception.
15709 @item i
15710 Instruction precision.  The trap handler can determine the exact
15711 instruction that caused a floating-point exception.
15712 @end table
15714 Other Alpha compilers provide the equivalent options called
15715 @option{-scope_safe} and @option{-resumption_safe}.
15717 @item -mieee-conformant
15718 @opindex mieee-conformant
15719 This option marks the generated code as IEEE conformant.  You must not
15720 use this option unless you also specify @option{-mtrap-precision=i} and either
15721 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
15722 is to emit the line @samp{.eflag 48} in the function prologue of the
15723 generated assembly file.
15725 @item -mbuild-constants
15726 @opindex mbuild-constants
15727 Normally GCC examines a 32- or 64-bit integer constant to
15728 see if it can construct it from smaller constants in two or three
15729 instructions.  If it cannot, it outputs the constant as a literal and
15730 generates code to load it from the data segment at run time.
15732 Use this option to require GCC to construct @emph{all} integer constants
15733 using code, even if it takes more instructions (the maximum is six).
15735 You typically use this option to build a shared library dynamic
15736 loader.  Itself a shared library, it must relocate itself in memory
15737 before it can find the variables and constants in its own data segment.
15739 @item -mbwx
15740 @itemx -mno-bwx
15741 @itemx -mcix
15742 @itemx -mno-cix
15743 @itemx -mfix
15744 @itemx -mno-fix
15745 @itemx -mmax
15746 @itemx -mno-max
15747 @opindex mbwx
15748 @opindex mno-bwx
15749 @opindex mcix
15750 @opindex mno-cix
15751 @opindex mfix
15752 @opindex mno-fix
15753 @opindex mmax
15754 @opindex mno-max
15755 Indicate whether GCC should generate code to use the optional BWX,
15756 CIX, FIX and MAX instruction sets.  The default is to use the instruction
15757 sets supported by the CPU type specified via @option{-mcpu=} option or that
15758 of the CPU on which GCC was built if none is specified.
15760 @item -mfloat-vax
15761 @itemx -mfloat-ieee
15762 @opindex mfloat-vax
15763 @opindex mfloat-ieee
15764 Generate code that uses (does not use) VAX F and G floating-point
15765 arithmetic instead of IEEE single and double precision.
15767 @item -mexplicit-relocs
15768 @itemx -mno-explicit-relocs
15769 @opindex mexplicit-relocs
15770 @opindex mno-explicit-relocs
15771 Older Alpha assemblers provided no way to generate symbol relocations
15772 except via assembler macros.  Use of these macros does not allow
15773 optimal instruction scheduling.  GNU binutils as of version 2.12
15774 supports a new syntax that allows the compiler to explicitly mark
15775 which relocations should apply to which instructions.  This option
15776 is mostly useful for debugging, as GCC detects the capabilities of
15777 the assembler when it is built and sets the default accordingly.
15779 @item -msmall-data
15780 @itemx -mlarge-data
15781 @opindex msmall-data
15782 @opindex mlarge-data
15783 When @option{-mexplicit-relocs} is in effect, static data is
15784 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
15785 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
15786 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
15787 16-bit relocations off of the @code{$gp} register.  This limits the
15788 size of the small data area to 64KB, but allows the variables to be
15789 directly accessed via a single instruction.
15791 The default is @option{-mlarge-data}.  With this option the data area
15792 is limited to just below 2GB@.  Programs that require more than 2GB of
15793 data must use @code{malloc} or @code{mmap} to allocate the data in the
15794 heap instead of in the program's data segment.
15796 When generating code for shared libraries, @option{-fpic} implies
15797 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
15799 @item -msmall-text
15800 @itemx -mlarge-text
15801 @opindex msmall-text
15802 @opindex mlarge-text
15803 When @option{-msmall-text} is used, the compiler assumes that the
15804 code of the entire program (or shared library) fits in 4MB, and is
15805 thus reachable with a branch instruction.  When @option{-msmall-data}
15806 is used, the compiler can assume that all local symbols share the
15807 same @code{$gp} value, and thus reduce the number of instructions
15808 required for a function call from 4 to 1.
15810 The default is @option{-mlarge-text}.
15812 @item -mcpu=@var{cpu_type}
15813 @opindex mcpu
15814 Set the instruction set and instruction scheduling parameters for
15815 machine type @var{cpu_type}.  You can specify either the @samp{EV}
15816 style name or the corresponding chip number.  GCC supports scheduling
15817 parameters for the EV4, EV5 and EV6 family of processors and
15818 chooses the default values for the instruction set from the processor
15819 you specify.  If you do not specify a processor type, GCC defaults
15820 to the processor on which the compiler was built.
15822 Supported values for @var{cpu_type} are
15824 @table @samp
15825 @item ev4
15826 @itemx ev45
15827 @itemx 21064
15828 Schedules as an EV4 and has no instruction set extensions.
15830 @item ev5
15831 @itemx 21164
15832 Schedules as an EV5 and has no instruction set extensions.
15834 @item ev56
15835 @itemx 21164a
15836 Schedules as an EV5 and supports the BWX extension.
15838 @item pca56
15839 @itemx 21164pc
15840 @itemx 21164PC
15841 Schedules as an EV5 and supports the BWX and MAX extensions.
15843 @item ev6
15844 @itemx 21264
15845 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
15847 @item ev67
15848 @itemx 21264a
15849 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
15850 @end table
15852 Native toolchains also support the value @samp{native},
15853 which selects the best architecture option for the host processor.
15854 @option{-mcpu=native} has no effect if GCC does not recognize
15855 the processor.
15857 @item -mtune=@var{cpu_type}
15858 @opindex mtune
15859 Set only the instruction scheduling parameters for machine type
15860 @var{cpu_type}.  The instruction set is not changed.
15862 Native toolchains also support the value @samp{native},
15863 which selects the best architecture option for the host processor.
15864 @option{-mtune=native} has no effect if GCC does not recognize
15865 the processor.
15867 @item -mmemory-latency=@var{time}
15868 @opindex mmemory-latency
15869 Sets the latency the scheduler should assume for typical memory
15870 references as seen by the application.  This number is highly
15871 dependent on the memory access patterns used by the application
15872 and the size of the external cache on the machine.
15874 Valid options for @var{time} are
15876 @table @samp
15877 @item @var{number}
15878 A decimal number representing clock cycles.
15880 @item L1
15881 @itemx L2
15882 @itemx L3
15883 @itemx main
15884 The compiler contains estimates of the number of clock cycles for
15885 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
15886 (also called Dcache, Scache, and Bcache), as well as to main memory.
15887 Note that L3 is only valid for EV5.
15889 @end table
15890 @end table
15892 @node FR30 Options
15893 @subsection FR30 Options
15894 @cindex FR30 Options
15896 These options are defined specifically for the FR30 port.
15898 @table @gcctabopt
15900 @item -msmall-model
15901 @opindex msmall-model
15902 Use the small address space model.  This can produce smaller code, but
15903 it does assume that all symbolic values and addresses fit into a
15904 20-bit range.
15906 @item -mno-lsim
15907 @opindex mno-lsim
15908 Assume that runtime support has been provided and so there is no need
15909 to include the simulator library (@file{libsim.a}) on the linker
15910 command line.
15912 @end table
15914 @node FT32 Options
15915 @subsection FT32 Options
15916 @cindex FT32 Options
15918 These options are defined specifically for the FT32 port.
15920 @table @gcctabopt
15922 @item -msim
15923 @opindex msim
15924 Specifies that the program will be run on the simulator.  This causes
15925 an alternate runtime startup and library to be linked.
15926 You must not use this option when generating programs that will run on
15927 real hardware; you must provide your own runtime library for whatever
15928 I/O functions are needed.
15930 @item -mlra
15931 @opindex mlra
15932 Enable Local Register Allocation.  This is still experimental for FT32,
15933 so by default the compiler uses standard reload.
15935 @item -mnodiv
15936 @opindex mnodiv
15937 Do not use div and mod instructions.
15939 @end table
15941 @node FRV Options
15942 @subsection FRV Options
15943 @cindex FRV Options
15945 @table @gcctabopt
15946 @item -mgpr-32
15947 @opindex mgpr-32
15949 Only use the first 32 general-purpose registers.
15951 @item -mgpr-64
15952 @opindex mgpr-64
15954 Use all 64 general-purpose registers.
15956 @item -mfpr-32
15957 @opindex mfpr-32
15959 Use only the first 32 floating-point registers.
15961 @item -mfpr-64
15962 @opindex mfpr-64
15964 Use all 64 floating-point registers.
15966 @item -mhard-float
15967 @opindex mhard-float
15969 Use hardware instructions for floating-point operations.
15971 @item -msoft-float
15972 @opindex msoft-float
15974 Use library routines for floating-point operations.
15976 @item -malloc-cc
15977 @opindex malloc-cc
15979 Dynamically allocate condition code registers.
15981 @item -mfixed-cc
15982 @opindex mfixed-cc
15984 Do not try to dynamically allocate condition code registers, only
15985 use @code{icc0} and @code{fcc0}.
15987 @item -mdword
15988 @opindex mdword
15990 Change ABI to use double word insns.
15992 @item -mno-dword
15993 @opindex mno-dword
15995 Do not use double word instructions.
15997 @item -mdouble
15998 @opindex mdouble
16000 Use floating-point double instructions.
16002 @item -mno-double
16003 @opindex mno-double
16005 Do not use floating-point double instructions.
16007 @item -mmedia
16008 @opindex mmedia
16010 Use media instructions.
16012 @item -mno-media
16013 @opindex mno-media
16015 Do not use media instructions.
16017 @item -mmuladd
16018 @opindex mmuladd
16020 Use multiply and add/subtract instructions.
16022 @item -mno-muladd
16023 @opindex mno-muladd
16025 Do not use multiply and add/subtract instructions.
16027 @item -mfdpic
16028 @opindex mfdpic
16030 Select the FDPIC ABI, which uses function descriptors to represent
16031 pointers to functions.  Without any PIC/PIE-related options, it
16032 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
16033 assumes GOT entries and small data are within a 12-bit range from the
16034 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
16035 are computed with 32 bits.
16036 With a @samp{bfin-elf} target, this option implies @option{-msim}.
16038 @item -minline-plt
16039 @opindex minline-plt
16041 Enable inlining of PLT entries in function calls to functions that are
16042 not known to bind locally.  It has no effect without @option{-mfdpic}.
16043 It's enabled by default if optimizing for speed and compiling for
16044 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
16045 optimization option such as @option{-O3} or above is present in the
16046 command line.
16048 @item -mTLS
16049 @opindex mTLS
16051 Assume a large TLS segment when generating thread-local code.
16053 @item -mtls
16054 @opindex mtls
16056 Do not assume a large TLS segment when generating thread-local code.
16058 @item -mgprel-ro
16059 @opindex mgprel-ro
16061 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
16062 that is known to be in read-only sections.  It's enabled by default,
16063 except for @option{-fpic} or @option{-fpie}: even though it may help
16064 make the global offset table smaller, it trades 1 instruction for 4.
16065 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
16066 one of which may be shared by multiple symbols, and it avoids the need
16067 for a GOT entry for the referenced symbol, so it's more likely to be a
16068 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
16070 @item -multilib-library-pic
16071 @opindex multilib-library-pic
16073 Link with the (library, not FD) pic libraries.  It's implied by
16074 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
16075 @option{-fpic} without @option{-mfdpic}.  You should never have to use
16076 it explicitly.
16078 @item -mlinked-fp
16079 @opindex mlinked-fp
16081 Follow the EABI requirement of always creating a frame pointer whenever
16082 a stack frame is allocated.  This option is enabled by default and can
16083 be disabled with @option{-mno-linked-fp}.
16085 @item -mlong-calls
16086 @opindex mlong-calls
16088 Use indirect addressing to call functions outside the current
16089 compilation unit.  This allows the functions to be placed anywhere
16090 within the 32-bit address space.
16092 @item -malign-labels
16093 @opindex malign-labels
16095 Try to align labels to an 8-byte boundary by inserting NOPs into the
16096 previous packet.  This option only has an effect when VLIW packing
16097 is enabled.  It doesn't create new packets; it merely adds NOPs to
16098 existing ones.
16100 @item -mlibrary-pic
16101 @opindex mlibrary-pic
16103 Generate position-independent EABI code.
16105 @item -macc-4
16106 @opindex macc-4
16108 Use only the first four media accumulator registers.
16110 @item -macc-8
16111 @opindex macc-8
16113 Use all eight media accumulator registers.
16115 @item -mpack
16116 @opindex mpack
16118 Pack VLIW instructions.
16120 @item -mno-pack
16121 @opindex mno-pack
16123 Do not pack VLIW instructions.
16125 @item -mno-eflags
16126 @opindex mno-eflags
16128 Do not mark ABI switches in e_flags.
16130 @item -mcond-move
16131 @opindex mcond-move
16133 Enable the use of conditional-move instructions (default).
16135 This switch is mainly for debugging the compiler and will likely be removed
16136 in a future version.
16138 @item -mno-cond-move
16139 @opindex mno-cond-move
16141 Disable the use of conditional-move instructions.
16143 This switch is mainly for debugging the compiler and will likely be removed
16144 in a future version.
16146 @item -mscc
16147 @opindex mscc
16149 Enable the use of conditional set instructions (default).
16151 This switch is mainly for debugging the compiler and will likely be removed
16152 in a future version.
16154 @item -mno-scc
16155 @opindex mno-scc
16157 Disable the use of conditional set instructions.
16159 This switch is mainly for debugging the compiler and will likely be removed
16160 in a future version.
16162 @item -mcond-exec
16163 @opindex mcond-exec
16165 Enable the use of conditional execution (default).
16167 This switch is mainly for debugging the compiler and will likely be removed
16168 in a future version.
16170 @item -mno-cond-exec
16171 @opindex mno-cond-exec
16173 Disable the use of conditional execution.
16175 This switch is mainly for debugging the compiler and will likely be removed
16176 in a future version.
16178 @item -mvliw-branch
16179 @opindex mvliw-branch
16181 Run a pass to pack branches into VLIW instructions (default).
16183 This switch is mainly for debugging the compiler and will likely be removed
16184 in a future version.
16186 @item -mno-vliw-branch
16187 @opindex mno-vliw-branch
16189 Do not run a pass to pack branches into VLIW instructions.
16191 This switch is mainly for debugging the compiler and will likely be removed
16192 in a future version.
16194 @item -mmulti-cond-exec
16195 @opindex mmulti-cond-exec
16197 Enable optimization of @code{&&} and @code{||} in conditional execution
16198 (default).
16200 This switch is mainly for debugging the compiler and will likely be removed
16201 in a future version.
16203 @item -mno-multi-cond-exec
16204 @opindex mno-multi-cond-exec
16206 Disable optimization of @code{&&} and @code{||} in conditional execution.
16208 This switch is mainly for debugging the compiler and will likely be removed
16209 in a future version.
16211 @item -mnested-cond-exec
16212 @opindex mnested-cond-exec
16214 Enable nested conditional execution optimizations (default).
16216 This switch is mainly for debugging the compiler and will likely be removed
16217 in a future version.
16219 @item -mno-nested-cond-exec
16220 @opindex mno-nested-cond-exec
16222 Disable nested conditional execution optimizations.
16224 This switch is mainly for debugging the compiler and will likely be removed
16225 in a future version.
16227 @item -moptimize-membar
16228 @opindex moptimize-membar
16230 This switch removes redundant @code{membar} instructions from the
16231 compiler-generated code.  It is enabled by default.
16233 @item -mno-optimize-membar
16234 @opindex mno-optimize-membar
16236 This switch disables the automatic removal of redundant @code{membar}
16237 instructions from the generated code.
16239 @item -mtomcat-stats
16240 @opindex mtomcat-stats
16242 Cause gas to print out tomcat statistics.
16244 @item -mcpu=@var{cpu}
16245 @opindex mcpu
16247 Select the processor type for which to generate code.  Possible values are
16248 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
16249 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
16251 @end table
16253 @node GNU/Linux Options
16254 @subsection GNU/Linux Options
16256 These @samp{-m} options are defined for GNU/Linux targets:
16258 @table @gcctabopt
16259 @item -mglibc
16260 @opindex mglibc
16261 Use the GNU C library.  This is the default except
16262 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
16263 @samp{*-*-linux-*android*} targets.
16265 @item -muclibc
16266 @opindex muclibc
16267 Use uClibc C library.  This is the default on
16268 @samp{*-*-linux-*uclibc*} targets.
16270 @item -mmusl
16271 @opindex mmusl
16272 Use the musl C library.  This is the default on
16273 @samp{*-*-linux-*musl*} targets.
16275 @item -mbionic
16276 @opindex mbionic
16277 Use Bionic C library.  This is the default on
16278 @samp{*-*-linux-*android*} targets.
16280 @item -mandroid
16281 @opindex mandroid
16282 Compile code compatible with Android platform.  This is the default on
16283 @samp{*-*-linux-*android*} targets.
16285 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
16286 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
16287 this option makes the GCC driver pass Android-specific options to the linker.
16288 Finally, this option causes the preprocessor macro @code{__ANDROID__}
16289 to be defined.
16291 @item -tno-android-cc
16292 @opindex tno-android-cc
16293 Disable compilation effects of @option{-mandroid}, i.e., do not enable
16294 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
16295 @option{-fno-rtti} by default.
16297 @item -tno-android-ld
16298 @opindex tno-android-ld
16299 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
16300 linking options to the linker.
16302 @end table
16304 @node H8/300 Options
16305 @subsection H8/300 Options
16307 These @samp{-m} options are defined for the H8/300 implementations:
16309 @table @gcctabopt
16310 @item -mrelax
16311 @opindex mrelax
16312 Shorten some address references at link time, when possible; uses the
16313 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
16314 ld, Using ld}, for a fuller description.
16316 @item -mh
16317 @opindex mh
16318 Generate code for the H8/300H@.
16320 @item -ms
16321 @opindex ms
16322 Generate code for the H8S@.
16324 @item -mn
16325 @opindex mn
16326 Generate code for the H8S and H8/300H in the normal mode.  This switch
16327 must be used either with @option{-mh} or @option{-ms}.
16329 @item -ms2600
16330 @opindex ms2600
16331 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
16333 @item -mexr
16334 @opindex mexr
16335 Extended registers are stored on stack before execution of function
16336 with monitor attribute. Default option is @option{-mexr}.
16337 This option is valid only for H8S targets.
16339 @item -mno-exr
16340 @opindex mno-exr
16341 Extended registers are not stored on stack before execution of function 
16342 with monitor attribute. Default option is @option{-mno-exr}. 
16343 This option is valid only for H8S targets.
16345 @item -mint32
16346 @opindex mint32
16347 Make @code{int} data 32 bits by default.
16349 @item -malign-300
16350 @opindex malign-300
16351 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
16352 The default for the H8/300H and H8S is to align longs and floats on
16353 4-byte boundaries.
16354 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
16355 This option has no effect on the H8/300.
16356 @end table
16358 @node HPPA Options
16359 @subsection HPPA Options
16360 @cindex HPPA Options
16362 These @samp{-m} options are defined for the HPPA family of computers:
16364 @table @gcctabopt
16365 @item -march=@var{architecture-type}
16366 @opindex march
16367 Generate code for the specified architecture.  The choices for
16368 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
16369 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
16370 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
16371 architecture option for your machine.  Code compiled for lower numbered
16372 architectures runs on higher numbered architectures, but not the
16373 other way around.
16375 @item -mpa-risc-1-0
16376 @itemx -mpa-risc-1-1
16377 @itemx -mpa-risc-2-0
16378 @opindex mpa-risc-1-0
16379 @opindex mpa-risc-1-1
16380 @opindex mpa-risc-2-0
16381 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
16383 @item -mjump-in-delay
16384 @opindex mjump-in-delay
16385 This option is ignored and provided for compatibility purposes only.
16387 @item -mdisable-fpregs
16388 @opindex mdisable-fpregs
16389 Prevent floating-point registers from being used in any manner.  This is
16390 necessary for compiling kernels that perform lazy context switching of
16391 floating-point registers.  If you use this option and attempt to perform
16392 floating-point operations, the compiler aborts.
16394 @item -mdisable-indexing
16395 @opindex mdisable-indexing
16396 Prevent the compiler from using indexing address modes.  This avoids some
16397 rather obscure problems when compiling MIG generated code under MACH@.
16399 @item -mno-space-regs
16400 @opindex mno-space-regs
16401 Generate code that assumes the target has no space registers.  This allows
16402 GCC to generate faster indirect calls and use unscaled index address modes.
16404 Such code is suitable for level 0 PA systems and kernels.
16406 @item -mfast-indirect-calls
16407 @opindex mfast-indirect-calls
16408 Generate code that assumes calls never cross space boundaries.  This
16409 allows GCC to emit code that performs faster indirect calls.
16411 This option does not work in the presence of shared libraries or nested
16412 functions.
16414 @item -mfixed-range=@var{register-range}
16415 @opindex mfixed-range
16416 Generate code treating the given register range as fixed registers.
16417 A fixed register is one that the register allocator cannot use.  This is
16418 useful when compiling kernel code.  A register range is specified as
16419 two registers separated by a dash.  Multiple register ranges can be
16420 specified separated by a comma.
16422 @item -mlong-load-store
16423 @opindex mlong-load-store
16424 Generate 3-instruction load and store sequences as sometimes required by
16425 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
16426 the HP compilers.
16428 @item -mportable-runtime
16429 @opindex mportable-runtime
16430 Use the portable calling conventions proposed by HP for ELF systems.
16432 @item -mgas
16433 @opindex mgas
16434 Enable the use of assembler directives only GAS understands.
16436 @item -mschedule=@var{cpu-type}
16437 @opindex mschedule
16438 Schedule code according to the constraints for the machine type
16439 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
16440 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
16441 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
16442 proper scheduling option for your machine.  The default scheduling is
16443 @samp{8000}.
16445 @item -mlinker-opt
16446 @opindex mlinker-opt
16447 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
16448 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
16449 linkers in which they give bogus error messages when linking some programs.
16451 @item -msoft-float
16452 @opindex msoft-float
16453 Generate output containing library calls for floating point.
16454 @strong{Warning:} the requisite libraries are not available for all HPPA
16455 targets.  Normally the facilities of the machine's usual C compiler are
16456 used, but this cannot be done directly in cross-compilation.  You must make
16457 your own arrangements to provide suitable library functions for
16458 cross-compilation.
16460 @option{-msoft-float} changes the calling convention in the output file;
16461 therefore, it is only useful if you compile @emph{all} of a program with
16462 this option.  In particular, you need to compile @file{libgcc.a}, the
16463 library that comes with GCC, with @option{-msoft-float} in order for
16464 this to work.
16466 @item -msio
16467 @opindex msio
16468 Generate the predefine, @code{_SIO}, for server IO@.  The default is
16469 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
16470 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
16471 options are available under HP-UX and HI-UX@.
16473 @item -mgnu-ld
16474 @opindex mgnu-ld
16475 Use options specific to GNU @command{ld}.
16476 This passes @option{-shared} to @command{ld} when
16477 building a shared library.  It is the default when GCC is configured,
16478 explicitly or implicitly, with the GNU linker.  This option does not
16479 affect which @command{ld} is called; it only changes what parameters
16480 are passed to that @command{ld}.
16481 The @command{ld} that is called is determined by the
16482 @option{--with-ld} configure option, GCC's program search path, and
16483 finally by the user's @env{PATH}.  The linker used by GCC can be printed
16484 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
16485 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
16487 @item -mhp-ld
16488 @opindex mhp-ld
16489 Use options specific to HP @command{ld}.
16490 This passes @option{-b} to @command{ld} when building
16491 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
16492 links.  It is the default when GCC is configured, explicitly or
16493 implicitly, with the HP linker.  This option does not affect
16494 which @command{ld} is called; it only changes what parameters are passed to that
16495 @command{ld}.
16496 The @command{ld} that is called is determined by the @option{--with-ld}
16497 configure option, GCC's program search path, and finally by the user's
16498 @env{PATH}.  The linker used by GCC can be printed using @samp{which
16499 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
16500 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
16502 @item -mlong-calls
16503 @opindex mno-long-calls
16504 Generate code that uses long call sequences.  This ensures that a call
16505 is always able to reach linker generated stubs.  The default is to generate
16506 long calls only when the distance from the call site to the beginning
16507 of the function or translation unit, as the case may be, exceeds a
16508 predefined limit set by the branch type being used.  The limits for
16509 normal calls are 7,600,000 and 240,000 bytes, respectively for the
16510 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
16511 240,000 bytes.
16513 Distances are measured from the beginning of functions when using the
16514 @option{-ffunction-sections} option, or when using the @option{-mgas}
16515 and @option{-mno-portable-runtime} options together under HP-UX with
16516 the SOM linker.
16518 It is normally not desirable to use this option as it degrades
16519 performance.  However, it may be useful in large applications,
16520 particularly when partial linking is used to build the application.
16522 The types of long calls used depends on the capabilities of the
16523 assembler and linker, and the type of code being generated.  The
16524 impact on systems that support long absolute calls, and long pic
16525 symbol-difference or pc-relative calls should be relatively small.
16526 However, an indirect call is used on 32-bit ELF systems in pic code
16527 and it is quite long.
16529 @item -munix=@var{unix-std}
16530 @opindex march
16531 Generate compiler predefines and select a startfile for the specified
16532 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
16533 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
16534 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
16535 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
16536 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
16537 and later.
16539 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
16540 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
16541 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
16542 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
16543 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
16544 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
16546 It is @emph{important} to note that this option changes the interfaces
16547 for various library routines.  It also affects the operational behavior
16548 of the C library.  Thus, @emph{extreme} care is needed in using this
16549 option.
16551 Library code that is intended to operate with more than one UNIX
16552 standard must test, set and restore the variable @code{__xpg4_extended_mask}
16553 as appropriate.  Most GNU software doesn't provide this capability.
16555 @item -nolibdld
16556 @opindex nolibdld
16557 Suppress the generation of link options to search libdld.sl when the
16558 @option{-static} option is specified on HP-UX 10 and later.
16560 @item -static
16561 @opindex static
16562 The HP-UX implementation of setlocale in libc has a dependency on
16563 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
16564 when the @option{-static} option is specified, special link options
16565 are needed to resolve this dependency.
16567 On HP-UX 10 and later, the GCC driver adds the necessary options to
16568 link with libdld.sl when the @option{-static} option is specified.
16569 This causes the resulting binary to be dynamic.  On the 64-bit port,
16570 the linkers generate dynamic binaries by default in any case.  The
16571 @option{-nolibdld} option can be used to prevent the GCC driver from
16572 adding these link options.
16574 @item -threads
16575 @opindex threads
16576 Add support for multithreading with the @dfn{dce thread} library
16577 under HP-UX@.  This option sets flags for both the preprocessor and
16578 linker.
16579 @end table
16581 @node IA-64 Options
16582 @subsection IA-64 Options
16583 @cindex IA-64 Options
16585 These are the @samp{-m} options defined for the Intel IA-64 architecture.
16587 @table @gcctabopt
16588 @item -mbig-endian
16589 @opindex mbig-endian
16590 Generate code for a big-endian target.  This is the default for HP-UX@.
16592 @item -mlittle-endian
16593 @opindex mlittle-endian
16594 Generate code for a little-endian target.  This is the default for AIX5
16595 and GNU/Linux.
16597 @item -mgnu-as
16598 @itemx -mno-gnu-as
16599 @opindex mgnu-as
16600 @opindex mno-gnu-as
16601 Generate (or don't) code for the GNU assembler.  This is the default.
16602 @c Also, this is the default if the configure option @option{--with-gnu-as}
16603 @c is used.
16605 @item -mgnu-ld
16606 @itemx -mno-gnu-ld
16607 @opindex mgnu-ld
16608 @opindex mno-gnu-ld
16609 Generate (or don't) code for the GNU linker.  This is the default.
16610 @c Also, this is the default if the configure option @option{--with-gnu-ld}
16611 @c is used.
16613 @item -mno-pic
16614 @opindex mno-pic
16615 Generate code that does not use a global pointer register.  The result
16616 is not position independent code, and violates the IA-64 ABI@.
16618 @item -mvolatile-asm-stop
16619 @itemx -mno-volatile-asm-stop
16620 @opindex mvolatile-asm-stop
16621 @opindex mno-volatile-asm-stop
16622 Generate (or don't) a stop bit immediately before and after volatile asm
16623 statements.
16625 @item -mregister-names
16626 @itemx -mno-register-names
16627 @opindex mregister-names
16628 @opindex mno-register-names
16629 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
16630 the stacked registers.  This may make assembler output more readable.
16632 @item -mno-sdata
16633 @itemx -msdata
16634 @opindex mno-sdata
16635 @opindex msdata
16636 Disable (or enable) optimizations that use the small data section.  This may
16637 be useful for working around optimizer bugs.
16639 @item -mconstant-gp
16640 @opindex mconstant-gp
16641 Generate code that uses a single constant global pointer value.  This is
16642 useful when compiling kernel code.
16644 @item -mauto-pic
16645 @opindex mauto-pic
16646 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16647 This is useful when compiling firmware code.
16649 @item -minline-float-divide-min-latency
16650 @opindex minline-float-divide-min-latency
16651 Generate code for inline divides of floating-point values
16652 using the minimum latency algorithm.
16654 @item -minline-float-divide-max-throughput
16655 @opindex minline-float-divide-max-throughput
16656 Generate code for inline divides of floating-point values
16657 using the maximum throughput algorithm.
16659 @item -mno-inline-float-divide
16660 @opindex mno-inline-float-divide
16661 Do not generate inline code for divides of floating-point values.
16663 @item -minline-int-divide-min-latency
16664 @opindex minline-int-divide-min-latency
16665 Generate code for inline divides of integer values
16666 using the minimum latency algorithm.
16668 @item -minline-int-divide-max-throughput
16669 @opindex minline-int-divide-max-throughput
16670 Generate code for inline divides of integer values
16671 using the maximum throughput algorithm.
16673 @item -mno-inline-int-divide
16674 @opindex mno-inline-int-divide
16675 Do not generate inline code for divides of integer values.
16677 @item -minline-sqrt-min-latency
16678 @opindex minline-sqrt-min-latency
16679 Generate code for inline square roots
16680 using the minimum latency algorithm.
16682 @item -minline-sqrt-max-throughput
16683 @opindex minline-sqrt-max-throughput
16684 Generate code for inline square roots
16685 using the maximum throughput algorithm.
16687 @item -mno-inline-sqrt
16688 @opindex mno-inline-sqrt
16689 Do not generate inline code for @code{sqrt}.
16691 @item -mfused-madd
16692 @itemx -mno-fused-madd
16693 @opindex mfused-madd
16694 @opindex mno-fused-madd
16695 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16696 instructions.  The default is to use these instructions.
16698 @item -mno-dwarf2-asm
16699 @itemx -mdwarf2-asm
16700 @opindex mno-dwarf2-asm
16701 @opindex mdwarf2-asm
16702 Don't (or do) generate assembler code for the DWARF line number debugging
16703 info.  This may be useful when not using the GNU assembler.
16705 @item -mearly-stop-bits
16706 @itemx -mno-early-stop-bits
16707 @opindex mearly-stop-bits
16708 @opindex mno-early-stop-bits
16709 Allow stop bits to be placed earlier than immediately preceding the
16710 instruction that triggered the stop bit.  This can improve instruction
16711 scheduling, but does not always do so.
16713 @item -mfixed-range=@var{register-range}
16714 @opindex mfixed-range
16715 Generate code treating the given register range as fixed registers.
16716 A fixed register is one that the register allocator cannot use.  This is
16717 useful when compiling kernel code.  A register range is specified as
16718 two registers separated by a dash.  Multiple register ranges can be
16719 specified separated by a comma.
16721 @item -mtls-size=@var{tls-size}
16722 @opindex mtls-size
16723 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16726 @item -mtune=@var{cpu-type}
16727 @opindex mtune
16728 Tune the instruction scheduling for a particular CPU, Valid values are
16729 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16730 and @samp{mckinley}.
16732 @item -milp32
16733 @itemx -mlp64
16734 @opindex milp32
16735 @opindex mlp64
16736 Generate code for a 32-bit or 64-bit environment.
16737 The 32-bit environment sets int, long and pointer to 32 bits.
16738 The 64-bit environment sets int to 32 bits and long and pointer
16739 to 64 bits.  These are HP-UX specific flags.
16741 @item -mno-sched-br-data-spec
16742 @itemx -msched-br-data-spec
16743 @opindex mno-sched-br-data-spec
16744 @opindex msched-br-data-spec
16745 (Dis/En)able data speculative scheduling before reload.
16746 This results in generation of @code{ld.a} instructions and
16747 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16748 The default setting is disabled.
16750 @item -msched-ar-data-spec
16751 @itemx -mno-sched-ar-data-spec
16752 @opindex msched-ar-data-spec
16753 @opindex mno-sched-ar-data-spec
16754 (En/Dis)able data speculative scheduling after reload.
16755 This results in generation of @code{ld.a} instructions and
16756 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16757 The default setting is enabled.
16759 @item -mno-sched-control-spec
16760 @itemx -msched-control-spec
16761 @opindex mno-sched-control-spec
16762 @opindex msched-control-spec
16763 (Dis/En)able control speculative scheduling.  This feature is
16764 available only during region scheduling (i.e.@: before reload).
16765 This results in generation of the @code{ld.s} instructions and
16766 the corresponding check instructions @code{chk.s}.
16767 The default setting is disabled.
16769 @item -msched-br-in-data-spec
16770 @itemx -mno-sched-br-in-data-spec
16771 @opindex msched-br-in-data-spec
16772 @opindex mno-sched-br-in-data-spec
16773 (En/Dis)able speculative scheduling of the instructions that
16774 are dependent on the data speculative loads before reload.
16775 This is effective only with @option{-msched-br-data-spec} enabled.
16776 The default setting is enabled.
16778 @item -msched-ar-in-data-spec
16779 @itemx -mno-sched-ar-in-data-spec
16780 @opindex msched-ar-in-data-spec
16781 @opindex mno-sched-ar-in-data-spec
16782 (En/Dis)able speculative scheduling of the instructions that
16783 are dependent on the data speculative loads after reload.
16784 This is effective only with @option{-msched-ar-data-spec} enabled.
16785 The default setting is enabled.
16787 @item -msched-in-control-spec
16788 @itemx -mno-sched-in-control-spec
16789 @opindex msched-in-control-spec
16790 @opindex mno-sched-in-control-spec
16791 (En/Dis)able speculative scheduling of the instructions that
16792 are dependent on the control speculative loads.
16793 This is effective only with @option{-msched-control-spec} enabled.
16794 The default setting is enabled.
16796 @item -mno-sched-prefer-non-data-spec-insns
16797 @itemx -msched-prefer-non-data-spec-insns
16798 @opindex mno-sched-prefer-non-data-spec-insns
16799 @opindex msched-prefer-non-data-spec-insns
16800 If enabled, data-speculative instructions are chosen for schedule
16801 only if there are no other choices at the moment.  This makes
16802 the use of the data speculation much more conservative.
16803 The default setting is disabled.
16805 @item -mno-sched-prefer-non-control-spec-insns
16806 @itemx -msched-prefer-non-control-spec-insns
16807 @opindex mno-sched-prefer-non-control-spec-insns
16808 @opindex msched-prefer-non-control-spec-insns
16809 If enabled, control-speculative instructions are chosen for schedule
16810 only if there are no other choices at the moment.  This makes
16811 the use of the control speculation much more conservative.
16812 The default setting is disabled.
16814 @item -mno-sched-count-spec-in-critical-path
16815 @itemx -msched-count-spec-in-critical-path
16816 @opindex mno-sched-count-spec-in-critical-path
16817 @opindex msched-count-spec-in-critical-path
16818 If enabled, speculative dependencies are considered during
16819 computation of the instructions priorities.  This makes the use of the
16820 speculation a bit more conservative.
16821 The default setting is disabled.
16823 @item -msched-spec-ldc
16824 @opindex msched-spec-ldc
16825 Use a simple data speculation check.  This option is on by default.
16827 @item -msched-control-spec-ldc
16828 @opindex msched-spec-ldc
16829 Use a simple check for control speculation.  This option is on by default.
16831 @item -msched-stop-bits-after-every-cycle
16832 @opindex msched-stop-bits-after-every-cycle
16833 Place a stop bit after every cycle when scheduling.  This option is on
16834 by default.
16836 @item -msched-fp-mem-deps-zero-cost
16837 @opindex msched-fp-mem-deps-zero-cost
16838 Assume that floating-point stores and loads are not likely to cause a conflict
16839 when placed into the same instruction group.  This option is disabled by
16840 default.
16842 @item -msel-sched-dont-check-control-spec
16843 @opindex msel-sched-dont-check-control-spec
16844 Generate checks for control speculation in selective scheduling.
16845 This flag is disabled by default.
16847 @item -msched-max-memory-insns=@var{max-insns}
16848 @opindex msched-max-memory-insns
16849 Limit on the number of memory insns per instruction group, giving lower
16850 priority to subsequent memory insns attempting to schedule in the same
16851 instruction group. Frequently useful to prevent cache bank conflicts.
16852 The default value is 1.
16854 @item -msched-max-memory-insns-hard-limit
16855 @opindex msched-max-memory-insns-hard-limit
16856 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16857 disallowing more than that number in an instruction group.
16858 Otherwise, the limit is ``soft'', meaning that non-memory operations
16859 are preferred when the limit is reached, but memory operations may still
16860 be scheduled.
16862 @end table
16864 @node LM32 Options
16865 @subsection LM32 Options
16866 @cindex LM32 options
16868 These @option{-m} options are defined for the LatticeMico32 architecture:
16870 @table @gcctabopt
16871 @item -mbarrel-shift-enabled
16872 @opindex mbarrel-shift-enabled
16873 Enable barrel-shift instructions.
16875 @item -mdivide-enabled
16876 @opindex mdivide-enabled
16877 Enable divide and modulus instructions.
16879 @item -mmultiply-enabled
16880 @opindex multiply-enabled
16881 Enable multiply instructions.
16883 @item -msign-extend-enabled
16884 @opindex msign-extend-enabled
16885 Enable sign extend instructions.
16887 @item -muser-enabled
16888 @opindex muser-enabled
16889 Enable user-defined instructions.
16891 @end table
16893 @node M32C Options
16894 @subsection M32C Options
16895 @cindex M32C options
16897 @table @gcctabopt
16898 @item -mcpu=@var{name}
16899 @opindex mcpu=
16900 Select the CPU for which code is generated.  @var{name} may be one of
16901 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16902 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16903 the M32C/80 series.
16905 @item -msim
16906 @opindex msim
16907 Specifies that the program will be run on the simulator.  This causes
16908 an alternate runtime library to be linked in which supports, for
16909 example, file I/O@.  You must not use this option when generating
16910 programs that will run on real hardware; you must provide your own
16911 runtime library for whatever I/O functions are needed.
16913 @item -memregs=@var{number}
16914 @opindex memregs=
16915 Specifies the number of memory-based pseudo-registers GCC uses
16916 during code generation.  These pseudo-registers are used like real
16917 registers, so there is a tradeoff between GCC's ability to fit the
16918 code into available registers, and the performance penalty of using
16919 memory instead of registers.  Note that all modules in a program must
16920 be compiled with the same value for this option.  Because of that, you
16921 must not use this option with GCC's default runtime libraries.
16923 @end table
16925 @node M32R/D Options
16926 @subsection M32R/D Options
16927 @cindex M32R/D options
16929 These @option{-m} options are defined for Renesas M32R/D architectures:
16931 @table @gcctabopt
16932 @item -m32r2
16933 @opindex m32r2
16934 Generate code for the M32R/2@.
16936 @item -m32rx
16937 @opindex m32rx
16938 Generate code for the M32R/X@.
16940 @item -m32r
16941 @opindex m32r
16942 Generate code for the M32R@.  This is the default.
16944 @item -mmodel=small
16945 @opindex mmodel=small
16946 Assume all objects live in the lower 16MB of memory (so that their addresses
16947 can be loaded with the @code{ld24} instruction), and assume all subroutines
16948 are reachable with the @code{bl} instruction.
16949 This is the default.
16951 The addressability of a particular object can be set with the
16952 @code{model} attribute.
16954 @item -mmodel=medium
16955 @opindex mmodel=medium
16956 Assume objects may be anywhere in the 32-bit address space (the compiler
16957 generates @code{seth/add3} instructions to load their addresses), and
16958 assume all subroutines are reachable with the @code{bl} instruction.
16960 @item -mmodel=large
16961 @opindex mmodel=large
16962 Assume objects may be anywhere in the 32-bit address space (the compiler
16963 generates @code{seth/add3} instructions to load their addresses), and
16964 assume subroutines may not be reachable with the @code{bl} instruction
16965 (the compiler generates the much slower @code{seth/add3/jl}
16966 instruction sequence).
16968 @item -msdata=none
16969 @opindex msdata=none
16970 Disable use of the small data area.  Variables are put into
16971 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
16972 @code{section} attribute has been specified).
16973 This is the default.
16975 The small data area consists of sections @code{.sdata} and @code{.sbss}.
16976 Objects may be explicitly put in the small data area with the
16977 @code{section} attribute using one of these sections.
16979 @item -msdata=sdata
16980 @opindex msdata=sdata
16981 Put small global and static data in the small data area, but do not
16982 generate special code to reference them.
16984 @item -msdata=use
16985 @opindex msdata=use
16986 Put small global and static data in the small data area, and generate
16987 special instructions to reference them.
16989 @item -G @var{num}
16990 @opindex G
16991 @cindex smaller data references
16992 Put global and static objects less than or equal to @var{num} bytes
16993 into the small data or BSS sections instead of the normal data or BSS
16994 sections.  The default value of @var{num} is 8.
16995 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16996 for this option to have any effect.
16998 All modules should be compiled with the same @option{-G @var{num}} value.
16999 Compiling with different values of @var{num} may or may not work; if it
17000 doesn't the linker gives an error message---incorrect code is not
17001 generated.
17003 @item -mdebug
17004 @opindex mdebug
17005 Makes the M32R-specific code in the compiler display some statistics
17006 that might help in debugging programs.
17008 @item -malign-loops
17009 @opindex malign-loops
17010 Align all loops to a 32-byte boundary.
17012 @item -mno-align-loops
17013 @opindex mno-align-loops
17014 Do not enforce a 32-byte alignment for loops.  This is the default.
17016 @item -missue-rate=@var{number}
17017 @opindex missue-rate=@var{number}
17018 Issue @var{number} instructions per cycle.  @var{number} can only be 1
17019 or 2.
17021 @item -mbranch-cost=@var{number}
17022 @opindex mbranch-cost=@var{number}
17023 @var{number} can only be 1 or 2.  If it is 1 then branches are
17024 preferred over conditional code, if it is 2, then the opposite applies.
17026 @item -mflush-trap=@var{number}
17027 @opindex mflush-trap=@var{number}
17028 Specifies the trap number to use to flush the cache.  The default is
17029 12.  Valid numbers are between 0 and 15 inclusive.
17031 @item -mno-flush-trap
17032 @opindex mno-flush-trap
17033 Specifies that the cache cannot be flushed by using a trap.
17035 @item -mflush-func=@var{name}
17036 @opindex mflush-func=@var{name}
17037 Specifies the name of the operating system function to call to flush
17038 the cache.  The default is @samp{_flush_cache}, but a function call
17039 is only used if a trap is not available.
17041 @item -mno-flush-func
17042 @opindex mno-flush-func
17043 Indicates that there is no OS function for flushing the cache.
17045 @end table
17047 @node M680x0 Options
17048 @subsection M680x0 Options
17049 @cindex M680x0 options
17051 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
17052 The default settings depend on which architecture was selected when
17053 the compiler was configured; the defaults for the most common choices
17054 are given below.
17056 @table @gcctabopt
17057 @item -march=@var{arch}
17058 @opindex march
17059 Generate code for a specific M680x0 or ColdFire instruction set
17060 architecture.  Permissible values of @var{arch} for M680x0
17061 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
17062 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
17063 architectures are selected according to Freescale's ISA classification
17064 and the permissible values are: @samp{isaa}, @samp{isaaplus},
17065 @samp{isab} and @samp{isac}.
17067 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
17068 code for a ColdFire target.  The @var{arch} in this macro is one of the
17069 @option{-march} arguments given above.
17071 When used together, @option{-march} and @option{-mtune} select code
17072 that runs on a family of similar processors but that is optimized
17073 for a particular microarchitecture.
17075 @item -mcpu=@var{cpu}
17076 @opindex mcpu
17077 Generate code for a specific M680x0 or ColdFire processor.
17078 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
17079 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
17080 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
17081 below, which also classifies the CPUs into families:
17083 @multitable @columnfractions 0.20 0.80
17084 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
17085 @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}
17086 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
17087 @item @samp{5206e} @tab @samp{5206e}
17088 @item @samp{5208} @tab @samp{5207} @samp{5208}
17089 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
17090 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
17091 @item @samp{5216} @tab @samp{5214} @samp{5216}
17092 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
17093 @item @samp{5225} @tab @samp{5224} @samp{5225}
17094 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
17095 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
17096 @item @samp{5249} @tab @samp{5249}
17097 @item @samp{5250} @tab @samp{5250}
17098 @item @samp{5271} @tab @samp{5270} @samp{5271}
17099 @item @samp{5272} @tab @samp{5272}
17100 @item @samp{5275} @tab @samp{5274} @samp{5275}
17101 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
17102 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
17103 @item @samp{5307} @tab @samp{5307}
17104 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
17105 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
17106 @item @samp{5407} @tab @samp{5407}
17107 @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}
17108 @end multitable
17110 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
17111 @var{arch} is compatible with @var{cpu}.  Other combinations of
17112 @option{-mcpu} and @option{-march} are rejected.
17114 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
17115 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
17116 where the value of @var{family} is given by the table above.
17118 @item -mtune=@var{tune}
17119 @opindex mtune
17120 Tune the code for a particular microarchitecture within the
17121 constraints set by @option{-march} and @option{-mcpu}.
17122 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
17123 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
17124 and @samp{cpu32}.  The ColdFire microarchitectures
17125 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
17127 You can also use @option{-mtune=68020-40} for code that needs
17128 to run relatively well on 68020, 68030 and 68040 targets.
17129 @option{-mtune=68020-60} is similar but includes 68060 targets
17130 as well.  These two options select the same tuning decisions as
17131 @option{-m68020-40} and @option{-m68020-60} respectively.
17133 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
17134 when tuning for 680x0 architecture @var{arch}.  It also defines
17135 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
17136 option is used.  If GCC is tuning for a range of architectures,
17137 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
17138 it defines the macros for every architecture in the range.
17140 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
17141 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
17142 of the arguments given above.
17144 @item -m68000
17145 @itemx -mc68000
17146 @opindex m68000
17147 @opindex mc68000
17148 Generate output for a 68000.  This is the default
17149 when the compiler is configured for 68000-based systems.
17150 It is equivalent to @option{-march=68000}.
17152 Use this option for microcontrollers with a 68000 or EC000 core,
17153 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
17155 @item -m68010
17156 @opindex m68010
17157 Generate output for a 68010.  This is the default
17158 when the compiler is configured for 68010-based systems.
17159 It is equivalent to @option{-march=68010}.
17161 @item -m68020
17162 @itemx -mc68020
17163 @opindex m68020
17164 @opindex mc68020
17165 Generate output for a 68020.  This is the default
17166 when the compiler is configured for 68020-based systems.
17167 It is equivalent to @option{-march=68020}.
17169 @item -m68030
17170 @opindex m68030
17171 Generate output for a 68030.  This is the default when the compiler is
17172 configured for 68030-based systems.  It is equivalent to
17173 @option{-march=68030}.
17175 @item -m68040
17176 @opindex m68040
17177 Generate output for a 68040.  This is the default when the compiler is
17178 configured for 68040-based systems.  It is equivalent to
17179 @option{-march=68040}.
17181 This option inhibits the use of 68881/68882 instructions that have to be
17182 emulated by software on the 68040.  Use this option if your 68040 does not
17183 have code to emulate those instructions.
17185 @item -m68060
17186 @opindex m68060
17187 Generate output for a 68060.  This is the default when the compiler is
17188 configured for 68060-based systems.  It is equivalent to
17189 @option{-march=68060}.
17191 This option inhibits the use of 68020 and 68881/68882 instructions that
17192 have to be emulated by software on the 68060.  Use this option if your 68060
17193 does not have code to emulate those instructions.
17195 @item -mcpu32
17196 @opindex mcpu32
17197 Generate output for a CPU32.  This is the default
17198 when the compiler is configured for CPU32-based systems.
17199 It is equivalent to @option{-march=cpu32}.
17201 Use this option for microcontrollers with a
17202 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
17203 68336, 68340, 68341, 68349 and 68360.
17205 @item -m5200
17206 @opindex m5200
17207 Generate output for a 520X ColdFire CPU@.  This is the default
17208 when the compiler is configured for 520X-based systems.
17209 It is equivalent to @option{-mcpu=5206}, and is now deprecated
17210 in favor of that option.
17212 Use this option for microcontroller with a 5200 core, including
17213 the MCF5202, MCF5203, MCF5204 and MCF5206.
17215 @item -m5206e
17216 @opindex m5206e
17217 Generate output for a 5206e ColdFire CPU@.  The option is now
17218 deprecated in favor of the equivalent @option{-mcpu=5206e}.
17220 @item -m528x
17221 @opindex m528x
17222 Generate output for a member of the ColdFire 528X family.
17223 The option is now deprecated in favor of the equivalent
17224 @option{-mcpu=528x}.
17226 @item -m5307
17227 @opindex m5307
17228 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
17229 in favor of the equivalent @option{-mcpu=5307}.
17231 @item -m5407
17232 @opindex m5407
17233 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
17234 in favor of the equivalent @option{-mcpu=5407}.
17236 @item -mcfv4e
17237 @opindex mcfv4e
17238 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
17239 This includes use of hardware floating-point instructions.
17240 The option is equivalent to @option{-mcpu=547x}, and is now
17241 deprecated in favor of that option.
17243 @item -m68020-40
17244 @opindex m68020-40
17245 Generate output for a 68040, without using any of the new instructions.
17246 This results in code that can run relatively efficiently on either a
17247 68020/68881 or a 68030 or a 68040.  The generated code does use the
17248 68881 instructions that are emulated on the 68040.
17250 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
17252 @item -m68020-60
17253 @opindex m68020-60
17254 Generate output for a 68060, without using any of the new instructions.
17255 This results in code that can run relatively efficiently on either a
17256 68020/68881 or a 68030 or a 68040.  The generated code does use the
17257 68881 instructions that are emulated on the 68060.
17259 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
17261 @item -mhard-float
17262 @itemx -m68881
17263 @opindex mhard-float
17264 @opindex m68881
17265 Generate floating-point instructions.  This is the default for 68020
17266 and above, and for ColdFire devices that have an FPU@.  It defines the
17267 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
17268 on ColdFire targets.
17270 @item -msoft-float
17271 @opindex msoft-float
17272 Do not generate floating-point instructions; use library calls instead.
17273 This is the default for 68000, 68010, and 68832 targets.  It is also
17274 the default for ColdFire devices that have no FPU.
17276 @item -mdiv
17277 @itemx -mno-div
17278 @opindex mdiv
17279 @opindex mno-div
17280 Generate (do not generate) ColdFire hardware divide and remainder
17281 instructions.  If @option{-march} is used without @option{-mcpu},
17282 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
17283 architectures.  Otherwise, the default is taken from the target CPU
17284 (either the default CPU, or the one specified by @option{-mcpu}).  For
17285 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
17286 @option{-mcpu=5206e}.
17288 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
17290 @item -mshort
17291 @opindex mshort
17292 Consider type @code{int} to be 16 bits wide, like @code{short int}.
17293 Additionally, parameters passed on the stack are also aligned to a
17294 16-bit boundary even on targets whose API mandates promotion to 32-bit.
17296 @item -mno-short
17297 @opindex mno-short
17298 Do not consider type @code{int} to be 16 bits wide.  This is the default.
17300 @item -mnobitfield
17301 @itemx -mno-bitfield
17302 @opindex mnobitfield
17303 @opindex mno-bitfield
17304 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
17305 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
17307 @item -mbitfield
17308 @opindex mbitfield
17309 Do use the bit-field instructions.  The @option{-m68020} option implies
17310 @option{-mbitfield}.  This is the default if you use a configuration
17311 designed for a 68020.
17313 @item -mrtd
17314 @opindex mrtd
17315 Use a different function-calling convention, in which functions
17316 that take a fixed number of arguments return with the @code{rtd}
17317 instruction, which pops their arguments while returning.  This
17318 saves one instruction in the caller since there is no need to pop
17319 the arguments there.
17321 This calling convention is incompatible with the one normally
17322 used on Unix, so you cannot use it if you need to call libraries
17323 compiled with the Unix compiler.
17325 Also, you must provide function prototypes for all functions that
17326 take variable numbers of arguments (including @code{printf});
17327 otherwise incorrect code is generated for calls to those
17328 functions.
17330 In addition, seriously incorrect code results if you call a
17331 function with too many arguments.  (Normally, extra arguments are
17332 harmlessly ignored.)
17334 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
17335 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
17337 @item -mno-rtd
17338 @opindex mno-rtd
17339 Do not use the calling conventions selected by @option{-mrtd}.
17340 This is the default.
17342 @item -malign-int
17343 @itemx -mno-align-int
17344 @opindex malign-int
17345 @opindex mno-align-int
17346 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
17347 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
17348 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
17349 Aligning variables on 32-bit boundaries produces code that runs somewhat
17350 faster on processors with 32-bit busses at the expense of more memory.
17352 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
17353 aligns structures containing the above types differently than
17354 most published application binary interface specifications for the m68k.
17356 @item -mpcrel
17357 @opindex mpcrel
17358 Use the pc-relative addressing mode of the 68000 directly, instead of
17359 using a global offset table.  At present, this option implies @option{-fpic},
17360 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
17361 not presently supported with @option{-mpcrel}, though this could be supported for
17362 68020 and higher processors.
17364 @item -mno-strict-align
17365 @itemx -mstrict-align
17366 @opindex mno-strict-align
17367 @opindex mstrict-align
17368 Do not (do) assume that unaligned memory references are handled by
17369 the system.
17371 @item -msep-data
17372 Generate code that allows the data segment to be located in a different
17373 area of memory from the text segment.  This allows for execute-in-place in
17374 an environment without virtual memory management.  This option implies
17375 @option{-fPIC}.
17377 @item -mno-sep-data
17378 Generate code that assumes that the data segment follows the text segment.
17379 This is the default.
17381 @item -mid-shared-library
17382 Generate code that supports shared libraries via the library ID method.
17383 This allows for execute-in-place and shared libraries in an environment
17384 without virtual memory management.  This option implies @option{-fPIC}.
17386 @item -mno-id-shared-library
17387 Generate code that doesn't assume ID-based shared libraries are being used.
17388 This is the default.
17390 @item -mshared-library-id=n
17391 Specifies the identification number of the ID-based shared library being
17392 compiled.  Specifying a value of 0 generates more compact code; specifying
17393 other values forces the allocation of that number to the current
17394 library, but is no more space- or time-efficient than omitting this option.
17396 @item -mxgot
17397 @itemx -mno-xgot
17398 @opindex mxgot
17399 @opindex mno-xgot
17400 When generating position-independent code for ColdFire, generate code
17401 that works if the GOT has more than 8192 entries.  This code is
17402 larger and slower than code generated without this option.  On M680x0
17403 processors, this option is not needed; @option{-fPIC} suffices.
17405 GCC normally uses a single instruction to load values from the GOT@.
17406 While this is relatively efficient, it only works if the GOT
17407 is smaller than about 64k.  Anything larger causes the linker
17408 to report an error such as:
17410 @cindex relocation truncated to fit (ColdFire)
17411 @smallexample
17412 relocation truncated to fit: R_68K_GOT16O foobar
17413 @end smallexample
17415 If this happens, you should recompile your code with @option{-mxgot}.
17416 It should then work with very large GOTs.  However, code generated with
17417 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
17418 the value of a global symbol.
17420 Note that some linkers, including newer versions of the GNU linker,
17421 can create multiple GOTs and sort GOT entries.  If you have such a linker,
17422 you should only need to use @option{-mxgot} when compiling a single
17423 object file that accesses more than 8192 GOT entries.  Very few do.
17425 These options have no effect unless GCC is generating
17426 position-independent code.
17428 @end table
17430 @node MCore Options
17431 @subsection MCore Options
17432 @cindex MCore options
17434 These are the @samp{-m} options defined for the Motorola M*Core
17435 processors.
17437 @table @gcctabopt
17439 @item -mhardlit
17440 @itemx -mno-hardlit
17441 @opindex mhardlit
17442 @opindex mno-hardlit
17443 Inline constants into the code stream if it can be done in two
17444 instructions or less.
17446 @item -mdiv
17447 @itemx -mno-div
17448 @opindex mdiv
17449 @opindex mno-div
17450 Use the divide instruction.  (Enabled by default).
17452 @item -mrelax-immediate
17453 @itemx -mno-relax-immediate
17454 @opindex mrelax-immediate
17455 @opindex mno-relax-immediate
17456 Allow arbitrary-sized immediates in bit operations.
17458 @item -mwide-bitfields
17459 @itemx -mno-wide-bitfields
17460 @opindex mwide-bitfields
17461 @opindex mno-wide-bitfields
17462 Always treat bit-fields as @code{int}-sized.
17464 @item -m4byte-functions
17465 @itemx -mno-4byte-functions
17466 @opindex m4byte-functions
17467 @opindex mno-4byte-functions
17468 Force all functions to be aligned to a 4-byte boundary.
17470 @item -mcallgraph-data
17471 @itemx -mno-callgraph-data
17472 @opindex mcallgraph-data
17473 @opindex mno-callgraph-data
17474 Emit callgraph information.
17476 @item -mslow-bytes
17477 @itemx -mno-slow-bytes
17478 @opindex mslow-bytes
17479 @opindex mno-slow-bytes
17480 Prefer word access when reading byte quantities.
17482 @item -mlittle-endian
17483 @itemx -mbig-endian
17484 @opindex mlittle-endian
17485 @opindex mbig-endian
17486 Generate code for a little-endian target.
17488 @item -m210
17489 @itemx -m340
17490 @opindex m210
17491 @opindex m340
17492 Generate code for the 210 processor.
17494 @item -mno-lsim
17495 @opindex mno-lsim
17496 Assume that runtime support has been provided and so omit the
17497 simulator library (@file{libsim.a)} from the linker command line.
17499 @item -mstack-increment=@var{size}
17500 @opindex mstack-increment
17501 Set the maximum amount for a single stack increment operation.  Large
17502 values can increase the speed of programs that contain functions
17503 that need a large amount of stack space, but they can also trigger a
17504 segmentation fault if the stack is extended too much.  The default
17505 value is 0x1000.
17507 @end table
17509 @node MeP Options
17510 @subsection MeP Options
17511 @cindex MeP options
17513 @table @gcctabopt
17515 @item -mabsdiff
17516 @opindex mabsdiff
17517 Enables the @code{abs} instruction, which is the absolute difference
17518 between two registers.
17520 @item -mall-opts
17521 @opindex mall-opts
17522 Enables all the optional instructions---average, multiply, divide, bit
17523 operations, leading zero, absolute difference, min/max, clip, and
17524 saturation.
17527 @item -maverage
17528 @opindex maverage
17529 Enables the @code{ave} instruction, which computes the average of two
17530 registers.
17532 @item -mbased=@var{n}
17533 @opindex mbased=
17534 Variables of size @var{n} bytes or smaller are placed in the
17535 @code{.based} section by default.  Based variables use the @code{$tp}
17536 register as a base register, and there is a 128-byte limit to the
17537 @code{.based} section.
17539 @item -mbitops
17540 @opindex mbitops
17541 Enables the bit operation instructions---bit test (@code{btstm}), set
17542 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
17543 test-and-set (@code{tas}).
17545 @item -mc=@var{name}
17546 @opindex mc=
17547 Selects which section constant data is placed in.  @var{name} may
17548 be @samp{tiny}, @samp{near}, or @samp{far}.
17550 @item -mclip
17551 @opindex mclip
17552 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
17553 useful unless you also provide @option{-mminmax}.
17555 @item -mconfig=@var{name}
17556 @opindex mconfig=
17557 Selects one of the built-in core configurations.  Each MeP chip has
17558 one or more modules in it; each module has a core CPU and a variety of
17559 coprocessors, optional instructions, and peripherals.  The
17560 @code{MeP-Integrator} tool, not part of GCC, provides these
17561 configurations through this option; using this option is the same as
17562 using all the corresponding command-line options.  The default
17563 configuration is @samp{default}.
17565 @item -mcop
17566 @opindex mcop
17567 Enables the coprocessor instructions.  By default, this is a 32-bit
17568 coprocessor.  Note that the coprocessor is normally enabled via the
17569 @option{-mconfig=} option.
17571 @item -mcop32
17572 @opindex mcop32
17573 Enables the 32-bit coprocessor's instructions.
17575 @item -mcop64
17576 @opindex mcop64
17577 Enables the 64-bit coprocessor's instructions.
17579 @item -mivc2
17580 @opindex mivc2
17581 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
17583 @item -mdc
17584 @opindex mdc
17585 Causes constant variables to be placed in the @code{.near} section.
17587 @item -mdiv
17588 @opindex mdiv
17589 Enables the @code{div} and @code{divu} instructions.
17591 @item -meb
17592 @opindex meb
17593 Generate big-endian code.
17595 @item -mel
17596 @opindex mel
17597 Generate little-endian code.
17599 @item -mio-volatile
17600 @opindex mio-volatile
17601 Tells the compiler that any variable marked with the @code{io}
17602 attribute is to be considered volatile.
17604 @item -ml
17605 @opindex ml
17606 Causes variables to be assigned to the @code{.far} section by default.
17608 @item -mleadz
17609 @opindex mleadz
17610 Enables the @code{leadz} (leading zero) instruction.
17612 @item -mm
17613 @opindex mm
17614 Causes variables to be assigned to the @code{.near} section by default.
17616 @item -mminmax
17617 @opindex mminmax
17618 Enables the @code{min} and @code{max} instructions.
17620 @item -mmult
17621 @opindex mmult
17622 Enables the multiplication and multiply-accumulate instructions.
17624 @item -mno-opts
17625 @opindex mno-opts
17626 Disables all the optional instructions enabled by @option{-mall-opts}.
17628 @item -mrepeat
17629 @opindex mrepeat
17630 Enables the @code{repeat} and @code{erepeat} instructions, used for
17631 low-overhead looping.
17633 @item -ms
17634 @opindex ms
17635 Causes all variables to default to the @code{.tiny} section.  Note
17636 that there is a 65536-byte limit to this section.  Accesses to these
17637 variables use the @code{%gp} base register.
17639 @item -msatur
17640 @opindex msatur
17641 Enables the saturation instructions.  Note that the compiler does not
17642 currently generate these itself, but this option is included for
17643 compatibility with other tools, like @code{as}.
17645 @item -msdram
17646 @opindex msdram
17647 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17649 @item -msim
17650 @opindex msim
17651 Link the simulator run-time libraries.
17653 @item -msimnovec
17654 @opindex msimnovec
17655 Link the simulator runtime libraries, excluding built-in support
17656 for reset and exception vectors and tables.
17658 @item -mtf
17659 @opindex mtf
17660 Causes all functions to default to the @code{.far} section.  Without
17661 this option, functions default to the @code{.near} section.
17663 @item -mtiny=@var{n}
17664 @opindex mtiny=
17665 Variables that are @var{n} bytes or smaller are allocated to the
17666 @code{.tiny} section.  These variables use the @code{$gp} base
17667 register.  The default for this option is 4, but note that there's a
17668 65536-byte limit to the @code{.tiny} section.
17670 @end table
17672 @node MicroBlaze Options
17673 @subsection MicroBlaze Options
17674 @cindex MicroBlaze Options
17676 @table @gcctabopt
17678 @item -msoft-float
17679 @opindex msoft-float
17680 Use software emulation for floating point (default).
17682 @item -mhard-float
17683 @opindex mhard-float
17684 Use hardware floating-point instructions.
17686 @item -mmemcpy
17687 @opindex mmemcpy
17688 Do not optimize block moves, use @code{memcpy}.
17690 @item -mno-clearbss
17691 @opindex mno-clearbss
17692 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17694 @item -mcpu=@var{cpu-type}
17695 @opindex mcpu=
17696 Use features of, and schedule code for, the given CPU.
17697 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17698 where @var{X} is a major version, @var{YY} is the minor version, and
17699 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17700 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17702 @item -mxl-soft-mul
17703 @opindex mxl-soft-mul
17704 Use software multiply emulation (default).
17706 @item -mxl-soft-div
17707 @opindex mxl-soft-div
17708 Use software emulation for divides (default).
17710 @item -mxl-barrel-shift
17711 @opindex mxl-barrel-shift
17712 Use the hardware barrel shifter.
17714 @item -mxl-pattern-compare
17715 @opindex mxl-pattern-compare
17716 Use pattern compare instructions.
17718 @item -msmall-divides
17719 @opindex msmall-divides
17720 Use table lookup optimization for small signed integer divisions.
17722 @item -mxl-stack-check
17723 @opindex mxl-stack-check
17724 This option is deprecated.  Use @option{-fstack-check} instead.
17726 @item -mxl-gp-opt
17727 @opindex mxl-gp-opt
17728 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17730 @item -mxl-multiply-high
17731 @opindex mxl-multiply-high
17732 Use multiply high instructions for high part of 32x32 multiply.
17734 @item -mxl-float-convert
17735 @opindex mxl-float-convert
17736 Use hardware floating-point conversion instructions.
17738 @item -mxl-float-sqrt
17739 @opindex mxl-float-sqrt
17740 Use hardware floating-point square root instruction.
17742 @item -mbig-endian
17743 @opindex mbig-endian
17744 Generate code for a big-endian target.
17746 @item -mlittle-endian
17747 @opindex mlittle-endian
17748 Generate code for a little-endian target.
17750 @item -mxl-reorder
17751 @opindex mxl-reorder
17752 Use reorder instructions (swap and byte reversed load/store).
17754 @item -mxl-mode-@var{app-model}
17755 Select application model @var{app-model}.  Valid models are
17756 @table @samp
17757 @item executable
17758 normal executable (default), uses startup code @file{crt0.o}.
17760 @item xmdstub
17761 for use with Xilinx Microprocessor Debugger (XMD) based
17762 software intrusive debug agent called xmdstub. This uses startup file
17763 @file{crt1.o} and sets the start address of the program to 0x800.
17765 @item bootstrap
17766 for applications that are loaded using a bootloader.
17767 This model uses startup file @file{crt2.o} which does not contain a processor
17768 reset vector handler. This is suitable for transferring control on a
17769 processor reset to the bootloader rather than the application.
17771 @item novectors
17772 for applications that do not require any of the
17773 MicroBlaze vectors. This option may be useful for applications running
17774 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17775 @end table
17777 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17778 @option{-mxl-mode-@var{app-model}}.
17780 @end table
17782 @node MIPS Options
17783 @subsection MIPS Options
17784 @cindex MIPS options
17786 @table @gcctabopt
17788 @item -EB
17789 @opindex EB
17790 Generate big-endian code.
17792 @item -EL
17793 @opindex EL
17794 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17795 configurations.
17797 @item -march=@var{arch}
17798 @opindex march
17799 Generate code that runs on @var{arch}, which can be the name of a
17800 generic MIPS ISA, or the name of a particular processor.
17801 The ISA names are:
17802 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17803 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
17804 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
17805 @samp{mips64r5} and @samp{mips64r6}.
17806 The processor names are:
17807 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17808 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17809 @samp{5kc}, @samp{5kf},
17810 @samp{20kc},
17811 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17812 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17813 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17814 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17815 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17816 @samp{i6400},
17817 @samp{interaptiv},
17818 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17819 @samp{m4k},
17820 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17821 @samp{m5100}, @samp{m5101},
17822 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
17823 @samp{orion},
17824 @samp{p5600},
17825 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17826 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17827 @samp{rm7000}, @samp{rm9000},
17828 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17829 @samp{sb1},
17830 @samp{sr71000},
17831 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17832 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17833 @samp{xlr} and @samp{xlp}.
17834 The special value @samp{from-abi} selects the
17835 most compatible architecture for the selected ABI (that is,
17836 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17838 The native Linux/GNU toolchain also supports the value @samp{native},
17839 which selects the best architecture option for the host processor.
17840 @option{-march=native} has no effect if GCC does not recognize
17841 the processor.
17843 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17844 (for example, @option{-march=r2k}).  Prefixes are optional, and
17845 @samp{vr} may be written @samp{r}.
17847 Names of the form @samp{@var{n}f2_1} refer to processors with
17848 FPUs clocked at half the rate of the core, names of the form
17849 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17850 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17851 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17852 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17853 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17854 accepted as synonyms for @samp{@var{n}f1_1}.
17856 GCC defines two macros based on the value of this option.  The first
17857 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
17858 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
17859 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
17860 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
17861 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
17863 Note that the @code{_MIPS_ARCH} macro uses the processor names given
17864 above.  In other words, it has the full prefix and does not
17865 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17866 the macro names the resolved architecture (either @code{"mips1"} or
17867 @code{"mips3"}).  It names the default architecture when no
17868 @option{-march} option is given.
17870 @item -mtune=@var{arch}
17871 @opindex mtune
17872 Optimize for @var{arch}.  Among other things, this option controls
17873 the way instructions are scheduled, and the perceived cost of arithmetic
17874 operations.  The list of @var{arch} values is the same as for
17875 @option{-march}.
17877 When this option is not used, GCC optimizes for the processor
17878 specified by @option{-march}.  By using @option{-march} and
17879 @option{-mtune} together, it is possible to generate code that
17880 runs on a family of processors, but optimize the code for one
17881 particular member of that family.
17883 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
17884 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17885 @option{-march} ones described above.
17887 @item -mips1
17888 @opindex mips1
17889 Equivalent to @option{-march=mips1}.
17891 @item -mips2
17892 @opindex mips2
17893 Equivalent to @option{-march=mips2}.
17895 @item -mips3
17896 @opindex mips3
17897 Equivalent to @option{-march=mips3}.
17899 @item -mips4
17900 @opindex mips4
17901 Equivalent to @option{-march=mips4}.
17903 @item -mips32
17904 @opindex mips32
17905 Equivalent to @option{-march=mips32}.
17907 @item -mips32r3
17908 @opindex mips32r3
17909 Equivalent to @option{-march=mips32r3}.
17911 @item -mips32r5
17912 @opindex mips32r5
17913 Equivalent to @option{-march=mips32r5}.
17915 @item -mips32r6
17916 @opindex mips32r6
17917 Equivalent to @option{-march=mips32r6}.
17919 @item -mips64
17920 @opindex mips64
17921 Equivalent to @option{-march=mips64}.
17923 @item -mips64r2
17924 @opindex mips64r2
17925 Equivalent to @option{-march=mips64r2}.
17927 @item -mips64r3
17928 @opindex mips64r3
17929 Equivalent to @option{-march=mips64r3}.
17931 @item -mips64r5
17932 @opindex mips64r5
17933 Equivalent to @option{-march=mips64r5}.
17935 @item -mips64r6
17936 @opindex mips64r6
17937 Equivalent to @option{-march=mips64r6}.
17939 @item -mips16
17940 @itemx -mno-mips16
17941 @opindex mips16
17942 @opindex mno-mips16
17943 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17944 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17946 MIPS16 code generation can also be controlled on a per-function basis
17947 by means of @code{mips16} and @code{nomips16} attributes.
17948 @xref{Function Attributes}, for more information.
17950 @item -mflip-mips16
17951 @opindex mflip-mips16
17952 Generate MIPS16 code on alternating functions.  This option is provided
17953 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17954 not intended for ordinary use in compiling user code.
17956 @item -minterlink-compressed
17957 @item -mno-interlink-compressed
17958 @opindex minterlink-compressed
17959 @opindex mno-interlink-compressed
17960 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17961 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17963 For example, code using the standard ISA encoding cannot jump directly
17964 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17965 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17966 knows that the target of the jump is not compressed.
17968 @item -minterlink-mips16
17969 @itemx -mno-interlink-mips16
17970 @opindex minterlink-mips16
17971 @opindex mno-interlink-mips16
17972 Aliases of @option{-minterlink-compressed} and
17973 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17974 and are retained for backwards compatibility.
17976 @item -mabi=32
17977 @itemx -mabi=o64
17978 @itemx -mabi=n32
17979 @itemx -mabi=64
17980 @itemx -mabi=eabi
17981 @opindex mabi=32
17982 @opindex mabi=o64
17983 @opindex mabi=n32
17984 @opindex mabi=64
17985 @opindex mabi=eabi
17986 Generate code for the given ABI@.
17988 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17989 generates 64-bit code when you select a 64-bit architecture, but you
17990 can use @option{-mgp32} to get 32-bit code instead.
17992 For information about the O64 ABI, see
17993 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17995 GCC supports a variant of the o32 ABI in which floating-point registers
17996 are 64 rather than 32 bits wide.  You can select this combination with
17997 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17998 and @code{mfhc1} instructions and is therefore only supported for
17999 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
18001 The register assignments for arguments and return values remain the
18002 same, but each scalar value is passed in a single 64-bit register
18003 rather than a pair of 32-bit registers.  For example, scalar
18004 floating-point values are returned in @samp{$f0} only, not a
18005 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
18006 remains the same in that the even-numbered double-precision registers
18007 are saved.
18009 Two additional variants of the o32 ABI are supported to enable
18010 a transition from 32-bit to 64-bit registers.  These are FPXX
18011 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
18012 The FPXX extension mandates that all code must execute correctly
18013 when run using 32-bit or 64-bit registers.  The code can be interlinked
18014 with either FP32 or FP64, but not both.
18015 The FP64A extension is similar to the FP64 extension but forbids the
18016 use of odd-numbered single-precision registers.  This can be used
18017 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
18018 processors and allows both FP32 and FP64A code to interlink and
18019 run in the same process without changing FPU modes.
18021 @item -mabicalls
18022 @itemx -mno-abicalls
18023 @opindex mabicalls
18024 @opindex mno-abicalls
18025 Generate (do not generate) code that is suitable for SVR4-style
18026 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
18027 systems.
18029 @item -mshared
18030 @itemx -mno-shared
18031 Generate (do not generate) code that is fully position-independent,
18032 and that can therefore be linked into shared libraries.  This option
18033 only affects @option{-mabicalls}.
18035 All @option{-mabicalls} code has traditionally been position-independent,
18036 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
18037 as an extension, the GNU toolchain allows executables to use absolute
18038 accesses for locally-binding symbols.  It can also use shorter GP
18039 initialization sequences and generate direct calls to locally-defined
18040 functions.  This mode is selected by @option{-mno-shared}.
18042 @option{-mno-shared} depends on binutils 2.16 or higher and generates
18043 objects that can only be linked by the GNU linker.  However, the option
18044 does not affect the ABI of the final executable; it only affects the ABI
18045 of relocatable objects.  Using @option{-mno-shared} generally makes
18046 executables both smaller and quicker.
18048 @option{-mshared} is the default.
18050 @item -mplt
18051 @itemx -mno-plt
18052 @opindex mplt
18053 @opindex mno-plt
18054 Assume (do not assume) that the static and dynamic linkers
18055 support PLTs and copy relocations.  This option only affects
18056 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
18057 has no effect without @option{-msym32}.
18059 You can make @option{-mplt} the default by configuring
18060 GCC with @option{--with-mips-plt}.  The default is
18061 @option{-mno-plt} otherwise.
18063 @item -mxgot
18064 @itemx -mno-xgot
18065 @opindex mxgot
18066 @opindex mno-xgot
18067 Lift (do not lift) the usual restrictions on the size of the global
18068 offset table.
18070 GCC normally uses a single instruction to load values from the GOT@.
18071 While this is relatively efficient, it only works if the GOT
18072 is smaller than about 64k.  Anything larger causes the linker
18073 to report an error such as:
18075 @cindex relocation truncated to fit (MIPS)
18076 @smallexample
18077 relocation truncated to fit: R_MIPS_GOT16 foobar
18078 @end smallexample
18080 If this happens, you should recompile your code with @option{-mxgot}.
18081 This works with very large GOTs, although the code is also
18082 less efficient, since it takes three instructions to fetch the
18083 value of a global symbol.
18085 Note that some linkers can create multiple GOTs.  If you have such a
18086 linker, you should only need to use @option{-mxgot} when a single object
18087 file accesses more than 64k's worth of GOT entries.  Very few do.
18089 These options have no effect unless GCC is generating position
18090 independent code.
18092 @item -mgp32
18093 @opindex mgp32
18094 Assume that general-purpose registers are 32 bits wide.
18096 @item -mgp64
18097 @opindex mgp64
18098 Assume that general-purpose registers are 64 bits wide.
18100 @item -mfp32
18101 @opindex mfp32
18102 Assume that floating-point registers are 32 bits wide.
18104 @item -mfp64
18105 @opindex mfp64
18106 Assume that floating-point registers are 64 bits wide.
18108 @item -mfpxx
18109 @opindex mfpxx
18110 Do not assume the width of floating-point registers.
18112 @item -mhard-float
18113 @opindex mhard-float
18114 Use floating-point coprocessor instructions.
18116 @item -msoft-float
18117 @opindex msoft-float
18118 Do not use floating-point coprocessor instructions.  Implement
18119 floating-point calculations using library calls instead.
18121 @item -mno-float
18122 @opindex mno-float
18123 Equivalent to @option{-msoft-float}, but additionally asserts that the
18124 program being compiled does not perform any floating-point operations.
18125 This option is presently supported only by some bare-metal MIPS
18126 configurations, where it may select a special set of libraries
18127 that lack all floating-point support (including, for example, the
18128 floating-point @code{printf} formats).  
18129 If code compiled with @option{-mno-float} accidentally contains
18130 floating-point operations, it is likely to suffer a link-time
18131 or run-time failure.
18133 @item -msingle-float
18134 @opindex msingle-float
18135 Assume that the floating-point coprocessor only supports single-precision
18136 operations.
18138 @item -mdouble-float
18139 @opindex mdouble-float
18140 Assume that the floating-point coprocessor supports double-precision
18141 operations.  This is the default.
18143 @item -modd-spreg
18144 @itemx -mno-odd-spreg
18145 @opindex modd-spreg
18146 @opindex mno-odd-spreg
18147 Enable the use of odd-numbered single-precision floating-point registers
18148 for the o32 ABI.  This is the default for processors that are known to
18149 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
18150 is set by default.
18152 @item -mabs=2008
18153 @itemx -mabs=legacy
18154 @opindex mabs=2008
18155 @opindex mabs=legacy
18156 These options control the treatment of the special not-a-number (NaN)
18157 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
18158 @code{neg.@i{fmt}} machine instructions.
18160 By default or when @option{-mabs=legacy} is used the legacy
18161 treatment is selected.  In this case these instructions are considered
18162 arithmetic and avoided where correct operation is required and the
18163 input operand might be a NaN.  A longer sequence of instructions that
18164 manipulate the sign bit of floating-point datum manually is used
18165 instead unless the @option{-ffinite-math-only} option has also been
18166 specified.
18168 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
18169 this case these instructions are considered non-arithmetic and therefore
18170 operating correctly in all cases, including in particular where the
18171 input operand is a NaN.  These instructions are therefore always used
18172 for the respective operations.
18174 @item -mnan=2008
18175 @itemx -mnan=legacy
18176 @opindex mnan=2008
18177 @opindex mnan=legacy
18178 These options control the encoding of the special not-a-number (NaN)
18179 IEEE 754 floating-point data.
18181 The @option{-mnan=legacy} option selects the legacy encoding.  In this
18182 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
18183 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
18184 by the first bit of their trailing significand field being 1.
18186 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
18187 this case qNaNs are denoted by the first bit of their trailing
18188 significand field being 1, whereas sNaNs are denoted by the first bit of
18189 their trailing significand field being 0.
18191 The default is @option{-mnan=legacy} unless GCC has been configured with
18192 @option{--with-nan=2008}.
18194 @item -mllsc
18195 @itemx -mno-llsc
18196 @opindex mllsc
18197 @opindex mno-llsc
18198 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
18199 implement atomic memory built-in functions.  When neither option is
18200 specified, GCC uses the instructions if the target architecture
18201 supports them.
18203 @option{-mllsc} is useful if the runtime environment can emulate the
18204 instructions and @option{-mno-llsc} can be useful when compiling for
18205 nonstandard ISAs.  You can make either option the default by
18206 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
18207 respectively.  @option{--with-llsc} is the default for some
18208 configurations; see the installation documentation for details.
18210 @item -mdsp
18211 @itemx -mno-dsp
18212 @opindex mdsp
18213 @opindex mno-dsp
18214 Use (do not use) revision 1 of the MIPS DSP ASE@.
18215 @xref{MIPS DSP Built-in Functions}.  This option defines the
18216 preprocessor macro @code{__mips_dsp}.  It also defines
18217 @code{__mips_dsp_rev} to 1.
18219 @item -mdspr2
18220 @itemx -mno-dspr2
18221 @opindex mdspr2
18222 @opindex mno-dspr2
18223 Use (do not use) revision 2 of the MIPS DSP ASE@.
18224 @xref{MIPS DSP Built-in Functions}.  This option defines the
18225 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
18226 It also defines @code{__mips_dsp_rev} to 2.
18228 @item -msmartmips
18229 @itemx -mno-smartmips
18230 @opindex msmartmips
18231 @opindex mno-smartmips
18232 Use (do not use) the MIPS SmartMIPS ASE.
18234 @item -mpaired-single
18235 @itemx -mno-paired-single
18236 @opindex mpaired-single
18237 @opindex mno-paired-single
18238 Use (do not use) paired-single floating-point instructions.
18239 @xref{MIPS Paired-Single Support}.  This option requires
18240 hardware floating-point support to be enabled.
18242 @item -mdmx
18243 @itemx -mno-mdmx
18244 @opindex mdmx
18245 @opindex mno-mdmx
18246 Use (do not use) MIPS Digital Media Extension instructions.
18247 This option can only be used when generating 64-bit code and requires
18248 hardware floating-point support to be enabled.
18250 @item -mips3d
18251 @itemx -mno-mips3d
18252 @opindex mips3d
18253 @opindex mno-mips3d
18254 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
18255 The option @option{-mips3d} implies @option{-mpaired-single}.
18257 @item -mmicromips
18258 @itemx -mno-micromips
18259 @opindex mmicromips
18260 @opindex mno-mmicromips
18261 Generate (do not generate) microMIPS code.
18263 MicroMIPS code generation can also be controlled on a per-function basis
18264 by means of @code{micromips} and @code{nomicromips} attributes.
18265 @xref{Function Attributes}, for more information.
18267 @item -mmt
18268 @itemx -mno-mt
18269 @opindex mmt
18270 @opindex mno-mt
18271 Use (do not use) MT Multithreading instructions.
18273 @item -mmcu
18274 @itemx -mno-mcu
18275 @opindex mmcu
18276 @opindex mno-mcu
18277 Use (do not use) the MIPS MCU ASE instructions.
18279 @item -meva
18280 @itemx -mno-eva
18281 @opindex meva
18282 @opindex mno-eva
18283 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
18285 @item -mvirt
18286 @itemx -mno-virt
18287 @opindex mvirt
18288 @opindex mno-virt
18289 Use (do not use) the MIPS Virtualization Application Specific instructions.
18291 @item -mxpa
18292 @itemx -mno-xpa
18293 @opindex mxpa
18294 @opindex mno-xpa
18295 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
18297 @item -mlong64
18298 @opindex mlong64
18299 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
18300 an explanation of the default and the way that the pointer size is
18301 determined.
18303 @item -mlong32
18304 @opindex mlong32
18305 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
18307 The default size of @code{int}s, @code{long}s and pointers depends on
18308 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
18309 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
18310 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
18311 or the same size as integer registers, whichever is smaller.
18313 @item -msym32
18314 @itemx -mno-sym32
18315 @opindex msym32
18316 @opindex mno-sym32
18317 Assume (do not assume) that all symbols have 32-bit values, regardless
18318 of the selected ABI@.  This option is useful in combination with
18319 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
18320 to generate shorter and faster references to symbolic addresses.
18322 @item -G @var{num}
18323 @opindex G
18324 Put definitions of externally-visible data in a small data section
18325 if that data is no bigger than @var{num} bytes.  GCC can then generate
18326 more efficient accesses to the data; see @option{-mgpopt} for details.
18328 The default @option{-G} option depends on the configuration.
18330 @item -mlocal-sdata
18331 @itemx -mno-local-sdata
18332 @opindex mlocal-sdata
18333 @opindex mno-local-sdata
18334 Extend (do not extend) the @option{-G} behavior to local data too,
18335 such as to static variables in C@.  @option{-mlocal-sdata} is the
18336 default for all configurations.
18338 If the linker complains that an application is using too much small data,
18339 you might want to try rebuilding the less performance-critical parts with
18340 @option{-mno-local-sdata}.  You might also want to build large
18341 libraries with @option{-mno-local-sdata}, so that the libraries leave
18342 more room for the main program.
18344 @item -mextern-sdata
18345 @itemx -mno-extern-sdata
18346 @opindex mextern-sdata
18347 @opindex mno-extern-sdata
18348 Assume (do not assume) that externally-defined data is in
18349 a small data section if the size of that data is within the @option{-G} limit.
18350 @option{-mextern-sdata} is the default for all configurations.
18352 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
18353 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
18354 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
18355 is placed in a small data section.  If @var{Var} is defined by another
18356 module, you must either compile that module with a high-enough
18357 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
18358 definition.  If @var{Var} is common, you must link the application
18359 with a high-enough @option{-G} setting.
18361 The easiest way of satisfying these restrictions is to compile
18362 and link every module with the same @option{-G} option.  However,
18363 you may wish to build a library that supports several different
18364 small data limits.  You can do this by compiling the library with
18365 the highest supported @option{-G} setting and additionally using
18366 @option{-mno-extern-sdata} to stop the library from making assumptions
18367 about externally-defined data.
18369 @item -mgpopt
18370 @itemx -mno-gpopt
18371 @opindex mgpopt
18372 @opindex mno-gpopt
18373 Use (do not use) GP-relative accesses for symbols that are known to be
18374 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
18375 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
18376 configurations.
18378 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
18379 might not hold the value of @code{_gp}.  For example, if the code is
18380 part of a library that might be used in a boot monitor, programs that
18381 call boot monitor routines pass an unknown value in @code{$gp}.
18382 (In such situations, the boot monitor itself is usually compiled
18383 with @option{-G0}.)
18385 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
18386 @option{-mno-extern-sdata}.
18388 @item -membedded-data
18389 @itemx -mno-embedded-data
18390 @opindex membedded-data
18391 @opindex mno-embedded-data
18392 Allocate variables to the read-only data section first if possible, then
18393 next in the small data section if possible, otherwise in data.  This gives
18394 slightly slower code than the default, but reduces the amount of RAM required
18395 when executing, and thus may be preferred for some embedded systems.
18397 @item -muninit-const-in-rodata
18398 @itemx -mno-uninit-const-in-rodata
18399 @opindex muninit-const-in-rodata
18400 @opindex mno-uninit-const-in-rodata
18401 Put uninitialized @code{const} variables in the read-only data section.
18402 This option is only meaningful in conjunction with @option{-membedded-data}.
18404 @item -mcode-readable=@var{setting}
18405 @opindex mcode-readable
18406 Specify whether GCC may generate code that reads from executable sections.
18407 There are three possible settings:
18409 @table @gcctabopt
18410 @item -mcode-readable=yes
18411 Instructions may freely access executable sections.  This is the
18412 default setting.
18414 @item -mcode-readable=pcrel
18415 MIPS16 PC-relative load instructions can access executable sections,
18416 but other instructions must not do so.  This option is useful on 4KSc
18417 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
18418 It is also useful on processors that can be configured to have a dual
18419 instruction/data SRAM interface and that, like the M4K, automatically
18420 redirect PC-relative loads to the instruction RAM.
18422 @item -mcode-readable=no
18423 Instructions must not access executable sections.  This option can be
18424 useful on targets that are configured to have a dual instruction/data
18425 SRAM interface but that (unlike the M4K) do not automatically redirect
18426 PC-relative loads to the instruction RAM.
18427 @end table
18429 @item -msplit-addresses
18430 @itemx -mno-split-addresses
18431 @opindex msplit-addresses
18432 @opindex mno-split-addresses
18433 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
18434 relocation operators.  This option has been superseded by
18435 @option{-mexplicit-relocs} but is retained for backwards compatibility.
18437 @item -mexplicit-relocs
18438 @itemx -mno-explicit-relocs
18439 @opindex mexplicit-relocs
18440 @opindex mno-explicit-relocs
18441 Use (do not use) assembler relocation operators when dealing with symbolic
18442 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
18443 is to use assembler macros instead.
18445 @option{-mexplicit-relocs} is the default if GCC was configured
18446 to use an assembler that supports relocation operators.
18448 @item -mcheck-zero-division
18449 @itemx -mno-check-zero-division
18450 @opindex mcheck-zero-division
18451 @opindex mno-check-zero-division
18452 Trap (do not trap) on integer division by zero.
18454 The default is @option{-mcheck-zero-division}.
18456 @item -mdivide-traps
18457 @itemx -mdivide-breaks
18458 @opindex mdivide-traps
18459 @opindex mdivide-breaks
18460 MIPS systems check for division by zero by generating either a
18461 conditional trap or a break instruction.  Using traps results in
18462 smaller code, but is only supported on MIPS II and later.  Also, some
18463 versions of the Linux kernel have a bug that prevents trap from
18464 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
18465 allow conditional traps on architectures that support them and
18466 @option{-mdivide-breaks} to force the use of breaks.
18468 The default is usually @option{-mdivide-traps}, but this can be
18469 overridden at configure time using @option{--with-divide=breaks}.
18470 Divide-by-zero checks can be completely disabled using
18471 @option{-mno-check-zero-division}.
18473 @item -mmemcpy
18474 @itemx -mno-memcpy
18475 @opindex mmemcpy
18476 @opindex mno-memcpy
18477 Force (do not force) the use of @code{memcpy} for non-trivial block
18478 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
18479 most constant-sized copies.
18481 @item -mlong-calls
18482 @itemx -mno-long-calls
18483 @opindex mlong-calls
18484 @opindex mno-long-calls
18485 Disable (do not disable) use of the @code{jal} instruction.  Calling
18486 functions using @code{jal} is more efficient but requires the caller
18487 and callee to be in the same 256 megabyte segment.
18489 This option has no effect on abicalls code.  The default is
18490 @option{-mno-long-calls}.
18492 @item -mmad
18493 @itemx -mno-mad
18494 @opindex mmad
18495 @opindex mno-mad
18496 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
18497 instructions, as provided by the R4650 ISA@.
18499 @item -mimadd
18500 @itemx -mno-imadd
18501 @opindex mimadd
18502 @opindex mno-imadd
18503 Enable (disable) use of the @code{madd} and @code{msub} integer
18504 instructions.  The default is @option{-mimadd} on architectures
18505 that support @code{madd} and @code{msub} except for the 74k 
18506 architecture where it was found to generate slower code.
18508 @item -mfused-madd
18509 @itemx -mno-fused-madd
18510 @opindex mfused-madd
18511 @opindex mno-fused-madd
18512 Enable (disable) use of the floating-point multiply-accumulate
18513 instructions, when they are available.  The default is
18514 @option{-mfused-madd}.
18516 On the R8000 CPU when multiply-accumulate instructions are used,
18517 the intermediate product is calculated to infinite precision
18518 and is not subject to the FCSR Flush to Zero bit.  This may be
18519 undesirable in some circumstances.  On other processors the result
18520 is numerically identical to the equivalent computation using
18521 separate multiply, add, subtract and negate instructions.
18523 @item -nocpp
18524 @opindex nocpp
18525 Tell the MIPS assembler to not run its preprocessor over user
18526 assembler files (with a @samp{.s} suffix) when assembling them.
18528 @item -mfix-24k
18529 @item -mno-fix-24k
18530 @opindex mfix-24k
18531 @opindex mno-fix-24k
18532 Work around the 24K E48 (lost data on stores during refill) errata.
18533 The workarounds are implemented by the assembler rather than by GCC@.
18535 @item -mfix-r4000
18536 @itemx -mno-fix-r4000
18537 @opindex mfix-r4000
18538 @opindex mno-fix-r4000
18539 Work around certain R4000 CPU errata:
18540 @itemize @minus
18541 @item
18542 A double-word or a variable shift may give an incorrect result if executed
18543 immediately after starting an integer division.
18544 @item
18545 A double-word or a variable shift may give an incorrect result if executed
18546 while an integer multiplication is in progress.
18547 @item
18548 An integer division may give an incorrect result if started in a delay slot
18549 of a taken branch or a jump.
18550 @end itemize
18552 @item -mfix-r4400
18553 @itemx -mno-fix-r4400
18554 @opindex mfix-r4400
18555 @opindex mno-fix-r4400
18556 Work around certain R4400 CPU errata:
18557 @itemize @minus
18558 @item
18559 A double-word or a variable shift may give an incorrect result if executed
18560 immediately after starting an integer division.
18561 @end itemize
18563 @item -mfix-r10000
18564 @itemx -mno-fix-r10000
18565 @opindex mfix-r10000
18566 @opindex mno-fix-r10000
18567 Work around certain R10000 errata:
18568 @itemize @minus
18569 @item
18570 @code{ll}/@code{sc} sequences may not behave atomically on revisions
18571 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
18572 @end itemize
18574 This option can only be used if the target architecture supports
18575 branch-likely instructions.  @option{-mfix-r10000} is the default when
18576 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
18577 otherwise.
18579 @item -mfix-rm7000
18580 @itemx -mno-fix-rm7000
18581 @opindex mfix-rm7000
18582 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
18583 workarounds are implemented by the assembler rather than by GCC@.
18585 @item -mfix-vr4120
18586 @itemx -mno-fix-vr4120
18587 @opindex mfix-vr4120
18588 Work around certain VR4120 errata:
18589 @itemize @minus
18590 @item
18591 @code{dmultu} does not always produce the correct result.
18592 @item
18593 @code{div} and @code{ddiv} do not always produce the correct result if one
18594 of the operands is negative.
18595 @end itemize
18596 The workarounds for the division errata rely on special functions in
18597 @file{libgcc.a}.  At present, these functions are only provided by
18598 the @code{mips64vr*-elf} configurations.
18600 Other VR4120 errata require a NOP to be inserted between certain pairs of
18601 instructions.  These errata are handled by the assembler, not by GCC itself.
18603 @item -mfix-vr4130
18604 @opindex mfix-vr4130
18605 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
18606 workarounds are implemented by the assembler rather than by GCC,
18607 although GCC avoids using @code{mflo} and @code{mfhi} if the
18608 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18609 instructions are available instead.
18611 @item -mfix-sb1
18612 @itemx -mno-fix-sb1
18613 @opindex mfix-sb1
18614 Work around certain SB-1 CPU core errata.
18615 (This flag currently works around the SB-1 revision 2
18616 ``F1'' and ``F2'' floating-point errata.)
18618 @item -mr10k-cache-barrier=@var{setting}
18619 @opindex mr10k-cache-barrier
18620 Specify whether GCC should insert cache barriers to avoid the
18621 side-effects of speculation on R10K processors.
18623 In common with many processors, the R10K tries to predict the outcome
18624 of a conditional branch and speculatively executes instructions from
18625 the ``taken'' branch.  It later aborts these instructions if the
18626 predicted outcome is wrong.  However, on the R10K, even aborted
18627 instructions can have side effects.
18629 This problem only affects kernel stores and, depending on the system,
18630 kernel loads.  As an example, a speculatively-executed store may load
18631 the target memory into cache and mark the cache line as dirty, even if
18632 the store itself is later aborted.  If a DMA operation writes to the
18633 same area of memory before the ``dirty'' line is flushed, the cached
18634 data overwrites the DMA-ed data.  See the R10K processor manual
18635 for a full description, including other potential problems.
18637 One workaround is to insert cache barrier instructions before every memory
18638 access that might be speculatively executed and that might have side
18639 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18640 controls GCC's implementation of this workaround.  It assumes that
18641 aborted accesses to any byte in the following regions does not have
18642 side effects:
18644 @enumerate
18645 @item
18646 the memory occupied by the current function's stack frame;
18648 @item
18649 the memory occupied by an incoming stack argument;
18651 @item
18652 the memory occupied by an object with a link-time-constant address.
18653 @end enumerate
18655 It is the kernel's responsibility to ensure that speculative
18656 accesses to these regions are indeed safe.
18658 If the input program contains a function declaration such as:
18660 @smallexample
18661 void foo (void);
18662 @end smallexample
18664 then the implementation of @code{foo} must allow @code{j foo} and
18665 @code{jal foo} to be executed speculatively.  GCC honors this
18666 restriction for functions it compiles itself.  It expects non-GCC
18667 functions (such as hand-written assembly code) to do the same.
18669 The option has three forms:
18671 @table @gcctabopt
18672 @item -mr10k-cache-barrier=load-store
18673 Insert a cache barrier before a load or store that might be
18674 speculatively executed and that might have side effects even
18675 if aborted.
18677 @item -mr10k-cache-barrier=store
18678 Insert a cache barrier before a store that might be speculatively
18679 executed and that might have side effects even if aborted.
18681 @item -mr10k-cache-barrier=none
18682 Disable the insertion of cache barriers.  This is the default setting.
18683 @end table
18685 @item -mflush-func=@var{func}
18686 @itemx -mno-flush-func
18687 @opindex mflush-func
18688 Specifies the function to call to flush the I and D caches, or to not
18689 call any such function.  If called, the function must take the same
18690 arguments as the common @code{_flush_func}, that is, the address of the
18691 memory range for which the cache is being flushed, the size of the
18692 memory range, and the number 3 (to flush both caches).  The default
18693 depends on the target GCC was configured for, but commonly is either
18694 @code{_flush_func} or @code{__cpu_flush}.
18696 @item mbranch-cost=@var{num}
18697 @opindex mbranch-cost
18698 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18699 This cost is only a heuristic and is not guaranteed to produce
18700 consistent results across releases.  A zero cost redundantly selects
18701 the default, which is based on the @option{-mtune} setting.
18703 @item -mbranch-likely
18704 @itemx -mno-branch-likely
18705 @opindex mbranch-likely
18706 @opindex mno-branch-likely
18707 Enable or disable use of Branch Likely instructions, regardless of the
18708 default for the selected architecture.  By default, Branch Likely
18709 instructions may be generated if they are supported by the selected
18710 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18711 and processors that implement those architectures; for those, Branch
18712 Likely instructions are not be generated by default because the MIPS32
18713 and MIPS64 architectures specifically deprecate their use.
18715 @item -mcompact-branches=never
18716 @itemx -mcompact-branches=optimal
18717 @itemx -mcompact-branches=always
18718 @opindex mcompact-branches=never
18719 @opindex mcompact-branches=optimal
18720 @opindex mcompact-branches=always
18721 These options control which form of branches will be generated.  The
18722 default is @option{-mcompact-branches=optimal}.
18724 The @option{-mcompact-branches=never} option ensures that compact branch
18725 instructions will never be generated.
18727 The @option{-mcompact-branches=always} option ensures that a compact
18728 branch instruction will be generated if available.  If a compact branch
18729 instruction is not available, a delay slot form of the branch will be
18730 used instead.
18732 This option is supported from MIPS Release 6 onwards.
18734 The @option{-mcompact-branches=optimal} option will cause a delay slot
18735 branch to be used if one is available in the current ISA and the delay
18736 slot is successfully filled.  If the delay slot is not filled, a compact
18737 branch will be chosen if one is available.
18739 @item -mfp-exceptions
18740 @itemx -mno-fp-exceptions
18741 @opindex mfp-exceptions
18742 Specifies whether FP exceptions are enabled.  This affects how
18743 FP instructions are scheduled for some processors.
18744 The default is that FP exceptions are
18745 enabled.
18747 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18748 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18749 FP pipe.
18751 @item -mvr4130-align
18752 @itemx -mno-vr4130-align
18753 @opindex mvr4130-align
18754 The VR4130 pipeline is two-way superscalar, but can only issue two
18755 instructions together if the first one is 8-byte aligned.  When this
18756 option is enabled, GCC aligns pairs of instructions that it
18757 thinks should execute in parallel.
18759 This option only has an effect when optimizing for the VR4130.
18760 It normally makes code faster, but at the expense of making it bigger.
18761 It is enabled by default at optimization level @option{-O3}.
18763 @item -msynci
18764 @itemx -mno-synci
18765 @opindex msynci
18766 Enable (disable) generation of @code{synci} instructions on
18767 architectures that support it.  The @code{synci} instructions (if
18768 enabled) are generated when @code{__builtin___clear_cache} is
18769 compiled.
18771 This option defaults to @option{-mno-synci}, but the default can be
18772 overridden by configuring GCC with @option{--with-synci}.
18774 When compiling code for single processor systems, it is generally safe
18775 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18776 does not invalidate the instruction caches on all cores and may lead
18777 to undefined behavior.
18779 @item -mrelax-pic-calls
18780 @itemx -mno-relax-pic-calls
18781 @opindex mrelax-pic-calls
18782 Try to turn PIC calls that are normally dispatched via register
18783 @code{$25} into direct calls.  This is only possible if the linker can
18784 resolve the destination at link time and if the destination is within
18785 range for a direct call.
18787 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18788 an assembler and a linker that support the @code{.reloc} assembly
18789 directive and @option{-mexplicit-relocs} is in effect.  With
18790 @option{-mno-explicit-relocs}, this optimization can be performed by the
18791 assembler and the linker alone without help from the compiler.
18793 @item -mmcount-ra-address
18794 @itemx -mno-mcount-ra-address
18795 @opindex mmcount-ra-address
18796 @opindex mno-mcount-ra-address
18797 Emit (do not emit) code that allows @code{_mcount} to modify the
18798 calling function's return address.  When enabled, this option extends
18799 the usual @code{_mcount} interface with a new @var{ra-address}
18800 parameter, which has type @code{intptr_t *} and is passed in register
18801 @code{$12}.  @code{_mcount} can then modify the return address by
18802 doing both of the following:
18803 @itemize
18804 @item
18805 Returning the new address in register @code{$31}.
18806 @item
18807 Storing the new address in @code{*@var{ra-address}},
18808 if @var{ra-address} is nonnull.
18809 @end itemize
18811 The default is @option{-mno-mcount-ra-address}.
18813 @item -mframe-header-opt
18814 @itemx -mno-frame-header-opt
18815 @opindex mframe-header-opt
18816 Enable (disable) frame header optimization in the o32 ABI.  When using the
18817 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
18818 function to write out register arguments.  When enabled, this optimization
18819 will suppress the allocation of the frame header if it can be determined that
18820 it is unused.
18822 This optimization is off by default at all optimization levels.
18824 @end table
18826 @node MMIX Options
18827 @subsection MMIX Options
18828 @cindex MMIX Options
18830 These options are defined for the MMIX:
18832 @table @gcctabopt
18833 @item -mlibfuncs
18834 @itemx -mno-libfuncs
18835 @opindex mlibfuncs
18836 @opindex mno-libfuncs
18837 Specify that intrinsic library functions are being compiled, passing all
18838 values in registers, no matter the size.
18840 @item -mepsilon
18841 @itemx -mno-epsilon
18842 @opindex mepsilon
18843 @opindex mno-epsilon
18844 Generate floating-point comparison instructions that compare with respect
18845 to the @code{rE} epsilon register.
18847 @item -mabi=mmixware
18848 @itemx -mabi=gnu
18849 @opindex mabi=mmixware
18850 @opindex mabi=gnu
18851 Generate code that passes function parameters and return values that (in
18852 the called function) are seen as registers @code{$0} and up, as opposed to
18853 the GNU ABI which uses global registers @code{$231} and up.
18855 @item -mzero-extend
18856 @itemx -mno-zero-extend
18857 @opindex mzero-extend
18858 @opindex mno-zero-extend
18859 When reading data from memory in sizes shorter than 64 bits, use (do not
18860 use) zero-extending load instructions by default, rather than
18861 sign-extending ones.
18863 @item -mknuthdiv
18864 @itemx -mno-knuthdiv
18865 @opindex mknuthdiv
18866 @opindex mno-knuthdiv
18867 Make the result of a division yielding a remainder have the same sign as
18868 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18869 remainder follows the sign of the dividend.  Both methods are
18870 arithmetically valid, the latter being almost exclusively used.
18872 @item -mtoplevel-symbols
18873 @itemx -mno-toplevel-symbols
18874 @opindex mtoplevel-symbols
18875 @opindex mno-toplevel-symbols
18876 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18877 code can be used with the @code{PREFIX} assembly directive.
18879 @item -melf
18880 @opindex melf
18881 Generate an executable in the ELF format, rather than the default
18882 @samp{mmo} format used by the @command{mmix} simulator.
18884 @item -mbranch-predict
18885 @itemx -mno-branch-predict
18886 @opindex mbranch-predict
18887 @opindex mno-branch-predict
18888 Use (do not use) the probable-branch instructions, when static branch
18889 prediction indicates a probable branch.
18891 @item -mbase-addresses
18892 @itemx -mno-base-addresses
18893 @opindex mbase-addresses
18894 @opindex mno-base-addresses
18895 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18896 base address automatically generates a request (handled by the assembler
18897 and the linker) for a constant to be set up in a global register.  The
18898 register is used for one or more base address requests within the range 0
18899 to 255 from the value held in the register.  The generally leads to short
18900 and fast code, but the number of different data items that can be
18901 addressed is limited.  This means that a program that uses lots of static
18902 data may require @option{-mno-base-addresses}.
18904 @item -msingle-exit
18905 @itemx -mno-single-exit
18906 @opindex msingle-exit
18907 @opindex mno-single-exit
18908 Force (do not force) generated code to have a single exit point in each
18909 function.
18910 @end table
18912 @node MN10300 Options
18913 @subsection MN10300 Options
18914 @cindex MN10300 options
18916 These @option{-m} options are defined for Matsushita MN10300 architectures:
18918 @table @gcctabopt
18919 @item -mmult-bug
18920 @opindex mmult-bug
18921 Generate code to avoid bugs in the multiply instructions for the MN10300
18922 processors.  This is the default.
18924 @item -mno-mult-bug
18925 @opindex mno-mult-bug
18926 Do not generate code to avoid bugs in the multiply instructions for the
18927 MN10300 processors.
18929 @item -mam33
18930 @opindex mam33
18931 Generate code using features specific to the AM33 processor.
18933 @item -mno-am33
18934 @opindex mno-am33
18935 Do not generate code using features specific to the AM33 processor.  This
18936 is the default.
18938 @item -mam33-2
18939 @opindex mam33-2
18940 Generate code using features specific to the AM33/2.0 processor.
18942 @item -mam34
18943 @opindex mam34
18944 Generate code using features specific to the AM34 processor.
18946 @item -mtune=@var{cpu-type}
18947 @opindex mtune
18948 Use the timing characteristics of the indicated CPU type when
18949 scheduling instructions.  This does not change the targeted processor
18950 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18951 @samp{am33-2} or @samp{am34}.
18953 @item -mreturn-pointer-on-d0
18954 @opindex mreturn-pointer-on-d0
18955 When generating a function that returns a pointer, return the pointer
18956 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18957 only in @code{a0}, and attempts to call such functions without a prototype
18958 result in errors.  Note that this option is on by default; use
18959 @option{-mno-return-pointer-on-d0} to disable it.
18961 @item -mno-crt0
18962 @opindex mno-crt0
18963 Do not link in the C run-time initialization object file.
18965 @item -mrelax
18966 @opindex mrelax
18967 Indicate to the linker that it should perform a relaxation optimization pass
18968 to shorten branches, calls and absolute memory addresses.  This option only
18969 has an effect when used on the command line for the final link step.
18971 This option makes symbolic debugging impossible.
18973 @item -mliw
18974 @opindex mliw
18975 Allow the compiler to generate @emph{Long Instruction Word}
18976 instructions if the target is the @samp{AM33} or later.  This is the
18977 default.  This option defines the preprocessor macro @code{__LIW__}.
18979 @item -mnoliw
18980 @opindex mnoliw
18981 Do not allow the compiler to generate @emph{Long Instruction Word}
18982 instructions.  This option defines the preprocessor macro
18983 @code{__NO_LIW__}.
18985 @item -msetlb
18986 @opindex msetlb
18987 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18988 instructions if the target is the @samp{AM33} or later.  This is the
18989 default.  This option defines the preprocessor macro @code{__SETLB__}.
18991 @item -mnosetlb
18992 @opindex mnosetlb
18993 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18994 instructions.  This option defines the preprocessor macro
18995 @code{__NO_SETLB__}.
18997 @end table
18999 @node Moxie Options
19000 @subsection Moxie Options
19001 @cindex Moxie Options
19003 @table @gcctabopt
19005 @item -meb
19006 @opindex meb
19007 Generate big-endian code.  This is the default for @samp{moxie-*-*}
19008 configurations.
19010 @item -mel
19011 @opindex mel
19012 Generate little-endian code.
19014 @item -mmul.x
19015 @opindex mmul.x
19016 Generate mul.x and umul.x instructions.  This is the default for
19017 @samp{moxiebox-*-*} configurations.
19019 @item -mno-crt0
19020 @opindex mno-crt0
19021 Do not link in the C run-time initialization object file.
19023 @end table
19025 @node MSP430 Options
19026 @subsection MSP430 Options
19027 @cindex MSP430 Options
19029 These options are defined for the MSP430:
19031 @table @gcctabopt
19033 @item -masm-hex
19034 @opindex masm-hex
19035 Force assembly output to always use hex constants.  Normally such
19036 constants are signed decimals, but this option is available for
19037 testsuite and/or aesthetic purposes.
19039 @item -mmcu=
19040 @opindex mmcu=
19041 Select the MCU to target.  This is used to create a C preprocessor
19042 symbol based upon the MCU name, converted to upper case and pre- and
19043 post-fixed with @samp{__}.  This in turn is used by the
19044 @file{msp430.h} header file to select an MCU-specific supplementary
19045 header file.
19047 The option also sets the ISA to use.  If the MCU name is one that is
19048 known to only support the 430 ISA then that is selected, otherwise the
19049 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
19050 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
19051 name selects the 430X ISA.
19053 In addition an MCU-specific linker script is added to the linker
19054 command line.  The script's name is the name of the MCU with
19055 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
19056 command line defines the C preprocessor symbol @code{__XXX__} and
19057 cause the linker to search for a script called @file{xxx.ld}.
19059 This option is also passed on to the assembler.
19061 @item -mwarn-mcu
19062 @itemx -mno-warn-mcu
19063 @opindex mwarn-mcu
19064 @opindex mno-warn-mcu
19065 This option enables or disables warnings about conflicts between the
19066 MCU name specified by the @option{-mmcu} option and the ISA set by the
19067 @option{-mcpu} option and/or the hardware multiply support set by the
19068 @option{-mhwmult} option.  It also toggles warnings about unrecognized
19069 MCU names.  This option is on by default.
19071 @item -mcpu=
19072 @opindex mcpu=
19073 Specifies the ISA to use.  Accepted values are @samp{msp430},
19074 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
19075 @option{-mmcu=} option should be used to select the ISA.
19077 @item -msim
19078 @opindex msim
19079 Link to the simulator runtime libraries and linker script.  Overrides
19080 any scripts that would be selected by the @option{-mmcu=} option.
19082 @item -mlarge
19083 @opindex mlarge
19084 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
19086 @item -msmall
19087 @opindex msmall
19088 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
19090 @item -mrelax
19091 @opindex mrelax
19092 This option is passed to the assembler and linker, and allows the
19093 linker to perform certain optimizations that cannot be done until
19094 the final link.
19096 @item mhwmult=
19097 @opindex mhwmult=
19098 Describes the type of hardware multiply supported by the target.
19099 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
19100 for the original 16-bit-only multiply supported by early MCUs.
19101 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
19102 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
19103 A value of @samp{auto} can also be given.  This tells GCC to deduce
19104 the hardware multiply support based upon the MCU name provided by the
19105 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
19106 the MCU name is not recognized then no hardware multiply support is
19107 assumed.  @code{auto} is the default setting.
19109 Hardware multiplies are normally performed by calling a library
19110 routine.  This saves space in the generated code.  When compiling at
19111 @option{-O3} or higher however the hardware multiplier is invoked
19112 inline.  This makes for bigger, but faster code.
19114 The hardware multiply routines disable interrupts whilst running and
19115 restore the previous interrupt state when they finish.  This makes
19116 them safe to use inside interrupt handlers as well as in normal code.
19118 @item -minrt
19119 @opindex minrt
19120 Enable the use of a minimum runtime environment - no static
19121 initializers or constructors.  This is intended for memory-constrained
19122 devices.  The compiler includes special symbols in some objects
19123 that tell the linker and runtime which code fragments are required.
19125 @item -mcode-region=
19126 @itemx -mdata-region=
19127 @opindex mcode-region
19128 @opindex mdata-region
19129 These options tell the compiler where to place functions and data that
19130 do not have one of the @code{lower}, @code{upper}, @code{either} or
19131 @code{section} attributes.  Possible values are @code{lower},
19132 @code{upper}, @code{either} or @code{any}.  The first three behave
19133 like the corresponding attribute.  The fourth possible value -
19134 @code{any} - is the default.  It leaves placement entirely up to the
19135 linker script and how it assigns the standard sections
19136 (@code{.text}, @code{.data}, etc) to the memory regions.
19138 @item -msilicon-errata=
19139 @opindex msilicon-errata
19140 This option passes on a request to assembler to enable the fixes for
19141 the named silicon errata.
19143 @item -msilicon-errata-warn=
19144 @opindex msilicon-errata-warn
19145 This option passes on a request to the assembler to enable warning
19146 messages when a silicon errata might need to be applied.
19148 @end table
19150 @node NDS32 Options
19151 @subsection NDS32 Options
19152 @cindex NDS32 Options
19154 These options are defined for NDS32 implementations:
19156 @table @gcctabopt
19158 @item -mbig-endian
19159 @opindex mbig-endian
19160 Generate code in big-endian mode.
19162 @item -mlittle-endian
19163 @opindex mlittle-endian
19164 Generate code in little-endian mode.
19166 @item -mreduced-regs
19167 @opindex mreduced-regs
19168 Use reduced-set registers for register allocation.
19170 @item -mfull-regs
19171 @opindex mfull-regs
19172 Use full-set registers for register allocation.
19174 @item -mcmov
19175 @opindex mcmov
19176 Generate conditional move instructions.
19178 @item -mno-cmov
19179 @opindex mno-cmov
19180 Do not generate conditional move instructions.
19182 @item -mperf-ext
19183 @opindex mperf-ext
19184 Generate performance extension instructions.
19186 @item -mno-perf-ext
19187 @opindex mno-perf-ext
19188 Do not generate performance extension instructions.
19190 @item -mv3push
19191 @opindex mv3push
19192 Generate v3 push25/pop25 instructions.
19194 @item -mno-v3push
19195 @opindex mno-v3push
19196 Do not generate v3 push25/pop25 instructions.
19198 @item -m16-bit
19199 @opindex m16-bit
19200 Generate 16-bit instructions.
19202 @item -mno-16-bit
19203 @opindex mno-16-bit
19204 Do not generate 16-bit instructions.
19206 @item -misr-vector-size=@var{num}
19207 @opindex misr-vector-size
19208 Specify the size of each interrupt vector, which must be 4 or 16.
19210 @item -mcache-block-size=@var{num}
19211 @opindex mcache-block-size
19212 Specify the size of each cache block,
19213 which must be a power of 2 between 4 and 512.
19215 @item -march=@var{arch}
19216 @opindex march
19217 Specify the name of the target architecture.
19219 @item -mcmodel=@var{code-model}
19220 @opindex mcmodel
19221 Set the code model to one of
19222 @table @asis
19223 @item @samp{small}
19224 All the data and read-only data segments must be within 512KB addressing space.
19225 The text segment must be within 16MB addressing space.
19226 @item @samp{medium}
19227 The data segment must be within 512KB while the read-only data segment can be
19228 within 4GB addressing space.  The text segment should be still within 16MB
19229 addressing space.
19230 @item @samp{large}
19231 All the text and data segments can be within 4GB addressing space.
19232 @end table
19234 @item -mctor-dtor
19235 @opindex mctor-dtor
19236 Enable constructor/destructor feature.
19238 @item -mrelax
19239 @opindex mrelax
19240 Guide linker to relax instructions.
19242 @end table
19244 @node Nios II Options
19245 @subsection Nios II Options
19246 @cindex Nios II options
19247 @cindex Altera Nios II options
19249 These are the options defined for the Altera Nios II processor.
19251 @table @gcctabopt
19253 @item -G @var{num}
19254 @opindex G
19255 @cindex smaller data references
19256 Put global and static objects less than or equal to @var{num} bytes
19257 into the small data or BSS sections instead of the normal data or BSS
19258 sections.  The default value of @var{num} is 8.
19260 @item -mgpopt=@var{option}
19261 @item -mgpopt
19262 @itemx -mno-gpopt
19263 @opindex mgpopt
19264 @opindex mno-gpopt
19265 Generate (do not generate) GP-relative accesses.  The following 
19266 @var{option} names are recognized:
19268 @table @samp
19270 @item none
19271 Do not generate GP-relative accesses.
19273 @item local
19274 Generate GP-relative accesses for small data objects that are not 
19275 external, weak, or uninitialized common symbols.  
19276 Also use GP-relative addressing for objects that
19277 have been explicitly placed in a small data section via a @code{section}
19278 attribute.
19280 @item global
19281 As for @samp{local}, but also generate GP-relative accesses for
19282 small data objects that are external, weak, or common.  If you use this option,
19283 you must ensure that all parts of your program (including libraries) are
19284 compiled with the same @option{-G} setting.
19286 @item data
19287 Generate GP-relative accesses for all data objects in the program.  If you
19288 use this option, the entire data and BSS segments
19289 of your program must fit in 64K of memory and you must use an appropriate
19290 linker script to allocate them within the addressable range of the
19291 global pointer.
19293 @item all
19294 Generate GP-relative addresses for function pointers as well as data
19295 pointers.  If you use this option, the entire text, data, and BSS segments
19296 of your program must fit in 64K of memory and you must use an appropriate
19297 linker script to allocate them within the addressable range of the
19298 global pointer.
19300 @end table
19302 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
19303 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
19305 The default is @option{-mgpopt} except when @option{-fpic} or
19306 @option{-fPIC} is specified to generate position-independent code.
19307 Note that the Nios II ABI does not permit GP-relative accesses from
19308 shared libraries.
19310 You may need to specify @option{-mno-gpopt} explicitly when building
19311 programs that include large amounts of small data, including large
19312 GOT data sections.  In this case, the 16-bit offset for GP-relative
19313 addressing may not be large enough to allow access to the entire 
19314 small data section.
19316 @item -mel
19317 @itemx -meb
19318 @opindex mel
19319 @opindex meb
19320 Generate little-endian (default) or big-endian (experimental) code,
19321 respectively.
19323 @item -march=@var{arch}
19324 @opindex march
19325 This specifies the name of the target Nios II architecture.  GCC uses this
19326 name to determine what kind of instructions it can emit when generating
19327 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
19329 The preprocessor macro @code{__nios2_arch__} is available to programs,
19330 with value 1 or 2, indicating the targeted ISA level.
19332 @item -mbypass-cache
19333 @itemx -mno-bypass-cache
19334 @opindex mno-bypass-cache
19335 @opindex mbypass-cache
19336 Force all load and store instructions to always bypass cache by 
19337 using I/O variants of the instructions. The default is not to
19338 bypass the cache.
19340 @item -mno-cache-volatile 
19341 @itemx -mcache-volatile       
19342 @opindex mcache-volatile 
19343 @opindex mno-cache-volatile
19344 Volatile memory access bypass the cache using the I/O variants of 
19345 the load and store instructions. The default is not to bypass the cache.
19347 @item -mno-fast-sw-div
19348 @itemx -mfast-sw-div
19349 @opindex mno-fast-sw-div
19350 @opindex mfast-sw-div
19351 Do not use table-based fast divide for small numbers. The default 
19352 is to use the fast divide at @option{-O3} and above.
19354 @item -mno-hw-mul
19355 @itemx -mhw-mul
19356 @itemx -mno-hw-mulx
19357 @itemx -mhw-mulx
19358 @itemx -mno-hw-div
19359 @itemx -mhw-div
19360 @opindex mno-hw-mul
19361 @opindex mhw-mul
19362 @opindex mno-hw-mulx
19363 @opindex mhw-mulx
19364 @opindex mno-hw-div
19365 @opindex mhw-div
19366 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
19367 instructions by the compiler. The default is to emit @code{mul}
19368 and not emit @code{div} and @code{mulx}.
19370 @item -mbmx
19371 @itemx -mno-bmx
19372 @itemx -mcdx
19373 @itemx -mno-cdx
19374 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
19375 CDX (code density) instructions.  Enabling these instructions also
19376 requires @option{-march=r2}.  Since these instructions are optional
19377 extensions to the R2 architecture, the default is not to emit them.
19379 @item -mcustom-@var{insn}=@var{N}
19380 @itemx -mno-custom-@var{insn}
19381 @opindex mcustom-@var{insn}
19382 @opindex mno-custom-@var{insn}
19383 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
19384 custom instruction with encoding @var{N} when generating code that uses 
19385 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
19386 instruction 253 for single-precision floating-point add operations instead
19387 of the default behavior of using a library call.
19389 The following values of @var{insn} are supported.  Except as otherwise
19390 noted, floating-point operations are expected to be implemented with
19391 normal IEEE 754 semantics and correspond directly to the C operators or the
19392 equivalent GCC built-in functions (@pxref{Other Builtins}).
19394 Single-precision floating point:
19395 @table @asis
19397 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
19398 Binary arithmetic operations.
19400 @item @samp{fnegs}
19401 Unary negation.
19403 @item @samp{fabss}
19404 Unary absolute value.
19406 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
19407 Comparison operations.
19409 @item @samp{fmins}, @samp{fmaxs}
19410 Floating-point minimum and maximum.  These instructions are only
19411 generated if @option{-ffinite-math-only} is specified.
19413 @item @samp{fsqrts}
19414 Unary square root operation.
19416 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
19417 Floating-point trigonometric and exponential functions.  These instructions
19418 are only generated if @option{-funsafe-math-optimizations} is also specified.
19420 @end table
19422 Double-precision floating point:
19423 @table @asis
19425 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
19426 Binary arithmetic operations.
19428 @item @samp{fnegd}
19429 Unary negation.
19431 @item @samp{fabsd}
19432 Unary absolute value.
19434 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
19435 Comparison operations.
19437 @item @samp{fmind}, @samp{fmaxd}
19438 Double-precision minimum and maximum.  These instructions are only
19439 generated if @option{-ffinite-math-only} is specified.
19441 @item @samp{fsqrtd}
19442 Unary square root operation.
19444 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
19445 Double-precision trigonometric and exponential functions.  These instructions
19446 are only generated if @option{-funsafe-math-optimizations} is also specified.
19448 @end table
19450 Conversions:
19451 @table @asis
19452 @item @samp{fextsd}
19453 Conversion from single precision to double precision.
19455 @item @samp{ftruncds}
19456 Conversion from double precision to single precision.
19458 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
19459 Conversion from floating point to signed or unsigned integer types, with
19460 truncation towards zero.
19462 @item @samp{round}
19463 Conversion from single-precision floating point to signed integer,
19464 rounding to the nearest integer and ties away from zero.
19465 This corresponds to the @code{__builtin_lroundf} function when
19466 @option{-fno-math-errno} is used.
19468 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
19469 Conversion from signed or unsigned integer types to floating-point types.
19471 @end table
19473 In addition, all of the following transfer instructions for internal
19474 registers X and Y must be provided to use any of the double-precision
19475 floating-point instructions.  Custom instructions taking two
19476 double-precision source operands expect the first operand in the
19477 64-bit register X.  The other operand (or only operand of a unary
19478 operation) is given to the custom arithmetic instruction with the
19479 least significant half in source register @var{src1} and the most
19480 significant half in @var{src2}.  A custom instruction that returns a
19481 double-precision result returns the most significant 32 bits in the
19482 destination register and the other half in 32-bit register Y.  
19483 GCC automatically generates the necessary code sequences to write
19484 register X and/or read register Y when double-precision floating-point
19485 instructions are used.
19487 @table @asis
19489 @item @samp{fwrx}
19490 Write @var{src1} into the least significant half of X and @var{src2} into
19491 the most significant half of X.
19493 @item @samp{fwry}
19494 Write @var{src1} into Y.
19496 @item @samp{frdxhi}, @samp{frdxlo}
19497 Read the most or least (respectively) significant half of X and store it in
19498 @var{dest}.
19500 @item @samp{frdy}
19501 Read the value of Y and store it into @var{dest}.
19502 @end table
19504 Note that you can gain more local control over generation of Nios II custom
19505 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
19506 and @code{target("no-custom-@var{insn}")} function attributes
19507 (@pxref{Function Attributes})
19508 or pragmas (@pxref{Function Specific Option Pragmas}).
19510 @item -mcustom-fpu-cfg=@var{name}
19511 @opindex mcustom-fpu-cfg
19513 This option enables a predefined, named set of custom instruction encodings
19514 (see @option{-mcustom-@var{insn}} above).  
19515 Currently, the following sets are defined:
19517 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
19518 @gccoptlist{-mcustom-fmuls=252 @gol
19519 -mcustom-fadds=253 @gol
19520 -mcustom-fsubs=254 @gol
19521 -fsingle-precision-constant}
19523 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
19524 @gccoptlist{-mcustom-fmuls=252 @gol
19525 -mcustom-fadds=253 @gol
19526 -mcustom-fsubs=254 @gol
19527 -mcustom-fdivs=255 @gol
19528 -fsingle-precision-constant}
19530 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
19531 @gccoptlist{-mcustom-floatus=243 @gol
19532 -mcustom-fixsi=244 @gol
19533 -mcustom-floatis=245 @gol
19534 -mcustom-fcmpgts=246 @gol
19535 -mcustom-fcmples=249 @gol
19536 -mcustom-fcmpeqs=250 @gol
19537 -mcustom-fcmpnes=251 @gol
19538 -mcustom-fmuls=252 @gol
19539 -mcustom-fadds=253 @gol
19540 -mcustom-fsubs=254 @gol
19541 -mcustom-fdivs=255 @gol
19542 -fsingle-precision-constant}
19544 Custom instruction assignments given by individual
19545 @option{-mcustom-@var{insn}=} options override those given by
19546 @option{-mcustom-fpu-cfg=}, regardless of the
19547 order of the options on the command line.
19549 Note that you can gain more local control over selection of a FPU
19550 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
19551 function attribute (@pxref{Function Attributes})
19552 or pragma (@pxref{Function Specific Option Pragmas}).
19554 @end table
19556 These additional @samp{-m} options are available for the Altera Nios II
19557 ELF (bare-metal) target:
19559 @table @gcctabopt
19561 @item -mhal
19562 @opindex mhal
19563 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
19564 startup and termination code, and is typically used in conjunction with
19565 @option{-msys-crt0=} to specify the location of the alternate startup code
19566 provided by the HAL BSP.
19568 @item -msmallc
19569 @opindex msmallc
19570 Link with a limited version of the C library, @option{-lsmallc}, rather than
19571 Newlib.
19573 @item -msys-crt0=@var{startfile}
19574 @opindex msys-crt0
19575 @var{startfile} is the file name of the startfile (crt0) to use 
19576 when linking.  This option is only useful in conjunction with @option{-mhal}.
19578 @item -msys-lib=@var{systemlib}
19579 @opindex msys-lib
19580 @var{systemlib} is the library name of the library that provides
19581 low-level system calls required by the C library,
19582 e.g. @code{read} and @code{write}.
19583 This option is typically used to link with a library provided by a HAL BSP.
19585 @end table
19587 @node Nvidia PTX Options
19588 @subsection Nvidia PTX Options
19589 @cindex Nvidia PTX options
19590 @cindex nvptx options
19592 These options are defined for Nvidia PTX:
19594 @table @gcctabopt
19596 @item -m32
19597 @itemx -m64
19598 @opindex m32
19599 @opindex m64
19600 Generate code for 32-bit or 64-bit ABI.
19602 @item -mmainkernel
19603 @opindex mmainkernel
19604 Link in code for a __main kernel.  This is for stand-alone instead of
19605 offloading execution.
19607 @item -moptimize
19608 @opindex moptimize
19609 Apply partitioned execution optimizations.  This is the default when any
19610 level of optimization is selected.
19612 @end table
19614 @node PDP-11 Options
19615 @subsection PDP-11 Options
19616 @cindex PDP-11 Options
19618 These options are defined for the PDP-11:
19620 @table @gcctabopt
19621 @item -mfpu
19622 @opindex mfpu
19623 Use hardware FPP floating point.  This is the default.  (FIS floating
19624 point on the PDP-11/40 is not supported.)
19626 @item -msoft-float
19627 @opindex msoft-float
19628 Do not use hardware floating point.
19630 @item -mac0
19631 @opindex mac0
19632 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
19634 @item -mno-ac0
19635 @opindex mno-ac0
19636 Return floating-point results in memory.  This is the default.
19638 @item -m40
19639 @opindex m40
19640 Generate code for a PDP-11/40.
19642 @item -m45
19643 @opindex m45
19644 Generate code for a PDP-11/45.  This is the default.
19646 @item -m10
19647 @opindex m10
19648 Generate code for a PDP-11/10.
19650 @item -mbcopy-builtin
19651 @opindex mbcopy-builtin
19652 Use inline @code{movmemhi} patterns for copying memory.  This is the
19653 default.
19655 @item -mbcopy
19656 @opindex mbcopy
19657 Do not use inline @code{movmemhi} patterns for copying memory.
19659 @item -mint16
19660 @itemx -mno-int32
19661 @opindex mint16
19662 @opindex mno-int32
19663 Use 16-bit @code{int}.  This is the default.
19665 @item -mint32
19666 @itemx -mno-int16
19667 @opindex mint32
19668 @opindex mno-int16
19669 Use 32-bit @code{int}.
19671 @item -mfloat64
19672 @itemx -mno-float32
19673 @opindex mfloat64
19674 @opindex mno-float32
19675 Use 64-bit @code{float}.  This is the default.
19677 @item -mfloat32
19678 @itemx -mno-float64
19679 @opindex mfloat32
19680 @opindex mno-float64
19681 Use 32-bit @code{float}.
19683 @item -mabshi
19684 @opindex mabshi
19685 Use @code{abshi2} pattern.  This is the default.
19687 @item -mno-abshi
19688 @opindex mno-abshi
19689 Do not use @code{abshi2} pattern.
19691 @item -mbranch-expensive
19692 @opindex mbranch-expensive
19693 Pretend that branches are expensive.  This is for experimenting with
19694 code generation only.
19696 @item -mbranch-cheap
19697 @opindex mbranch-cheap
19698 Do not pretend that branches are expensive.  This is the default.
19700 @item -munix-asm
19701 @opindex munix-asm
19702 Use Unix assembler syntax.  This is the default when configured for
19703 @samp{pdp11-*-bsd}.
19705 @item -mdec-asm
19706 @opindex mdec-asm
19707 Use DEC assembler syntax.  This is the default when configured for any
19708 PDP-11 target other than @samp{pdp11-*-bsd}.
19709 @end table
19711 @node picoChip Options
19712 @subsection picoChip Options
19713 @cindex picoChip options
19715 These @samp{-m} options are defined for picoChip implementations:
19717 @table @gcctabopt
19719 @item -mae=@var{ae_type}
19720 @opindex mcpu
19721 Set the instruction set, register set, and instruction scheduling
19722 parameters for array element type @var{ae_type}.  Supported values
19723 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
19725 @option{-mae=ANY} selects a completely generic AE type.  Code
19726 generated with this option runs on any of the other AE types.  The
19727 code is not as efficient as it would be if compiled for a specific
19728 AE type, and some types of operation (e.g., multiplication) do not
19729 work properly on all types of AE.
19731 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
19732 for compiled code, and is the default.
19734 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
19735 option may suffer from poor performance of byte (char) manipulation,
19736 since the DSP AE does not provide hardware support for byte load/stores.
19738 @item -msymbol-as-address
19739 Enable the compiler to directly use a symbol name as an address in a
19740 load/store instruction, without first loading it into a
19741 register.  Typically, the use of this option generates larger
19742 programs, which run faster than when the option isn't used.  However, the
19743 results vary from program to program, so it is left as a user option,
19744 rather than being permanently enabled.
19746 @item -mno-inefficient-warnings
19747 Disables warnings about the generation of inefficient code.  These
19748 warnings can be generated, for example, when compiling code that
19749 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19750 no hardware support for byte-level memory operations, so all byte
19751 load/stores must be synthesized from word load/store operations.  This is
19752 inefficient and a warning is generated to indicate
19753 that you should rewrite the code to avoid byte operations, or to target
19754 an AE type that has the necessary hardware support.  This option disables
19755 these warnings.
19757 @end table
19759 @node PowerPC Options
19760 @subsection PowerPC Options
19761 @cindex PowerPC options
19763 These are listed under @xref{RS/6000 and PowerPC Options}.
19765 @node RL78 Options
19766 @subsection RL78 Options
19767 @cindex RL78 Options
19769 @table @gcctabopt
19771 @item -msim
19772 @opindex msim
19773 Links in additional target libraries to support operation within a
19774 simulator.
19776 @item -mmul=none
19777 @itemx -mmul=g10
19778 @itemx -mmul=g13
19779 @itemx -mmul=g14
19780 @itemx -mmul=rl78
19781 @opindex mmul
19782 Specifies the type of hardware multiplication and division support to
19783 be used.  The simplest is @code{none}, which uses software for both
19784 multiplication and division.  This is the default.  The @code{g13}
19785 value is for the hardware multiply/divide peripheral found on the
19786 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
19787 the multiplication and division instructions supported by the RL78/G14
19788 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
19789 the value @code{mg10} is an alias for @code{none}.
19791 In addition a C preprocessor macro is defined, based upon the setting
19792 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
19793 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
19795 @item -mcpu=g10
19796 @itemx -mcpu=g13
19797 @itemx -mcpu=g14
19798 @itemx -mcpu=rl78
19799 @opindex mcpu
19800 Specifies the RL78 core to target.  The default is the G14 core, also
19801 known as an S3 core or just RL78.  The G13 or S2 core does not have
19802 multiply or divide instructions, instead it uses a hardware peripheral
19803 for these operations.  The G10 or S1 core does not have register
19804 banks, so it uses a different calling convention.
19806 If this option is set it also selects the type of hardware multiply
19807 support to use, unless this is overridden by an explicit
19808 @option{-mmul=none} option on the command line.  Thus specifying
19809 @option{-mcpu=g13} enables the use of the G13 hardware multiply
19810 peripheral and specifying @option{-mcpu=g10} disables the use of
19811 hardware multiplications altogether.
19813 Note, although the RL78/G14 core is the default target, specifying
19814 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
19815 change the behavior of the toolchain since it also enables G14
19816 hardware multiply support.  If these options are not specified on the
19817 command line then software multiplication routines will be used even
19818 though the code targets the RL78 core.  This is for backwards
19819 compatibility with older toolchains which did not have hardware
19820 multiply and divide support.
19822 In addition a C preprocessor macro is defined, based upon the setting
19823 of this option.  Possible values are: @code{__RL78_G10__},
19824 @code{__RL78_G13__} or @code{__RL78_G14__}.
19826 @item -mg10
19827 @itemx -mg13
19828 @itemx -mg14
19829 @itemx -mrl78
19830 @opindex mg10
19831 @opindex mg13
19832 @opindex mg14
19833 @opindex mrl78
19834 These are aliases for the corresponding @option{-mcpu=} option.  They
19835 are provided for backwards compatibility.
19837 @item -mallregs
19838 @opindex mallregs
19839 Allow the compiler to use all of the available registers.  By default
19840 registers @code{r24..r31} are reserved for use in interrupt handlers.
19841 With this option enabled these registers can be used in ordinary
19842 functions as well.
19844 @item -m64bit-doubles
19845 @itemx -m32bit-doubles
19846 @opindex m64bit-doubles
19847 @opindex m32bit-doubles
19848 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19849 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19850 @option{-m32bit-doubles}.
19852 @item -msave-mduc-in-interrupts
19853 @item -mno-save-mduc-in-interrupts
19854 @opindex msave-mduc-in-interrupts
19855 @opindex mno-save-mduc-in-interrupts
19856 Specifies that interrupt handler functions should preserve the
19857 MDUC registers.  This is only necessary if normal code might use
19858 the MDUC registers, for example because it performs multiplication
19859 and division operations.  The default is to ignore the MDUC registers
19860 as this makes the interrupt handlers faster.  The target option -mg13
19861 needs to be passed for this to work as this feature is only available
19862 on the G13 target (S2 core).  The MDUC registers will only be saved
19863 if the interrupt handler performs a multiplication or division
19864 operation or it calls another function.
19866 @end table
19868 @node RS/6000 and PowerPC Options
19869 @subsection IBM RS/6000 and PowerPC Options
19870 @cindex RS/6000 and PowerPC Options
19871 @cindex IBM RS/6000 and PowerPC Options
19873 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19874 @table @gcctabopt
19875 @item -mpowerpc-gpopt
19876 @itemx -mno-powerpc-gpopt
19877 @itemx -mpowerpc-gfxopt
19878 @itemx -mno-powerpc-gfxopt
19879 @need 800
19880 @itemx -mpowerpc64
19881 @itemx -mno-powerpc64
19882 @itemx -mmfcrf
19883 @itemx -mno-mfcrf
19884 @itemx -mpopcntb
19885 @itemx -mno-popcntb
19886 @itemx -mpopcntd
19887 @itemx -mno-popcntd
19888 @itemx -mfprnd
19889 @itemx -mno-fprnd
19890 @need 800
19891 @itemx -mcmpb
19892 @itemx -mno-cmpb
19893 @itemx -mmfpgpr
19894 @itemx -mno-mfpgpr
19895 @itemx -mhard-dfp
19896 @itemx -mno-hard-dfp
19897 @opindex mpowerpc-gpopt
19898 @opindex mno-powerpc-gpopt
19899 @opindex mpowerpc-gfxopt
19900 @opindex mno-powerpc-gfxopt
19901 @opindex mpowerpc64
19902 @opindex mno-powerpc64
19903 @opindex mmfcrf
19904 @opindex mno-mfcrf
19905 @opindex mpopcntb
19906 @opindex mno-popcntb
19907 @opindex mpopcntd
19908 @opindex mno-popcntd
19909 @opindex mfprnd
19910 @opindex mno-fprnd
19911 @opindex mcmpb
19912 @opindex mno-cmpb
19913 @opindex mmfpgpr
19914 @opindex mno-mfpgpr
19915 @opindex mhard-dfp
19916 @opindex mno-hard-dfp
19917 You use these options to specify which instructions are available on the
19918 processor you are using.  The default value of these options is
19919 determined when configuring GCC@.  Specifying the
19920 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19921 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19922 rather than the options listed above.
19924 Specifying @option{-mpowerpc-gpopt} allows
19925 GCC to use the optional PowerPC architecture instructions in the
19926 General Purpose group, including floating-point square root.  Specifying
19927 @option{-mpowerpc-gfxopt} allows GCC to
19928 use the optional PowerPC architecture instructions in the Graphics
19929 group, including floating-point select.
19931 The @option{-mmfcrf} option allows GCC to generate the move from
19932 condition register field instruction implemented on the POWER4
19933 processor and other processors that support the PowerPC V2.01
19934 architecture.
19935 The @option{-mpopcntb} option allows GCC to generate the popcount and
19936 double-precision FP reciprocal estimate instruction implemented on the
19937 POWER5 processor and other processors that support the PowerPC V2.02
19938 architecture.
19939 The @option{-mpopcntd} option allows GCC to generate the popcount
19940 instruction implemented on the POWER7 processor and other processors
19941 that support the PowerPC V2.06 architecture.
19942 The @option{-mfprnd} option allows GCC to generate the FP round to
19943 integer instructions implemented on the POWER5+ processor and other
19944 processors that support the PowerPC V2.03 architecture.
19945 The @option{-mcmpb} option allows GCC to generate the compare bytes
19946 instruction implemented on the POWER6 processor and other processors
19947 that support the PowerPC V2.05 architecture.
19948 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19949 general-purpose register instructions implemented on the POWER6X
19950 processor and other processors that support the extended PowerPC V2.05
19951 architecture.
19952 The @option{-mhard-dfp} option allows GCC to generate the decimal
19953 floating-point instructions implemented on some POWER processors.
19955 The @option{-mpowerpc64} option allows GCC to generate the additional
19956 64-bit instructions that are found in the full PowerPC64 architecture
19957 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19958 @option{-mno-powerpc64}.
19960 @item -mcpu=@var{cpu_type}
19961 @opindex mcpu
19962 Set architecture type, register usage, and
19963 instruction scheduling parameters for machine type @var{cpu_type}.
19964 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19965 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19966 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19967 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19968 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19969 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19970 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19971 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19972 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19973 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
19974 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
19975 and @samp{rs64}.
19977 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
19978 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
19979 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
19980 architecture machine types, with an appropriate, generic processor
19981 model assumed for scheduling purposes.
19983 The other options specify a specific processor.  Code generated under
19984 those options runs best on that processor, and may not run at all on
19985 others.
19987 The @option{-mcpu} options automatically enable or disable the
19988 following options:
19990 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19991 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19992 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19993 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19994 -mcrypto -mdirect-move -mhtm -mpower8-fusion -mpower8-vector @gol
19995 -mquad-memory -mquad-memory-atomic -mmodulo -mfloat128 -mfloat128-hardware @gol
19996 -mpower9-fusion -mpower9-vector -mpower9-dform}
19998 The particular options set for any particular CPU varies between
19999 compiler versions, depending on what setting seems to produce optimal
20000 code for that CPU; it doesn't necessarily reflect the actual hardware's
20001 capabilities.  If you wish to set an individual option to a particular
20002 value, you may specify it after the @option{-mcpu} option, like
20003 @option{-mcpu=970 -mno-altivec}.
20005 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
20006 not enabled or disabled by the @option{-mcpu} option at present because
20007 AIX does not have full support for these options.  You may still
20008 enable or disable them individually if you're sure it'll work in your
20009 environment.
20011 @item -mtune=@var{cpu_type}
20012 @opindex mtune
20013 Set the instruction scheduling parameters for machine type
20014 @var{cpu_type}, but do not set the architecture type or register usage,
20015 as @option{-mcpu=@var{cpu_type}} does.  The same
20016 values for @var{cpu_type} are used for @option{-mtune} as for
20017 @option{-mcpu}.  If both are specified, the code generated uses the
20018 architecture and registers set by @option{-mcpu}, but the
20019 scheduling parameters set by @option{-mtune}.
20021 @item -mcmodel=small
20022 @opindex mcmodel=small
20023 Generate PowerPC64 code for the small model: The TOC is limited to
20024 64k.
20026 @item -mcmodel=medium
20027 @opindex mcmodel=medium
20028 Generate PowerPC64 code for the medium model: The TOC and other static
20029 data may be up to a total of 4G in size.
20031 @item -mcmodel=large
20032 @opindex mcmodel=large
20033 Generate PowerPC64 code for the large model: The TOC may be up to 4G
20034 in size.  Other data and code is only limited by the 64-bit address
20035 space.
20037 @item -maltivec
20038 @itemx -mno-altivec
20039 @opindex maltivec
20040 @opindex mno-altivec
20041 Generate code that uses (does not use) AltiVec instructions, and also
20042 enable the use of built-in functions that allow more direct access to
20043 the AltiVec instruction set.  You may also need to set
20044 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
20045 enhancements.
20047 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
20048 @option{-maltivec=be}, the element order for AltiVec intrinsics such
20049 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
20050 match array element order corresponding to the endianness of the
20051 target.  That is, element zero identifies the leftmost element in a
20052 vector register when targeting a big-endian platform, and identifies
20053 the rightmost element in a vector register when targeting a
20054 little-endian platform.
20056 @item -maltivec=be
20057 @opindex maltivec=be
20058 Generate AltiVec instructions using big-endian element order,
20059 regardless of whether the target is big- or little-endian.  This is
20060 the default when targeting a big-endian platform.
20062 The element order is used to interpret element numbers in AltiVec
20063 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
20064 @code{vec_insert}.  By default, these match array element order
20065 corresponding to the endianness for the target.
20067 @item -maltivec=le
20068 @opindex maltivec=le
20069 Generate AltiVec instructions using little-endian element order,
20070 regardless of whether the target is big- or little-endian.  This is
20071 the default when targeting a little-endian platform.  This option is
20072 currently ignored when targeting a big-endian platform.
20074 The element order is used to interpret element numbers in AltiVec
20075 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
20076 @code{vec_insert}.  By default, these match array element order
20077 corresponding to the endianness for the target.
20079 @item -mvrsave
20080 @itemx -mno-vrsave
20081 @opindex mvrsave
20082 @opindex mno-vrsave
20083 Generate VRSAVE instructions when generating AltiVec code.
20085 @item -mgen-cell-microcode
20086 @opindex mgen-cell-microcode
20087 Generate Cell microcode instructions.
20089 @item -mwarn-cell-microcode
20090 @opindex mwarn-cell-microcode
20091 Warn when a Cell microcode instruction is emitted.  An example
20092 of a Cell microcode instruction is a variable shift.
20094 @item -msecure-plt
20095 @opindex msecure-plt
20096 Generate code that allows @command{ld} and @command{ld.so}
20097 to build executables and shared
20098 libraries with non-executable @code{.plt} and @code{.got} sections.
20099 This is a PowerPC
20100 32-bit SYSV ABI option.
20102 @item -mbss-plt
20103 @opindex mbss-plt
20104 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
20105 fills in, and
20106 requires @code{.plt} and @code{.got}
20107 sections that are both writable and executable.
20108 This is a PowerPC 32-bit SYSV ABI option.
20110 @item -misel
20111 @itemx -mno-isel
20112 @opindex misel
20113 @opindex mno-isel
20114 This switch enables or disables the generation of ISEL instructions.
20116 @item -misel=@var{yes/no}
20117 This switch has been deprecated.  Use @option{-misel} and
20118 @option{-mno-isel} instead.
20120 @item -mlra
20121 @opindex mlra
20122 Enable Local Register Allocation.  This is still experimental for PowerPC,
20123 so by default the compiler uses standard reload
20124 (i.e. @option{-mno-lra}).
20126 @item -mspe
20127 @itemx -mno-spe
20128 @opindex mspe
20129 @opindex mno-spe
20130 This switch enables or disables the generation of SPE simd
20131 instructions.
20133 @item -mpaired
20134 @itemx -mno-paired
20135 @opindex mpaired
20136 @opindex mno-paired
20137 This switch enables or disables the generation of PAIRED simd
20138 instructions.
20140 @item -mspe=@var{yes/no}
20141 This option has been deprecated.  Use @option{-mspe} and
20142 @option{-mno-spe} instead.
20144 @item -mvsx
20145 @itemx -mno-vsx
20146 @opindex mvsx
20147 @opindex mno-vsx
20148 Generate code that uses (does not use) vector/scalar (VSX)
20149 instructions, and also enable the use of built-in functions that allow
20150 more direct access to the VSX instruction set.
20152 @item -mcrypto
20153 @itemx -mno-crypto
20154 @opindex mcrypto
20155 @opindex mno-crypto
20156 Enable the use (disable) of the built-in functions that allow direct
20157 access to the cryptographic instructions that were added in version
20158 2.07 of the PowerPC ISA.
20160 @item -mdirect-move
20161 @itemx -mno-direct-move
20162 @opindex mdirect-move
20163 @opindex mno-direct-move
20164 Generate code that uses (does not use) the instructions to move data
20165 between the general purpose registers and the vector/scalar (VSX)
20166 registers that were added in version 2.07 of the PowerPC ISA.
20168 @item -mhtm
20169 @itemx -mno-htm
20170 @opindex mhtm
20171 @opindex mno-htm
20172 Enable (disable) the use of the built-in functions that allow direct
20173 access to the Hardware Transactional Memory (HTM) instructions that
20174 were added in version 2.07 of the PowerPC ISA.
20176 @item -mpower8-fusion
20177 @itemx -mno-power8-fusion
20178 @opindex mpower8-fusion
20179 @opindex mno-power8-fusion
20180 Generate code that keeps (does not keeps) some integer operations
20181 adjacent so that the instructions can be fused together on power8 and
20182 later processors.
20184 @item -mpower8-vector
20185 @itemx -mno-power8-vector
20186 @opindex mpower8-vector
20187 @opindex mno-power8-vector
20188 Generate code that uses (does not use) the vector and scalar
20189 instructions that were added in version 2.07 of the PowerPC ISA.  Also
20190 enable the use of built-in functions that allow more direct access to
20191 the vector instructions.
20193 @item -mquad-memory
20194 @itemx -mno-quad-memory
20195 @opindex mquad-memory
20196 @opindex mno-quad-memory
20197 Generate code that uses (does not use) the non-atomic quad word memory
20198 instructions.  The @option{-mquad-memory} option requires use of
20199 64-bit mode.
20201 @item -mquad-memory-atomic
20202 @itemx -mno-quad-memory-atomic
20203 @opindex mquad-memory-atomic
20204 @opindex mno-quad-memory-atomic
20205 Generate code that uses (does not use) the atomic quad word memory
20206 instructions.  The @option{-mquad-memory-atomic} option requires use of
20207 64-bit mode.
20209 @item -mupper-regs-df
20210 @itemx -mno-upper-regs-df
20211 @opindex mupper-regs-df
20212 @opindex mno-upper-regs-df
20213 Generate code that uses (does not use) the scalar double precision
20214 instructions that target all 64 registers in the vector/scalar
20215 floating point register set that were added in version 2.06 of the
20216 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
20217 use any of the @option{-mcpu=power7}, @option{-mcpu=power8}, or
20218 @option{-mvsx} options.
20220 @item -mupper-regs-sf
20221 @itemx -mno-upper-regs-sf
20222 @opindex mupper-regs-sf
20223 @opindex mno-upper-regs-sf
20224 Generate code that uses (does not use) the scalar single precision
20225 instructions that target all 64 registers in the vector/scalar
20226 floating point register set that were added in version 2.07 of the
20227 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
20228 use either of the @option{-mcpu=power8} or @option{-mpower8-vector}
20229 options.
20231 @item -mupper-regs
20232 @itemx -mno-upper-regs
20233 @opindex mupper-regs
20234 @opindex mno-upper-regs
20235 Generate code that uses (does not use) the scalar
20236 instructions that target all 64 registers in the vector/scalar
20237 floating point register set, depending on the model of the machine.
20239 If the @option{-mno-upper-regs} option is used, it turns off both
20240 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
20242 @item -mfloat128
20243 @itemx -mno-float128
20244 @opindex mfloat128
20245 @opindex mno-float128
20246 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
20247 and use either software emulation for IEEE 128-bit floating point or
20248 hardware instructions.
20250 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
20251 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
20252 option.  The @code{-mfloat128} option only works on PowerPC 64-bit
20253 Linux systems.
20255 @item -mfloat128-hardware
20256 @itemx -mno-float128-hardware
20257 @opindex mfloat128-hardware
20258 @opindex mno-float128-hardware
20259 Enable/disable using ISA 3.0 hardware instructions to support the
20260 @var{__float128} data type.
20262 @item -mmodulo
20263 @itemx -mno-modulo
20264 @opindex mmodulo
20265 @opindex mno-module
20266 Generate code that uses (does not use) the ISA 3.0 integer modulo
20267 instructions.  The @option{-mmodulo} option is enabled by default
20268 with the @option{-mcpu=power9} option.
20270 @item -mpower9-fusion
20271 @itemx -mno-power9-fusion
20272 @opindex mpower9-fusion
20273 @opindex mno-power9-fusion
20274 Generate code that keeps (does not keeps) some operations adjacent so
20275 that the instructions can be fused together on power9 and later
20276 processors.
20278 @item -mpower9-vector
20279 @itemx -mno-power9-vector
20280 @opindex mpower9-vector
20281 @opindex mno-power9-vector
20282 Generate code that uses (does not use) the vector and scalar
20283 instructions that were added in version 3.0 of the PowerPC ISA.  Also
20284 enable the use of built-in functions that allow more direct access to
20285 the vector instructions.
20287 @item -mpower9-dform
20288 @itemx -mno-power9-dform
20289 @opindex mpower9-dform
20290 @opindex mno-power9-dform
20291 Enable (disable) scalar d-form (register + offset) memory instructions
20292 to load/store traditional Altivec registers. If the @var{LRA} register
20293 allocator is enabled, also enable (disable) vector d-form memory
20294 instructions.
20296 @item -mfloat-gprs=@var{yes/single/double/no}
20297 @itemx -mfloat-gprs
20298 @opindex mfloat-gprs
20299 This switch enables or disables the generation of floating-point
20300 operations on the general-purpose registers for architectures that
20301 support it.
20303 The argument @samp{yes} or @samp{single} enables the use of
20304 single-precision floating-point operations.
20306 The argument @samp{double} enables the use of single and
20307 double-precision floating-point operations.
20309 The argument @samp{no} disables floating-point operations on the
20310 general-purpose registers.
20312 This option is currently only available on the MPC854x.
20314 @item -m32
20315 @itemx -m64
20316 @opindex m32
20317 @opindex m64
20318 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
20319 targets (including GNU/Linux).  The 32-bit environment sets int, long
20320 and pointer to 32 bits and generates code that runs on any PowerPC
20321 variant.  The 64-bit environment sets int to 32 bits and long and
20322 pointer to 64 bits, and generates code for PowerPC64, as for
20323 @option{-mpowerpc64}.
20325 @item -mfull-toc
20326 @itemx -mno-fp-in-toc
20327 @itemx -mno-sum-in-toc
20328 @itemx -mminimal-toc
20329 @opindex mfull-toc
20330 @opindex mno-fp-in-toc
20331 @opindex mno-sum-in-toc
20332 @opindex mminimal-toc
20333 Modify generation of the TOC (Table Of Contents), which is created for
20334 every executable file.  The @option{-mfull-toc} option is selected by
20335 default.  In that case, GCC allocates at least one TOC entry for
20336 each unique non-automatic variable reference in your program.  GCC
20337 also places floating-point constants in the TOC@.  However, only
20338 16,384 entries are available in the TOC@.
20340 If you receive a linker error message that saying you have overflowed
20341 the available TOC space, you can reduce the amount of TOC space used
20342 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
20343 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
20344 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
20345 generate code to calculate the sum of an address and a constant at
20346 run time instead of putting that sum into the TOC@.  You may specify one
20347 or both of these options.  Each causes GCC to produce very slightly
20348 slower and larger code at the expense of conserving TOC space.
20350 If you still run out of space in the TOC even when you specify both of
20351 these options, specify @option{-mminimal-toc} instead.  This option causes
20352 GCC to make only one TOC entry for every file.  When you specify this
20353 option, GCC produces code that is slower and larger but which
20354 uses extremely little TOC space.  You may wish to use this option
20355 only on files that contain less frequently-executed code.
20357 @item -maix64
20358 @itemx -maix32
20359 @opindex maix64
20360 @opindex maix32
20361 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
20362 @code{long} type, and the infrastructure needed to support them.
20363 Specifying @option{-maix64} implies @option{-mpowerpc64},
20364 while @option{-maix32} disables the 64-bit ABI and
20365 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
20367 @item -mxl-compat
20368 @itemx -mno-xl-compat
20369 @opindex mxl-compat
20370 @opindex mno-xl-compat
20371 Produce code that conforms more closely to IBM XL compiler semantics
20372 when using AIX-compatible ABI@.  Pass floating-point arguments to
20373 prototyped functions beyond the register save area (RSA) on the stack
20374 in addition to argument FPRs.  Do not assume that most significant
20375 double in 128-bit long double value is properly rounded when comparing
20376 values and converting to double.  Use XL symbol names for long double
20377 support routines.
20379 The AIX calling convention was extended but not initially documented to
20380 handle an obscure K&R C case of calling a function that takes the
20381 address of its arguments with fewer arguments than declared.  IBM XL
20382 compilers access floating-point arguments that do not fit in the
20383 RSA from the stack when a subroutine is compiled without
20384 optimization.  Because always storing floating-point arguments on the
20385 stack is inefficient and rarely needed, this option is not enabled by
20386 default and only is necessary when calling subroutines compiled by IBM
20387 XL compilers without optimization.
20389 @item -mpe
20390 @opindex mpe
20391 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
20392 application written to use message passing with special startup code to
20393 enable the application to run.  The system must have PE installed in the
20394 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
20395 must be overridden with the @option{-specs=} option to specify the
20396 appropriate directory location.  The Parallel Environment does not
20397 support threads, so the @option{-mpe} option and the @option{-pthread}
20398 option are incompatible.
20400 @item -malign-natural
20401 @itemx -malign-power
20402 @opindex malign-natural
20403 @opindex malign-power
20404 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
20405 @option{-malign-natural} overrides the ABI-defined alignment of larger
20406 types, such as floating-point doubles, on their natural size-based boundary.
20407 The option @option{-malign-power} instructs GCC to follow the ABI-specified
20408 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
20410 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
20411 is not supported.
20413 @item -msoft-float
20414 @itemx -mhard-float
20415 @opindex msoft-float
20416 @opindex mhard-float
20417 Generate code that does not use (uses) the floating-point register set.
20418 Software floating-point emulation is provided if you use the
20419 @option{-msoft-float} option, and pass the option to GCC when linking.
20421 @item -msingle-float
20422 @itemx -mdouble-float
20423 @opindex msingle-float
20424 @opindex mdouble-float
20425 Generate code for single- or double-precision floating-point operations.
20426 @option{-mdouble-float} implies @option{-msingle-float}.
20428 @item -msimple-fpu
20429 @opindex msimple-fpu
20430 Do not generate @code{sqrt} and @code{div} instructions for hardware
20431 floating-point unit.
20433 @item -mfpu=@var{name}
20434 @opindex mfpu
20435 Specify type of floating-point unit.  Valid values for @var{name} are
20436 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
20437 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
20438 @samp{sp_full} (equivalent to @option{-msingle-float}),
20439 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
20441 @item -mxilinx-fpu
20442 @opindex mxilinx-fpu
20443 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
20445 @item -mmultiple
20446 @itemx -mno-multiple
20447 @opindex mmultiple
20448 @opindex mno-multiple
20449 Generate code that uses (does not use) the load multiple word
20450 instructions and the store multiple word instructions.  These
20451 instructions are generated by default on POWER systems, and not
20452 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
20453 PowerPC systems, since those instructions do not work when the
20454 processor is in little-endian mode.  The exceptions are PPC740 and
20455 PPC750 which permit these instructions in little-endian mode.
20457 @item -mstring
20458 @itemx -mno-string
20459 @opindex mstring
20460 @opindex mno-string
20461 Generate code that uses (does not use) the load string instructions
20462 and the store string word instructions to save multiple registers and
20463 do small block moves.  These instructions are generated by default on
20464 POWER systems, and not generated on PowerPC systems.  Do not use
20465 @option{-mstring} on little-endian PowerPC systems, since those
20466 instructions do not work when the processor is in little-endian mode.
20467 The exceptions are PPC740 and PPC750 which permit these instructions
20468 in little-endian mode.
20470 @item -mupdate
20471 @itemx -mno-update
20472 @opindex mupdate
20473 @opindex mno-update
20474 Generate code that uses (does not use) the load or store instructions
20475 that update the base register to the address of the calculated memory
20476 location.  These instructions are generated by default.  If you use
20477 @option{-mno-update}, there is a small window between the time that the
20478 stack pointer is updated and the address of the previous frame is
20479 stored, which means code that walks the stack frame across interrupts or
20480 signals may get corrupted data.
20482 @item -mavoid-indexed-addresses
20483 @itemx -mno-avoid-indexed-addresses
20484 @opindex mavoid-indexed-addresses
20485 @opindex mno-avoid-indexed-addresses
20486 Generate code that tries to avoid (not avoid) the use of indexed load
20487 or store instructions. These instructions can incur a performance
20488 penalty on Power6 processors in certain situations, such as when
20489 stepping through large arrays that cross a 16M boundary.  This option
20490 is enabled by default when targeting Power6 and disabled otherwise.
20492 @item -mfused-madd
20493 @itemx -mno-fused-madd
20494 @opindex mfused-madd
20495 @opindex mno-fused-madd
20496 Generate code that uses (does not use) the floating-point multiply and
20497 accumulate instructions.  These instructions are generated by default
20498 if hardware floating point is used.  The machine-dependent
20499 @option{-mfused-madd} option is now mapped to the machine-independent
20500 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
20501 mapped to @option{-ffp-contract=off}.
20503 @item -mmulhw
20504 @itemx -mno-mulhw
20505 @opindex mmulhw
20506 @opindex mno-mulhw
20507 Generate code that uses (does not use) the half-word multiply and
20508 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
20509 These instructions are generated by default when targeting those
20510 processors.
20512 @item -mdlmzb
20513 @itemx -mno-dlmzb
20514 @opindex mdlmzb
20515 @opindex mno-dlmzb
20516 Generate code that uses (does not use) the string-search @samp{dlmzb}
20517 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
20518 generated by default when targeting those processors.
20520 @item -mno-bit-align
20521 @itemx -mbit-align
20522 @opindex mno-bit-align
20523 @opindex mbit-align
20524 On System V.4 and embedded PowerPC systems do not (do) force structures
20525 and unions that contain bit-fields to be aligned to the base type of the
20526 bit-field.
20528 For example, by default a structure containing nothing but 8
20529 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
20530 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
20531 the structure is aligned to a 1-byte boundary and is 1 byte in
20532 size.
20534 @item -mno-strict-align
20535 @itemx -mstrict-align
20536 @opindex mno-strict-align
20537 @opindex mstrict-align
20538 On System V.4 and embedded PowerPC systems do not (do) assume that
20539 unaligned memory references are handled by the system.
20541 @item -mrelocatable
20542 @itemx -mno-relocatable
20543 @opindex mrelocatable
20544 @opindex mno-relocatable
20545 Generate code that allows (does not allow) a static executable to be
20546 relocated to a different address at run time.  A simple embedded
20547 PowerPC system loader should relocate the entire contents of
20548 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
20549 a table of 32-bit addresses generated by this option.  For this to
20550 work, all objects linked together must be compiled with
20551 @option{-mrelocatable} or @option{-mrelocatable-lib}.
20552 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
20554 @item -mrelocatable-lib
20555 @itemx -mno-relocatable-lib
20556 @opindex mrelocatable-lib
20557 @opindex mno-relocatable-lib
20558 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
20559 @code{.fixup} section to allow static executables to be relocated at
20560 run time, but @option{-mrelocatable-lib} does not use the smaller stack
20561 alignment of @option{-mrelocatable}.  Objects compiled with
20562 @option{-mrelocatable-lib} may be linked with objects compiled with
20563 any combination of the @option{-mrelocatable} options.
20565 @item -mno-toc
20566 @itemx -mtoc
20567 @opindex mno-toc
20568 @opindex mtoc
20569 On System V.4 and embedded PowerPC systems do not (do) assume that
20570 register 2 contains a pointer to a global area pointing to the addresses
20571 used in the program.
20573 @item -mlittle
20574 @itemx -mlittle-endian
20575 @opindex mlittle
20576 @opindex mlittle-endian
20577 On System V.4 and embedded PowerPC systems compile code for the
20578 processor in little-endian mode.  The @option{-mlittle-endian} option is
20579 the same as @option{-mlittle}.
20581 @item -mbig
20582 @itemx -mbig-endian
20583 @opindex mbig
20584 @opindex mbig-endian
20585 On System V.4 and embedded PowerPC systems compile code for the
20586 processor in big-endian mode.  The @option{-mbig-endian} option is
20587 the same as @option{-mbig}.
20589 @item -mdynamic-no-pic
20590 @opindex mdynamic-no-pic
20591 On Darwin and Mac OS X systems, compile code so that it is not
20592 relocatable, but that its external references are relocatable.  The
20593 resulting code is suitable for applications, but not shared
20594 libraries.
20596 @item -msingle-pic-base
20597 @opindex msingle-pic-base
20598 Treat the register used for PIC addressing as read-only, rather than
20599 loading it in the prologue for each function.  The runtime system is
20600 responsible for initializing this register with an appropriate value
20601 before execution begins.
20603 @item -mprioritize-restricted-insns=@var{priority}
20604 @opindex mprioritize-restricted-insns
20605 This option controls the priority that is assigned to
20606 dispatch-slot restricted instructions during the second scheduling
20607 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
20608 or @samp{2} to assign no, highest, or second-highest (respectively) 
20609 priority to dispatch-slot restricted
20610 instructions.
20612 @item -msched-costly-dep=@var{dependence_type}
20613 @opindex msched-costly-dep
20614 This option controls which dependences are considered costly
20615 by the target during instruction scheduling.  The argument
20616 @var{dependence_type} takes one of the following values:
20618 @table @asis
20619 @item @samp{no}
20620 No dependence is costly.
20622 @item @samp{all}
20623 All dependences are costly.
20625 @item @samp{true_store_to_load}
20626 A true dependence from store to load is costly.
20628 @item @samp{store_to_load}
20629 Any dependence from store to load is costly.
20631 @item @var{number}
20632 Any dependence for which the latency is greater than or equal to 
20633 @var{number} is costly.
20634 @end table
20636 @item -minsert-sched-nops=@var{scheme}
20637 @opindex minsert-sched-nops
20638 This option controls which NOP insertion scheme is used during
20639 the second scheduling pass.  The argument @var{scheme} takes one of the
20640 following values:
20642 @table @asis
20643 @item @samp{no}
20644 Don't insert NOPs.
20646 @item @samp{pad}
20647 Pad with NOPs any dispatch group that has vacant issue slots,
20648 according to the scheduler's grouping.
20650 @item @samp{regroup_exact}
20651 Insert NOPs to force costly dependent insns into
20652 separate groups.  Insert exactly as many NOPs as needed to force an insn
20653 to a new group, according to the estimated processor grouping.
20655 @item @var{number}
20656 Insert NOPs to force costly dependent insns into
20657 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
20658 @end table
20660 @item -mcall-sysv
20661 @opindex mcall-sysv
20662 On System V.4 and embedded PowerPC systems compile code using calling
20663 conventions that adhere to the March 1995 draft of the System V
20664 Application Binary Interface, PowerPC processor supplement.  This is the
20665 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
20667 @item -mcall-sysv-eabi
20668 @itemx -mcall-eabi
20669 @opindex mcall-sysv-eabi
20670 @opindex mcall-eabi
20671 Specify both @option{-mcall-sysv} and @option{-meabi} options.
20673 @item -mcall-sysv-noeabi
20674 @opindex mcall-sysv-noeabi
20675 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
20677 @item -mcall-aixdesc
20678 @opindex m
20679 On System V.4 and embedded PowerPC systems compile code for the AIX
20680 operating system.
20682 @item -mcall-linux
20683 @opindex mcall-linux
20684 On System V.4 and embedded PowerPC systems compile code for the
20685 Linux-based GNU system.
20687 @item -mcall-freebsd
20688 @opindex mcall-freebsd
20689 On System V.4 and embedded PowerPC systems compile code for the
20690 FreeBSD operating system.
20692 @item -mcall-netbsd
20693 @opindex mcall-netbsd
20694 On System V.4 and embedded PowerPC systems compile code for the
20695 NetBSD operating system.
20697 @item -mcall-openbsd
20698 @opindex mcall-netbsd
20699 On System V.4 and embedded PowerPC systems compile code for the
20700 OpenBSD operating system.
20702 @item -maix-struct-return
20703 @opindex maix-struct-return
20704 Return all structures in memory (as specified by the AIX ABI)@.
20706 @item -msvr4-struct-return
20707 @opindex msvr4-struct-return
20708 Return structures smaller than 8 bytes in registers (as specified by the
20709 SVR4 ABI)@.
20711 @item -mabi=@var{abi-type}
20712 @opindex mabi
20713 Extend the current ABI with a particular extension, or remove such extension.
20714 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
20715 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
20716 @samp{elfv1}, @samp{elfv2}@.
20718 @item -mabi=spe
20719 @opindex mabi=spe
20720 Extend the current ABI with SPE ABI extensions.  This does not change
20721 the default ABI, instead it adds the SPE ABI extensions to the current
20722 ABI@.
20724 @item -mabi=no-spe
20725 @opindex mabi=no-spe
20726 Disable Book-E SPE ABI extensions for the current ABI@.
20728 @item -mabi=ibmlongdouble
20729 @opindex mabi=ibmlongdouble
20730 Change the current ABI to use IBM extended-precision long double.
20731 This is a PowerPC 32-bit SYSV ABI option.
20733 @item -mabi=ieeelongdouble
20734 @opindex mabi=ieeelongdouble
20735 Change the current ABI to use IEEE extended-precision long double.
20736 This is a PowerPC 32-bit Linux ABI option.
20738 @item -mabi=elfv1
20739 @opindex mabi=elfv1
20740 Change the current ABI to use the ELFv1 ABI.
20741 This is the default ABI for big-endian PowerPC 64-bit Linux.
20742 Overriding the default ABI requires special system support and is
20743 likely to fail in spectacular ways.
20745 @item -mabi=elfv2
20746 @opindex mabi=elfv2
20747 Change the current ABI to use the ELFv2 ABI.
20748 This is the default ABI for little-endian PowerPC 64-bit Linux.
20749 Overriding the default ABI requires special system support and is
20750 likely to fail in spectacular ways.
20752 @item -mprototype
20753 @itemx -mno-prototype
20754 @opindex mprototype
20755 @opindex mno-prototype
20756 On System V.4 and embedded PowerPC systems assume that all calls to
20757 variable argument functions are properly prototyped.  Otherwise, the
20758 compiler must insert an instruction before every non-prototyped call to
20759 set or clear bit 6 of the condition code register (@code{CR}) to
20760 indicate whether floating-point values are passed in the floating-point
20761 registers in case the function takes variable arguments.  With
20762 @option{-mprototype}, only calls to prototyped variable argument functions
20763 set or clear the bit.
20765 @item -msim
20766 @opindex msim
20767 On embedded PowerPC systems, assume that the startup module is called
20768 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
20769 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
20770 configurations.
20772 @item -mmvme
20773 @opindex mmvme
20774 On embedded PowerPC systems, assume that the startup module is called
20775 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
20776 @file{libc.a}.
20778 @item -mads
20779 @opindex mads
20780 On embedded PowerPC systems, assume that the startup module is called
20781 @file{crt0.o} and the standard C libraries are @file{libads.a} and
20782 @file{libc.a}.
20784 @item -myellowknife
20785 @opindex myellowknife
20786 On embedded PowerPC systems, assume that the startup module is called
20787 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
20788 @file{libc.a}.
20790 @item -mvxworks
20791 @opindex mvxworks
20792 On System V.4 and embedded PowerPC systems, specify that you are
20793 compiling for a VxWorks system.
20795 @item -memb
20796 @opindex memb
20797 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
20798 header to indicate that @samp{eabi} extended relocations are used.
20800 @item -meabi
20801 @itemx -mno-eabi
20802 @opindex meabi
20803 @opindex mno-eabi
20804 On System V.4 and embedded PowerPC systems do (do not) adhere to the
20805 Embedded Applications Binary Interface (EABI), which is a set of
20806 modifications to the System V.4 specifications.  Selecting @option{-meabi}
20807 means that the stack is aligned to an 8-byte boundary, a function
20808 @code{__eabi} is called from @code{main} to set up the EABI
20809 environment, and the @option{-msdata} option can use both @code{r2} and
20810 @code{r13} to point to two separate small data areas.  Selecting
20811 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
20812 no EABI initialization function is called from @code{main}, and the
20813 @option{-msdata} option only uses @code{r13} to point to a single
20814 small data area.  The @option{-meabi} option is on by default if you
20815 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
20817 @item -msdata=eabi
20818 @opindex msdata=eabi
20819 On System V.4 and embedded PowerPC systems, put small initialized
20820 @code{const} global and static data in the @code{.sdata2} section, which
20821 is pointed to by register @code{r2}.  Put small initialized
20822 non-@code{const} global and static data in the @code{.sdata} section,
20823 which is pointed to by register @code{r13}.  Put small uninitialized
20824 global and static data in the @code{.sbss} section, which is adjacent to
20825 the @code{.sdata} section.  The @option{-msdata=eabi} option is
20826 incompatible with the @option{-mrelocatable} option.  The
20827 @option{-msdata=eabi} option also sets the @option{-memb} option.
20829 @item -msdata=sysv
20830 @opindex msdata=sysv
20831 On System V.4 and embedded PowerPC systems, put small global and static
20832 data in the @code{.sdata} section, which is pointed to by register
20833 @code{r13}.  Put small uninitialized global and static data in the
20834 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
20835 The @option{-msdata=sysv} option is incompatible with the
20836 @option{-mrelocatable} option.
20838 @item -msdata=default
20839 @itemx -msdata
20840 @opindex msdata=default
20841 @opindex msdata
20842 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
20843 compile code the same as @option{-msdata=eabi}, otherwise compile code the
20844 same as @option{-msdata=sysv}.
20846 @item -msdata=data
20847 @opindex msdata=data
20848 On System V.4 and embedded PowerPC systems, put small global
20849 data in the @code{.sdata} section.  Put small uninitialized global
20850 data in the @code{.sbss} section.  Do not use register @code{r13}
20851 to address small data however.  This is the default behavior unless
20852 other @option{-msdata} options are used.
20854 @item -msdata=none
20855 @itemx -mno-sdata
20856 @opindex msdata=none
20857 @opindex mno-sdata
20858 On embedded PowerPC systems, put all initialized global and static data
20859 in the @code{.data} section, and all uninitialized data in the
20860 @code{.bss} section.
20862 @item -mblock-move-inline-limit=@var{num}
20863 @opindex mblock-move-inline-limit
20864 Inline all block moves (such as calls to @code{memcpy} or structure
20865 copies) less than or equal to @var{num} bytes.  The minimum value for
20866 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
20867 targets.  The default value is target-specific.
20869 @item -G @var{num}
20870 @opindex G
20871 @cindex smaller data references (PowerPC)
20872 @cindex .sdata/.sdata2 references (PowerPC)
20873 On embedded PowerPC systems, put global and static items less than or
20874 equal to @var{num} bytes into the small data or BSS sections instead of
20875 the normal data or BSS section.  By default, @var{num} is 8.  The
20876 @option{-G @var{num}} switch is also passed to the linker.
20877 All modules should be compiled with the same @option{-G @var{num}} value.
20879 @item -mregnames
20880 @itemx -mno-regnames
20881 @opindex mregnames
20882 @opindex mno-regnames
20883 On System V.4 and embedded PowerPC systems do (do not) emit register
20884 names in the assembly language output using symbolic forms.
20886 @item -mlongcall
20887 @itemx -mno-longcall
20888 @opindex mlongcall
20889 @opindex mno-longcall
20890 By default assume that all calls are far away so that a longer and more
20891 expensive calling sequence is required.  This is required for calls
20892 farther than 32 megabytes (33,554,432 bytes) from the current location.
20893 A short call is generated if the compiler knows
20894 the call cannot be that far away.  This setting can be overridden by
20895 the @code{shortcall} function attribute, or by @code{#pragma
20896 longcall(0)}.
20898 Some linkers are capable of detecting out-of-range calls and generating
20899 glue code on the fly.  On these systems, long calls are unnecessary and
20900 generate slower code.  As of this writing, the AIX linker can do this,
20901 as can the GNU linker for PowerPC/64.  It is planned to add this feature
20902 to the GNU linker for 32-bit PowerPC systems as well.
20904 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
20905 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
20906 addresses represent the callee and the branch island.  The
20907 Darwin/PPC linker prefers the first address and generates a @code{bl
20908 callee} if the PPC @code{bl} instruction reaches the callee directly;
20909 otherwise, the linker generates @code{bl L42} to call the branch
20910 island.  The branch island is appended to the body of the
20911 calling function; it computes the full 32-bit address of the callee
20912 and jumps to it.
20914 On Mach-O (Darwin) systems, this option directs the compiler emit to
20915 the glue for every direct call, and the Darwin linker decides whether
20916 to use or discard it.
20918 In the future, GCC may ignore all longcall specifications
20919 when the linker is known to generate glue.
20921 @item -mtls-markers
20922 @itemx -mno-tls-markers
20923 @opindex mtls-markers
20924 @opindex mno-tls-markers
20925 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20926 specifying the function argument.  The relocation allows the linker to
20927 reliably associate function call with argument setup instructions for
20928 TLS optimization, which in turn allows GCC to better schedule the
20929 sequence.
20931 @item -pthread
20932 @opindex pthread
20933 Adds support for multithreading with the @dfn{pthreads} library.
20934 This option sets flags for both the preprocessor and linker.
20936 @item -mrecip
20937 @itemx -mno-recip
20938 @opindex mrecip
20939 This option enables use of the reciprocal estimate and
20940 reciprocal square root estimate instructions with additional
20941 Newton-Raphson steps to increase precision instead of doing a divide or
20942 square root and divide for floating-point arguments.  You should use
20943 the @option{-ffast-math} option when using @option{-mrecip} (or at
20944 least @option{-funsafe-math-optimizations},
20945 @option{-ffinite-math-only}, @option{-freciprocal-math} and
20946 @option{-fno-trapping-math}).  Note that while the throughput of the
20947 sequence is generally higher than the throughput of the non-reciprocal
20948 instruction, the precision of the sequence can be decreased by up to 2
20949 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20950 roots.
20952 @item -mrecip=@var{opt}
20953 @opindex mrecip=opt
20954 This option controls which reciprocal estimate instructions
20955 may be used.  @var{opt} is a comma-separated list of options, which may
20956 be preceded by a @code{!} to invert the option:
20958 @table @samp
20960 @item all
20961 Enable all estimate instructions.
20963 @item default 
20964 Enable the default instructions, equivalent to @option{-mrecip}.
20966 @item none 
20967 Disable all estimate instructions, equivalent to @option{-mno-recip}.
20969 @item div 
20970 Enable the reciprocal approximation instructions for both 
20971 single and double precision.
20973 @item divf 
20974 Enable the single-precision reciprocal approximation instructions.
20976 @item divd 
20977 Enable the double-precision reciprocal approximation instructions.
20979 @item rsqrt 
20980 Enable the reciprocal square root approximation instructions for both
20981 single and double precision.
20983 @item rsqrtf 
20984 Enable the single-precision reciprocal square root approximation instructions.
20986 @item rsqrtd 
20987 Enable the double-precision reciprocal square root approximation instructions.
20989 @end table
20991 So, for example, @option{-mrecip=all,!rsqrtd} enables
20992 all of the reciprocal estimate instructions, except for the
20993 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20994 which handle the double-precision reciprocal square root calculations.
20996 @item -mrecip-precision
20997 @itemx -mno-recip-precision
20998 @opindex mrecip-precision
20999 Assume (do not assume) that the reciprocal estimate instructions
21000 provide higher-precision estimates than is mandated by the PowerPC
21001 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
21002 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
21003 The double-precision square root estimate instructions are not generated by
21004 default on low-precision machines, since they do not provide an
21005 estimate that converges after three steps.
21007 @item -mveclibabi=@var{type}
21008 @opindex mveclibabi
21009 Specifies the ABI type to use for vectorizing intrinsics using an
21010 external library.  The only type supported at present is @samp{mass},
21011 which specifies to use IBM's Mathematical Acceleration Subsystem
21012 (MASS) libraries for vectorizing intrinsics using external libraries.
21013 GCC currently emits calls to @code{acosd2}, @code{acosf4},
21014 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
21015 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
21016 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
21017 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
21018 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
21019 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
21020 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
21021 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
21022 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
21023 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
21024 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
21025 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
21026 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
21027 for power7.  Both @option{-ftree-vectorize} and
21028 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
21029 libraries must be specified at link time.
21031 @item -mfriz
21032 @itemx -mno-friz
21033 @opindex mfriz
21034 Generate (do not generate) the @code{friz} instruction when the
21035 @option{-funsafe-math-optimizations} option is used to optimize
21036 rounding of floating-point values to 64-bit integer and back to floating
21037 point.  The @code{friz} instruction does not return the same value if
21038 the floating-point number is too large to fit in an integer.
21040 @item -mpointers-to-nested-functions
21041 @itemx -mno-pointers-to-nested-functions
21042 @opindex mpointers-to-nested-functions
21043 Generate (do not generate) code to load up the static chain register
21044 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
21045 systems where a function pointer points to a 3-word descriptor giving
21046 the function address, TOC value to be loaded in register @code{r2}, and
21047 static chain value to be loaded in register @code{r11}.  The
21048 @option{-mpointers-to-nested-functions} is on by default.  You cannot
21049 call through pointers to nested functions or pointers
21050 to functions compiled in other languages that use the static chain if
21051 you use @option{-mno-pointers-to-nested-functions}.
21053 @item -msave-toc-indirect
21054 @itemx -mno-save-toc-indirect
21055 @opindex msave-toc-indirect
21056 Generate (do not generate) code to save the TOC value in the reserved
21057 stack location in the function prologue if the function calls through
21058 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
21059 saved in the prologue, it is saved just before the call through the
21060 pointer.  The @option{-mno-save-toc-indirect} option is the default.
21062 @item -mcompat-align-parm
21063 @itemx -mno-compat-align-parm
21064 @opindex mcompat-align-parm
21065 Generate (do not generate) code to pass structure parameters with a
21066 maximum alignment of 64 bits, for compatibility with older versions
21067 of GCC.
21069 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
21070 structure parameter on a 128-bit boundary when that structure contained
21071 a member requiring 128-bit alignment.  This is corrected in more
21072 recent versions of GCC.  This option may be used to generate code
21073 that is compatible with functions compiled with older versions of
21074 GCC.
21076 The @option{-mno-compat-align-parm} option is the default.
21077 @end table
21079 @node RX Options
21080 @subsection RX Options
21081 @cindex RX Options
21083 These command-line options are defined for RX targets:
21085 @table @gcctabopt
21086 @item -m64bit-doubles
21087 @itemx -m32bit-doubles
21088 @opindex m64bit-doubles
21089 @opindex m32bit-doubles
21090 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
21091 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
21092 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
21093 works on 32-bit values, which is why the default is
21094 @option{-m32bit-doubles}.
21096 @item -fpu
21097 @itemx -nofpu
21098 @opindex fpu
21099 @opindex nofpu
21100 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
21101 floating-point hardware.  The default is enabled for the RX600
21102 series and disabled for the RX200 series.
21104 Floating-point instructions are only generated for 32-bit floating-point 
21105 values, however, so the FPU hardware is not used for doubles if the
21106 @option{-m64bit-doubles} option is used.
21108 @emph{Note} If the @option{-fpu} option is enabled then
21109 @option{-funsafe-math-optimizations} is also enabled automatically.
21110 This is because the RX FPU instructions are themselves unsafe.
21112 @item -mcpu=@var{name}
21113 @opindex mcpu
21114 Selects the type of RX CPU to be targeted.  Currently three types are
21115 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
21116 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
21118 The only difference between @samp{RX600} and @samp{RX610} is that the
21119 @samp{RX610} does not support the @code{MVTIPL} instruction.
21121 The @samp{RX200} series does not have a hardware floating-point unit
21122 and so @option{-nofpu} is enabled by default when this type is
21123 selected.
21125 @item -mbig-endian-data
21126 @itemx -mlittle-endian-data
21127 @opindex mbig-endian-data
21128 @opindex mlittle-endian-data
21129 Store data (but not code) in the big-endian format.  The default is
21130 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
21131 format.
21133 @item -msmall-data-limit=@var{N}
21134 @opindex msmall-data-limit
21135 Specifies the maximum size in bytes of global and static variables
21136 which can be placed into the small data area.  Using the small data
21137 area can lead to smaller and faster code, but the size of area is
21138 limited and it is up to the programmer to ensure that the area does
21139 not overflow.  Also when the small data area is used one of the RX's
21140 registers (usually @code{r13}) is reserved for use pointing to this
21141 area, so it is no longer available for use by the compiler.  This
21142 could result in slower and/or larger code if variables are pushed onto
21143 the stack instead of being held in this register.
21145 Note, common variables (variables that have not been initialized) and
21146 constants are not placed into the small data area as they are assigned
21147 to other sections in the output executable.
21149 The default value is zero, which disables this feature.  Note, this
21150 feature is not enabled by default with higher optimization levels
21151 (@option{-O2} etc) because of the potentially detrimental effects of
21152 reserving a register.  It is up to the programmer to experiment and
21153 discover whether this feature is of benefit to their program.  See the
21154 description of the @option{-mpid} option for a description of how the
21155 actual register to hold the small data area pointer is chosen.
21157 @item -msim
21158 @itemx -mno-sim
21159 @opindex msim
21160 @opindex mno-sim
21161 Use the simulator runtime.  The default is to use the libgloss
21162 board-specific runtime.
21164 @item -mas100-syntax
21165 @itemx -mno-as100-syntax
21166 @opindex mas100-syntax
21167 @opindex mno-as100-syntax
21168 When generating assembler output use a syntax that is compatible with
21169 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
21170 assembler, but it has some restrictions so it is not generated by default.
21172 @item -mmax-constant-size=@var{N}
21173 @opindex mmax-constant-size
21174 Specifies the maximum size, in bytes, of a constant that can be used as
21175 an operand in a RX instruction.  Although the RX instruction set does
21176 allow constants of up to 4 bytes in length to be used in instructions,
21177 a longer value equates to a longer instruction.  Thus in some
21178 circumstances it can be beneficial to restrict the size of constants
21179 that are used in instructions.  Constants that are too big are instead
21180 placed into a constant pool and referenced via register indirection.
21182 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
21183 or 4 means that constants of any size are allowed.
21185 @item -mrelax
21186 @opindex mrelax
21187 Enable linker relaxation.  Linker relaxation is a process whereby the
21188 linker attempts to reduce the size of a program by finding shorter
21189 versions of various instructions.  Disabled by default.
21191 @item -mint-register=@var{N}
21192 @opindex mint-register
21193 Specify the number of registers to reserve for fast interrupt handler
21194 functions.  The value @var{N} can be between 0 and 4.  A value of 1
21195 means that register @code{r13} is reserved for the exclusive use
21196 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
21197 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
21198 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
21199 A value of 0, the default, does not reserve any registers.
21201 @item -msave-acc-in-interrupts
21202 @opindex msave-acc-in-interrupts
21203 Specifies that interrupt handler functions should preserve the
21204 accumulator register.  This is only necessary if normal code might use
21205 the accumulator register, for example because it performs 64-bit
21206 multiplications.  The default is to ignore the accumulator as this
21207 makes the interrupt handlers faster.
21209 @item -mpid
21210 @itemx -mno-pid
21211 @opindex mpid
21212 @opindex mno-pid
21213 Enables the generation of position independent data.  When enabled any
21214 access to constant data is done via an offset from a base address
21215 held in a register.  This allows the location of constant data to be
21216 determined at run time without requiring the executable to be
21217 relocated, which is a benefit to embedded applications with tight
21218 memory constraints.  Data that can be modified is not affected by this
21219 option.
21221 Note, using this feature reserves a register, usually @code{r13}, for
21222 the constant data base address.  This can result in slower and/or
21223 larger code, especially in complicated functions.
21225 The actual register chosen to hold the constant data base address
21226 depends upon whether the @option{-msmall-data-limit} and/or the
21227 @option{-mint-register} command-line options are enabled.  Starting
21228 with register @code{r13} and proceeding downwards, registers are
21229 allocated first to satisfy the requirements of @option{-mint-register},
21230 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
21231 is possible for the small data area register to be @code{r8} if both
21232 @option{-mint-register=4} and @option{-mpid} are specified on the
21233 command line.
21235 By default this feature is not enabled.  The default can be restored
21236 via the @option{-mno-pid} command-line option.
21238 @item -mno-warn-multiple-fast-interrupts
21239 @itemx -mwarn-multiple-fast-interrupts
21240 @opindex mno-warn-multiple-fast-interrupts
21241 @opindex mwarn-multiple-fast-interrupts
21242 Prevents GCC from issuing a warning message if it finds more than one
21243 fast interrupt handler when it is compiling a file.  The default is to
21244 issue a warning for each extra fast interrupt handler found, as the RX
21245 only supports one such interrupt.
21247 @item -mallow-string-insns
21248 @itemx -mno-allow-string-insns
21249 @opindex mallow-string-insns
21250 @opindex mno-allow-string-insns
21251 Enables or disables the use of the string manipulation instructions
21252 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
21253 @code{SWHILE} and also the @code{RMPA} instruction.  These
21254 instructions may prefetch data, which is not safe to do if accessing
21255 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
21256 for more information).
21258 The default is to allow these instructions, but it is not possible for
21259 GCC to reliably detect all circumstances where a string instruction
21260 might be used to access an I/O register, so their use cannot be
21261 disabled automatically.  Instead it is reliant upon the programmer to
21262 use the @option{-mno-allow-string-insns} option if their program
21263 accesses I/O space.
21265 When the instructions are enabled GCC defines the C preprocessor
21266 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
21267 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
21269 @item -mjsr
21270 @itemx -mno-jsr
21271 @opindex mjsr
21272 @opindex mno-jsr
21273 Use only (or not only) @code{JSR} instructions to access functions.
21274 This option can be used when code size exceeds the range of @code{BSR}
21275 instructions.  Note that @option{-mno-jsr} does not mean to not use
21276 @code{JSR} but instead means that any type of branch may be used.
21277 @end table
21279 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
21280 has special significance to the RX port when used with the
21281 @code{interrupt} function attribute.  This attribute indicates a
21282 function intended to process fast interrupts.  GCC ensures
21283 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
21284 and/or @code{r13} and only provided that the normal use of the
21285 corresponding registers have been restricted via the
21286 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
21287 options.
21289 @node S/390 and zSeries Options
21290 @subsection S/390 and zSeries Options
21291 @cindex S/390 and zSeries Options
21293 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
21295 @table @gcctabopt
21296 @item -mhard-float
21297 @itemx -msoft-float
21298 @opindex mhard-float
21299 @opindex msoft-float
21300 Use (do not use) the hardware floating-point instructions and registers
21301 for floating-point operations.  When @option{-msoft-float} is specified,
21302 functions in @file{libgcc.a} are used to perform floating-point
21303 operations.  When @option{-mhard-float} is specified, the compiler
21304 generates IEEE floating-point instructions.  This is the default.
21306 @item -mhard-dfp
21307 @itemx -mno-hard-dfp
21308 @opindex mhard-dfp
21309 @opindex mno-hard-dfp
21310 Use (do not use) the hardware decimal-floating-point instructions for
21311 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
21312 specified, functions in @file{libgcc.a} are used to perform
21313 decimal-floating-point operations.  When @option{-mhard-dfp} is
21314 specified, the compiler generates decimal-floating-point hardware
21315 instructions.  This is the default for @option{-march=z9-ec} or higher.
21317 @item -mlong-double-64
21318 @itemx -mlong-double-128
21319 @opindex mlong-double-64
21320 @opindex mlong-double-128
21321 These switches control the size of @code{long double} type. A size
21322 of 64 bits makes the @code{long double} type equivalent to the @code{double}
21323 type. This is the default.
21325 @item -mbackchain
21326 @itemx -mno-backchain
21327 @opindex mbackchain
21328 @opindex mno-backchain
21329 Store (do not store) the address of the caller's frame as backchain pointer
21330 into the callee's stack frame.
21331 A backchain may be needed to allow debugging using tools that do not understand
21332 DWARF call frame information.
21333 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
21334 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
21335 the backchain is placed into the topmost word of the 96/160 byte register
21336 save area.
21338 In general, code compiled with @option{-mbackchain} is call-compatible with
21339 code compiled with @option{-mmo-backchain}; however, use of the backchain
21340 for debugging purposes usually requires that the whole binary is built with
21341 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
21342 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
21343 to build a linux kernel use @option{-msoft-float}.
21345 The default is to not maintain the backchain.
21347 @item -mpacked-stack
21348 @itemx -mno-packed-stack
21349 @opindex mpacked-stack
21350 @opindex mno-packed-stack
21351 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
21352 specified, the compiler uses the all fields of the 96/160 byte register save
21353 area only for their default purpose; unused fields still take up stack space.
21354 When @option{-mpacked-stack} is specified, register save slots are densely
21355 packed at the top of the register save area; unused space is reused for other
21356 purposes, allowing for more efficient use of the available stack space.
21357 However, when @option{-mbackchain} is also in effect, the topmost word of
21358 the save area is always used to store the backchain, and the return address
21359 register is always saved two words below the backchain.
21361 As long as the stack frame backchain is not used, code generated with
21362 @option{-mpacked-stack} is call-compatible with code generated with
21363 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
21364 S/390 or zSeries generated code that uses the stack frame backchain at run
21365 time, not just for debugging purposes.  Such code is not call-compatible
21366 with code compiled with @option{-mpacked-stack}.  Also, note that the
21367 combination of @option{-mbackchain},
21368 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
21369 to build a linux kernel use @option{-msoft-float}.
21371 The default is to not use the packed stack layout.
21373 @item -msmall-exec
21374 @itemx -mno-small-exec
21375 @opindex msmall-exec
21376 @opindex mno-small-exec
21377 Generate (or do not generate) code using the @code{bras} instruction
21378 to do subroutine calls.
21379 This only works reliably if the total executable size does not
21380 exceed 64k.  The default is to use the @code{basr} instruction instead,
21381 which does not have this limitation.
21383 @item -m64
21384 @itemx -m31
21385 @opindex m64
21386 @opindex m31
21387 When @option{-m31} is specified, generate code compliant to the
21388 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
21389 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
21390 particular to generate 64-bit instructions.  For the @samp{s390}
21391 targets, the default is @option{-m31}, while the @samp{s390x}
21392 targets default to @option{-m64}.
21394 @item -mzarch
21395 @itemx -mesa
21396 @opindex mzarch
21397 @opindex mesa
21398 When @option{-mzarch} is specified, generate code using the
21399 instructions available on z/Architecture.
21400 When @option{-mesa} is specified, generate code using the
21401 instructions available on ESA/390.  Note that @option{-mesa} is
21402 not possible with @option{-m64}.
21403 When generating code compliant to the GNU/Linux for S/390 ABI,
21404 the default is @option{-mesa}.  When generating code compliant
21405 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
21407 @item -mhtm
21408 @itemx -mno-htm
21409 @opindex mhtm
21410 @opindex mno-htm
21411 The @option{-mhtm} option enables a set of builtins making use of
21412 instructions available with the transactional execution facility
21413 introduced with the IBM zEnterprise EC12 machine generation
21414 @ref{S/390 System z Built-in Functions}.
21415 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
21417 @item -mvx
21418 @itemx -mno-vx
21419 @opindex mvx
21420 @opindex mno-vx
21421 When @option{-mvx} is specified, generate code using the instructions
21422 available with the vector extension facility introduced with the IBM
21423 z13 machine generation.
21424 This option changes the ABI for some vector type values with regard to
21425 alignment and calling conventions.  In case vector type values are
21426 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
21427 command will be added to mark the resulting binary with the ABI used.
21428 @option{-mvx} is enabled by default when using @option{-march=z13}.
21430 @item -mzvector
21431 @itemx -mno-zvector
21432 @opindex mzvector
21433 @opindex mno-zvector
21434 The @option{-mzvector} option enables vector language extensions and
21435 builtins using instructions available with the vector extension
21436 facility introduced with the IBM z13 machine generation.
21437 This option adds support for @samp{vector} to be used as a keyword to
21438 define vector type variables and arguments.  @samp{vector} is only
21439 available when GNU extensions are enabled.  It will not be expanded
21440 when requesting strict standard compliance e.g. with @option{-std=c99}.
21441 In addition to the GCC low-level builtins @option{-mzvector} enables
21442 a set of builtins added for compatibility with AltiVec-style
21443 implementations like Power and Cell.  In order to make use of these
21444 builtins the header file @file{vecintrin.h} needs to be included.
21445 @option{-mzvector} is disabled by default.
21447 @item -mmvcle
21448 @itemx -mno-mvcle
21449 @opindex mmvcle
21450 @opindex mno-mvcle
21451 Generate (or do not generate) code using the @code{mvcle} instruction
21452 to perform block moves.  When @option{-mno-mvcle} is specified,
21453 use a @code{mvc} loop instead.  This is the default unless optimizing for
21454 size.
21456 @item -mdebug
21457 @itemx -mno-debug
21458 @opindex mdebug
21459 @opindex mno-debug
21460 Print (or do not print) additional debug information when compiling.
21461 The default is to not print debug information.
21463 @item -march=@var{cpu-type}
21464 @opindex march
21465 Generate code that runs on @var{cpu-type}, which is the name of a
21466 system representing a certain processor type.  Possible values for
21467 @var{cpu-type} are @samp{z900}, @samp{z990}, @samp{z9-109},
21468 @samp{z9-ec}, @samp{z10}, @samp{z196}, @samp{zEC12}, and @samp{z13}.
21469 The default is @option{-march=z900}.  @samp{g5} and @samp{g6} are
21470 deprecated and will be removed with future releases.
21472 @item -mtune=@var{cpu-type}
21473 @opindex mtune
21474 Tune to @var{cpu-type} everything applicable about the generated code,
21475 except for the ABI and the set of available instructions.
21476 The list of @var{cpu-type} values is the same as for @option{-march}.
21477 The default is the value used for @option{-march}.
21479 @item -mtpf-trace
21480 @itemx -mno-tpf-trace
21481 @opindex mtpf-trace
21482 @opindex mno-tpf-trace
21483 Generate code that adds (does not add) in TPF OS specific branches to trace
21484 routines in the operating system.  This option is off by default, even
21485 when compiling for the TPF OS@.
21487 @item -mfused-madd
21488 @itemx -mno-fused-madd
21489 @opindex mfused-madd
21490 @opindex mno-fused-madd
21491 Generate code that uses (does not use) the floating-point multiply and
21492 accumulate instructions.  These instructions are generated by default if
21493 hardware floating point is used.
21495 @item -mwarn-framesize=@var{framesize}
21496 @opindex mwarn-framesize
21497 Emit a warning if the current function exceeds the given frame size.  Because
21498 this is a compile-time check it doesn't need to be a real problem when the program
21499 runs.  It is intended to identify functions that most probably cause
21500 a stack overflow.  It is useful to be used in an environment with limited stack
21501 size e.g.@: the linux kernel.
21503 @item -mwarn-dynamicstack
21504 @opindex mwarn-dynamicstack
21505 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
21506 arrays.  This is generally a bad idea with a limited stack size.
21508 @item -mstack-guard=@var{stack-guard}
21509 @itemx -mstack-size=@var{stack-size}
21510 @opindex mstack-guard
21511 @opindex mstack-size
21512 If these options are provided the S/390 back end emits additional instructions in
21513 the function prologue that trigger a trap if the stack size is @var{stack-guard}
21514 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
21515 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
21516 the frame size of the compiled function is chosen.
21517 These options are intended to be used to help debugging stack overflow problems.
21518 The additionally emitted code causes only little overhead and hence can also be
21519 used in production-like systems without greater performance degradation.  The given
21520 values have to be exact powers of 2 and @var{stack-size} has to be greater than
21521 @var{stack-guard} without exceeding 64k.
21522 In order to be efficient the extra code makes the assumption that the stack starts
21523 at an address aligned to the value given by @var{stack-size}.
21524 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
21526 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
21527 @opindex mhotpatch
21528 If the hotpatch option is enabled, a ``hot-patching'' function
21529 prologue is generated for all functions in the compilation unit.
21530 The funtion label is prepended with the given number of two-byte
21531 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
21532 the label, 2 * @var{post-halfwords} bytes are appended, using the
21533 largest NOP like instructions the architecture allows (maximum
21534 1000000).
21536 If both arguments are zero, hotpatching is disabled.
21538 This option can be overridden for individual functions with the
21539 @code{hotpatch} attribute.
21540 @end table
21542 @node Score Options
21543 @subsection Score Options
21544 @cindex Score Options
21546 These options are defined for Score implementations:
21548 @table @gcctabopt
21549 @item -meb
21550 @opindex meb
21551 Compile code for big-endian mode.  This is the default.
21553 @item -mel
21554 @opindex mel
21555 Compile code for little-endian mode.
21557 @item -mnhwloop
21558 @opindex mnhwloop
21559 Disable generation of @code{bcnz} instructions.
21561 @item -muls
21562 @opindex muls
21563 Enable generation of unaligned load and store instructions.
21565 @item -mmac
21566 @opindex mmac
21567 Enable the use of multiply-accumulate instructions. Disabled by default.
21569 @item -mscore5
21570 @opindex mscore5
21571 Specify the SCORE5 as the target architecture.
21573 @item -mscore5u
21574 @opindex mscore5u
21575 Specify the SCORE5U of the target architecture.
21577 @item -mscore7
21578 @opindex mscore7
21579 Specify the SCORE7 as the target architecture. This is the default.
21581 @item -mscore7d
21582 @opindex mscore7d
21583 Specify the SCORE7D as the target architecture.
21584 @end table
21586 @node SH Options
21587 @subsection SH Options
21589 These @samp{-m} options are defined for the SH implementations:
21591 @table @gcctabopt
21592 @item -m1
21593 @opindex m1
21594 Generate code for the SH1.
21596 @item -m2
21597 @opindex m2
21598 Generate code for the SH2.
21600 @item -m2e
21601 Generate code for the SH2e.
21603 @item -m2a-nofpu
21604 @opindex m2a-nofpu
21605 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
21606 that the floating-point unit is not used.
21608 @item -m2a-single-only
21609 @opindex m2a-single-only
21610 Generate code for the SH2a-FPU, in such a way that no double-precision
21611 floating-point operations are used.
21613 @item -m2a-single
21614 @opindex m2a-single
21615 Generate code for the SH2a-FPU assuming the floating-point unit is in
21616 single-precision mode by default.
21618 @item -m2a
21619 @opindex m2a
21620 Generate code for the SH2a-FPU assuming the floating-point unit is in
21621 double-precision mode by default.
21623 @item -m3
21624 @opindex m3
21625 Generate code for the SH3.
21627 @item -m3e
21628 @opindex m3e
21629 Generate code for the SH3e.
21631 @item -m4-nofpu
21632 @opindex m4-nofpu
21633 Generate code for the SH4 without a floating-point unit.
21635 @item -m4-single-only
21636 @opindex m4-single-only
21637 Generate code for the SH4 with a floating-point unit that only
21638 supports single-precision arithmetic.
21640 @item -m4-single
21641 @opindex m4-single
21642 Generate code for the SH4 assuming the floating-point unit is in
21643 single-precision mode by default.
21645 @item -m4
21646 @opindex m4
21647 Generate code for the SH4.
21649 @item -m4-100
21650 @opindex m4-100
21651 Generate code for SH4-100.
21653 @item -m4-100-nofpu
21654 @opindex m4-100-nofpu
21655 Generate code for SH4-100 in such a way that the
21656 floating-point unit is not used.
21658 @item -m4-100-single
21659 @opindex m4-100-single
21660 Generate code for SH4-100 assuming the floating-point unit is in
21661 single-precision mode by default.
21663 @item -m4-100-single-only
21664 @opindex m4-100-single-only
21665 Generate code for SH4-100 in such a way that no double-precision
21666 floating-point operations are used.
21668 @item -m4-200
21669 @opindex m4-200
21670 Generate code for SH4-200.
21672 @item -m4-200-nofpu
21673 @opindex m4-200-nofpu
21674 Generate code for SH4-200 without in such a way that the
21675 floating-point unit is not used.
21677 @item -m4-200-single
21678 @opindex m4-200-single
21679 Generate code for SH4-200 assuming the floating-point unit is in
21680 single-precision mode by default.
21682 @item -m4-200-single-only
21683 @opindex m4-200-single-only
21684 Generate code for SH4-200 in such a way that no double-precision
21685 floating-point operations are used.
21687 @item -m4-300
21688 @opindex m4-300
21689 Generate code for SH4-300.
21691 @item -m4-300-nofpu
21692 @opindex m4-300-nofpu
21693 Generate code for SH4-300 without in such a way that the
21694 floating-point unit is not used.
21696 @item -m4-300-single
21697 @opindex m4-300-single
21698 Generate code for SH4-300 in such a way that no double-precision
21699 floating-point operations are used.
21701 @item -m4-300-single-only
21702 @opindex m4-300-single-only
21703 Generate code for SH4-300 in such a way that no double-precision
21704 floating-point operations are used.
21706 @item -m4-340
21707 @opindex m4-340
21708 Generate code for SH4-340 (no MMU, no FPU).
21710 @item -m4-500
21711 @opindex m4-500
21712 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
21713 assembler.
21715 @item -m4a-nofpu
21716 @opindex m4a-nofpu
21717 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
21718 floating-point unit is not used.
21720 @item -m4a-single-only
21721 @opindex m4a-single-only
21722 Generate code for the SH4a, in such a way that no double-precision
21723 floating-point operations are used.
21725 @item -m4a-single
21726 @opindex m4a-single
21727 Generate code for the SH4a assuming the floating-point unit is in
21728 single-precision mode by default.
21730 @item -m4a
21731 @opindex m4a
21732 Generate code for the SH4a.
21734 @item -m4al
21735 @opindex m4al
21736 Same as @option{-m4a-nofpu}, except that it implicitly passes
21737 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
21738 instructions at the moment.
21740 @item -mb
21741 @opindex mb
21742 Compile code for the processor in big-endian mode.
21744 @item -ml
21745 @opindex ml
21746 Compile code for the processor in little-endian mode.
21748 @item -mdalign
21749 @opindex mdalign
21750 Align doubles at 64-bit boundaries.  Note that this changes the calling
21751 conventions, and thus some functions from the standard C library do
21752 not work unless you recompile it first with @option{-mdalign}.
21754 @item -mrelax
21755 @opindex mrelax
21756 Shorten some address references at link time, when possible; uses the
21757 linker option @option{-relax}.
21759 @item -mbigtable
21760 @opindex mbigtable
21761 Use 32-bit offsets in @code{switch} tables.  The default is to use
21762 16-bit offsets.
21764 @item -mbitops
21765 @opindex mbitops
21766 Enable the use of bit manipulation instructions on SH2A.
21768 @item -mfmovd
21769 @opindex mfmovd
21770 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
21771 alignment constraints.
21773 @item -mrenesas
21774 @opindex mrenesas
21775 Comply with the calling conventions defined by Renesas.
21777 @item -mno-renesas
21778 @opindex mno-renesas
21779 Comply with the calling conventions defined for GCC before the Renesas
21780 conventions were available.  This option is the default for all
21781 targets of the SH toolchain.
21783 @item -mnomacsave
21784 @opindex mnomacsave
21785 Mark the @code{MAC} register as call-clobbered, even if
21786 @option{-mrenesas} is given.
21788 @item -mieee
21789 @itemx -mno-ieee
21790 @opindex mieee
21791 @opindex mno-ieee
21792 Control the IEEE compliance of floating-point comparisons, which affects the
21793 handling of cases where the result of a comparison is unordered.  By default
21794 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
21795 enabled @option{-mno-ieee} is implicitly set, which results in faster
21796 floating-point greater-equal and less-equal comparisons.  The implicit settings
21797 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
21799 @item -minline-ic_invalidate
21800 @opindex minline-ic_invalidate
21801 Inline code to invalidate instruction cache entries after setting up
21802 nested function trampolines.
21803 This option has no effect if @option{-musermode} is in effect and the selected
21804 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
21805 instruction.
21806 If the selected code generation option does not allow the use of the @code{icbi}
21807 instruction, and @option{-musermode} is not in effect, the inlined code
21808 manipulates the instruction cache address array directly with an associative
21809 write.  This not only requires privileged mode at run time, but it also
21810 fails if the cache line had been mapped via the TLB and has become unmapped.
21812 @item -misize
21813 @opindex misize
21814 Dump instruction size and location in the assembly code.
21816 @item -mpadstruct
21817 @opindex mpadstruct
21818 This option is deprecated.  It pads structures to multiple of 4 bytes,
21819 which is incompatible with the SH ABI@.
21821 @item -matomic-model=@var{model}
21822 @opindex matomic-model=@var{model}
21823 Sets the model of atomic operations and additional parameters as a comma
21824 separated list.  For details on the atomic built-in functions see
21825 @ref{__atomic Builtins}.  The following models and parameters are supported:
21827 @table @samp
21829 @item none
21830 Disable compiler generated atomic sequences and emit library calls for atomic
21831 operations.  This is the default if the target is not @code{sh*-*-linux*}.
21833 @item soft-gusa
21834 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
21835 built-in functions.  The generated atomic sequences require additional support
21836 from the interrupt/exception handling code of the system and are only suitable
21837 for SH3* and SH4* single-core systems.  This option is enabled by default when
21838 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
21839 this option also partially utilizes the hardware atomic instructions
21840 @code{movli.l} and @code{movco.l} to create more efficient code, unless
21841 @samp{strict} is specified.  
21843 @item soft-tcb
21844 Generate software atomic sequences that use a variable in the thread control
21845 block.  This is a variation of the gUSA sequences which can also be used on
21846 SH1* and SH2* targets.  The generated atomic sequences require additional
21847 support from the interrupt/exception handling code of the system and are only
21848 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
21849 parameter has to be specified as well.
21851 @item soft-imask
21852 Generate software atomic sequences that temporarily disable interrupts by
21853 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
21854 in privileged mode and is only suitable for single-core systems.  Additional
21855 support from the interrupt/exception handling code of the system is not
21856 required.  This model is enabled by default when the target is
21857 @code{sh*-*-linux*} and SH1* or SH2*.
21859 @item hard-llcs
21860 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
21861 instructions only.  This is only available on SH4A and is suitable for
21862 multi-core systems.  Since the hardware instructions support only 32 bit atomic
21863 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
21864 Code compiled with this option is also compatible with other software
21865 atomic model interrupt/exception handling systems if executed on an SH4A
21866 system.  Additional support from the interrupt/exception handling code of the
21867 system is not required for this model.
21869 @item gbr-offset=
21870 This parameter specifies the offset in bytes of the variable in the thread
21871 control block structure that should be used by the generated atomic sequences
21872 when the @samp{soft-tcb} model has been selected.  For other models this
21873 parameter is ignored.  The specified value must be an integer multiple of four
21874 and in the range 0-1020.
21876 @item strict
21877 This parameter prevents mixed usage of multiple atomic models, even if they
21878 are compatible, and makes the compiler generate atomic sequences of the
21879 specified model only.
21881 @end table
21883 @item -mtas
21884 @opindex mtas
21885 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
21886 Notice that depending on the particular hardware and software configuration
21887 this can degrade overall performance due to the operand cache line flushes
21888 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
21889 processors the @code{tas.b} instruction must be used with caution since it
21890 can result in data corruption for certain cache configurations.
21892 @item -mprefergot
21893 @opindex mprefergot
21894 When generating position-independent code, emit function calls using
21895 the Global Offset Table instead of the Procedure Linkage Table.
21897 @item -musermode
21898 @itemx -mno-usermode
21899 @opindex musermode
21900 @opindex mno-usermode
21901 Don't allow (allow) the compiler generating privileged mode code.  Specifying
21902 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
21903 inlined code would not work in user mode.  @option{-musermode} is the default
21904 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
21905 @option{-musermode} has no effect, since there is no user mode.
21907 @item -multcost=@var{number}
21908 @opindex multcost=@var{number}
21909 Set the cost to assume for a multiply insn.
21911 @item -mdiv=@var{strategy}
21912 @opindex mdiv=@var{strategy}
21913 Set the division strategy to be used for integer division operations.
21914 @var{strategy} can be one of: 
21916 @table @samp
21918 @item call-div1
21919 Calls a library function that uses the single-step division instruction
21920 @code{div1} to perform the operation.  Division by zero calculates an
21921 unspecified result and does not trap.  This is the default except for SH4,
21922 SH2A and SHcompact.
21924 @item call-fp
21925 Calls a library function that performs the operation in double precision
21926 floating point.  Division by zero causes a floating-point exception.  This is
21927 the default for SHcompact with FPU.  Specifying this for targets that do not
21928 have a double precision FPU defaults to @code{call-div1}.
21930 @item call-table
21931 Calls a library function that uses a lookup table for small divisors and
21932 the @code{div1} instruction with case distinction for larger divisors.  Division
21933 by zero calculates an unspecified result and does not trap.  This is the default
21934 for SH4.  Specifying this for targets that do not have dynamic shift
21935 instructions defaults to @code{call-div1}.
21937 @end table
21939 When a division strategy has not been specified the default strategy is
21940 selected based on the current target.  For SH2A the default strategy is to
21941 use the @code{divs} and @code{divu} instructions instead of library function
21942 calls.
21944 @item -maccumulate-outgoing-args
21945 @opindex maccumulate-outgoing-args
21946 Reserve space once for outgoing arguments in the function prologue rather
21947 than around each call.  Generally beneficial for performance and size.  Also
21948 needed for unwinding to avoid changing the stack frame around conditional code.
21950 @item -mdivsi3_libfunc=@var{name}
21951 @opindex mdivsi3_libfunc=@var{name}
21952 Set the name of the library function used for 32-bit signed division to
21953 @var{name}.
21954 This only affects the name used in the @samp{call} division strategies, and
21955 the compiler still expects the same sets of input/output/clobbered registers as
21956 if this option were not present.
21958 @item -mfixed-range=@var{register-range}
21959 @opindex mfixed-range
21960 Generate code treating the given register range as fixed registers.
21961 A fixed register is one that the register allocator can not use.  This is
21962 useful when compiling kernel code.  A register range is specified as
21963 two registers separated by a dash.  Multiple register ranges can be
21964 specified separated by a comma.
21966 @item -mbranch-cost=@var{num}
21967 @opindex mbranch-cost=@var{num}
21968 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21969 make the compiler try to generate more branch-free code if possible.  
21970 If not specified the value is selected depending on the processor type that
21971 is being compiled for.
21973 @item -mzdcbranch
21974 @itemx -mno-zdcbranch
21975 @opindex mzdcbranch
21976 @opindex mno-zdcbranch
21977 Assume (do not assume) that zero displacement conditional branch instructions
21978 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21979 compiler prefers zero displacement branch code sequences.  This is
21980 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21981 disabled by specifying @option{-mno-zdcbranch}.
21983 @item -mcbranch-force-delay-slot
21984 @opindex mcbranch-force-delay-slot
21985 Force the usage of delay slots for conditional branches, which stuffs the delay
21986 slot with a @code{nop} if a suitable instruction can't be found.  By default
21987 this option is disabled.  It can be enabled to work around hardware bugs as
21988 found in the original SH7055.
21990 @item -mfused-madd
21991 @itemx -mno-fused-madd
21992 @opindex mfused-madd
21993 @opindex mno-fused-madd
21994 Generate code that uses (does not use) the floating-point multiply and
21995 accumulate instructions.  These instructions are generated by default
21996 if hardware floating point is used.  The machine-dependent
21997 @option{-mfused-madd} option is now mapped to the machine-independent
21998 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21999 mapped to @option{-ffp-contract=off}.
22001 @item -mfsca
22002 @itemx -mno-fsca
22003 @opindex mfsca
22004 @opindex mno-fsca
22005 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
22006 and cosine approximations.  The option @option{-mfsca} must be used in
22007 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
22008 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
22009 approximations even if @option{-funsafe-math-optimizations} is in effect.
22011 @item -mfsrra
22012 @itemx -mno-fsrra
22013 @opindex mfsrra
22014 @opindex mno-fsrra
22015 Allow or disallow the compiler to emit the @code{fsrra} instruction for
22016 reciprocal square root approximations.  The option @option{-mfsrra} must be used
22017 in combination with @option{-funsafe-math-optimizations} and
22018 @option{-ffinite-math-only}.  It is enabled by default when generating code for
22019 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
22020 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
22021 in effect.
22023 @item -mpretend-cmove
22024 @opindex mpretend-cmove
22025 Prefer zero-displacement conditional branches for conditional move instruction
22026 patterns.  This can result in faster code on the SH4 processor.
22028 @item -mfdpic
22029 @opindex fdpic
22030 Generate code using the FDPIC ABI.
22032 @end table
22034 @node Solaris 2 Options
22035 @subsection Solaris 2 Options
22036 @cindex Solaris 2 options
22038 These @samp{-m} options are supported on Solaris 2:
22040 @table @gcctabopt
22041 @item -mclear-hwcap
22042 @opindex mclear-hwcap
22043 @option{-mclear-hwcap} tells the compiler to remove the hardware
22044 capabilities generated by the Solaris assembler.  This is only necessary
22045 when object files use ISA extensions not supported by the current
22046 machine, but check at runtime whether or not to use them.
22048 @item -mimpure-text
22049 @opindex mimpure-text
22050 @option{-mimpure-text}, used in addition to @option{-shared}, tells
22051 the compiler to not pass @option{-z text} to the linker when linking a
22052 shared object.  Using this option, you can link position-dependent
22053 code into a shared object.
22055 @option{-mimpure-text} suppresses the ``relocations remain against
22056 allocatable but non-writable sections'' linker error message.
22057 However, the necessary relocations trigger copy-on-write, and the
22058 shared object is not actually shared across processes.  Instead of
22059 using @option{-mimpure-text}, you should compile all source code with
22060 @option{-fpic} or @option{-fPIC}.
22062 @end table
22064 These switches are supported in addition to the above on Solaris 2:
22066 @table @gcctabopt
22067 @item -pthreads
22068 @opindex pthreads
22069 Add support for multithreading using the POSIX threads library.  This
22070 option sets flags for both the preprocessor and linker.  This option does
22071 not affect the thread safety of object code produced  by the compiler or
22072 that of libraries supplied with it.
22074 @item -pthread
22075 @opindex pthread
22076 This is a synonym for @option{-pthreads}.
22077 @end table
22079 @node SPARC Options
22080 @subsection SPARC Options
22081 @cindex SPARC options
22083 These @samp{-m} options are supported on the SPARC:
22085 @table @gcctabopt
22086 @item -mno-app-regs
22087 @itemx -mapp-regs
22088 @opindex mno-app-regs
22089 @opindex mapp-regs
22090 Specify @option{-mapp-regs} to generate output using the global registers
22091 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
22092 global register 1, each global register 2 through 4 is then treated as an
22093 allocable register that is clobbered by function calls.  This is the default.
22095 To be fully SVR4 ABI-compliant at the cost of some performance loss,
22096 specify @option{-mno-app-regs}.  You should compile libraries and system
22097 software with this option.
22099 @item -mflat
22100 @itemx -mno-flat
22101 @opindex mflat
22102 @opindex mno-flat
22103 With @option{-mflat}, the compiler does not generate save/restore instructions
22104 and uses a ``flat'' or single register window model.  This model is compatible
22105 with the regular register window model.  The local registers and the input
22106 registers (0--5) are still treated as ``call-saved'' registers and are
22107 saved on the stack as needed.
22109 With @option{-mno-flat} (the default), the compiler generates save/restore
22110 instructions (except for leaf functions).  This is the normal operating mode.
22112 @item -mfpu
22113 @itemx -mhard-float
22114 @opindex mfpu
22115 @opindex mhard-float
22116 Generate output containing floating-point instructions.  This is the
22117 default.
22119 @item -mno-fpu
22120 @itemx -msoft-float
22121 @opindex mno-fpu
22122 @opindex msoft-float
22123 Generate output containing library calls for floating point.
22124 @strong{Warning:} the requisite libraries are not available for all SPARC
22125 targets.  Normally the facilities of the machine's usual C compiler are
22126 used, but this cannot be done directly in cross-compilation.  You must make
22127 your own arrangements to provide suitable library functions for
22128 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
22129 @samp{sparclite-*-*} do provide software floating-point support.
22131 @option{-msoft-float} changes the calling convention in the output file;
22132 therefore, it is only useful if you compile @emph{all} of a program with
22133 this option.  In particular, you need to compile @file{libgcc.a}, the
22134 library that comes with GCC, with @option{-msoft-float} in order for
22135 this to work.
22137 @item -mhard-quad-float
22138 @opindex mhard-quad-float
22139 Generate output containing quad-word (long double) floating-point
22140 instructions.
22142 @item -msoft-quad-float
22143 @opindex msoft-quad-float
22144 Generate output containing library calls for quad-word (long double)
22145 floating-point instructions.  The functions called are those specified
22146 in the SPARC ABI@.  This is the default.
22148 As of this writing, there are no SPARC implementations that have hardware
22149 support for the quad-word floating-point instructions.  They all invoke
22150 a trap handler for one of these instructions, and then the trap handler
22151 emulates the effect of the instruction.  Because of the trap handler overhead,
22152 this is much slower than calling the ABI library routines.  Thus the
22153 @option{-msoft-quad-float} option is the default.
22155 @item -mno-unaligned-doubles
22156 @itemx -munaligned-doubles
22157 @opindex mno-unaligned-doubles
22158 @opindex munaligned-doubles
22159 Assume that doubles have 8-byte alignment.  This is the default.
22161 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
22162 alignment only if they are contained in another type, or if they have an
22163 absolute address.  Otherwise, it assumes they have 4-byte alignment.
22164 Specifying this option avoids some rare compatibility problems with code
22165 generated by other compilers.  It is not the default because it results
22166 in a performance loss, especially for floating-point code.
22168 @item -muser-mode
22169 @itemx -mno-user-mode
22170 @opindex muser-mode
22171 @opindex mno-user-mode
22172 Do not generate code that can only run in supervisor mode.  This is relevant
22173 only for the @code{casa} instruction emitted for the LEON3 processor.  This
22174 is the default.
22176 @item -mfaster-structs
22177 @itemx -mno-faster-structs
22178 @opindex mfaster-structs
22179 @opindex mno-faster-structs
22180 With @option{-mfaster-structs}, the compiler assumes that structures
22181 should have 8-byte alignment.  This enables the use of pairs of
22182 @code{ldd} and @code{std} instructions for copies in structure
22183 assignment, in place of twice as many @code{ld} and @code{st} pairs.
22184 However, the use of this changed alignment directly violates the SPARC
22185 ABI@.  Thus, it's intended only for use on targets where the developer
22186 acknowledges that their resulting code is not directly in line with
22187 the rules of the ABI@.
22189 @item -mstd-struct-return
22190 @itemx -mno-std-struct-return
22191 @opindex mstd-struct-return
22192 @opindex mno-std-struct-return
22193 With @option{-mstd-struct-return}, the compiler generates checking code
22194 in functions returning structures or unions to detect size mismatches
22195 between the two sides of function calls, as per the 32-bit ABI@.
22197 The default is @option{-mno-std-struct-return}.  This option has no effect
22198 in 64-bit mode.
22200 @item -mcpu=@var{cpu_type}
22201 @opindex mcpu
22202 Set the instruction set, register set, and instruction scheduling parameters
22203 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
22204 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
22205 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
22206 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
22207 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
22208 @samp{niagara3}, @samp{niagara4} and @samp{niagara7}.
22210 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
22211 which selects the best architecture option for the host processor.
22212 @option{-mcpu=native} has no effect if GCC does not recognize
22213 the processor.
22215 Default instruction scheduling parameters are used for values that select
22216 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
22217 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
22219 Here is a list of each supported architecture and their supported
22220 implementations.
22222 @table @asis
22223 @item v7
22224 cypress, leon3v7
22226 @item v8
22227 supersparc, hypersparc, leon, leon3
22229 @item sparclite
22230 f930, f934, sparclite86x
22232 @item sparclet
22233 tsc701
22235 @item v9
22236 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4, niagara7
22237 @end table
22239 By default (unless configured otherwise), GCC generates code for the V7
22240 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
22241 additionally optimizes it for the Cypress CY7C602 chip, as used in the
22242 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
22243 SPARCStation 1, 2, IPX etc.
22245 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
22246 architecture.  The only difference from V7 code is that the compiler emits
22247 the integer multiply and integer divide instructions which exist in SPARC-V8
22248 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
22249 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
22250 2000 series.
22252 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
22253 the SPARC architecture.  This adds the integer multiply, integer divide step
22254 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
22255 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
22256 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
22257 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
22258 MB86934 chip, which is the more recent SPARClite with FPU@.
22260 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
22261 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
22262 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
22263 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
22264 optimizes it for the TEMIC SPARClet chip.
22266 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
22267 architecture.  This adds 64-bit integer and floating-point move instructions,
22268 3 additional floating-point condition code registers and conditional move
22269 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
22270 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
22271 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
22272 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
22273 @option{-mcpu=niagara}, the compiler additionally optimizes it for
22274 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
22275 additionally optimizes it for Sun UltraSPARC T2 chips. With
22276 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
22277 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
22278 additionally optimizes it for Sun UltraSPARC T4 chips.  With
22279 @option{-mcpu=niagara7}, the compiler additionally optimizes it for
22280 Oracle SPARC M7 chips.
22282 @item -mtune=@var{cpu_type}
22283 @opindex mtune
22284 Set the instruction scheduling parameters for machine type
22285 @var{cpu_type}, but do not set the instruction set or register set that the
22286 option @option{-mcpu=@var{cpu_type}} does.
22288 The same values for @option{-mcpu=@var{cpu_type}} can be used for
22289 @option{-mtune=@var{cpu_type}}, but the only useful values are those
22290 that select a particular CPU implementation.  Those are
22291 @samp{cypress}, @samp{supersparc}, @samp{hypersparc}, @samp{leon},
22292 @samp{leon3}, @samp{leon3v7}, @samp{f930}, @samp{f934},
22293 @samp{sparclite86x}, @samp{tsc701}, @samp{ultrasparc},
22294 @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2}, @samp{niagara3},
22295 @samp{niagara4} and @samp{niagara7}.  With native Solaris and
22296 GNU/Linux toolchains, @samp{native} can also be used.
22298 @item -mv8plus
22299 @itemx -mno-v8plus
22300 @opindex mv8plus
22301 @opindex mno-v8plus
22302 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
22303 difference from the V8 ABI is that the global and out registers are
22304 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
22305 mode for all SPARC-V9 processors.
22307 @item -mvis
22308 @itemx -mno-vis
22309 @opindex mvis
22310 @opindex mno-vis
22311 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
22312 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
22314 @item -mvis2
22315 @itemx -mno-vis2
22316 @opindex mvis2
22317 @opindex mno-vis2
22318 With @option{-mvis2}, GCC generates code that takes advantage of
22319 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
22320 default is @option{-mvis2} when targeting a cpu that supports such
22321 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
22322 also sets @option{-mvis}.
22324 @item -mvis3
22325 @itemx -mno-vis3
22326 @opindex mvis3
22327 @opindex mno-vis3
22328 With @option{-mvis3}, GCC generates code that takes advantage of
22329 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
22330 default is @option{-mvis3} when targeting a cpu that supports such
22331 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
22332 also sets @option{-mvis2} and @option{-mvis}.
22334 @item -mvis4
22335 @itemx -mno-vis4
22336 @opindex mvis4
22337 @opindex mno-vis4
22338 With @option{-mvis4}, GCC generates code that takes advantage of
22339 version 4.0 of the UltraSPARC Visual Instruction Set extensions.  The
22340 default is @option{-mvis4} when targeting a cpu that supports such
22341 instructions, such as niagara-7 and later.  Setting @option{-mvis4}
22342 also sets @option{-mvis3}, @option{-mvis2} and @option{-mvis}.
22344 @item -mcbcond
22345 @itemx -mno-cbcond
22346 @opindex mcbcond
22347 @opindex mno-cbcond
22348 With @option{-mcbcond}, GCC generates code that takes advantage of
22349 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
22350 The default is @option{-mcbcond} when targeting a cpu that supports such
22351 instructions, such as niagara-4 and later.
22353 @item -mpopc
22354 @itemx -mno-popc
22355 @opindex mpopc
22356 @opindex mno-popc
22357 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
22358 population count instruction.  The default is @option{-mpopc}
22359 when targeting a cpu that supports such instructions, such as Niagara-2 and
22360 later.
22362 @item -mfmaf
22363 @itemx -mno-fmaf
22364 @opindex mfmaf
22365 @opindex mno-fmaf
22366 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
22367 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
22368 when targeting a cpu that supports such instructions, such as Niagara-3 and
22369 later.
22371 @item -mfix-at697f
22372 @opindex mfix-at697f
22373 Enable the documented workaround for the single erratum of the Atmel AT697F
22374 processor (which corresponds to erratum #13 of the AT697E processor).
22376 @item -mfix-ut699
22377 @opindex mfix-ut699
22378 Enable the documented workarounds for the floating-point errata and the data
22379 cache nullify errata of the UT699 processor.
22380 @end table
22382 These @samp{-m} options are supported in addition to the above
22383 on SPARC-V9 processors in 64-bit environments:
22385 @table @gcctabopt
22386 @item -m32
22387 @itemx -m64
22388 @opindex m32
22389 @opindex m64
22390 Generate code for a 32-bit or 64-bit environment.
22391 The 32-bit environment sets int, long and pointer to 32 bits.
22392 The 64-bit environment sets int to 32 bits and long and pointer
22393 to 64 bits.
22395 @item -mcmodel=@var{which}
22396 @opindex mcmodel
22397 Set the code model to one of
22399 @table @samp
22400 @item medlow
22401 The Medium/Low code model: 64-bit addresses, programs
22402 must be linked in the low 32 bits of memory.  Programs can be statically
22403 or dynamically linked.
22405 @item medmid
22406 The Medium/Middle code model: 64-bit addresses, programs
22407 must be linked in the low 44 bits of memory, the text and data segments must
22408 be less than 2GB in size and the data segment must be located within 2GB of
22409 the text segment.
22411 @item medany
22412 The Medium/Anywhere code model: 64-bit addresses, programs
22413 may be linked anywhere in memory, the text and data segments must be less
22414 than 2GB in size and the data segment must be located within 2GB of the
22415 text segment.
22417 @item embmedany
22418 The Medium/Anywhere code model for embedded systems:
22419 64-bit addresses, the text and data segments must be less than 2GB in
22420 size, both starting anywhere in memory (determined at link time).  The
22421 global register %g4 points to the base of the data segment.  Programs
22422 are statically linked and PIC is not supported.
22423 @end table
22425 @item -mmemory-model=@var{mem-model}
22426 @opindex mmemory-model
22427 Set the memory model in force on the processor to one of
22429 @table @samp
22430 @item default
22431 The default memory model for the processor and operating system.
22433 @item rmo
22434 Relaxed Memory Order
22436 @item pso
22437 Partial Store Order
22439 @item tso
22440 Total Store Order
22442 @item sc
22443 Sequential Consistency
22444 @end table
22446 These memory models are formally defined in Appendix D of the Sparc V9
22447 architecture manual, as set in the processor's @code{PSTATE.MM} field.
22449 @item -mstack-bias
22450 @itemx -mno-stack-bias
22451 @opindex mstack-bias
22452 @opindex mno-stack-bias
22453 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
22454 frame pointer if present, are offset by @minus{}2047 which must be added back
22455 when making stack frame references.  This is the default in 64-bit mode.
22456 Otherwise, assume no such offset is present.
22457 @end table
22459 @node SPU Options
22460 @subsection SPU Options
22461 @cindex SPU options
22463 These @samp{-m} options are supported on the SPU:
22465 @table @gcctabopt
22466 @item -mwarn-reloc
22467 @itemx -merror-reloc
22468 @opindex mwarn-reloc
22469 @opindex merror-reloc
22471 The loader for SPU does not handle dynamic relocations.  By default, GCC
22472 gives an error when it generates code that requires a dynamic
22473 relocation.  @option{-mno-error-reloc} disables the error,
22474 @option{-mwarn-reloc} generates a warning instead.
22476 @item -msafe-dma
22477 @itemx -munsafe-dma
22478 @opindex msafe-dma
22479 @opindex munsafe-dma
22481 Instructions that initiate or test completion of DMA must not be
22482 reordered with respect to loads and stores of the memory that is being
22483 accessed.
22484 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
22485 memory accesses, but that can lead to inefficient code in places where the
22486 memory is known to not change.  Rather than mark the memory as volatile,
22487 you can use @option{-msafe-dma} to tell the compiler to treat
22488 the DMA instructions as potentially affecting all memory.  
22490 @item -mbranch-hints
22491 @opindex mbranch-hints
22493 By default, GCC generates a branch hint instruction to avoid
22494 pipeline stalls for always-taken or probably-taken branches.  A hint
22495 is not generated closer than 8 instructions away from its branch.
22496 There is little reason to disable them, except for debugging purposes,
22497 or to make an object a little bit smaller.
22499 @item -msmall-mem
22500 @itemx -mlarge-mem
22501 @opindex msmall-mem
22502 @opindex mlarge-mem
22504 By default, GCC generates code assuming that addresses are never larger
22505 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
22506 a full 32-bit address.
22508 @item -mstdmain
22509 @opindex mstdmain
22511 By default, GCC links against startup code that assumes the SPU-style
22512 main function interface (which has an unconventional parameter list).
22513 With @option{-mstdmain}, GCC links your program against startup
22514 code that assumes a C99-style interface to @code{main}, including a
22515 local copy of @code{argv} strings.
22517 @item -mfixed-range=@var{register-range}
22518 @opindex mfixed-range
22519 Generate code treating the given register range as fixed registers.
22520 A fixed register is one that the register allocator cannot use.  This is
22521 useful when compiling kernel code.  A register range is specified as
22522 two registers separated by a dash.  Multiple register ranges can be
22523 specified separated by a comma.
22525 @item -mea32
22526 @itemx -mea64
22527 @opindex mea32
22528 @opindex mea64
22529 Compile code assuming that pointers to the PPU address space accessed
22530 via the @code{__ea} named address space qualifier are either 32 or 64
22531 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
22532 all object code in an executable must be compiled with the same setting.
22534 @item -maddress-space-conversion
22535 @itemx -mno-address-space-conversion
22536 @opindex maddress-space-conversion
22537 @opindex mno-address-space-conversion
22538 Allow/disallow treating the @code{__ea} address space as superset
22539 of the generic address space.  This enables explicit type casts
22540 between @code{__ea} and generic pointer as well as implicit
22541 conversions of generic pointers to @code{__ea} pointers.  The
22542 default is to allow address space pointer conversions.
22544 @item -mcache-size=@var{cache-size}
22545 @opindex mcache-size
22546 This option controls the version of libgcc that the compiler links to an
22547 executable and selects a software-managed cache for accessing variables
22548 in the @code{__ea} address space with a particular cache size.  Possible
22549 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
22550 and @samp{128}.  The default cache size is 64KB.
22552 @item -matomic-updates
22553 @itemx -mno-atomic-updates
22554 @opindex matomic-updates
22555 @opindex mno-atomic-updates
22556 This option controls the version of libgcc that the compiler links to an
22557 executable and selects whether atomic updates to the software-managed
22558 cache of PPU-side variables are used.  If you use atomic updates, changes
22559 to a PPU variable from SPU code using the @code{__ea} named address space
22560 qualifier do not interfere with changes to other PPU variables residing
22561 in the same cache line from PPU code.  If you do not use atomic updates,
22562 such interference may occur; however, writing back cache lines is
22563 more efficient.  The default behavior is to use atomic updates.
22565 @item -mdual-nops
22566 @itemx -mdual-nops=@var{n}
22567 @opindex mdual-nops
22568 By default, GCC inserts nops to increase dual issue when it expects
22569 it to increase performance.  @var{n} can be a value from 0 to 10.  A
22570 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
22571 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
22573 @item -mhint-max-nops=@var{n}
22574 @opindex mhint-max-nops
22575 Maximum number of nops to insert for a branch hint.  A branch hint must
22576 be at least 8 instructions away from the branch it is affecting.  GCC
22577 inserts up to @var{n} nops to enforce this, otherwise it does not
22578 generate the branch hint.
22580 @item -mhint-max-distance=@var{n}
22581 @opindex mhint-max-distance
22582 The encoding of the branch hint instruction limits the hint to be within
22583 256 instructions of the branch it is affecting.  By default, GCC makes
22584 sure it is within 125.
22586 @item -msafe-hints
22587 @opindex msafe-hints
22588 Work around a hardware bug that causes the SPU to stall indefinitely.
22589 By default, GCC inserts the @code{hbrp} instruction to make sure
22590 this stall won't happen.
22592 @end table
22594 @node System V Options
22595 @subsection Options for System V
22597 These additional options are available on System V Release 4 for
22598 compatibility with other compilers on those systems:
22600 @table @gcctabopt
22601 @item -G
22602 @opindex G
22603 Create a shared object.
22604 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
22606 @item -Qy
22607 @opindex Qy
22608 Identify the versions of each tool used by the compiler, in a
22609 @code{.ident} assembler directive in the output.
22611 @item -Qn
22612 @opindex Qn
22613 Refrain from adding @code{.ident} directives to the output file (this is
22614 the default).
22616 @item -YP,@var{dirs}
22617 @opindex YP
22618 Search the directories @var{dirs}, and no others, for libraries
22619 specified with @option{-l}.
22621 @item -Ym,@var{dir}
22622 @opindex Ym
22623 Look in the directory @var{dir} to find the M4 preprocessor.
22624 The assembler uses this option.
22625 @c This is supposed to go with a -Yd for predefined M4 macro files, but
22626 @c the generic assembler that comes with Solaris takes just -Ym.
22627 @end table
22629 @node TILE-Gx Options
22630 @subsection TILE-Gx Options
22631 @cindex TILE-Gx options
22633 These @samp{-m} options are supported on the TILE-Gx:
22635 @table @gcctabopt
22636 @item -mcmodel=small
22637 @opindex mcmodel=small
22638 Generate code for the small model.  The distance for direct calls is
22639 limited to 500M in either direction.  PC-relative addresses are 32
22640 bits.  Absolute addresses support the full address range.
22642 @item -mcmodel=large
22643 @opindex mcmodel=large
22644 Generate code for the large model.  There is no limitation on call
22645 distance, pc-relative addresses, or absolute addresses.
22647 @item -mcpu=@var{name}
22648 @opindex mcpu
22649 Selects the type of CPU to be targeted.  Currently the only supported
22650 type is @samp{tilegx}.
22652 @item -m32
22653 @itemx -m64
22654 @opindex m32
22655 @opindex m64
22656 Generate code for a 32-bit or 64-bit environment.  The 32-bit
22657 environment sets int, long, and pointer to 32 bits.  The 64-bit
22658 environment sets int to 32 bits and long and pointer to 64 bits.
22660 @item -mbig-endian
22661 @itemx -mlittle-endian
22662 @opindex mbig-endian
22663 @opindex mlittle-endian
22664 Generate code in big/little endian mode, respectively.
22665 @end table
22667 @node TILEPro Options
22668 @subsection TILEPro Options
22669 @cindex TILEPro options
22671 These @samp{-m} options are supported on the TILEPro:
22673 @table @gcctabopt
22674 @item -mcpu=@var{name}
22675 @opindex mcpu
22676 Selects the type of CPU to be targeted.  Currently the only supported
22677 type is @samp{tilepro}.
22679 @item -m32
22680 @opindex m32
22681 Generate code for a 32-bit environment, which sets int, long, and
22682 pointer to 32 bits.  This is the only supported behavior so the flag
22683 is essentially ignored.
22684 @end table
22686 @node V850 Options
22687 @subsection V850 Options
22688 @cindex V850 Options
22690 These @samp{-m} options are defined for V850 implementations:
22692 @table @gcctabopt
22693 @item -mlong-calls
22694 @itemx -mno-long-calls
22695 @opindex mlong-calls
22696 @opindex mno-long-calls
22697 Treat all calls as being far away (near).  If calls are assumed to be
22698 far away, the compiler always loads the function's address into a
22699 register, and calls indirect through the pointer.
22701 @item -mno-ep
22702 @itemx -mep
22703 @opindex mno-ep
22704 @opindex mep
22705 Do not optimize (do optimize) basic blocks that use the same index
22706 pointer 4 or more times to copy pointer into the @code{ep} register, and
22707 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
22708 option is on by default if you optimize.
22710 @item -mno-prolog-function
22711 @itemx -mprolog-function
22712 @opindex mno-prolog-function
22713 @opindex mprolog-function
22714 Do not use (do use) external functions to save and restore registers
22715 at the prologue and epilogue of a function.  The external functions
22716 are slower, but use less code space if more than one function saves
22717 the same number of registers.  The @option{-mprolog-function} option
22718 is on by default if you optimize.
22720 @item -mspace
22721 @opindex mspace
22722 Try to make the code as small as possible.  At present, this just turns
22723 on the @option{-mep} and @option{-mprolog-function} options.
22725 @item -mtda=@var{n}
22726 @opindex mtda
22727 Put static or global variables whose size is @var{n} bytes or less into
22728 the tiny data area that register @code{ep} points to.  The tiny data
22729 area can hold up to 256 bytes in total (128 bytes for byte references).
22731 @item -msda=@var{n}
22732 @opindex msda
22733 Put static or global variables whose size is @var{n} bytes or less into
22734 the small data area that register @code{gp} points to.  The small data
22735 area can hold up to 64 kilobytes.
22737 @item -mzda=@var{n}
22738 @opindex mzda
22739 Put static or global variables whose size is @var{n} bytes or less into
22740 the first 32 kilobytes of memory.
22742 @item -mv850
22743 @opindex mv850
22744 Specify that the target processor is the V850.
22746 @item -mv850e3v5
22747 @opindex mv850e3v5
22748 Specify that the target processor is the V850E3V5.  The preprocessor
22749 constant @code{__v850e3v5__} is defined if this option is used.
22751 @item -mv850e2v4
22752 @opindex mv850e2v4
22753 Specify that the target processor is the V850E3V5.  This is an alias for
22754 the @option{-mv850e3v5} option.
22756 @item -mv850e2v3
22757 @opindex mv850e2v3
22758 Specify that the target processor is the V850E2V3.  The preprocessor
22759 constant @code{__v850e2v3__} is defined if this option is used.
22761 @item -mv850e2
22762 @opindex mv850e2
22763 Specify that the target processor is the V850E2.  The preprocessor
22764 constant @code{__v850e2__} is defined if this option is used.
22766 @item -mv850e1
22767 @opindex mv850e1
22768 Specify that the target processor is the V850E1.  The preprocessor
22769 constants @code{__v850e1__} and @code{__v850e__} are defined if
22770 this option is used.
22772 @item -mv850es
22773 @opindex mv850es
22774 Specify that the target processor is the V850ES.  This is an alias for
22775 the @option{-mv850e1} option.
22777 @item -mv850e
22778 @opindex mv850e
22779 Specify that the target processor is the V850E@.  The preprocessor
22780 constant @code{__v850e__} is defined if this option is used.
22782 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
22783 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
22784 are defined then a default target processor is chosen and the
22785 relevant @samp{__v850*__} preprocessor constant is defined.
22787 The preprocessor constants @code{__v850} and @code{__v851__} are always
22788 defined, regardless of which processor variant is the target.
22790 @item -mdisable-callt
22791 @itemx -mno-disable-callt
22792 @opindex mdisable-callt
22793 @opindex mno-disable-callt
22794 This option suppresses generation of the @code{CALLT} instruction for the
22795 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
22796 architecture.
22798 This option is enabled by default when the RH850 ABI is
22799 in use (see @option{-mrh850-abi}), and disabled by default when the
22800 GCC ABI is in use.  If @code{CALLT} instructions are being generated
22801 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
22803 @item -mrelax
22804 @itemx -mno-relax
22805 @opindex mrelax
22806 @opindex mno-relax
22807 Pass on (or do not pass on) the @option{-mrelax} command-line option
22808 to the assembler.
22810 @item -mlong-jumps
22811 @itemx -mno-long-jumps
22812 @opindex mlong-jumps
22813 @opindex mno-long-jumps
22814 Disable (or re-enable) the generation of PC-relative jump instructions.
22816 @item -msoft-float
22817 @itemx -mhard-float
22818 @opindex msoft-float
22819 @opindex mhard-float
22820 Disable (or re-enable) the generation of hardware floating point
22821 instructions.  This option is only significant when the target
22822 architecture is @samp{V850E2V3} or higher.  If hardware floating point
22823 instructions are being generated then the C preprocessor symbol
22824 @code{__FPU_OK__} is defined, otherwise the symbol
22825 @code{__NO_FPU__} is defined.
22827 @item -mloop
22828 @opindex mloop
22829 Enables the use of the e3v5 LOOP instruction.  The use of this
22830 instruction is not enabled by default when the e3v5 architecture is
22831 selected because its use is still experimental.
22833 @item -mrh850-abi
22834 @itemx -mghs
22835 @opindex mrh850-abi
22836 @opindex mghs
22837 Enables support for the RH850 version of the V850 ABI.  This is the
22838 default.  With this version of the ABI the following rules apply:
22840 @itemize
22841 @item
22842 Integer sized structures and unions are returned via a memory pointer
22843 rather than a register.
22845 @item
22846 Large structures and unions (more than 8 bytes in size) are passed by
22847 value.
22849 @item
22850 Functions are aligned to 16-bit boundaries.
22852 @item
22853 The @option{-m8byte-align} command-line option is supported.
22855 @item
22856 The @option{-mdisable-callt} command-line option is enabled by
22857 default.  The @option{-mno-disable-callt} command-line option is not
22858 supported.
22859 @end itemize
22861 When this version of the ABI is enabled the C preprocessor symbol
22862 @code{__V850_RH850_ABI__} is defined.
22864 @item -mgcc-abi
22865 @opindex mgcc-abi
22866 Enables support for the old GCC version of the V850 ABI.  With this
22867 version of the ABI the following rules apply:
22869 @itemize
22870 @item
22871 Integer sized structures and unions are returned in register @code{r10}.
22873 @item
22874 Large structures and unions (more than 8 bytes in size) are passed by
22875 reference.
22877 @item
22878 Functions are aligned to 32-bit boundaries, unless optimizing for
22879 size.
22881 @item
22882 The @option{-m8byte-align} command-line option is not supported.
22884 @item
22885 The @option{-mdisable-callt} command-line option is supported but not
22886 enabled by default.
22887 @end itemize
22889 When this version of the ABI is enabled the C preprocessor symbol
22890 @code{__V850_GCC_ABI__} is defined.
22892 @item -m8byte-align
22893 @itemx -mno-8byte-align
22894 @opindex m8byte-align
22895 @opindex mno-8byte-align
22896 Enables support for @code{double} and @code{long long} types to be
22897 aligned on 8-byte boundaries.  The default is to restrict the
22898 alignment of all objects to at most 4-bytes.  When
22899 @option{-m8byte-align} is in effect the C preprocessor symbol
22900 @code{__V850_8BYTE_ALIGN__} is defined.
22902 @item -mbig-switch
22903 @opindex mbig-switch
22904 Generate code suitable for big switch tables.  Use this option only if
22905 the assembler/linker complain about out of range branches within a switch
22906 table.
22908 @item -mapp-regs
22909 @opindex mapp-regs
22910 This option causes r2 and r5 to be used in the code generated by
22911 the compiler.  This setting is the default.
22913 @item -mno-app-regs
22914 @opindex mno-app-regs
22915 This option causes r2 and r5 to be treated as fixed registers.
22917 @end table
22919 @node VAX Options
22920 @subsection VAX Options
22921 @cindex VAX options
22923 These @samp{-m} options are defined for the VAX:
22925 @table @gcctabopt
22926 @item -munix
22927 @opindex munix
22928 Do not output certain jump instructions (@code{aobleq} and so on)
22929 that the Unix assembler for the VAX cannot handle across long
22930 ranges.
22932 @item -mgnu
22933 @opindex mgnu
22934 Do output those jump instructions, on the assumption that the
22935 GNU assembler is being used.
22937 @item -mg
22938 @opindex mg
22939 Output code for G-format floating-point numbers instead of D-format.
22940 @end table
22942 @node Visium Options
22943 @subsection Visium Options
22944 @cindex Visium options
22946 @table @gcctabopt
22948 @item -mdebug
22949 @opindex mdebug
22950 A program which performs file I/O and is destined to run on an MCM target
22951 should be linked with this option.  It causes the libraries libc.a and
22952 libdebug.a to be linked.  The program should be run on the target under
22953 the control of the GDB remote debugging stub.
22955 @item -msim
22956 @opindex msim
22957 A program which performs file I/O and is destined to run on the simulator
22958 should be linked with option.  This causes libraries libc.a and libsim.a to
22959 be linked.
22961 @item -mfpu
22962 @itemx -mhard-float
22963 @opindex mfpu
22964 @opindex mhard-float
22965 Generate code containing floating-point instructions.  This is the
22966 default.
22968 @item -mno-fpu
22969 @itemx -msoft-float
22970 @opindex mno-fpu
22971 @opindex msoft-float
22972 Generate code containing library calls for floating-point.
22974 @option{-msoft-float} changes the calling convention in the output file;
22975 therefore, it is only useful if you compile @emph{all} of a program with
22976 this option.  In particular, you need to compile @file{libgcc.a}, the
22977 library that comes with GCC, with @option{-msoft-float} in order for
22978 this to work.
22980 @item -mcpu=@var{cpu_type}
22981 @opindex mcpu
22982 Set the instruction set, register set, and instruction scheduling parameters
22983 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
22984 @samp{mcm}, @samp{gr5} and @samp{gr6}.
22986 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
22988 By default (unless configured otherwise), GCC generates code for the GR5
22989 variant of the Visium architecture.  
22991 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
22992 architecture.  The only difference from GR5 code is that the compiler will
22993 generate block move instructions.
22995 @item -mtune=@var{cpu_type}
22996 @opindex mtune
22997 Set the instruction scheduling parameters for machine type @var{cpu_type},
22998 but do not set the instruction set or register set that the option
22999 @option{-mcpu=@var{cpu_type}} would.
23001 @item -msv-mode
23002 @opindex msv-mode
23003 Generate code for the supervisor mode, where there are no restrictions on
23004 the access to general registers.  This is the default.
23006 @item -muser-mode
23007 @opindex muser-mode
23008 Generate code for the user mode, where the access to some general registers
23009 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
23010 mode; on the GR6, only registers r29 to r31 are affected.
23011 @end table
23013 @node VMS Options
23014 @subsection VMS Options
23016 These @samp{-m} options are defined for the VMS implementations:
23018 @table @gcctabopt
23019 @item -mvms-return-codes
23020 @opindex mvms-return-codes
23021 Return VMS condition codes from @code{main}. The default is to return POSIX-style
23022 condition (e.g.@ error) codes.
23024 @item -mdebug-main=@var{prefix}
23025 @opindex mdebug-main=@var{prefix}
23026 Flag the first routine whose name starts with @var{prefix} as the main
23027 routine for the debugger.
23029 @item -mmalloc64
23030 @opindex mmalloc64
23031 Default to 64-bit memory allocation routines.
23033 @item -mpointer-size=@var{size}
23034 @opindex mpointer-size=@var{size}
23035 Set the default size of pointers. Possible options for @var{size} are
23036 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
23037 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
23038 The later option disables @code{pragma pointer_size}.
23039 @end table
23041 @node VxWorks Options
23042 @subsection VxWorks Options
23043 @cindex VxWorks Options
23045 The options in this section are defined for all VxWorks targets.
23046 Options specific to the target hardware are listed with the other
23047 options for that target.
23049 @table @gcctabopt
23050 @item -mrtp
23051 @opindex mrtp
23052 GCC can generate code for both VxWorks kernels and real time processes
23053 (RTPs).  This option switches from the former to the latter.  It also
23054 defines the preprocessor macro @code{__RTP__}.
23056 @item -non-static
23057 @opindex non-static
23058 Link an RTP executable against shared libraries rather than static
23059 libraries.  The options @option{-static} and @option{-shared} can
23060 also be used for RTPs (@pxref{Link Options}); @option{-static}
23061 is the default.
23063 @item -Bstatic
23064 @itemx -Bdynamic
23065 @opindex Bstatic
23066 @opindex Bdynamic
23067 These options are passed down to the linker.  They are defined for
23068 compatibility with Diab.
23070 @item -Xbind-lazy
23071 @opindex Xbind-lazy
23072 Enable lazy binding of function calls.  This option is equivalent to
23073 @option{-Wl,-z,now} and is defined for compatibility with Diab.
23075 @item -Xbind-now
23076 @opindex Xbind-now
23077 Disable lazy binding of function calls.  This option is the default and
23078 is defined for compatibility with Diab.
23079 @end table
23081 @node x86 Options
23082 @subsection x86 Options
23083 @cindex x86 Options
23085 These @samp{-m} options are defined for the x86 family of computers.
23087 @table @gcctabopt
23089 @item -march=@var{cpu-type}
23090 @opindex march
23091 Generate instructions for the machine type @var{cpu-type}.  In contrast to
23092 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
23093 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
23094 to generate code that may not run at all on processors other than the one
23095 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
23096 @option{-mtune=@var{cpu-type}}.
23098 The choices for @var{cpu-type} are:
23100 @table @samp
23101 @item native
23102 This selects the CPU to generate code for at compilation time by determining
23103 the processor type of the compiling machine.  Using @option{-march=native}
23104 enables all instruction subsets supported by the local machine (hence
23105 the result might not run on different machines).  Using @option{-mtune=native}
23106 produces code optimized for the local machine under the constraints
23107 of the selected instruction set.  
23109 @item i386
23110 Original Intel i386 CPU@.
23112 @item i486
23113 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
23115 @item i586
23116 @itemx pentium
23117 Intel Pentium CPU with no MMX support.
23119 @item lakemont
23120 Intel Lakemont MCU, based on Intel Pentium CPU.
23122 @item pentium-mmx
23123 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
23125 @item pentiumpro
23126 Intel Pentium Pro CPU@.
23128 @item i686
23129 When used with @option{-march}, the Pentium Pro
23130 instruction set is used, so the code runs on all i686 family chips.
23131 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
23133 @item pentium2
23134 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
23135 support.
23137 @item pentium3
23138 @itemx pentium3m
23139 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
23140 set support.
23142 @item pentium-m
23143 Intel Pentium M; low-power version of Intel Pentium III CPU
23144 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
23146 @item pentium4
23147 @itemx pentium4m
23148 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
23150 @item prescott
23151 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
23152 set support.
23154 @item nocona
23155 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
23156 SSE2 and SSE3 instruction set support.
23158 @item core2
23159 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
23160 instruction set support.
23162 @item nehalem
23163 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23164 SSE4.1, SSE4.2 and POPCNT instruction set support.
23166 @item westmere
23167 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23168 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
23170 @item sandybridge
23171 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23172 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
23174 @item ivybridge
23175 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23176 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
23177 instruction set support.
23179 @item haswell
23180 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23181 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23182 BMI, BMI2 and F16C instruction set support.
23184 @item broadwell
23185 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23186 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23187 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
23189 @item skylake
23190 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23191 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23192 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
23193 XSAVES instruction set support.
23195 @item bonnell
23196 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
23197 instruction set support.
23199 @item silvermont
23200 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23201 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
23203 @item knl
23204 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
23205 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23206 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
23207 AVX512CD instruction set support.
23209 @item skylake-avx512
23210 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
23211 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23212 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
23213 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
23215 @item k6
23216 AMD K6 CPU with MMX instruction set support.
23218 @item k6-2
23219 @itemx k6-3
23220 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
23222 @item athlon
23223 @itemx athlon-tbird
23224 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
23225 support.
23227 @item athlon-4
23228 @itemx athlon-xp
23229 @itemx athlon-mp
23230 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
23231 instruction set support.
23233 @item k8
23234 @itemx opteron
23235 @itemx athlon64
23236 @itemx athlon-fx
23237 Processors based on the AMD K8 core with x86-64 instruction set support,
23238 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
23239 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
23240 instruction set extensions.)
23242 @item k8-sse3
23243 @itemx opteron-sse3
23244 @itemx athlon64-sse3
23245 Improved versions of AMD K8 cores with SSE3 instruction set support.
23247 @item amdfam10
23248 @itemx barcelona
23249 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
23250 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
23251 instruction set extensions.)
23253 @item bdver1
23254 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
23255 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
23256 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
23257 @item bdver2
23258 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23259 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
23260 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
23261 extensions.)
23262 @item bdver3
23263 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23264 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
23265 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
23266 64-bit instruction set extensions.
23267 @item bdver4
23268 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23269 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
23270 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
23271 SSE4.2, ABM and 64-bit instruction set extensions.
23273 @item znver1
23274 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
23275 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
23276 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
23277 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
23278 instruction set extensions.
23280 @item btver1
23281 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
23282 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
23283 instruction set extensions.)
23285 @item btver2
23286 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
23287 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
23288 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
23290 @item winchip-c6
23291 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
23292 set support.
23294 @item winchip2
23295 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
23296 instruction set support.
23298 @item c3
23299 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
23300 implemented for this chip.)
23302 @item c3-2
23303 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
23304 (No scheduling is
23305 implemented for this chip.)
23307 @item geode
23308 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
23309 @end table
23311 @item -mtune=@var{cpu-type}
23312 @opindex mtune
23313 Tune to @var{cpu-type} everything applicable about the generated code, except
23314 for the ABI and the set of available instructions.  
23315 While picking a specific @var{cpu-type} schedules things appropriately
23316 for that particular chip, the compiler does not generate any code that
23317 cannot run on the default machine type unless you use a
23318 @option{-march=@var{cpu-type}} option.
23319 For example, if GCC is configured for i686-pc-linux-gnu
23320 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
23321 but still runs on i686 machines.
23323 The choices for @var{cpu-type} are the same as for @option{-march}.
23324 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
23326 @table @samp
23327 @item generic
23328 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
23329 If you know the CPU on which your code will run, then you should use
23330 the corresponding @option{-mtune} or @option{-march} option instead of
23331 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
23332 of your application will have, then you should use this option.
23334 As new processors are deployed in the marketplace, the behavior of this
23335 option will change.  Therefore, if you upgrade to a newer version of
23336 GCC, code generation controlled by this option will change to reflect
23337 the processors
23338 that are most common at the time that version of GCC is released.
23340 There is no @option{-march=generic} option because @option{-march}
23341 indicates the instruction set the compiler can use, and there is no
23342 generic instruction set applicable to all processors.  In contrast,
23343 @option{-mtune} indicates the processor (or, in this case, collection of
23344 processors) for which the code is optimized.
23346 @item intel
23347 Produce code optimized for the most current Intel processors, which are
23348 Haswell and Silvermont for this version of GCC.  If you know the CPU
23349 on which your code will run, then you should use the corresponding
23350 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
23351 But, if you want your application performs better on both Haswell and
23352 Silvermont, then you should use this option.
23354 As new Intel processors are deployed in the marketplace, the behavior of
23355 this option will change.  Therefore, if you upgrade to a newer version of
23356 GCC, code generation controlled by this option will change to reflect
23357 the most current Intel processors at the time that version of GCC is
23358 released.
23360 There is no @option{-march=intel} option because @option{-march} indicates
23361 the instruction set the compiler can use, and there is no common
23362 instruction set applicable to all processors.  In contrast,
23363 @option{-mtune} indicates the processor (or, in this case, collection of
23364 processors) for which the code is optimized.
23365 @end table
23367 @item -mcpu=@var{cpu-type}
23368 @opindex mcpu
23369 A deprecated synonym for @option{-mtune}.
23371 @item -mfpmath=@var{unit}
23372 @opindex mfpmath
23373 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
23374 for @var{unit} are:
23376 @table @samp
23377 @item 387
23378 Use the standard 387 floating-point coprocessor present on the majority of chips and
23379 emulated otherwise.  Code compiled with this option runs almost everywhere.
23380 The temporary results are computed in 80-bit precision instead of the precision
23381 specified by the type, resulting in slightly different results compared to most
23382 of other chips.  See @option{-ffloat-store} for more detailed description.
23384 This is the default choice for x86-32 targets.
23386 @item sse
23387 Use scalar floating-point instructions present in the SSE instruction set.
23388 This instruction set is supported by Pentium III and newer chips,
23389 and in the AMD line
23390 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
23391 instruction set supports only single-precision arithmetic, thus the double and
23392 extended-precision arithmetic are still done using 387.  A later version, present
23393 only in Pentium 4 and AMD x86-64 chips, supports double-precision
23394 arithmetic too.
23396 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
23397 or @option{-msse2} switches to enable SSE extensions and make this option
23398 effective.  For the x86-64 compiler, these extensions are enabled by default.
23400 The resulting code should be considerably faster in the majority of cases and avoid
23401 the numerical instability problems of 387 code, but may break some existing
23402 code that expects temporaries to be 80 bits.
23404 This is the default choice for the x86-64 compiler.
23406 @item sse,387
23407 @itemx sse+387
23408 @itemx both
23409 Attempt to utilize both instruction sets at once.  This effectively doubles the
23410 amount of available registers, and on chips with separate execution units for
23411 387 and SSE the execution resources too.  Use this option with care, as it is
23412 still experimental, because the GCC register allocator does not model separate
23413 functional units well, resulting in unstable performance.
23414 @end table
23416 @item -masm=@var{dialect}
23417 @opindex masm=@var{dialect}
23418 Output assembly instructions using selected @var{dialect}.  Also affects
23419 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
23420 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
23421 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
23422 not support @samp{intel}.
23424 @item -mieee-fp
23425 @itemx -mno-ieee-fp
23426 @opindex mieee-fp
23427 @opindex mno-ieee-fp
23428 Control whether or not the compiler uses IEEE floating-point
23429 comparisons.  These correctly handle the case where the result of a
23430 comparison is unordered.
23432 @item -msoft-float
23433 @opindex msoft-float
23434 Generate output containing library calls for floating point.
23436 @strong{Warning:} the requisite libraries are not part of GCC@.
23437 Normally the facilities of the machine's usual C compiler are used, but
23438 this can't be done directly in cross-compilation.  You must make your
23439 own arrangements to provide suitable library functions for
23440 cross-compilation.
23442 On machines where a function returns floating-point results in the 80387
23443 register stack, some floating-point opcodes may be emitted even if
23444 @option{-msoft-float} is used.
23446 @item -mno-fp-ret-in-387
23447 @opindex mno-fp-ret-in-387
23448 Do not use the FPU registers for return values of functions.
23450 The usual calling convention has functions return values of types
23451 @code{float} and @code{double} in an FPU register, even if there
23452 is no FPU@.  The idea is that the operating system should emulate
23453 an FPU@.
23455 The option @option{-mno-fp-ret-in-387} causes such values to be returned
23456 in ordinary CPU registers instead.
23458 @item -mno-fancy-math-387
23459 @opindex mno-fancy-math-387
23460 Some 387 emulators do not support the @code{sin}, @code{cos} and
23461 @code{sqrt} instructions for the 387.  Specify this option to avoid
23462 generating those instructions.  This option is the default on
23463 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
23464 indicates that the target CPU always has an FPU and so the
23465 instruction does not need emulation.  These
23466 instructions are not generated unless you also use the
23467 @option{-funsafe-math-optimizations} switch.
23469 @item -malign-double
23470 @itemx -mno-align-double
23471 @opindex malign-double
23472 @opindex mno-align-double
23473 Control whether GCC aligns @code{double}, @code{long double}, and
23474 @code{long long} variables on a two-word boundary or a one-word
23475 boundary.  Aligning @code{double} variables on a two-word boundary
23476 produces code that runs somewhat faster on a Pentium at the
23477 expense of more memory.
23479 On x86-64, @option{-malign-double} is enabled by default.
23481 @strong{Warning:} if you use the @option{-malign-double} switch,
23482 structures containing the above types are aligned differently than
23483 the published application binary interface specifications for the x86-32
23484 and are not binary compatible with structures in code compiled
23485 without that switch.
23487 @item -m96bit-long-double
23488 @itemx -m128bit-long-double
23489 @opindex m96bit-long-double
23490 @opindex m128bit-long-double
23491 These switches control the size of @code{long double} type.  The x86-32
23492 application binary interface specifies the size to be 96 bits,
23493 so @option{-m96bit-long-double} is the default in 32-bit mode.
23495 Modern architectures (Pentium and newer) prefer @code{long double}
23496 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
23497 conforming to the ABI, this is not possible.  So specifying
23498 @option{-m128bit-long-double} aligns @code{long double}
23499 to a 16-byte boundary by padding the @code{long double} with an additional
23500 32-bit zero.
23502 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
23503 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
23505 Notice that neither of these options enable any extra precision over the x87
23506 standard of 80 bits for a @code{long double}.
23508 @strong{Warning:} if you override the default value for your target ABI, this
23509 changes the size of 
23510 structures and arrays containing @code{long double} variables,
23511 as well as modifying the function calling convention for functions taking
23512 @code{long double}.  Hence they are not binary-compatible
23513 with code compiled without that switch.
23515 @item -mlong-double-64
23516 @itemx -mlong-double-80
23517 @itemx -mlong-double-128
23518 @opindex mlong-double-64
23519 @opindex mlong-double-80
23520 @opindex mlong-double-128
23521 These switches control the size of @code{long double} type. A size
23522 of 64 bits makes the @code{long double} type equivalent to the @code{double}
23523 type. This is the default for 32-bit Bionic C library.  A size
23524 of 128 bits makes the @code{long double} type equivalent to the
23525 @code{__float128} type. This is the default for 64-bit Bionic C library.
23527 @strong{Warning:} if you override the default value for your target ABI, this
23528 changes the size of
23529 structures and arrays containing @code{long double} variables,
23530 as well as modifying the function calling convention for functions taking
23531 @code{long double}.  Hence they are not binary-compatible
23532 with code compiled without that switch.
23534 @item -malign-data=@var{type}
23535 @opindex malign-data
23536 Control how GCC aligns variables.  Supported values for @var{type} are
23537 @samp{compat} uses increased alignment value compatible uses GCC 4.8
23538 and earlier, @samp{abi} uses alignment value as specified by the
23539 psABI, and @samp{cacheline} uses increased alignment value to match
23540 the cache line size.  @samp{compat} is the default.
23542 @item -mlarge-data-threshold=@var{threshold}
23543 @opindex mlarge-data-threshold
23544 When @option{-mcmodel=medium} is specified, data objects larger than
23545 @var{threshold} are placed in the large data section.  This value must be the
23546 same across all objects linked into the binary, and defaults to 65535.
23548 @item -mrtd
23549 @opindex mrtd
23550 Use a different function-calling convention, in which functions that
23551 take a fixed number of arguments return with the @code{ret @var{num}}
23552 instruction, which pops their arguments while returning.  This saves one
23553 instruction in the caller since there is no need to pop the arguments
23554 there.
23556 You can specify that an individual function is called with this calling
23557 sequence with the function attribute @code{stdcall}.  You can also
23558 override the @option{-mrtd} option by using the function attribute
23559 @code{cdecl}.  @xref{Function Attributes}.
23561 @strong{Warning:} this calling convention is incompatible with the one
23562 normally used on Unix, so you cannot use it if you need to call
23563 libraries compiled with the Unix compiler.
23565 Also, you must provide function prototypes for all functions that
23566 take variable numbers of arguments (including @code{printf});
23567 otherwise incorrect code is generated for calls to those
23568 functions.
23570 In addition, seriously incorrect code results if you call a
23571 function with too many arguments.  (Normally, extra arguments are
23572 harmlessly ignored.)
23574 @item -mregparm=@var{num}
23575 @opindex mregparm
23576 Control how many registers are used to pass integer arguments.  By
23577 default, no registers are used to pass arguments, and at most 3
23578 registers can be used.  You can control this behavior for a specific
23579 function by using the function attribute @code{regparm}.
23580 @xref{Function Attributes}.
23582 @strong{Warning:} if you use this switch, and
23583 @var{num} is nonzero, then you must build all modules with the same
23584 value, including any libraries.  This includes the system libraries and
23585 startup modules.
23587 @item -msseregparm
23588 @opindex msseregparm
23589 Use SSE register passing conventions for float and double arguments
23590 and return values.  You can control this behavior for a specific
23591 function by using the function attribute @code{sseregparm}.
23592 @xref{Function Attributes}.
23594 @strong{Warning:} if you use this switch then you must build all
23595 modules with the same value, including any libraries.  This includes
23596 the system libraries and startup modules.
23598 @item -mvect8-ret-in-mem
23599 @opindex mvect8-ret-in-mem
23600 Return 8-byte vectors in memory instead of MMX registers.  This is the
23601 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
23602 Studio compilers until version 12.  Later compiler versions (starting
23603 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
23604 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
23605 you need to remain compatible with existing code produced by those
23606 previous compiler versions or older versions of GCC@.
23608 @item -mpc32
23609 @itemx -mpc64
23610 @itemx -mpc80
23611 @opindex mpc32
23612 @opindex mpc64
23613 @opindex mpc80
23615 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
23616 is specified, the significands of results of floating-point operations are
23617 rounded to 24 bits (single precision); @option{-mpc64} rounds the
23618 significands of results of floating-point operations to 53 bits (double
23619 precision) and @option{-mpc80} rounds the significands of results of
23620 floating-point operations to 64 bits (extended double precision), which is
23621 the default.  When this option is used, floating-point operations in higher
23622 precisions are not available to the programmer without setting the FPU
23623 control word explicitly.
23625 Setting the rounding of floating-point operations to less than the default
23626 80 bits can speed some programs by 2% or more.  Note that some mathematical
23627 libraries assume that extended-precision (80-bit) floating-point operations
23628 are enabled by default; routines in such libraries could suffer significant
23629 loss of accuracy, typically through so-called ``catastrophic cancellation'',
23630 when this option is used to set the precision to less than extended precision.
23632 @item -mstackrealign
23633 @opindex mstackrealign
23634 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
23635 option generates an alternate prologue and epilogue that realigns the
23636 run-time stack if necessary.  This supports mixing legacy codes that keep
23637 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
23638 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
23639 applicable to individual functions.
23641 @item -mpreferred-stack-boundary=@var{num}
23642 @opindex mpreferred-stack-boundary
23643 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
23644 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
23645 the default is 4 (16 bytes or 128 bits).
23647 @strong{Warning:} When generating code for the x86-64 architecture with
23648 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
23649 used to keep the stack boundary aligned to 8 byte boundary.  Since
23650 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
23651 intended to be used in controlled environment where stack space is
23652 important limitation.  This option leads to wrong code when functions
23653 compiled with 16 byte stack alignment (such as functions from a standard
23654 library) are called with misaligned stack.  In this case, SSE
23655 instructions may lead to misaligned memory access traps.  In addition,
23656 variable arguments are handled incorrectly for 16 byte aligned
23657 objects (including x87 long double and __int128), leading to wrong
23658 results.  You must build all modules with
23659 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
23660 includes the system libraries and startup modules.
23662 @item -mincoming-stack-boundary=@var{num}
23663 @opindex mincoming-stack-boundary
23664 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
23665 boundary.  If @option{-mincoming-stack-boundary} is not specified,
23666 the one specified by @option{-mpreferred-stack-boundary} is used.
23668 On Pentium and Pentium Pro, @code{double} and @code{long double} values
23669 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
23670 suffer significant run time performance penalties.  On Pentium III, the
23671 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
23672 properly if it is not 16-byte aligned.
23674 To ensure proper alignment of this values on the stack, the stack boundary
23675 must be as aligned as that required by any value stored on the stack.
23676 Further, every function must be generated such that it keeps the stack
23677 aligned.  Thus calling a function compiled with a higher preferred
23678 stack boundary from a function compiled with a lower preferred stack
23679 boundary most likely misaligns the stack.  It is recommended that
23680 libraries that use callbacks always use the default setting.
23682 This extra alignment does consume extra stack space, and generally
23683 increases code size.  Code that is sensitive to stack space usage, such
23684 as embedded systems and operating system kernels, may want to reduce the
23685 preferred alignment to @option{-mpreferred-stack-boundary=2}.
23687 @need 200
23688 @item -mmmx
23689 @opindex mmmx
23690 @need 200
23691 @itemx -msse
23692 @opindex msse
23693 @need 200
23694 @itemx -msse2
23695 @opindex msse2
23696 @need 200
23697 @itemx -msse3
23698 @opindex msse3
23699 @need 200
23700 @itemx -mssse3
23701 @opindex mssse3
23702 @need 200
23703 @itemx -msse4
23704 @opindex msse4
23705 @need 200
23706 @itemx -msse4a
23707 @opindex msse4a
23708 @need 200
23709 @itemx -msse4.1
23710 @opindex msse4.1
23711 @need 200
23712 @itemx -msse4.2
23713 @opindex msse4.2
23714 @need 200
23715 @itemx -mavx
23716 @opindex mavx
23717 @need 200
23718 @itemx -mavx2
23719 @opindex mavx2
23720 @need 200
23721 @itemx -mavx512f
23722 @opindex mavx512f
23723 @need 200
23724 @itemx -mavx512pf
23725 @opindex mavx512pf
23726 @need 200
23727 @itemx -mavx512er
23728 @opindex mavx512er
23729 @need 200
23730 @itemx -mavx512cd
23731 @opindex mavx512cd
23732 @need 200
23733 @itemx -mavx512vl
23734 @opindex mavx512vl
23735 @need 200
23736 @itemx -mavx512bw
23737 @opindex mavx512bw
23738 @need 200
23739 @itemx -mavx512dq
23740 @opindex mavx512dq
23741 @need 200
23742 @itemx -mavx512ifma
23743 @opindex mavx512ifma
23744 @need 200
23745 @itemx -mavx512vbmi
23746 @opindex mavx512vbmi
23747 @need 200
23748 @itemx -msha
23749 @opindex msha
23750 @need 200
23751 @itemx -maes
23752 @opindex maes
23753 @need 200
23754 @itemx -mpclmul
23755 @opindex mpclmul
23756 @need 200
23757 @itemx -mclfushopt
23758 @opindex mclfushopt
23759 @need 200
23760 @itemx -mfsgsbase
23761 @opindex mfsgsbase
23762 @need 200
23763 @itemx -mrdrnd
23764 @opindex mrdrnd
23765 @need 200
23766 @itemx -mf16c
23767 @opindex mf16c
23768 @need 200
23769 @itemx -mfma
23770 @opindex mfma
23771 @need 200
23772 @itemx -mfma4
23773 @opindex mfma4
23774 @need 200
23775 @itemx -mprefetchwt1
23776 @opindex mprefetchwt1
23777 @need 200
23778 @itemx -mxop
23779 @opindex mxop
23780 @need 200
23781 @itemx -mlwp
23782 @opindex mlwp
23783 @need 200
23784 @itemx -m3dnow
23785 @opindex m3dnow
23786 @need 200
23787 @itemx -mpopcnt
23788 @opindex mpopcnt
23789 @need 200
23790 @itemx -mabm
23791 @opindex mabm
23792 @need 200
23793 @itemx -mbmi
23794 @opindex mbmi
23795 @need 200
23796 @itemx -mbmi2
23797 @need 200
23798 @itemx -mlzcnt
23799 @opindex mlzcnt
23800 @need 200
23801 @itemx -mfxsr
23802 @opindex mfxsr
23803 @need 200
23804 @itemx -mxsave
23805 @opindex mxsave
23806 @need 200
23807 @itemx -mxsaveopt
23808 @opindex mxsaveopt
23809 @need 200
23810 @itemx -mxsavec
23811 @opindex mxsavec
23812 @need 200
23813 @itemx -mxsaves
23814 @opindex mxsaves
23815 @need 200
23816 @itemx -mrtm
23817 @opindex mrtm
23818 @need 200
23819 @itemx -mtbm
23820 @opindex mtbm
23821 @need 200
23822 @itemx -mmpx
23823 @opindex mmpx
23824 @need 200
23825 @itemx -mmwaitx
23826 @opindex mmwaitx
23827 @need 200
23828 @itemx -mclzero
23829 @opindex mclzero
23830 @itemx -mpku
23831 @opindex mpku
23832 These switches enable the use of instructions in the MMX, SSE,
23833 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
23834 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
23835 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
23836 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU or 3DNow!@:
23837 extended instruction sets.  Each has a corresponding @option{-mno-} option
23838 to disable use of these instructions.
23840 These extensions are also available as built-in functions: see
23841 @ref{x86 Built-in Functions}, for details of the functions enabled and
23842 disabled by these switches.
23844 To generate SSE/SSE2 instructions automatically from floating-point
23845 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
23847 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
23848 generates new AVX instructions or AVX equivalence for all SSEx instructions
23849 when needed.
23851 These options enable GCC to use these extended instructions in
23852 generated code, even without @option{-mfpmath=sse}.  Applications that
23853 perform run-time CPU detection must compile separate files for each
23854 supported architecture, using the appropriate flags.  In particular,
23855 the file containing the CPU detection code should be compiled without
23856 these options.
23858 @item -mdump-tune-features
23859 @opindex mdump-tune-features
23860 This option instructs GCC to dump the names of the x86 performance 
23861 tuning features and default settings. The names can be used in 
23862 @option{-mtune-ctrl=@var{feature-list}}.
23864 @item -mtune-ctrl=@var{feature-list}
23865 @opindex mtune-ctrl=@var{feature-list}
23866 This option is used to do fine grain control of x86 code generation features.
23867 @var{feature-list} is a comma separated list of @var{feature} names. See also
23868 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
23869 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
23870 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
23871 developers. Using it may lead to code paths not covered by testing and can
23872 potentially result in compiler ICEs or runtime errors.
23874 @item -mno-default
23875 @opindex mno-default
23876 This option instructs GCC to turn off all tunable features. See also 
23877 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
23879 @item -mcld
23880 @opindex mcld
23881 This option instructs GCC to emit a @code{cld} instruction in the prologue
23882 of functions that use string instructions.  String instructions depend on
23883 the DF flag to select between autoincrement or autodecrement mode.  While the
23884 ABI specifies the DF flag to be cleared on function entry, some operating
23885 systems violate this specification by not clearing the DF flag in their
23886 exception dispatchers.  The exception handler can be invoked with the DF flag
23887 set, which leads to wrong direction mode when string instructions are used.
23888 This option can be enabled by default on 32-bit x86 targets by configuring
23889 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
23890 instructions can be suppressed with the @option{-mno-cld} compiler option
23891 in this case.
23893 @item -mvzeroupper
23894 @opindex mvzeroupper
23895 This option instructs GCC to emit a @code{vzeroupper} instruction
23896 before a transfer of control flow out of the function to minimize
23897 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
23898 intrinsics.
23900 @item -mprefer-avx128
23901 @opindex mprefer-avx128
23902 This option instructs GCC to use 128-bit AVX instructions instead of
23903 256-bit AVX instructions in the auto-vectorizer.
23905 @item -mcx16
23906 @opindex mcx16
23907 This option enables GCC to generate @code{CMPXCHG16B} instructions.
23908 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
23909 (or oword) data types.  
23910 This is useful for high-resolution counters that can be updated
23911 by multiple processors (or cores).  This instruction is generated as part of
23912 atomic built-in functions: see @ref{__sync Builtins} or
23913 @ref{__atomic Builtins} for details.
23915 @item -msahf
23916 @opindex msahf
23917 This option enables generation of @code{SAHF} instructions in 64-bit code.
23918 Early Intel Pentium 4 CPUs with Intel 64 support,
23919 prior to the introduction of Pentium 4 G1 step in December 2005,
23920 lacked the @code{LAHF} and @code{SAHF} instructions
23921 which are supported by AMD64.
23922 These are load and store instructions, respectively, for certain status flags.
23923 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
23924 @code{drem}, and @code{remainder} built-in functions;
23925 see @ref{Other Builtins} for details.
23927 @item -mmovbe
23928 @opindex mmovbe
23929 This option enables use of the @code{movbe} instruction to implement
23930 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
23932 @item -mcrc32
23933 @opindex mcrc32
23934 This option enables built-in functions @code{__builtin_ia32_crc32qi},
23935 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
23936 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
23938 @item -mrecip
23939 @opindex mrecip
23940 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
23941 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
23942 with an additional Newton-Raphson step
23943 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
23944 (and their vectorized
23945 variants) for single-precision floating-point arguments.  These instructions
23946 are generated only when @option{-funsafe-math-optimizations} is enabled
23947 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
23948 Note that while the throughput of the sequence is higher than the throughput
23949 of the non-reciprocal instruction, the precision of the sequence can be
23950 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
23952 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
23953 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
23954 combination), and doesn't need @option{-mrecip}.
23956 Also note that GCC emits the above sequence with additional Newton-Raphson step
23957 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
23958 already with @option{-ffast-math} (or the above option combination), and
23959 doesn't need @option{-mrecip}.
23961 @item -mrecip=@var{opt}
23962 @opindex mrecip=opt
23963 This option controls which reciprocal estimate instructions
23964 may be used.  @var{opt} is a comma-separated list of options, which may
23965 be preceded by a @samp{!} to invert the option:
23967 @table @samp
23968 @item all
23969 Enable all estimate instructions.
23971 @item default
23972 Enable the default instructions, equivalent to @option{-mrecip}.
23974 @item none
23975 Disable all estimate instructions, equivalent to @option{-mno-recip}.
23977 @item div
23978 Enable the approximation for scalar division.
23980 @item vec-div
23981 Enable the approximation for vectorized division.
23983 @item sqrt
23984 Enable the approximation for scalar square root.
23986 @item vec-sqrt
23987 Enable the approximation for vectorized square root.
23988 @end table
23990 So, for example, @option{-mrecip=all,!sqrt} enables
23991 all of the reciprocal approximations, except for square root.
23993 @item -mveclibabi=@var{type}
23994 @opindex mveclibabi
23995 Specifies the ABI type to use for vectorizing intrinsics using an
23996 external library.  Supported values for @var{type} are @samp{svml} 
23997 for the Intel short
23998 vector math library and @samp{acml} for the AMD math core library.
23999 To use this option, both @option{-ftree-vectorize} and
24000 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
24001 ABI-compatible library must be specified at link time.
24003 GCC currently emits calls to @code{vmldExp2},
24004 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
24005 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
24006 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
24007 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
24008 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
24009 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
24010 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
24011 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
24012 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
24013 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
24014 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
24015 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
24016 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
24017 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
24018 when @option{-mveclibabi=acml} is used.  
24020 @item -mabi=@var{name}
24021 @opindex mabi
24022 Generate code for the specified calling convention.  Permissible values
24023 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
24024 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
24025 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
24026 You can control this behavior for specific functions by
24027 using the function attributes @code{ms_abi} and @code{sysv_abi}.
24028 @xref{Function Attributes}.
24030 @item -mtls-dialect=@var{type}
24031 @opindex mtls-dialect
24032 Generate code to access thread-local storage using the @samp{gnu} or
24033 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
24034 @samp{gnu2} is more efficient, but it may add compile- and run-time
24035 requirements that cannot be satisfied on all systems.
24037 @item -mpush-args
24038 @itemx -mno-push-args
24039 @opindex mpush-args
24040 @opindex mno-push-args
24041 Use PUSH operations to store outgoing parameters.  This method is shorter
24042 and usually equally fast as method using SUB/MOV operations and is enabled
24043 by default.  In some cases disabling it may improve performance because of
24044 improved scheduling and reduced dependencies.
24046 @item -maccumulate-outgoing-args
24047 @opindex maccumulate-outgoing-args
24048 If enabled, the maximum amount of space required for outgoing arguments is
24049 computed in the function prologue.  This is faster on most modern CPUs
24050 because of reduced dependencies, improved scheduling and reduced stack usage
24051 when the preferred stack boundary is not equal to 2.  The drawback is a notable
24052 increase in code size.  This switch implies @option{-mno-push-args}.
24054 @item -mthreads
24055 @opindex mthreads
24056 Support thread-safe exception handling on MinGW.  Programs that rely
24057 on thread-safe exception handling must compile and link all code with the
24058 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
24059 @option{-D_MT}; when linking, it links in a special thread helper library
24060 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
24062 @item -mms-bitfields
24063 @itemx -mno-ms-bitfields
24064 @opindex mms-bitfields
24065 @opindex mno-ms-bitfields
24067 Enable/disable bit-field layout compatible with the native Microsoft
24068 Windows compiler.  
24070 If @code{packed} is used on a structure, or if bit-fields are used,
24071 it may be that the Microsoft ABI lays out the structure differently
24072 than the way GCC normally does.  Particularly when moving packed
24073 data between functions compiled with GCC and the native Microsoft compiler
24074 (either via function call or as data in a file), it may be necessary to access
24075 either format.
24077 This option is enabled by default for Microsoft Windows
24078 targets.  This behavior can also be controlled locally by use of variable
24079 or type attributes.  For more information, see @ref{x86 Variable Attributes}
24080 and @ref{x86 Type Attributes}.
24082 The Microsoft structure layout algorithm is fairly simple with the exception
24083 of the bit-field packing.  
24084 The padding and alignment of members of structures and whether a bit-field 
24085 can straddle a storage-unit boundary are determine by these rules:
24087 @enumerate
24088 @item Structure members are stored sequentially in the order in which they are
24089 declared: the first member has the lowest memory address and the last member
24090 the highest.
24092 @item Every data object has an alignment requirement.  The alignment requirement
24093 for all data except structures, unions, and arrays is either the size of the
24094 object or the current packing size (specified with either the
24095 @code{aligned} attribute or the @code{pack} pragma),
24096 whichever is less.  For structures, unions, and arrays,
24097 the alignment requirement is the largest alignment requirement of its members.
24098 Every object is allocated an offset so that:
24100 @smallexample
24101 offset % alignment_requirement == 0
24102 @end smallexample
24104 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
24105 unit if the integral types are the same size and if the next bit-field fits
24106 into the current allocation unit without crossing the boundary imposed by the
24107 common alignment requirements of the bit-fields.
24108 @end enumerate
24110 MSVC interprets zero-length bit-fields in the following ways:
24112 @enumerate
24113 @item If a zero-length bit-field is inserted between two bit-fields that
24114 are normally coalesced, the bit-fields are not coalesced.
24116 For example:
24118 @smallexample
24119 struct
24120  @{
24121    unsigned long bf_1 : 12;
24122    unsigned long : 0;
24123    unsigned long bf_2 : 12;
24124  @} t1;
24125 @end smallexample
24127 @noindent
24128 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
24129 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
24131 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
24132 alignment of the zero-length bit-field is greater than the member that follows it,
24133 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
24135 For example:
24137 @smallexample
24138 struct
24139  @{
24140    char foo : 4;
24141    short : 0;
24142    char bar;
24143  @} t2;
24145 struct
24146  @{
24147    char foo : 4;
24148    short : 0;
24149    double bar;
24150  @} t3;
24151 @end smallexample
24153 @noindent
24154 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
24155 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
24156 bit-field does not affect the alignment of @code{bar} or, as a result, the size
24157 of the structure.
24159 Taking this into account, it is important to note the following:
24161 @enumerate
24162 @item If a zero-length bit-field follows a normal bit-field, the type of the
24163 zero-length bit-field may affect the alignment of the structure as whole. For
24164 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
24165 normal bit-field, and is of type short.
24167 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
24168 still affect the alignment of the structure:
24170 @smallexample
24171 struct
24172  @{
24173    char foo : 6;
24174    long : 0;
24175  @} t4;
24176 @end smallexample
24178 @noindent
24179 Here, @code{t4} takes up 4 bytes.
24180 @end enumerate
24182 @item Zero-length bit-fields following non-bit-field members are ignored:
24184 @smallexample
24185 struct
24186  @{
24187    char foo;
24188    long : 0;
24189    char bar;
24190  @} t5;
24191 @end smallexample
24193 @noindent
24194 Here, @code{t5} takes up 2 bytes.
24195 @end enumerate
24198 @item -mno-align-stringops
24199 @opindex mno-align-stringops
24200 Do not align the destination of inlined string operations.  This switch reduces
24201 code size and improves performance in case the destination is already aligned,
24202 but GCC doesn't know about it.
24204 @item -minline-all-stringops
24205 @opindex minline-all-stringops
24206 By default GCC inlines string operations only when the destination is 
24207 known to be aligned to least a 4-byte boundary.  
24208 This enables more inlining and increases code
24209 size, but may improve performance of code that depends on fast
24210 @code{memcpy}, @code{strlen},
24211 and @code{memset} for short lengths.
24213 @item -minline-stringops-dynamically
24214 @opindex minline-stringops-dynamically
24215 For string operations of unknown size, use run-time checks with
24216 inline code for small blocks and a library call for large blocks.
24218 @item -mstringop-strategy=@var{alg}
24219 @opindex mstringop-strategy=@var{alg}
24220 Override the internal decision heuristic for the particular algorithm to use
24221 for inlining string operations.  The allowed values for @var{alg} are:
24223 @table @samp
24224 @item rep_byte
24225 @itemx rep_4byte
24226 @itemx rep_8byte
24227 Expand using i386 @code{rep} prefix of the specified size.
24229 @item byte_loop
24230 @itemx loop
24231 @itemx unrolled_loop
24232 Expand into an inline loop.
24234 @item libcall
24235 Always use a library call.
24236 @end table
24238 @item -mmemcpy-strategy=@var{strategy}
24239 @opindex mmemcpy-strategy=@var{strategy}
24240 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
24241 should be inlined and what inline algorithm to use when the expected size
24242 of the copy operation is known. @var{strategy} 
24243 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
24244 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
24245 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
24246 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
24247 in the list must be specified in increasing order.  The minimal byte size for 
24248 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
24249 preceding range.
24251 @item -mmemset-strategy=@var{strategy}
24252 @opindex mmemset-strategy=@var{strategy}
24253 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
24254 @code{__builtin_memset} expansion.
24256 @item -momit-leaf-frame-pointer
24257 @opindex momit-leaf-frame-pointer
24258 Don't keep the frame pointer in a register for leaf functions.  This
24259 avoids the instructions to save, set up, and restore frame pointers and
24260 makes an extra register available in leaf functions.  The option
24261 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
24262 which might make debugging harder.
24264 @item -mtls-direct-seg-refs
24265 @itemx -mno-tls-direct-seg-refs
24266 @opindex mtls-direct-seg-refs
24267 Controls whether TLS variables may be accessed with offsets from the
24268 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
24269 or whether the thread base pointer must be added.  Whether or not this
24270 is valid depends on the operating system, and whether it maps the
24271 segment to cover the entire TLS area.
24273 For systems that use the GNU C Library, the default is on.
24275 @item -msse2avx
24276 @itemx -mno-sse2avx
24277 @opindex msse2avx
24278 Specify that the assembler should encode SSE instructions with VEX
24279 prefix.  The option @option{-mavx} turns this on by default.
24281 @item -mfentry
24282 @itemx -mno-fentry
24283 @opindex mfentry
24284 If profiling is active (@option{-pg}), put the profiling
24285 counter call before the prologue.
24286 Note: On x86 architectures the attribute @code{ms_hook_prologue}
24287 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
24289 @item -mrecord-mcount
24290 @itemx -mno-record-mcount
24291 @opindex mrecord-mcount
24292 If profiling is active (@option{-pg}), generate a __mcount_loc section
24293 that contains pointers to each profiling call. This is useful for
24294 automatically patching and out calls.
24296 @item -mnop-mcount
24297 @itemx -mno-nop-mcount
24298 @opindex mnop-mcount
24299 If profiling is active (@option{-pg}), generate the calls to
24300 the profiling functions as nops. This is useful when they
24301 should be patched in later dynamically. This is likely only
24302 useful together with @option{-mrecord-mcount}.
24304 @item -mskip-rax-setup
24305 @itemx -mno-skip-rax-setup
24306 @opindex mskip-rax-setup
24307 When generating code for the x86-64 architecture with SSE extensions
24308 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
24309 register when there are no variable arguments passed in vector registers.
24311 @strong{Warning:} Since RAX register is used to avoid unnecessarily
24312 saving vector registers on stack when passing variable arguments, the
24313 impacts of this option are callees may waste some stack space,
24314 misbehave or jump to a random location.  GCC 4.4 or newer don't have
24315 those issues, regardless the RAX register value.
24317 @item -m8bit-idiv
24318 @itemx -mno-8bit-idiv
24319 @opindex m8bit-idiv
24320 On some processors, like Intel Atom, 8-bit unsigned integer divide is
24321 much faster than 32-bit/64-bit integer divide.  This option generates a
24322 run-time check.  If both dividend and divisor are within range of 0
24323 to 255, 8-bit unsigned integer divide is used instead of
24324 32-bit/64-bit integer divide.
24326 @item -mavx256-split-unaligned-load
24327 @itemx -mavx256-split-unaligned-store
24328 @opindex mavx256-split-unaligned-load
24329 @opindex mavx256-split-unaligned-store
24330 Split 32-byte AVX unaligned load and store.
24332 @item -mstack-protector-guard=@var{guard}
24333 @opindex mstack-protector-guard=@var{guard}
24334 Generate stack protection code using canary at @var{guard}.  Supported
24335 locations are @samp{global} for global canary or @samp{tls} for per-thread
24336 canary in the TLS block (the default).  This option has effect only when
24337 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
24339 @item -mmitigate-rop
24340 @opindex mmitigate-rop
24341 Try to avoid generating code sequences that contain unintended return
24342 opcodes, to mitigate against certain forms of attack. At the moment,
24343 this option is limited in what it can do and should not be relied
24344 on to provide serious protection.
24346 @item -mgeneral-regs-only
24347 @opindex mgeneral-regs-only
24348 Generate code that uses only the general-purpose registers.  This
24349 prevents the compiler from using floating-point, vector, mask and bound
24350 registers.
24352 @end table
24354 These @samp{-m} switches are supported in addition to the above
24355 on x86-64 processors in 64-bit environments.
24357 @table @gcctabopt
24358 @item -m32
24359 @itemx -m64
24360 @itemx -mx32
24361 @itemx -m16
24362 @itemx -miamcu
24363 @opindex m32
24364 @opindex m64
24365 @opindex mx32
24366 @opindex m16
24367 @opindex miamcu
24368 Generate code for a 16-bit, 32-bit or 64-bit environment.
24369 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
24370 to 32 bits, and
24371 generates code that runs on any i386 system.
24373 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
24374 types to 64 bits, and generates code for the x86-64 architecture.
24375 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
24376 and @option{-mdynamic-no-pic} options.
24378 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
24379 to 32 bits, and
24380 generates code for the x86-64 architecture.
24382 The @option{-m16} option is the same as @option{-m32}, except for that
24383 it outputs the @code{.code16gcc} assembly directive at the beginning of
24384 the assembly output so that the binary can run in 16-bit mode.
24386 The @option{-miamcu} option generates code which conforms to Intel MCU
24387 psABI.  It requires the @option{-m32} option to be turned on.
24389 @item -mno-red-zone
24390 @opindex mno-red-zone
24391 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
24392 by the x86-64 ABI; it is a 128-byte area beyond the location of the
24393 stack pointer that is not modified by signal or interrupt handlers
24394 and therefore can be used for temporary data without adjusting the stack
24395 pointer.  The flag @option{-mno-red-zone} disables this red zone.
24397 @item -mcmodel=small
24398 @opindex mcmodel=small
24399 Generate code for the small code model: the program and its symbols must
24400 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
24401 Programs can be statically or dynamically linked.  This is the default
24402 code model.
24404 @item -mcmodel=kernel
24405 @opindex mcmodel=kernel
24406 Generate code for the kernel code model.  The kernel runs in the
24407 negative 2 GB of the address space.
24408 This model has to be used for Linux kernel code.
24410 @item -mcmodel=medium
24411 @opindex mcmodel=medium
24412 Generate code for the medium model: the program is linked in the lower 2
24413 GB of the address space.  Small symbols are also placed there.  Symbols
24414 with sizes larger than @option{-mlarge-data-threshold} are put into
24415 large data or BSS sections and can be located above 2GB.  Programs can
24416 be statically or dynamically linked.
24418 @item -mcmodel=large
24419 @opindex mcmodel=large
24420 Generate code for the large model.  This model makes no assumptions
24421 about addresses and sizes of sections.
24423 @item -maddress-mode=long
24424 @opindex maddress-mode=long
24425 Generate code for long address mode.  This is only supported for 64-bit
24426 and x32 environments.  It is the default address mode for 64-bit
24427 environments.
24429 @item -maddress-mode=short
24430 @opindex maddress-mode=short
24431 Generate code for short address mode.  This is only supported for 32-bit
24432 and x32 environments.  It is the default address mode for 32-bit and
24433 x32 environments.
24434 @end table
24436 @node x86 Windows Options
24437 @subsection x86 Windows Options
24438 @cindex x86 Windows Options
24439 @cindex Windows Options for x86
24441 These additional options are available for Microsoft Windows targets:
24443 @table @gcctabopt
24444 @item -mconsole
24445 @opindex mconsole
24446 This option
24447 specifies that a console application is to be generated, by
24448 instructing the linker to set the PE header subsystem type
24449 required for console applications.
24450 This option is available for Cygwin and MinGW targets and is
24451 enabled by default on those targets.
24453 @item -mdll
24454 @opindex mdll
24455 This option is available for Cygwin and MinGW targets.  It
24456 specifies that a DLL---a dynamic link library---is to be
24457 generated, enabling the selection of the required runtime
24458 startup object and entry point.
24460 @item -mnop-fun-dllimport
24461 @opindex mnop-fun-dllimport
24462 This option is available for Cygwin and MinGW targets.  It
24463 specifies that the @code{dllimport} attribute should be ignored.
24465 @item -mthread
24466 @opindex mthread
24467 This option is available for MinGW targets. It specifies
24468 that MinGW-specific thread support is to be used.
24470 @item -municode
24471 @opindex municode
24472 This option is available for MinGW-w64 targets.  It causes
24473 the @code{UNICODE} preprocessor macro to be predefined, and
24474 chooses Unicode-capable runtime startup code.
24476 @item -mwin32
24477 @opindex mwin32
24478 This option is available for Cygwin and MinGW targets.  It
24479 specifies that the typical Microsoft Windows predefined macros are to
24480 be set in the pre-processor, but does not influence the choice
24481 of runtime library/startup code.
24483 @item -mwindows
24484 @opindex mwindows
24485 This option is available for Cygwin and MinGW targets.  It
24486 specifies that a GUI application is to be generated by
24487 instructing the linker to set the PE header subsystem type
24488 appropriately.
24490 @item -fno-set-stack-executable
24491 @opindex fno-set-stack-executable
24492 This option is available for MinGW targets. It specifies that
24493 the executable flag for the stack used by nested functions isn't
24494 set. This is necessary for binaries running in kernel mode of
24495 Microsoft Windows, as there the User32 API, which is used to set executable
24496 privileges, isn't available.
24498 @item -fwritable-relocated-rdata
24499 @opindex fno-writable-relocated-rdata
24500 This option is available for MinGW and Cygwin targets.  It specifies
24501 that relocated-data in read-only section is put into the @code{.data}
24502 section.  This is a necessary for older runtimes not supporting
24503 modification of @code{.rdata} sections for pseudo-relocation.
24505 @item -mpe-aligned-commons
24506 @opindex mpe-aligned-commons
24507 This option is available for Cygwin and MinGW targets.  It
24508 specifies that the GNU extension to the PE file format that
24509 permits the correct alignment of COMMON variables should be
24510 used when generating code.  It is enabled by default if
24511 GCC detects that the target assembler found during configuration
24512 supports the feature.
24513 @end table
24515 See also under @ref{x86 Options} for standard options.
24517 @node Xstormy16 Options
24518 @subsection Xstormy16 Options
24519 @cindex Xstormy16 Options
24521 These options are defined for Xstormy16:
24523 @table @gcctabopt
24524 @item -msim
24525 @opindex msim
24526 Choose startup files and linker script suitable for the simulator.
24527 @end table
24529 @node Xtensa Options
24530 @subsection Xtensa Options
24531 @cindex Xtensa Options
24533 These options are supported for Xtensa targets:
24535 @table @gcctabopt
24536 @item -mconst16
24537 @itemx -mno-const16
24538 @opindex mconst16
24539 @opindex mno-const16
24540 Enable or disable use of @code{CONST16} instructions for loading
24541 constant values.  The @code{CONST16} instruction is currently not a
24542 standard option from Tensilica.  When enabled, @code{CONST16}
24543 instructions are always used in place of the standard @code{L32R}
24544 instructions.  The use of @code{CONST16} is enabled by default only if
24545 the @code{L32R} instruction is not available.
24547 @item -mfused-madd
24548 @itemx -mno-fused-madd
24549 @opindex mfused-madd
24550 @opindex mno-fused-madd
24551 Enable or disable use of fused multiply/add and multiply/subtract
24552 instructions in the floating-point option.  This has no effect if the
24553 floating-point option is not also enabled.  Disabling fused multiply/add
24554 and multiply/subtract instructions forces the compiler to use separate
24555 instructions for the multiply and add/subtract operations.  This may be
24556 desirable in some cases where strict IEEE 754-compliant results are
24557 required: the fused multiply add/subtract instructions do not round the
24558 intermediate result, thereby producing results with @emph{more} bits of
24559 precision than specified by the IEEE standard.  Disabling fused multiply
24560 add/subtract instructions also ensures that the program output is not
24561 sensitive to the compiler's ability to combine multiply and add/subtract
24562 operations.
24564 @item -mserialize-volatile
24565 @itemx -mno-serialize-volatile
24566 @opindex mserialize-volatile
24567 @opindex mno-serialize-volatile
24568 When this option is enabled, GCC inserts @code{MEMW} instructions before
24569 @code{volatile} memory references to guarantee sequential consistency.
24570 The default is @option{-mserialize-volatile}.  Use
24571 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
24573 @item -mforce-no-pic
24574 @opindex mforce-no-pic
24575 For targets, like GNU/Linux, where all user-mode Xtensa code must be
24576 position-independent code (PIC), this option disables PIC for compiling
24577 kernel code.
24579 @item -mtext-section-literals
24580 @itemx -mno-text-section-literals
24581 @opindex mtext-section-literals
24582 @opindex mno-text-section-literals
24583 These options control the treatment of literal pools.  The default is
24584 @option{-mno-text-section-literals}, which places literals in a separate
24585 section in the output file.  This allows the literal pool to be placed
24586 in a data RAM/ROM, and it also allows the linker to combine literal
24587 pools from separate object files to remove redundant literals and
24588 improve code size.  With @option{-mtext-section-literals}, the literals
24589 are interspersed in the text section in order to keep them as close as
24590 possible to their references.  This may be necessary for large assembly
24591 files.  Literals for each function are placed right before that function.
24593 @item -mauto-litpools
24594 @itemx -mno-auto-litpools
24595 @opindex mauto-litpools
24596 @opindex mno-auto-litpools
24597 These options control the treatment of literal pools.  The default is
24598 @option{-mno-auto-litpools}, which places literals in a separate
24599 section in the output file unless @option{-mtext-section-literals} is
24600 used.  With @option{-mauto-litpools} the literals are interspersed in
24601 the text section by the assembler.  Compiler does not produce explicit
24602 @code{.literal} directives and loads literals into registers with
24603 @code{MOVI} instructions instead of @code{L32R} to let the assembler
24604 do relaxation and place literals as necessary.  This option allows
24605 assembler to create several literal pools per function and assemble
24606 very big functions, which may not be possible with
24607 @option{-mtext-section-literals}.
24609 @item -mtarget-align
24610 @itemx -mno-target-align
24611 @opindex mtarget-align
24612 @opindex mno-target-align
24613 When this option is enabled, GCC instructs the assembler to
24614 automatically align instructions to reduce branch penalties at the
24615 expense of some code density.  The assembler attempts to widen density
24616 instructions to align branch targets and the instructions following call
24617 instructions.  If there are not enough preceding safe density
24618 instructions to align a target, no widening is performed.  The
24619 default is @option{-mtarget-align}.  These options do not affect the
24620 treatment of auto-aligned instructions like @code{LOOP}, which the
24621 assembler always aligns, either by widening density instructions or
24622 by inserting NOP instructions.
24624 @item -mlongcalls
24625 @itemx -mno-longcalls
24626 @opindex mlongcalls
24627 @opindex mno-longcalls
24628 When this option is enabled, GCC instructs the assembler to translate
24629 direct calls to indirect calls unless it can determine that the target
24630 of a direct call is in the range allowed by the call instruction.  This
24631 translation typically occurs for calls to functions in other source
24632 files.  Specifically, the assembler translates a direct @code{CALL}
24633 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
24634 The default is @option{-mno-longcalls}.  This option should be used in
24635 programs where the call target can potentially be out of range.  This
24636 option is implemented in the assembler, not the compiler, so the
24637 assembly code generated by GCC still shows direct call
24638 instructions---look at the disassembled object code to see the actual
24639 instructions.  Note that the assembler uses an indirect call for
24640 every cross-file call, not just those that really are out of range.
24641 @end table
24643 @node zSeries Options
24644 @subsection zSeries Options
24645 @cindex zSeries options
24647 These are listed under @xref{S/390 and zSeries Options}.
24650 @c man end
24652 @node Spec Files
24653 @section Specifying Subprocesses and the Switches to Pass to Them
24654 @cindex Spec Files
24656 @command{gcc} is a driver program.  It performs its job by invoking a
24657 sequence of other programs to do the work of compiling, assembling and
24658 linking.  GCC interprets its command-line parameters and uses these to
24659 deduce which programs it should invoke, and which command-line options
24660 it ought to place on their command lines.  This behavior is controlled
24661 by @dfn{spec strings}.  In most cases there is one spec string for each
24662 program that GCC can invoke, but a few programs have multiple spec
24663 strings to control their behavior.  The spec strings built into GCC can
24664 be overridden by using the @option{-specs=} command-line switch to specify
24665 a spec file.
24667 @dfn{Spec files} are plain-text files that are used to construct spec
24668 strings.  They consist of a sequence of directives separated by blank
24669 lines.  The type of directive is determined by the first non-whitespace
24670 character on the line, which can be one of the following:
24672 @table @code
24673 @item %@var{command}
24674 Issues a @var{command} to the spec file processor.  The commands that can
24675 appear here are:
24677 @table @code
24678 @item %include <@var{file}>
24679 @cindex @code{%include}
24680 Search for @var{file} and insert its text at the current point in the
24681 specs file.
24683 @item %include_noerr <@var{file}>
24684 @cindex @code{%include_noerr}
24685 Just like @samp{%include}, but do not generate an error message if the include
24686 file cannot be found.
24688 @item %rename @var{old_name} @var{new_name}
24689 @cindex @code{%rename}
24690 Rename the spec string @var{old_name} to @var{new_name}.
24692 @end table
24694 @item *[@var{spec_name}]:
24695 This tells the compiler to create, override or delete the named spec
24696 string.  All lines after this directive up to the next directive or
24697 blank line are considered to be the text for the spec string.  If this
24698 results in an empty string then the spec is deleted.  (Or, if the
24699 spec did not exist, then nothing happens.)  Otherwise, if the spec
24700 does not currently exist a new spec is created.  If the spec does
24701 exist then its contents are overridden by the text of this
24702 directive, unless the first character of that text is the @samp{+}
24703 character, in which case the text is appended to the spec.
24705 @item [@var{suffix}]:
24706 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
24707 and up to the next directive or blank line are considered to make up the
24708 spec string for the indicated suffix.  When the compiler encounters an
24709 input file with the named suffix, it processes the spec string in
24710 order to work out how to compile that file.  For example:
24712 @smallexample
24713 .ZZ:
24714 z-compile -input %i
24715 @end smallexample
24717 This says that any input file whose name ends in @samp{.ZZ} should be
24718 passed to the program @samp{z-compile}, which should be invoked with the
24719 command-line switch @option{-input} and with the result of performing the
24720 @samp{%i} substitution.  (See below.)
24722 As an alternative to providing a spec string, the text following a
24723 suffix directive can be one of the following:
24725 @table @code
24726 @item @@@var{language}
24727 This says that the suffix is an alias for a known @var{language}.  This is
24728 similar to using the @option{-x} command-line switch to GCC to specify a
24729 language explicitly.  For example:
24731 @smallexample
24732 .ZZ:
24733 @@c++
24734 @end smallexample
24736 Says that .ZZ files are, in fact, C++ source files.
24738 @item #@var{name}
24739 This causes an error messages saying:
24741 @smallexample
24742 @var{name} compiler not installed on this system.
24743 @end smallexample
24744 @end table
24746 GCC already has an extensive list of suffixes built into it.
24747 This directive adds an entry to the end of the list of suffixes, but
24748 since the list is searched from the end backwards, it is effectively
24749 possible to override earlier entries using this technique.
24751 @end table
24753 GCC has the following spec strings built into it.  Spec files can
24754 override these strings or create their own.  Note that individual
24755 targets can also add their own spec strings to this list.
24757 @smallexample
24758 asm          Options to pass to the assembler
24759 asm_final    Options to pass to the assembler post-processor
24760 cpp          Options to pass to the C preprocessor
24761 cc1          Options to pass to the C compiler
24762 cc1plus      Options to pass to the C++ compiler
24763 endfile      Object files to include at the end of the link
24764 link         Options to pass to the linker
24765 lib          Libraries to include on the command line to the linker
24766 libgcc       Decides which GCC support library to pass to the linker
24767 linker       Sets the name of the linker
24768 predefines   Defines to be passed to the C preprocessor
24769 signed_char  Defines to pass to CPP to say whether @code{char} is signed
24770              by default
24771 startfile    Object files to include at the start of the link
24772 @end smallexample
24774 Here is a small example of a spec file:
24776 @smallexample
24777 %rename lib                 old_lib
24779 *lib:
24780 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
24781 @end smallexample
24783 This example renames the spec called @samp{lib} to @samp{old_lib} and
24784 then overrides the previous definition of @samp{lib} with a new one.
24785 The new definition adds in some extra command-line options before
24786 including the text of the old definition.
24788 @dfn{Spec strings} are a list of command-line options to be passed to their
24789 corresponding program.  In addition, the spec strings can contain
24790 @samp{%}-prefixed sequences to substitute variable text or to
24791 conditionally insert text into the command line.  Using these constructs
24792 it is possible to generate quite complex command lines.
24794 Here is a table of all defined @samp{%}-sequences for spec
24795 strings.  Note that spaces are not generated automatically around the
24796 results of expanding these sequences.  Therefore you can concatenate them
24797 together or combine them with constant text in a single argument.
24799 @table @code
24800 @item %%
24801 Substitute one @samp{%} into the program name or argument.
24803 @item %i
24804 Substitute the name of the input file being processed.
24806 @item %b
24807 Substitute the basename of the input file being processed.
24808 This is the substring up to (and not including) the last period
24809 and not including the directory.
24811 @item %B
24812 This is the same as @samp{%b}, but include the file suffix (text after
24813 the last period).
24815 @item %d
24816 Marks the argument containing or following the @samp{%d} as a
24817 temporary file name, so that that file is deleted if GCC exits
24818 successfully.  Unlike @samp{%g}, this contributes no text to the
24819 argument.
24821 @item %g@var{suffix}
24822 Substitute a file name that has suffix @var{suffix} and is chosen
24823 once per compilation, and mark the argument in the same way as
24824 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
24825 name is now chosen in a way that is hard to predict even when previously
24826 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
24827 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
24828 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
24829 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
24830 was simply substituted with a file name chosen once per compilation,
24831 without regard to any appended suffix (which was therefore treated
24832 just like ordinary text), making such attacks more likely to succeed.
24834 @item %u@var{suffix}
24835 Like @samp{%g}, but generates a new temporary file name
24836 each time it appears instead of once per compilation.
24838 @item %U@var{suffix}
24839 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
24840 new one if there is no such last file name.  In the absence of any
24841 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
24842 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
24843 involves the generation of two distinct file names, one
24844 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
24845 simply substituted with a file name chosen for the previous @samp{%u},
24846 without regard to any appended suffix.
24848 @item %j@var{suffix}
24849 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
24850 writable, and if @option{-save-temps} is not used; 
24851 otherwise, substitute the name
24852 of a temporary file, just like @samp{%u}.  This temporary file is not
24853 meant for communication between processes, but rather as a junk
24854 disposal mechanism.
24856 @item %|@var{suffix}
24857 @itemx %m@var{suffix}
24858 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
24859 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
24860 all.  These are the two most common ways to instruct a program that it
24861 should read from standard input or write to standard output.  If you
24862 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
24863 construct: see for example @file{f/lang-specs.h}.
24865 @item %.@var{SUFFIX}
24866 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
24867 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
24868 terminated by the next space or %.
24870 @item %w
24871 Marks the argument containing or following the @samp{%w} as the
24872 designated output file of this compilation.  This puts the argument
24873 into the sequence of arguments that @samp{%o} substitutes.
24875 @item %o
24876 Substitutes the names of all the output files, with spaces
24877 automatically placed around them.  You should write spaces
24878 around the @samp{%o} as well or the results are undefined.
24879 @samp{%o} is for use in the specs for running the linker.
24880 Input files whose names have no recognized suffix are not compiled
24881 at all, but they are included among the output files, so they are
24882 linked.
24884 @item %O
24885 Substitutes the suffix for object files.  Note that this is
24886 handled specially when it immediately follows @samp{%g, %u, or %U},
24887 because of the need for those to form complete file names.  The
24888 handling is such that @samp{%O} is treated exactly as if it had already
24889 been substituted, except that @samp{%g, %u, and %U} do not currently
24890 support additional @var{suffix} characters following @samp{%O} as they do
24891 following, for example, @samp{.o}.
24893 @item %p
24894 Substitutes the standard macro predefinitions for the
24895 current target machine.  Use this when running @command{cpp}.
24897 @item %P
24898 Like @samp{%p}, but puts @samp{__} before and after the name of each
24899 predefined macro, except for macros that start with @samp{__} or with
24900 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
24903 @item %I
24904 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
24905 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
24906 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
24907 and @option{-imultilib} as necessary.
24909 @item %s
24910 Current argument is the name of a library or startup file of some sort.
24911 Search for that file in a standard list of directories and substitute
24912 the full name found.  The current working directory is included in the
24913 list of directories scanned.
24915 @item %T
24916 Current argument is the name of a linker script.  Search for that file
24917 in the current list of directories to scan for libraries. If the file
24918 is located insert a @option{--script} option into the command line
24919 followed by the full path name found.  If the file is not found then
24920 generate an error message.  Note: the current working directory is not
24921 searched.
24923 @item %e@var{str}
24924 Print @var{str} as an error message.  @var{str} is terminated by a newline.
24925 Use this when inconsistent options are detected.
24927 @item %(@var{name})
24928 Substitute the contents of spec string @var{name} at this point.
24930 @item %x@{@var{option}@}
24931 Accumulate an option for @samp{%X}.
24933 @item %X
24934 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
24935 spec string.
24937 @item %Y
24938 Output the accumulated assembler options specified by @option{-Wa}.
24940 @item %Z
24941 Output the accumulated preprocessor options specified by @option{-Wp}.
24943 @item %a
24944 Process the @code{asm} spec.  This is used to compute the
24945 switches to be passed to the assembler.
24947 @item %A
24948 Process the @code{asm_final} spec.  This is a spec string for
24949 passing switches to an assembler post-processor, if such a program is
24950 needed.
24952 @item %l
24953 Process the @code{link} spec.  This is the spec for computing the
24954 command line passed to the linker.  Typically it makes use of the
24955 @samp{%L %G %S %D and %E} sequences.
24957 @item %D
24958 Dump out a @option{-L} option for each directory that GCC believes might
24959 contain startup files.  If the target supports multilibs then the
24960 current multilib directory is prepended to each of these paths.
24962 @item %L
24963 Process the @code{lib} spec.  This is a spec string for deciding which
24964 libraries are included on the command line to the linker.
24966 @item %G
24967 Process the @code{libgcc} spec.  This is a spec string for deciding
24968 which GCC support library is included on the command line to the linker.
24970 @item %S
24971 Process the @code{startfile} spec.  This is a spec for deciding which
24972 object files are the first ones passed to the linker.  Typically
24973 this might be a file named @file{crt0.o}.
24975 @item %E
24976 Process the @code{endfile} spec.  This is a spec string that specifies
24977 the last object files that are passed to the linker.
24979 @item %C
24980 Process the @code{cpp} spec.  This is used to construct the arguments
24981 to be passed to the C preprocessor.
24983 @item %1
24984 Process the @code{cc1} spec.  This is used to construct the options to be
24985 passed to the actual C compiler (@command{cc1}).
24987 @item %2
24988 Process the @code{cc1plus} spec.  This is used to construct the options to be
24989 passed to the actual C++ compiler (@command{cc1plus}).
24991 @item %*
24992 Substitute the variable part of a matched option.  See below.
24993 Note that each comma in the substituted string is replaced by
24994 a single space.
24996 @item %<@code{S}
24997 Remove all occurrences of @code{-S} from the command line.  Note---this
24998 command is position dependent.  @samp{%} commands in the spec string
24999 before this one see @code{-S}, @samp{%} commands in the spec string
25000 after this one do not.
25002 @item %:@var{function}(@var{args})
25003 Call the named function @var{function}, passing it @var{args}.
25004 @var{args} is first processed as a nested spec string, then split
25005 into an argument vector in the usual fashion.  The function returns
25006 a string which is processed as if it had appeared literally as part
25007 of the current spec.
25009 The following built-in spec functions are provided:
25011 @table @code
25012 @item @code{getenv}
25013 The @code{getenv} spec function takes two arguments: an environment
25014 variable name and a string.  If the environment variable is not
25015 defined, a fatal error is issued.  Otherwise, the return value is the
25016 value of the environment variable concatenated with the string.  For
25017 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
25019 @smallexample
25020 %:getenv(TOPDIR /include)
25021 @end smallexample
25023 expands to @file{/path/to/top/include}.
25025 @item @code{if-exists}
25026 The @code{if-exists} spec function takes one argument, an absolute
25027 pathname to a file.  If the file exists, @code{if-exists} returns the
25028 pathname.  Here is a small example of its usage:
25030 @smallexample
25031 *startfile:
25032 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
25033 @end smallexample
25035 @item @code{if-exists-else}
25036 The @code{if-exists-else} spec function is similar to the @code{if-exists}
25037 spec function, except that it takes two arguments.  The first argument is
25038 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
25039 returns the pathname.  If it does not exist, it returns the second argument.
25040 This way, @code{if-exists-else} can be used to select one file or another,
25041 based on the existence of the first.  Here is a small example of its usage:
25043 @smallexample
25044 *startfile:
25045 crt0%O%s %:if-exists(crti%O%s) \
25046 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
25047 @end smallexample
25049 @item @code{replace-outfile}
25050 The @code{replace-outfile} spec function takes two arguments.  It looks for the
25051 first argument in the outfiles array and replaces it with the second argument.  Here
25052 is a small example of its usage:
25054 @smallexample
25055 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
25056 @end smallexample
25058 @item @code{remove-outfile}
25059 The @code{remove-outfile} spec function takes one argument.  It looks for the
25060 first argument in the outfiles array and removes it.  Here is a small example
25061 its usage:
25063 @smallexample
25064 %:remove-outfile(-lm)
25065 @end smallexample
25067 @item @code{pass-through-libs}
25068 The @code{pass-through-libs} spec function takes any number of arguments.  It
25069 finds any @option{-l} options and any non-options ending in @file{.a} (which it
25070 assumes are the names of linker input library archive files) and returns a
25071 result containing all the found arguments each prepended by
25072 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
25073 intended to be passed to the LTO linker plugin.
25075 @smallexample
25076 %:pass-through-libs(%G %L %G)
25077 @end smallexample
25079 @item @code{print-asm-header}
25080 The @code{print-asm-header} function takes no arguments and simply
25081 prints a banner like:
25083 @smallexample
25084 Assembler options
25085 =================
25087 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
25088 @end smallexample
25090 It is used to separate compiler options from assembler options
25091 in the @option{--target-help} output.
25092 @end table
25094 @item %@{@code{S}@}
25095 Substitutes the @code{-S} switch, if that switch is given to GCC@.
25096 If that switch is not specified, this substitutes nothing.  Note that
25097 the leading dash is omitted when specifying this option, and it is
25098 automatically inserted if the substitution is performed.  Thus the spec
25099 string @samp{%@{foo@}} matches the command-line option @option{-foo}
25100 and outputs the command-line option @option{-foo}.
25102 @item %W@{@code{S}@}
25103 Like %@{@code{S}@} but mark last argument supplied within as a file to be
25104 deleted on failure.
25106 @item %@{@code{S}*@}
25107 Substitutes all the switches specified to GCC whose names start
25108 with @code{-S}, but which also take an argument.  This is used for
25109 switches like @option{-o}, @option{-D}, @option{-I}, etc.
25110 GCC considers @option{-o foo} as being
25111 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
25112 text, including the space.  Thus two arguments are generated.
25114 @item %@{@code{S}*&@code{T}*@}
25115 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
25116 (the order of @code{S} and @code{T} in the spec is not significant).
25117 There can be any number of ampersand-separated variables; for each the
25118 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
25120 @item %@{@code{S}:@code{X}@}
25121 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
25123 @item %@{!@code{S}:@code{X}@}
25124 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
25126 @item %@{@code{S}*:@code{X}@}
25127 Substitutes @code{X} if one or more switches whose names start with
25128 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
25129 once, no matter how many such switches appeared.  However, if @code{%*}
25130 appears somewhere in @code{X}, then @code{X} is substituted once
25131 for each matching switch, with the @code{%*} replaced by the part of
25132 that switch matching the @code{*}.
25134 If @code{%*} appears as the last part of a spec sequence then a space
25135 is added after the end of the last substitution.  If there is more
25136 text in the sequence, however, then a space is not generated.  This
25137 allows the @code{%*} substitution to be used as part of a larger
25138 string.  For example, a spec string like this:
25140 @smallexample
25141 %@{mcu=*:--script=%*/memory.ld@}
25142 @end smallexample
25144 @noindent
25145 when matching an option like @option{-mcu=newchip} produces:
25147 @smallexample
25148 --script=newchip/memory.ld
25149 @end smallexample
25151 @item %@{.@code{S}:@code{X}@}
25152 Substitutes @code{X}, if processing a file with suffix @code{S}.
25154 @item %@{!.@code{S}:@code{X}@}
25155 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
25157 @item %@{,@code{S}:@code{X}@}
25158 Substitutes @code{X}, if processing a file for language @code{S}.
25160 @item %@{!,@code{S}:@code{X}@}
25161 Substitutes @code{X}, if not processing a file for language @code{S}.
25163 @item %@{@code{S}|@code{P}:@code{X}@}
25164 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
25165 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
25166 @code{*} sequences as well, although they have a stronger binding than
25167 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
25168 alternatives must be starred, and only the first matching alternative
25169 is substituted.
25171 For example, a spec string like this:
25173 @smallexample
25174 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
25175 @end smallexample
25177 @noindent
25178 outputs the following command-line options from the following input
25179 command-line options:
25181 @smallexample
25182 fred.c        -foo -baz
25183 jim.d         -bar -boggle
25184 -d fred.c     -foo -baz -boggle
25185 -d jim.d      -bar -baz -boggle
25186 @end smallexample
25188 @item %@{S:X; T:Y; :D@}
25190 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
25191 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
25192 be as many clauses as you need.  This may be combined with @code{.},
25193 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
25196 @end table
25198 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
25199 construct may contain other nested @samp{%} constructs or spaces, or
25200 even newlines.  They are processed as usual, as described above.
25201 Trailing white space in @code{X} is ignored.  White space may also
25202 appear anywhere on the left side of the colon in these constructs,
25203 except between @code{.} or @code{*} and the corresponding word.
25205 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
25206 handled specifically in these constructs.  If another value of
25207 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
25208 @option{-W} switch is found later in the command line, the earlier
25209 switch value is ignored, except with @{@code{S}*@} where @code{S} is
25210 just one letter, which passes all matching options.
25212 The character @samp{|} at the beginning of the predicate text is used to
25213 indicate that a command should be piped to the following command, but
25214 only if @option{-pipe} is specified.
25216 It is built into GCC which switches take arguments and which do not.
25217 (You might think it would be useful to generalize this to allow each
25218 compiler's spec to say which switches take arguments.  But this cannot
25219 be done in a consistent fashion.  GCC cannot even decide which input
25220 files have been specified without knowing which switches take arguments,
25221 and it must know which input files to compile in order to tell which
25222 compilers to run).
25224 GCC also knows implicitly that arguments starting in @option{-l} are to be
25225 treated as compiler output files, and passed to the linker in their
25226 proper position among the other output files.
25228 @node Environment Variables
25229 @section Environment Variables Affecting GCC
25230 @cindex environment variables
25232 @c man begin ENVIRONMENT
25233 This section describes several environment variables that affect how GCC
25234 operates.  Some of them work by specifying directories or prefixes to use
25235 when searching for various kinds of files.  Some are used to specify other
25236 aspects of the compilation environment.
25238 Note that you can also specify places to search using options such as
25239 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
25240 take precedence over places specified using environment variables, which
25241 in turn take precedence over those specified by the configuration of GCC@.
25242 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
25243 GNU Compiler Collection (GCC) Internals}.
25245 @table @env
25246 @item LANG
25247 @itemx LC_CTYPE
25248 @c @itemx LC_COLLATE
25249 @itemx LC_MESSAGES
25250 @c @itemx LC_MONETARY
25251 @c @itemx LC_NUMERIC
25252 @c @itemx LC_TIME
25253 @itemx LC_ALL
25254 @findex LANG
25255 @findex LC_CTYPE
25256 @c @findex LC_COLLATE
25257 @findex LC_MESSAGES
25258 @c @findex LC_MONETARY
25259 @c @findex LC_NUMERIC
25260 @c @findex LC_TIME
25261 @findex LC_ALL
25262 @cindex locale
25263 These environment variables control the way that GCC uses
25264 localization information which allows GCC to work with different
25265 national conventions.  GCC inspects the locale categories
25266 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
25267 so.  These locale categories can be set to any value supported by your
25268 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
25269 Kingdom encoded in UTF-8.
25271 The @env{LC_CTYPE} environment variable specifies character
25272 classification.  GCC uses it to determine the character boundaries in
25273 a string; this is needed for some multibyte encodings that contain quote
25274 and escape characters that are otherwise interpreted as a string
25275 end or escape.
25277 The @env{LC_MESSAGES} environment variable specifies the language to
25278 use in diagnostic messages.
25280 If the @env{LC_ALL} environment variable is set, it overrides the value
25281 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
25282 and @env{LC_MESSAGES} default to the value of the @env{LANG}
25283 environment variable.  If none of these variables are set, GCC
25284 defaults to traditional C English behavior.
25286 @item TMPDIR
25287 @findex TMPDIR
25288 If @env{TMPDIR} is set, it specifies the directory to use for temporary
25289 files.  GCC uses temporary files to hold the output of one stage of
25290 compilation which is to be used as input to the next stage: for example,
25291 the output of the preprocessor, which is the input to the compiler
25292 proper.
25294 @item GCC_COMPARE_DEBUG
25295 @findex GCC_COMPARE_DEBUG
25296 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
25297 @option{-fcompare-debug} to the compiler driver.  See the documentation
25298 of this option for more details.
25300 @item GCC_EXEC_PREFIX
25301 @findex GCC_EXEC_PREFIX
25302 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
25303 names of the subprograms executed by the compiler.  No slash is added
25304 when this prefix is combined with the name of a subprogram, but you can
25305 specify a prefix that ends with a slash if you wish.
25307 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
25308 an appropriate prefix to use based on the pathname it is invoked with.
25310 If GCC cannot find the subprogram using the specified prefix, it
25311 tries looking in the usual places for the subprogram.
25313 The default value of @env{GCC_EXEC_PREFIX} is
25314 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
25315 the installed compiler. In many cases @var{prefix} is the value
25316 of @code{prefix} when you ran the @file{configure} script.
25318 Other prefixes specified with @option{-B} take precedence over this prefix.
25320 This prefix is also used for finding files such as @file{crt0.o} that are
25321 used for linking.
25323 In addition, the prefix is used in an unusual way in finding the
25324 directories to search for header files.  For each of the standard
25325 directories whose name normally begins with @samp{/usr/local/lib/gcc}
25326 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
25327 replacing that beginning with the specified prefix to produce an
25328 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
25329 @file{foo/bar} just before it searches the standard directory 
25330 @file{/usr/local/lib/bar}.
25331 If a standard directory begins with the configured
25332 @var{prefix} then the value of @var{prefix} is replaced by
25333 @env{GCC_EXEC_PREFIX} when looking for header files.
25335 @item COMPILER_PATH
25336 @findex COMPILER_PATH
25337 The value of @env{COMPILER_PATH} is a colon-separated list of
25338 directories, much like @env{PATH}.  GCC tries the directories thus
25339 specified when searching for subprograms, if it can't find the
25340 subprograms using @env{GCC_EXEC_PREFIX}.
25342 @item LIBRARY_PATH
25343 @findex LIBRARY_PATH
25344 The value of @env{LIBRARY_PATH} is a colon-separated list of
25345 directories, much like @env{PATH}.  When configured as a native compiler,
25346 GCC tries the directories thus specified when searching for special
25347 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
25348 using GCC also uses these directories when searching for ordinary
25349 libraries for the @option{-l} option (but directories specified with
25350 @option{-L} come first).
25352 @item LANG
25353 @findex LANG
25354 @cindex locale definition
25355 This variable is used to pass locale information to the compiler.  One way in
25356 which this information is used is to determine the character set to be used
25357 when character literals, string literals and comments are parsed in C and C++.
25358 When the compiler is configured to allow multibyte characters,
25359 the following values for @env{LANG} are recognized:
25361 @table @samp
25362 @item C-JIS
25363 Recognize JIS characters.
25364 @item C-SJIS
25365 Recognize SJIS characters.
25366 @item C-EUCJP
25367 Recognize EUCJP characters.
25368 @end table
25370 If @env{LANG} is not defined, or if it has some other value, then the
25371 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
25372 recognize and translate multibyte characters.
25373 @end table
25375 @noindent
25376 Some additional environment variables affect the behavior of the
25377 preprocessor.
25379 @include cppenv.texi
25381 @c man end
25383 @node Precompiled Headers
25384 @section Using Precompiled Headers
25385 @cindex precompiled headers
25386 @cindex speed of compilation
25388 Often large projects have many header files that are included in every
25389 source file.  The time the compiler takes to process these header files
25390 over and over again can account for nearly all of the time required to
25391 build the project.  To make builds faster, GCC allows you to
25392 @dfn{precompile} a header file.
25394 To create a precompiled header file, simply compile it as you would any
25395 other file, if necessary using the @option{-x} option to make the driver
25396 treat it as a C or C++ header file.  You may want to use a
25397 tool like @command{make} to keep the precompiled header up-to-date when
25398 the headers it contains change.
25400 A precompiled header file is searched for when @code{#include} is
25401 seen in the compilation.  As it searches for the included file
25402 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
25403 compiler looks for a precompiled header in each directory just before it
25404 looks for the include file in that directory.  The name searched for is
25405 the name specified in the @code{#include} with @samp{.gch} appended.  If
25406 the precompiled header file can't be used, it is ignored.
25408 For instance, if you have @code{#include "all.h"}, and you have
25409 @file{all.h.gch} in the same directory as @file{all.h}, then the
25410 precompiled header file is used if possible, and the original
25411 header is used otherwise.
25413 Alternatively, you might decide to put the precompiled header file in a
25414 directory and use @option{-I} to ensure that directory is searched
25415 before (or instead of) the directory containing the original header.
25416 Then, if you want to check that the precompiled header file is always
25417 used, you can put a file of the same name as the original header in this
25418 directory containing an @code{#error} command.
25420 This also works with @option{-include}.  So yet another way to use
25421 precompiled headers, good for projects not designed with precompiled
25422 header files in mind, is to simply take most of the header files used by
25423 a project, include them from another header file, precompile that header
25424 file, and @option{-include} the precompiled header.  If the header files
25425 have guards against multiple inclusion, they are skipped because
25426 they've already been included (in the precompiled header).
25428 If you need to precompile the same header file for different
25429 languages, targets, or compiler options, you can instead make a
25430 @emph{directory} named like @file{all.h.gch}, and put each precompiled
25431 header in the directory, perhaps using @option{-o}.  It doesn't matter
25432 what you call the files in the directory; every precompiled header in
25433 the directory is considered.  The first precompiled header
25434 encountered in the directory that is valid for this compilation is
25435 used; they're searched in no particular order.
25437 There are many other possibilities, limited only by your imagination,
25438 good sense, and the constraints of your build system.
25440 A precompiled header file can be used only when these conditions apply:
25442 @itemize
25443 @item
25444 Only one precompiled header can be used in a particular compilation.
25446 @item
25447 A precompiled header can't be used once the first C token is seen.  You
25448 can have preprocessor directives before a precompiled header; you cannot
25449 include a precompiled header from inside another header.
25451 @item
25452 The precompiled header file must be produced for the same language as
25453 the current compilation.  You can't use a C precompiled header for a C++
25454 compilation.
25456 @item
25457 The precompiled header file must have been produced by the same compiler
25458 binary as the current compilation is using.
25460 @item
25461 Any macros defined before the precompiled header is included must
25462 either be defined in the same way as when the precompiled header was
25463 generated, or must not affect the precompiled header, which usually
25464 means that they don't appear in the precompiled header at all.
25466 The @option{-D} option is one way to define a macro before a
25467 precompiled header is included; using a @code{#define} can also do it.
25468 There are also some options that define macros implicitly, like
25469 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
25470 defined this way.
25472 @item If debugging information is output when using the precompiled
25473 header, using @option{-g} or similar, the same kind of debugging information
25474 must have been output when building the precompiled header.  However,
25475 a precompiled header built using @option{-g} can be used in a compilation
25476 when no debugging information is being output.
25478 @item The same @option{-m} options must generally be used when building
25479 and using the precompiled header.  @xref{Submodel Options},
25480 for any cases where this rule is relaxed.
25482 @item Each of the following options must be the same when building and using
25483 the precompiled header:
25485 @gccoptlist{-fexceptions}
25487 @item
25488 Some other command-line options starting with @option{-f},
25489 @option{-p}, or @option{-O} must be defined in the same way as when
25490 the precompiled header was generated.  At present, it's not clear
25491 which options are safe to change and which are not; the safest choice
25492 is to use exactly the same options when generating and using the
25493 precompiled header.  The following are known to be safe:
25495 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
25496 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
25497 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
25498 -pedantic-errors}
25500 @end itemize
25502 For all of these except the last, the compiler automatically
25503 ignores the precompiled header if the conditions aren't met.  If you
25504 find an option combination that doesn't work and doesn't cause the
25505 precompiled header to be ignored, please consider filing a bug report,
25506 see @ref{Bugs}.
25508 If you do use differing options when generating and using the
25509 precompiled header, the actual behavior is a mixture of the
25510 behavior for the options.  For instance, if you use @option{-g} to
25511 generate the precompiled header but not when using it, you may or may
25512 not get debugging information for routines in the precompiled header.