Fix minor doc bugs, signalling typo, major version changes rare.
[official-gcc.git] / gcc / doc / invoke.texi
blobf3d087f9cad4889c88115693416dffa3a97a2008
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-default  -Wswitch-enum -Wswitch-bool -Wsync-nand @gol
301 -Wsystem-headers  -Wtautological-compare  -Wtrampolines  -Wtrigraphs @gol
302 -Wtype-limits  -Wundef @gol
303 -Wuninitialized  -Wunknown-pragmas  -Wunsafe-loop-optimizations @gol
304 -Wunsuffixed-float-constants  -Wunused  -Wunused-function @gol
305 -Wunused-label  -Wunused-local-typedefs -Wunused-parameter @gol
306 -Wno-unused-result -Wunused-value @gol -Wunused-variable @gol
307 -Wunused-const-variable -Wunused-const-variable=@var{n} @gol
308 -Wunused-but-set-parameter -Wunused-but-set-variable @gol
309 -Wuseless-cast -Wvariadic-macros -Wvector-operation-performance @gol
310 -Wvla -Wvolatile-register-var  -Wwrite-strings @gol
311 -Wzero-as-null-pointer-constant -Whsa}
313 @item C and Objective-C-only Warning Options
314 @gccoptlist{-Wbad-function-cast  -Wmissing-declarations @gol
315 -Wmissing-parameter-type  -Wmissing-prototypes  -Wnested-externs @gol
316 -Wold-style-declaration  -Wold-style-definition @gol
317 -Wstrict-prototypes  -Wtraditional  -Wtraditional-conversion @gol
318 -Wdeclaration-after-statement -Wpointer-sign}
320 @item Debugging Options
321 @xref{Debugging Options,,Options for Debugging Your Program}.
322 @gccoptlist{-g  -g@var{level}  -gcoff  -gdwarf -gdwarf-@var{version} @gol
323 -ggdb  -grecord-gcc-switches  -gno-record-gcc-switches @gol
324 -gstabs  -gstabs+  -gstrict-dwarf  -gno-strict-dwarf @gol
325 -gvms  -gxcoff  -gxcoff+ -gz@r{[}=@var{type}@r{]} @gol
326 -fdebug-prefix-map=@var{old}=@var{new} -fdebug-types-section @gol
327 -feliminate-dwarf2-dups -fno-eliminate-unused-debug-types @gol
328 -femit-struct-debug-baseonly -femit-struct-debug-reduced @gol
329 -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]} @gol
330 -feliminate-unused-debug-symbols -femit-class-debug-always @gol
331 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
332 -fvar-tracking -fvar-tracking-assignments}
334 @item Optimization Options
335 @xref{Optimize Options,,Options that Control Optimization}.
336 @gccoptlist{-faggressive-loop-optimizations -falign-functions[=@var{n}] @gol
337 -falign-jumps[=@var{n}] @gol
338 -falign-labels[=@var{n}] -falign-loops[=@var{n}] @gol
339 -fassociative-math -fauto-profile -fauto-profile[=@var{path}] @gol
340 -fauto-inc-dec -fbranch-probabilities @gol
341 -fbranch-target-load-optimize -fbranch-target-load-optimize2 @gol
342 -fbtr-bb-exclusive -fcaller-saves @gol
343 -fcombine-stack-adjustments -fconserve-stack @gol
344 -fcompare-elim -fcprop-registers -fcrossjumping @gol
345 -fcse-follow-jumps -fcse-skip-blocks -fcx-fortran-rules @gol
346 -fcx-limited-range @gol
347 -fdata-sections -fdce -fdelayed-branch @gol
348 -fdelete-null-pointer-checks -fdevirtualize -fdevirtualize-speculatively @gol
349 -fdevirtualize-at-ltrans -fdse @gol
350 -fearly-inlining -fipa-sra -fexpensive-optimizations -ffat-lto-objects @gol
351 -ffast-math -ffinite-math-only -ffloat-store -fexcess-precision=@var{style} @gol
352 -fforward-propagate -ffp-contract=@var{style} -ffunction-sections @gol
353 -fgcse -fgcse-after-reload -fgcse-las -fgcse-lm -fgraphite-identity @gol
354 -fgcse-sm -fhoist-adjacent-loads -fif-conversion @gol
355 -fif-conversion2 -findirect-inlining @gol
356 -finline-functions -finline-functions-called-once -finline-limit=@var{n} @gol
357 -finline-small-functions -fipa-cp -fipa-cp-clone -fipa-cp-alignment @gol
358 -fipa-pta -fipa-profile -fipa-pure-const -fipa-reference -fipa-icf @gol
359 -fira-algorithm=@var{algorithm} @gol
360 -fira-region=@var{region} -fira-hoist-pressure @gol
361 -fira-loop-pressure -fno-ira-share-save-slots @gol
362 -fno-ira-share-spill-slots @gol
363 -fisolate-erroneous-paths-dereference -fisolate-erroneous-paths-attribute @gol
364 -fivopts -fkeep-inline-functions -fkeep-static-functions @gol
365 -fkeep-static-consts -flive-range-shrinkage @gol
366 -floop-block -floop-interchange -floop-strip-mine @gol
367 -floop-unroll-and-jam -floop-nest-optimize @gol
368 -floop-parallelize-all -flra-remat -flto -flto-compression-level @gol
369 -flto-partition=@var{alg} -fmerge-all-constants @gol
370 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
371 -fmove-loop-invariants -fno-branch-count-reg @gol
372 -fno-defer-pop -fno-function-cse -fno-guess-branch-probability @gol
373 -fno-inline -fno-math-errno -fno-peephole -fno-peephole2 @gol
374 -fno-sched-interblock -fno-sched-spec -fno-signed-zeros @gol
375 -fno-toplevel-reorder -fno-trapping-math -fno-zero-initialized-in-bss @gol
376 -fomit-frame-pointer -foptimize-sibling-calls @gol
377 -fpartial-inlining -fpeel-loops -fpredictive-commoning @gol
378 -fprefetch-loop-arrays @gol
379 -fprofile-correction @gol
380 -fprofile-use -fprofile-use=@var{path} -fprofile-values @gol
381 -fprofile-reorder-functions @gol
382 -freciprocal-math -free -frename-registers -freorder-blocks @gol
383 -freorder-blocks-algorithm=@var{algorithm} @gol
384 -freorder-blocks-and-partition -freorder-functions @gol
385 -frerun-cse-after-loop -freschedule-modulo-scheduled-loops @gol
386 -frounding-math -fsched2-use-superblocks -fsched-pressure @gol
387 -fsched-spec-load -fsched-spec-load-dangerous @gol
388 -fsched-stalled-insns-dep[=@var{n}] -fsched-stalled-insns[=@var{n}] @gol
389 -fsched-group-heuristic -fsched-critical-path-heuristic @gol
390 -fsched-spec-insn-heuristic -fsched-rank-heuristic @gol
391 -fsched-last-insn-heuristic -fsched-dep-count-heuristic @gol
392 -fschedule-fusion @gol
393 -fschedule-insns -fschedule-insns2 -fsection-anchors @gol
394 -fselective-scheduling -fselective-scheduling2 @gol
395 -fsel-sched-pipelining -fsel-sched-pipelining-outer-loops @gol
396 -fsemantic-interposition -fshrink-wrap -fsignaling-nans @gol
397 -fsingle-precision-constant -fsplit-ivs-in-unroller @gol
398 -fsplit-paths @gol
399 -fsplit-wide-types -fssa-backprop -fssa-phiopt @gol
400 -fstdarg-opt -fstrict-aliasing @gol
401 -fstrict-overflow -fthread-jumps -ftracer -ftree-bit-ccp @gol
402 -ftree-builtin-call-dce -ftree-ccp -ftree-ch @gol
403 -ftree-coalesce-vars -ftree-copy-prop -ftree-dce -ftree-dominator-opts @gol
404 -ftree-dse -ftree-forwprop -ftree-fre -ftree-loop-if-convert @gol
405 -ftree-loop-if-convert-stores -ftree-loop-im @gol
406 -ftree-phiprop -ftree-loop-distribution -ftree-loop-distribute-patterns @gol
407 -ftree-loop-ivcanon -ftree-loop-linear -ftree-loop-optimize @gol
408 -ftree-loop-vectorize @gol
409 -ftree-parallelize-loops=@var{n} -ftree-pre -ftree-partial-pre -ftree-pta @gol
410 -ftree-reassoc -ftree-sink -ftree-slsr -ftree-sra @gol
411 -ftree-switch-conversion -ftree-tail-merge -ftree-ter @gol
412 -ftree-vectorize -ftree-vrp -funconstrained-commons @gol
413 -funit-at-a-time -funroll-all-loops -funroll-loops @gol
414 -funsafe-loop-optimizations -funsafe-math-optimizations -funswitch-loops @gol
415 -fipa-ra -fvariable-expansion-in-unroller -fvect-cost-model -fvpt @gol
416 -fweb -fwhole-program -fwpa -fuse-linker-plugin @gol
417 --param @var{name}=@var{value}
418 -O  -O0  -O1  -O2  -O3  -Os -Ofast -Og}
420 @item Program Instrumentation Options
421 @xref{Instrumentation Options,,Program Instrumentation Options}.
422 @gccoptlist{-p  -pg  -fprofile-arcs --coverage -ftest-coverage @gol
423 -fprofile-dir=@var{path} -fprofile-generate -fprofile-generate=@var{path} @gol
424 -fsanitize=@var{style} -fsanitize-recover -fsanitize-recover=@var{style} @gol
425 -fasan-shadow-offset=@var{number} -fsanitize-sections=@var{s1},@var{s2},... @gol
426 -fsanitize-undefined-trap-on-error -fbounds-check @gol
427 -fcheck-pointer-bounds -fchkp-check-incomplete-type @gol
428 -fchkp-first-field-has-own-bounds -fchkp-narrow-bounds @gol
429 -fchkp-narrow-to-innermost-array -fchkp-optimize @gol
430 -fchkp-use-fast-string-functions -fchkp-use-nochk-string-functions @gol
431 -fchkp-use-static-bounds -fchkp-use-static-const-bounds @gol
432 -fchkp-treat-zero-dynamic-size-as-infinite -fchkp-check-read @gol
433 -fchkp-check-read -fchkp-check-write -fchkp-store-bounds @gol
434 -fchkp-instrument-calls -fchkp-instrument-marked-only @gol
435 -fchkp-use-wrappers @gol
436 -fstack-protector -fstack-protector-all -fstack-protector-strong @gol
437 -fstack-protector-explicit -fstack-check @gol
438 -fstack-limit-register=@var{reg}  -fstack-limit-symbol=@var{sym} @gol
439 -fno-stack-limit -fsplit-stack @gol
440 -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]} @gol
441 -fvtv-counts -fvtv-debug @gol
442 -finstrument-functions @gol
443 -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{} @gol
444 -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}}
446 @item Preprocessor Options
447 @xref{Preprocessor Options,,Options Controlling the Preprocessor}.
448 @gccoptlist{-A@var{question}=@var{answer} @gol
449 -A-@var{question}@r{[}=@var{answer}@r{]} @gol
450 -C  -dD  -dI  -dM  -dN @gol
451 -D@var{macro}@r{[}=@var{defn}@r{]}  -E  -H @gol
452 -idirafter @var{dir} @gol
453 -include @var{file}  -imacros @var{file} @gol
454 -iprefix @var{file}  -iwithprefix @var{dir} @gol
455 -iwithprefixbefore @var{dir}  -isystem @var{dir} @gol
456 -imultilib @var{dir} -isysroot @var{dir} @gol
457 -M  -MM  -MF  -MG  -MP  -MQ  -MT  -nostdinc  @gol
458 -P  -fdebug-cpp -ftrack-macro-expansion -fworking-directory @gol
459 -remap -trigraphs  -undef  -U@var{macro}  @gol
460 -Wp,@var{option} -Xpreprocessor @var{option} -no-integrated-cpp}
462 @item Assembler Option
463 @xref{Assembler Options,,Passing Options to the Assembler}.
464 @gccoptlist{-Wa,@var{option}  -Xassembler @var{option}}
466 @item Linker Options
467 @xref{Link Options,,Options for Linking}.
468 @gccoptlist{@var{object-file-name}  -fuse-ld=@var{linker} -l@var{library} @gol
469 -nostartfiles  -nodefaultlibs  -nostdlib -pie -rdynamic @gol
470 -s  -static -static-libgcc -static-libstdc++ @gol
471 -static-libasan -static-libtsan -static-liblsan -static-libubsan @gol
472 -static-libmpx -static-libmpxwrappers @gol
473 -shared -shared-libgcc  -symbolic @gol
474 -T @var{script}  -Wl,@var{option}  -Xlinker @var{option} @gol
475 -u @var{symbol} -z @var{keyword}}
477 @item Directory Options
478 @xref{Directory Options,,Options for Directory Search}.
479 @gccoptlist{-B@var{prefix} -I@var{dir} -iplugindir=@var{dir} @gol
480 -iquote@var{dir} -L@var{dir} -no-canonical-prefixes -I- @gol
481 --sysroot=@var{dir} --no-sysroot-suffix}
483 @item Code Generation Options
484 @xref{Code Gen Options,,Options for Code Generation Conventions}.
485 @gccoptlist{-fcall-saved-@var{reg}  -fcall-used-@var{reg} @gol
486 -ffixed-@var{reg}  -fexceptions @gol
487 -fnon-call-exceptions  -fdelete-dead-exceptions  -funwind-tables @gol
488 -fasynchronous-unwind-tables @gol
489 -fno-gnu-unique @gol
490 -finhibit-size-directive  -fno-common  -fno-ident @gol
491 -fpcc-struct-return  -fpic  -fPIC -fpie -fPIE -fno-plt @gol
492 -fno-jump-tables @gol
493 -frecord-gcc-switches @gol
494 -freg-struct-return  -fshort-enums  -fshort-wchar @gol
495 -fverbose-asm  -fpack-struct[=@var{n}]  @gol
496 -fleading-underscore  -ftls-model=@var{model} @gol
497 -fstack-reuse=@var{reuse_level} @gol
498 -ftrapv  -fwrapv @gol
499 -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]} @gol
500 -fstrict-volatile-bitfields -fsync-libcalls}
502 @item Developer Options
503 @xref{Developer Options,,GCC Developer Options}.
504 @gccoptlist{-d@var{letters}  -dumpspecs  -dumpmachine  -dumpversion @gol
505 -fchecking -fchecking=@var{n} -fdbg-cnt-list @gol
506 -fdbg-cnt=@var{counter-value-list} @gol
507 -fdisable-ipa-@var{pass_name} @gol
508 -fdisable-rtl-@var{pass_name} @gol
509 -fdisable-rtl-@var{pass-name}=@var{range-list} @gol
510 -fdisable-tree-@var{pass_name} @gol
511 -fdisable-tree-@var{pass-name}=@var{range-list} @gol
512 -fdump-noaddr -fdump-unnumbered -fdump-unnumbered-links @gol
513 -fdump-translation-unit@r{[}-@var{n}@r{]} @gol
514 -fdump-class-hierarchy@r{[}-@var{n}@r{]} @gol
515 -fdump-ipa-all -fdump-ipa-cgraph -fdump-ipa-inline @gol
516 -fdump-passes @gol
517 -fdump-rtl-@var{pass} -fdump-rtl-@var{pass}=@var{filename} @gol
518 -fdump-statistics @gol
519 -fdump-tree-all @gol
520 -fdump-tree-original@r{[}-@var{n}@r{]}  @gol
521 -fdump-tree-optimized@r{[}-@var{n}@r{]} @gol
522 -fdump-tree-cfg -fdump-tree-alias @gol
523 -fdump-tree-ch @gol
524 -fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
525 -fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
526 -fdump-tree-gimple@r{[}-raw@r{]} @gol
527 -fdump-tree-dom@r{[}-@var{n}@r{]} @gol
528 -fdump-tree-dse@r{[}-@var{n}@r{]} @gol
529 -fdump-tree-phiprop@r{[}-@var{n}@r{]} @gol
530 -fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
531 -fdump-tree-backprop@r{[}-@var{n}@r{]} @gol
532 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
533 -fdump-tree-nrv -fdump-tree-vect @gol
534 -fdump-tree-sink @gol
535 -fdump-tree-sra@r{[}-@var{n}@r{]} @gol
536 -fdump-tree-forwprop@r{[}-@var{n}@r{]} @gol
537 -fdump-tree-fre@r{[}-@var{n}@r{]} @gol
538 -fdump-tree-vtable-verify @gol
539 -fdump-tree-vrp@r{[}-@var{n}@r{]} @gol
540 -fdump-tree-split-paths@r{[}-@var{n}@r{]} @gol
541 -fdump-tree-storeccp@r{[}-@var{n}@r{]} @gol
542 -fdump-final-insns=@var{file} @gol
543 -fcompare-debug@r{[}=@var{opts}@r{]}  -fcompare-debug-second @gol
544 -fenable-@var{kind}-@var{pass} @gol
545 -fenable-@var{kind}-@var{pass}=@var{range-list} @gol
546 -fira-verbose=@var{n} @gol
547 -flto-report -flto-report-wpa -fmem-report-wpa @gol
548 -fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report @gol
549 -fopt-info -fopt-info-@var{options}@r{[}=@var{file}@r{]} @gol
550 -fprofile-report @gol
551 -frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
552 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
553 -fstats  -fstack-usage  -ftime-report @gol
554 -fvar-tracking-assignments-toggle -gtoggle @gol
555 -print-file-name=@var{library}  -print-libgcc-file-name @gol
556 -print-multi-directory  -print-multi-lib  -print-multi-os-directory @gol
557 -print-prog-name=@var{program}  -print-search-dirs  -Q @gol
558 -print-sysroot -print-sysroot-headers-suffix @gol
559 -save-temps -save-temps=cwd -save-temps=obj -time@r{[}=@var{file}@r{]}}
561 @item Machine-Dependent Options
562 @xref{Submodel Options,,Machine-Dependent Options}.
563 @c This list is ordered alphanumerically by subsection name.
564 @c Try and put the significant identifier (CPU or system) first,
565 @c so users have a clue at guessing where the ones they want will be.
567 @emph{AArch64 Options}
568 @gccoptlist{-mabi=@var{name}  -mbig-endian  -mlittle-endian @gol
569 -mgeneral-regs-only @gol
570 -mcmodel=tiny  -mcmodel=small  -mcmodel=large @gol
571 -mstrict-align @gol
572 -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
573 -mtls-dialect=desc  -mtls-dialect=traditional @gol
574 -mtls-size=@var{size} @gol
575 -mfix-cortex-a53-835769  -mno-fix-cortex-a53-835769 @gol
576 -mfix-cortex-a53-843419  -mno-fix-cortex-a53-843419 @gol
577 -mlow-precision-recip-sqrt -mno-low-precision-recip-sqrt@gol
578 -march=@var{name}  -mcpu=@var{name}  -mtune=@var{name}}
580 @emph{Adapteva Epiphany Options}
581 @gccoptlist{-mhalf-reg-file -mprefer-short-insn-regs @gol
582 -mbranch-cost=@var{num} -mcmove -mnops=@var{num} -msoft-cmpsf @gol
583 -msplit-lohi -mpost-inc -mpost-modify -mstack-offset=@var{num} @gol
584 -mround-nearest -mlong-calls -mshort-calls -msmall16 @gol
585 -mfp-mode=@var{mode} -mvect-double -max-vect-align=@var{num} @gol
586 -msplit-vecmove-early -m1reg-@var{reg}}
588 @emph{ARC Options}
589 @gccoptlist{-mbarrel-shifter @gol
590 -mcpu=@var{cpu} -mA6 -mARC600 -mA7 -mARC700 @gol
591 -mdpfp -mdpfp-compact -mdpfp-fast -mno-dpfp-lrsr @gol
592 -mea -mno-mpy -mmul32x16 -mmul64 -matomic @gol
593 -mnorm -mspfp -mspfp-compact -mspfp-fast -msimd -msoft-float -mswap @gol
594 -mcrc -mdsp-packa -mdvbf -mlock -mmac-d16 -mmac-24 -mrtsc -mswape @gol
595 -mtelephony -mxy -misize -mannotate-align -marclinux -marclinux_prof @gol
596 -mlong-calls -mmedium-calls -msdata @gol
597 -mucb-mcount -mvolatile-cache -mtp-regno=@var{regno} @gol
598 -malign-call -mauto-modify-reg -mbbit-peephole -mno-brcc @gol
599 -mcase-vector-pcrel -mcompact-casesi -mno-cond-exec -mearly-cbranchsi @gol
600 -mexpand-adddi -mindexed-loads -mlra -mlra-priority-none @gol
601 -mlra-priority-compact mlra-priority-noncompact -mno-millicode @gol
602 -mmixed-code -mq-class -mRcq -mRcw -msize-level=@var{level} @gol
603 -mtune=@var{cpu} -mmultcost=@var{num} @gol
604 -munalign-prob-threshold=@var{probability} -mmpy-option=@var{multo} @gol
605 -mdiv-rem -mcode-density -mll64 -mfpu=@var{fpu}}
607 @emph{ARM Options}
608 @gccoptlist{-mapcs-frame  -mno-apcs-frame @gol
609 -mabi=@var{name} @gol
610 -mapcs-stack-check  -mno-apcs-stack-check @gol
611 -mapcs-float  -mno-apcs-float @gol
612 -mapcs-reentrant  -mno-apcs-reentrant @gol
613 -msched-prolog  -mno-sched-prolog @gol
614 -mlittle-endian  -mbig-endian @gol
615 -mfloat-abi=@var{name} @gol
616 -mfp16-format=@var{name}
617 -mthumb-interwork  -mno-thumb-interwork @gol
618 -mcpu=@var{name}  -march=@var{name}  -mfpu=@var{name}  @gol
619 -mtune=@var{name} -mprint-tune-info @gol
620 -mstructure-size-boundary=@var{n} @gol
621 -mabort-on-noreturn @gol
622 -mlong-calls  -mno-long-calls @gol
623 -msingle-pic-base  -mno-single-pic-base @gol
624 -mpic-register=@var{reg} @gol
625 -mnop-fun-dllimport @gol
626 -mpoke-function-name @gol
627 -mthumb  -marm @gol
628 -mtpcs-frame  -mtpcs-leaf-frame @gol
629 -mcaller-super-interworking  -mcallee-super-interworking @gol
630 -mtp=@var{name} -mtls-dialect=@var{dialect} @gol
631 -mword-relocations @gol
632 -mfix-cortex-m3-ldrd @gol
633 -munaligned-access @gol
634 -mneon-for-64bits @gol
635 -mslow-flash-data @gol
636 -masm-syntax-unified @gol
637 -mrestrict-it}
639 @emph{AVR Options}
640 @gccoptlist{-mmcu=@var{mcu} -maccumulate-args -mbranch-cost=@var{cost} @gol
641 -mcall-prologues -mint8 -mn_flash=@var{size} -mno-interrupts @gol
642 -mrelax -mrmw -mstrict-X -mtiny-stack -nodevicelib -Waddr-space-convert}
644 @emph{Blackfin Options}
645 @gccoptlist{-mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]} @gol
646 -msim -momit-leaf-frame-pointer  -mno-omit-leaf-frame-pointer @gol
647 -mspecld-anomaly  -mno-specld-anomaly  -mcsync-anomaly  -mno-csync-anomaly @gol
648 -mlow-64k -mno-low64k  -mstack-check-l1  -mid-shared-library @gol
649 -mno-id-shared-library  -mshared-library-id=@var{n} @gol
650 -mleaf-id-shared-library  -mno-leaf-id-shared-library @gol
651 -msep-data  -mno-sep-data  -mlong-calls  -mno-long-calls @gol
652 -mfast-fp -minline-plt -mmulticore  -mcorea  -mcoreb  -msdram @gol
653 -micplb}
655 @emph{C6X Options}
656 @gccoptlist{-mbig-endian  -mlittle-endian -march=@var{cpu} @gol
657 -msim -msdata=@var{sdata-type}}
659 @emph{CRIS Options}
660 @gccoptlist{-mcpu=@var{cpu}  -march=@var{cpu}  -mtune=@var{cpu} @gol
661 -mmax-stack-frame=@var{n}  -melinux-stacksize=@var{n} @gol
662 -metrax4  -metrax100  -mpdebug  -mcc-init  -mno-side-effects @gol
663 -mstack-align  -mdata-align  -mconst-align @gol
664 -m32-bit  -m16-bit  -m8-bit  -mno-prologue-epilogue  -mno-gotplt @gol
665 -melf  -maout  -melinux  -mlinux  -sim  -sim2 @gol
666 -mmul-bug-workaround  -mno-mul-bug-workaround}
668 @emph{CR16 Options}
669 @gccoptlist{-mmac @gol
670 -mcr16cplus -mcr16c @gol
671 -msim -mint32 -mbit-ops
672 -mdata-model=@var{model}}
674 @emph{Darwin Options}
675 @gccoptlist{-all_load  -allowable_client  -arch  -arch_errors_fatal @gol
676 -arch_only  -bind_at_load  -bundle  -bundle_loader @gol
677 -client_name  -compatibility_version  -current_version @gol
678 -dead_strip @gol
679 -dependency-file  -dylib_file  -dylinker_install_name @gol
680 -dynamic  -dynamiclib  -exported_symbols_list @gol
681 -filelist  -flat_namespace  -force_cpusubtype_ALL @gol
682 -force_flat_namespace  -headerpad_max_install_names @gol
683 -iframework @gol
684 -image_base  -init  -install_name  -keep_private_externs @gol
685 -multi_module  -multiply_defined  -multiply_defined_unused @gol
686 -noall_load   -no_dead_strip_inits_and_terms @gol
687 -nofixprebinding -nomultidefs  -noprebind  -noseglinkedit @gol
688 -pagezero_size  -prebind  -prebind_all_twolevel_modules @gol
689 -private_bundle  -read_only_relocs  -sectalign @gol
690 -sectobjectsymbols  -whyload  -seg1addr @gol
691 -sectcreate  -sectobjectsymbols  -sectorder @gol
692 -segaddr -segs_read_only_addr -segs_read_write_addr @gol
693 -seg_addr_table  -seg_addr_table_filename  -seglinkedit @gol
694 -segprot  -segs_read_only_addr  -segs_read_write_addr @gol
695 -single_module  -static  -sub_library  -sub_umbrella @gol
696 -twolevel_namespace  -umbrella  -undefined @gol
697 -unexported_symbols_list  -weak_reference_mismatches @gol
698 -whatsloaded -F -gused -gfull -mmacosx-version-min=@var{version} @gol
699 -mkernel -mone-byte-bool}
701 @emph{DEC Alpha Options}
702 @gccoptlist{-mno-fp-regs  -msoft-float @gol
703 -mieee  -mieee-with-inexact  -mieee-conformant @gol
704 -mfp-trap-mode=@var{mode}  -mfp-rounding-mode=@var{mode} @gol
705 -mtrap-precision=@var{mode}  -mbuild-constants @gol
706 -mcpu=@var{cpu-type}  -mtune=@var{cpu-type} @gol
707 -mbwx  -mmax  -mfix  -mcix @gol
708 -mfloat-vax  -mfloat-ieee @gol
709 -mexplicit-relocs  -msmall-data  -mlarge-data @gol
710 -msmall-text  -mlarge-text @gol
711 -mmemory-latency=@var{time}}
713 @emph{FR30 Options}
714 @gccoptlist{-msmall-model -mno-lsim}
716 @emph{FT32 Options}
717 @gccoptlist{-msim -mlra -mnodiv}
719 @emph{FRV Options}
720 @gccoptlist{-mgpr-32  -mgpr-64  -mfpr-32  -mfpr-64 @gol
721 -mhard-float  -msoft-float @gol
722 -malloc-cc  -mfixed-cc  -mdword  -mno-dword @gol
723 -mdouble  -mno-double @gol
724 -mmedia  -mno-media  -mmuladd  -mno-muladd @gol
725 -mfdpic  -minline-plt -mgprel-ro  -multilib-library-pic @gol
726 -mlinked-fp  -mlong-calls  -malign-labels @gol
727 -mlibrary-pic  -macc-4  -macc-8 @gol
728 -mpack  -mno-pack  -mno-eflags  -mcond-move  -mno-cond-move @gol
729 -moptimize-membar -mno-optimize-membar @gol
730 -mscc  -mno-scc  -mcond-exec  -mno-cond-exec @gol
731 -mvliw-branch  -mno-vliw-branch @gol
732 -mmulti-cond-exec  -mno-multi-cond-exec  -mnested-cond-exec @gol
733 -mno-nested-cond-exec  -mtomcat-stats @gol
734 -mTLS -mtls @gol
735 -mcpu=@var{cpu}}
737 @emph{GNU/Linux Options}
738 @gccoptlist{-mglibc -muclibc -mmusl -mbionic -mandroid @gol
739 -tno-android-cc -tno-android-ld}
741 @emph{H8/300 Options}
742 @gccoptlist{-mrelax  -mh  -ms  -mn  -mexr -mno-exr  -mint32  -malign-300}
744 @emph{HPPA Options}
745 @gccoptlist{-march=@var{architecture-type} @gol
746 -mdisable-fpregs  -mdisable-indexing @gol
747 -mfast-indirect-calls  -mgas  -mgnu-ld   -mhp-ld @gol
748 -mfixed-range=@var{register-range} @gol
749 -mjump-in-delay -mlinker-opt -mlong-calls @gol
750 -mlong-load-store  -mno-disable-fpregs @gol
751 -mno-disable-indexing  -mno-fast-indirect-calls  -mno-gas @gol
752 -mno-jump-in-delay  -mno-long-load-store @gol
753 -mno-portable-runtime  -mno-soft-float @gol
754 -mno-space-regs  -msoft-float  -mpa-risc-1-0 @gol
755 -mpa-risc-1-1  -mpa-risc-2-0  -mportable-runtime @gol
756 -mschedule=@var{cpu-type}  -mspace-regs  -msio  -mwsio @gol
757 -munix=@var{unix-std}  -nolibdld  -static  -threads}
759 @emph{IA-64 Options}
760 @gccoptlist{-mbig-endian  -mlittle-endian  -mgnu-as  -mgnu-ld  -mno-pic @gol
761 -mvolatile-asm-stop  -mregister-names  -msdata -mno-sdata @gol
762 -mconstant-gp  -mauto-pic  -mfused-madd @gol
763 -minline-float-divide-min-latency @gol
764 -minline-float-divide-max-throughput @gol
765 -mno-inline-float-divide @gol
766 -minline-int-divide-min-latency @gol
767 -minline-int-divide-max-throughput  @gol
768 -mno-inline-int-divide @gol
769 -minline-sqrt-min-latency -minline-sqrt-max-throughput @gol
770 -mno-inline-sqrt @gol
771 -mdwarf2-asm -mearly-stop-bits @gol
772 -mfixed-range=@var{register-range} -mtls-size=@var{tls-size} @gol
773 -mtune=@var{cpu-type} -milp32 -mlp64 @gol
774 -msched-br-data-spec -msched-ar-data-spec -msched-control-spec @gol
775 -msched-br-in-data-spec -msched-ar-in-data-spec -msched-in-control-spec @gol
776 -msched-spec-ldc -msched-spec-control-ldc @gol
777 -msched-prefer-non-data-spec-insns -msched-prefer-non-control-spec-insns @gol
778 -msched-stop-bits-after-every-cycle -msched-count-spec-in-critical-path @gol
779 -msel-sched-dont-check-control-spec -msched-fp-mem-deps-zero-cost @gol
780 -msched-max-memory-insns-hard-limit -msched-max-memory-insns=@var{max-insns}}
782 @emph{LM32 Options}
783 @gccoptlist{-mbarrel-shift-enabled -mdivide-enabled -mmultiply-enabled @gol
784 -msign-extend-enabled -muser-enabled}
786 @emph{M32R/D Options}
787 @gccoptlist{-m32r2 -m32rx -m32r @gol
788 -mdebug @gol
789 -malign-loops -mno-align-loops @gol
790 -missue-rate=@var{number} @gol
791 -mbranch-cost=@var{number} @gol
792 -mmodel=@var{code-size-model-type} @gol
793 -msdata=@var{sdata-type} @gol
794 -mno-flush-func -mflush-func=@var{name} @gol
795 -mno-flush-trap -mflush-trap=@var{number} @gol
796 -G @var{num}}
798 @emph{M32C Options}
799 @gccoptlist{-mcpu=@var{cpu} -msim -memregs=@var{number}}
801 @emph{M680x0 Options}
802 @gccoptlist{-march=@var{arch}  -mcpu=@var{cpu}  -mtune=@var{tune} @gol
803 -m68000  -m68020  -m68020-40  -m68020-60  -m68030  -m68040 @gol
804 -m68060  -mcpu32  -m5200  -m5206e  -m528x  -m5307  -m5407 @gol
805 -mcfv4e  -mbitfield  -mno-bitfield  -mc68000  -mc68020 @gol
806 -mnobitfield  -mrtd  -mno-rtd  -mdiv  -mno-div  -mshort @gol
807 -mno-short  -mhard-float  -m68881  -msoft-float  -mpcrel @gol
808 -malign-int  -mstrict-align  -msep-data  -mno-sep-data @gol
809 -mshared-library-id=n  -mid-shared-library  -mno-id-shared-library @gol
810 -mxgot -mno-xgot}
812 @emph{MCore Options}
813 @gccoptlist{-mhardlit  -mno-hardlit  -mdiv  -mno-div  -mrelax-immediates @gol
814 -mno-relax-immediates  -mwide-bitfields  -mno-wide-bitfields @gol
815 -m4byte-functions  -mno-4byte-functions  -mcallgraph-data @gol
816 -mno-callgraph-data  -mslow-bytes  -mno-slow-bytes  -mno-lsim @gol
817 -mlittle-endian  -mbig-endian  -m210  -m340  -mstack-increment}
819 @emph{MeP Options}
820 @gccoptlist{-mabsdiff -mall-opts -maverage -mbased=@var{n} -mbitops @gol
821 -mc=@var{n} -mclip -mconfig=@var{name} -mcop -mcop32 -mcop64 -mivc2 @gol
822 -mdc -mdiv -meb -mel -mio-volatile -ml -mleadz -mm -mminmax @gol
823 -mmult -mno-opts -mrepeat -ms -msatur -msdram -msim -msimnovec -mtf @gol
824 -mtiny=@var{n}}
826 @emph{MicroBlaze Options}
827 @gccoptlist{-msoft-float -mhard-float -msmall-divides -mcpu=@var{cpu} @gol
828 -mmemcpy -mxl-soft-mul -mxl-soft-div -mxl-barrel-shift @gol
829 -mxl-pattern-compare -mxl-stack-check -mxl-gp-opt -mno-clearbss @gol
830 -mxl-multiply-high -mxl-float-convert -mxl-float-sqrt @gol
831 -mbig-endian -mlittle-endian -mxl-reorder -mxl-mode-@var{app-model}}
833 @emph{MIPS Options}
834 @gccoptlist{-EL  -EB  -march=@var{arch}  -mtune=@var{arch} @gol
835 -mips1  -mips2  -mips3  -mips4  -mips32  -mips32r2  -mips32r3  -mips32r5 @gol
836 -mips32r6  -mips64  -mips64r2  -mips64r3  -mips64r5  -mips64r6 @gol
837 -mips16  -mno-mips16  -mflip-mips16 @gol
838 -minterlink-compressed -mno-interlink-compressed @gol
839 -minterlink-mips16  -mno-interlink-mips16 @gol
840 -mabi=@var{abi}  -mabicalls  -mno-abicalls @gol
841 -mshared  -mno-shared  -mplt  -mno-plt  -mxgot  -mno-xgot @gol
842 -mgp32  -mgp64  -mfp32  -mfpxx  -mfp64  -mhard-float  -msoft-float @gol
843 -mno-float  -msingle-float  -mdouble-float @gol
844 -modd-spreg -mno-odd-spreg @gol
845 -mabs=@var{mode}  -mnan=@var{encoding} @gol
846 -mdsp  -mno-dsp  -mdspr2  -mno-dspr2 @gol
847 -mmcu -mmno-mcu @gol
848 -meva -mno-eva @gol
849 -mvirt -mno-virt @gol
850 -mxpa -mno-xpa @gol
851 -mmicromips -mno-micromips @gol
852 -mmsa -mno-msa @gol
853 -mfpu=@var{fpu-type} @gol
854 -msmartmips  -mno-smartmips @gol
855 -mpaired-single  -mno-paired-single  -mdmx  -mno-mdmx @gol
856 -mips3d  -mno-mips3d  -mmt  -mno-mt  -mllsc  -mno-llsc @gol
857 -mlong64  -mlong32  -msym32  -mno-sym32 @gol
858 -G@var{num}  -mlocal-sdata  -mno-local-sdata @gol
859 -mextern-sdata  -mno-extern-sdata  -mgpopt  -mno-gopt @gol
860 -membedded-data  -mno-embedded-data @gol
861 -muninit-const-in-rodata  -mno-uninit-const-in-rodata @gol
862 -mcode-readable=@var{setting} @gol
863 -msplit-addresses  -mno-split-addresses @gol
864 -mexplicit-relocs  -mno-explicit-relocs @gol
865 -mcheck-zero-division  -mno-check-zero-division @gol
866 -mdivide-traps  -mdivide-breaks @gol
867 -mmemcpy  -mno-memcpy  -mlong-calls  -mno-long-calls @gol
868 -mmad -mno-mad -mimadd -mno-imadd -mfused-madd  -mno-fused-madd  -nocpp @gol
869 -mfix-24k -mno-fix-24k @gol
870 -mfix-r4000  -mno-fix-r4000  -mfix-r4400  -mno-fix-r4400 @gol
871 -mfix-r10000 -mno-fix-r10000  -mfix-rm7000 -mno-fix-rm7000 @gol
872 -mfix-vr4120  -mno-fix-vr4120 @gol
873 -mfix-vr4130  -mno-fix-vr4130  -mfix-sb1  -mno-fix-sb1 @gol
874 -mflush-func=@var{func}  -mno-flush-func @gol
875 -mbranch-cost=@var{num}  -mbranch-likely  -mno-branch-likely @gol
876 -mcompact-branches=@var{policy} @gol
877 -mfp-exceptions -mno-fp-exceptions @gol
878 -mvr4130-align -mno-vr4130-align -msynci -mno-synci @gol
879 -mrelax-pic-calls -mno-relax-pic-calls -mmcount-ra-address @gol
880 -mframe-header-opt -mno-frame-header-opt}
882 @emph{MMIX Options}
883 @gccoptlist{-mlibfuncs  -mno-libfuncs  -mepsilon  -mno-epsilon  -mabi=gnu @gol
884 -mabi=mmixware  -mzero-extend  -mknuthdiv  -mtoplevel-symbols @gol
885 -melf  -mbranch-predict  -mno-branch-predict  -mbase-addresses @gol
886 -mno-base-addresses  -msingle-exit  -mno-single-exit}
888 @emph{MN10300 Options}
889 @gccoptlist{-mmult-bug  -mno-mult-bug @gol
890 -mno-am33 -mam33 -mam33-2 -mam34 @gol
891 -mtune=@var{cpu-type} @gol
892 -mreturn-pointer-on-d0 @gol
893 -mno-crt0  -mrelax -mliw -msetlb}
895 @emph{Moxie Options}
896 @gccoptlist{-meb -mel -mmul.x -mno-crt0}
898 @emph{MSP430 Options}
899 @gccoptlist{-msim -masm-hex -mmcu= -mcpu= -mlarge -msmall -mrelax @gol
900 -mwarn-mcu @gol
901 -mcode-region= -mdata-region= @gol
902 -msilicon-errata= -msilicon-errata-warn= @gol
903 -mhwmult= -minrt}
905 @emph{NDS32 Options}
906 @gccoptlist{-mbig-endian -mlittle-endian @gol
907 -mreduced-regs -mfull-regs @gol
908 -mcmov -mno-cmov @gol
909 -mperf-ext -mno-perf-ext @gol
910 -mv3push -mno-v3push @gol
911 -m16bit -mno-16bit @gol
912 -misr-vector-size=@var{num} @gol
913 -mcache-block-size=@var{num} @gol
914 -march=@var{arch} @gol
915 -mcmodel=@var{code-model} @gol
916 -mctor-dtor -mrelax}
918 @emph{Nios II Options}
919 @gccoptlist{-G @var{num} -mgpopt=@var{option} -mgpopt -mno-gpopt @gol
920 -mel -meb @gol
921 -mno-bypass-cache -mbypass-cache @gol
922 -mno-cache-volatile -mcache-volatile @gol
923 -mno-fast-sw-div -mfast-sw-div @gol
924 -mhw-mul -mno-hw-mul -mhw-mulx -mno-hw-mulx -mno-hw-div -mhw-div @gol
925 -mcustom-@var{insn}=@var{N} -mno-custom-@var{insn} @gol
926 -mcustom-fpu-cfg=@var{name} @gol
927 -mhal -msmallc -msys-crt0=@var{name} -msys-lib=@var{name} @gol
928 -march=@var{arch} -mbmx -mno-bmx -mcdx -mno-cdx}
930 @emph{Nvidia PTX Options}
931 @gccoptlist{-m32 -m64 -mmainkernel -moptimize}
933 @emph{PDP-11 Options}
934 @gccoptlist{-mfpu  -msoft-float  -mac0  -mno-ac0  -m40  -m45  -m10 @gol
935 -mbcopy  -mbcopy-builtin  -mint32  -mno-int16 @gol
936 -mint16  -mno-int32  -mfloat32  -mno-float64 @gol
937 -mfloat64  -mno-float32  -mabshi  -mno-abshi @gol
938 -mbranch-expensive  -mbranch-cheap @gol
939 -munix-asm  -mdec-asm}
941 @emph{picoChip Options}
942 @gccoptlist{-mae=@var{ae_type} -mvliw-lookahead=@var{N} @gol
943 -msymbol-as-address -mno-inefficient-warnings}
945 @emph{PowerPC Options}
946 See RS/6000 and PowerPC Options.
948 @emph{RL78 Options}
949 @gccoptlist{-msim -mmul=none -mmul=g13 -mmul=g14 -mallregs @gol
950 -mcpu=g10 -mcpu=g13 -mcpu=g14 -mg10 -mg13 -mg14 @gol
951 -m64bit-doubles -m32bit-doubles -msave-mduc-in-interrupts}
953 @emph{RS/6000 and PowerPC Options}
954 @gccoptlist{-mcpu=@var{cpu-type} @gol
955 -mtune=@var{cpu-type} @gol
956 -mcmodel=@var{code-model} @gol
957 -mpowerpc64 @gol
958 -maltivec  -mno-altivec @gol
959 -mpowerpc-gpopt  -mno-powerpc-gpopt @gol
960 -mpowerpc-gfxopt  -mno-powerpc-gfxopt @gol
961 -mmfcrf  -mno-mfcrf  -mpopcntb  -mno-popcntb -mpopcntd -mno-popcntd @gol
962 -mfprnd  -mno-fprnd @gol
963 -mcmpb -mno-cmpb -mmfpgpr -mno-mfpgpr -mhard-dfp -mno-hard-dfp @gol
964 -mfull-toc   -mminimal-toc  -mno-fp-in-toc  -mno-sum-in-toc @gol
965 -m64  -m32  -mxl-compat  -mno-xl-compat  -mpe @gol
966 -malign-power  -malign-natural @gol
967 -msoft-float  -mhard-float  -mmultiple  -mno-multiple @gol
968 -msingle-float -mdouble-float -msimple-fpu @gol
969 -mstring  -mno-string  -mupdate  -mno-update @gol
970 -mavoid-indexed-addresses  -mno-avoid-indexed-addresses @gol
971 -mfused-madd  -mno-fused-madd  -mbit-align  -mno-bit-align @gol
972 -mstrict-align  -mno-strict-align  -mrelocatable @gol
973 -mno-relocatable  -mrelocatable-lib  -mno-relocatable-lib @gol
974 -mtoc  -mno-toc  -mlittle  -mlittle-endian  -mbig  -mbig-endian @gol
975 -mdynamic-no-pic  -maltivec -mswdiv  -msingle-pic-base @gol
976 -mprioritize-restricted-insns=@var{priority} @gol
977 -msched-costly-dep=@var{dependence_type} @gol
978 -minsert-sched-nops=@var{scheme} @gol
979 -mcall-sysv  -mcall-netbsd @gol
980 -maix-struct-return  -msvr4-struct-return @gol
981 -mabi=@var{abi-type} -msecure-plt -mbss-plt @gol
982 -mblock-move-inline-limit=@var{num} @gol
983 -misel -mno-isel @gol
984 -misel=yes  -misel=no @gol
985 -mspe -mno-spe @gol
986 -mspe=yes  -mspe=no @gol
987 -mpaired @gol
988 -mgen-cell-microcode -mwarn-cell-microcode @gol
989 -mvrsave -mno-vrsave @gol
990 -mmulhw -mno-mulhw @gol
991 -mdlmzb -mno-dlmzb @gol
992 -mfloat-gprs=yes  -mfloat-gprs=no -mfloat-gprs=single -mfloat-gprs=double @gol
993 -mprototype  -mno-prototype @gol
994 -msim  -mmvme  -mads  -myellowknife  -memb  -msdata @gol
995 -msdata=@var{opt}  -mvxworks  -G @var{num}  -pthread @gol
996 -mrecip -mrecip=@var{opt} -mno-recip -mrecip-precision @gol
997 -mno-recip-precision @gol
998 -mveclibabi=@var{type} -mfriz -mno-friz @gol
999 -mpointers-to-nested-functions -mno-pointers-to-nested-functions @gol
1000 -msave-toc-indirect -mno-save-toc-indirect @gol
1001 -mpower8-fusion -mno-mpower8-fusion -mpower8-vector -mno-power8-vector @gol
1002 -mcrypto -mno-crypto -mdirect-move -mno-direct-move @gol
1003 -mquad-memory -mno-quad-memory @gol
1004 -mquad-memory-atomic -mno-quad-memory-atomic @gol
1005 -mcompat-align-parm -mno-compat-align-parm @gol
1006 -mupper-regs-df -mno-upper-regs-df -mupper-regs-sf -mno-upper-regs-sf @gol
1007 -mupper-regs -mno-upper-regs -mmodulo -mno-modulo @gol
1008 -mfloat128 -mno-float128 -mfloat128-hardware -mno-float128-hardware @gol
1009 -mpower9-fusion -mno-mpower9-fusion -mpower9-vector -mno-power9-vector @gol
1010 -mpower9-dform -mno-power9-dform -mlra -mno-lra}
1012 @emph{RX Options}
1013 @gccoptlist{-m64bit-doubles  -m32bit-doubles  -fpu  -nofpu@gol
1014 -mcpu=@gol
1015 -mbig-endian-data -mlittle-endian-data @gol
1016 -msmall-data @gol
1017 -msim  -mno-sim@gol
1018 -mas100-syntax -mno-as100-syntax@gol
1019 -mrelax@gol
1020 -mmax-constant-size=@gol
1021 -mint-register=@gol
1022 -mpid@gol
1023 -mallow-string-insns -mno-allow-string-insns@gol
1024 -mjsr@gol
1025 -mno-warn-multiple-fast-interrupts@gol
1026 -msave-acc-in-interrupts}
1028 @emph{S/390 and zSeries Options}
1029 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1030 -mhard-float  -msoft-float  -mhard-dfp -mno-hard-dfp @gol
1031 -mlong-double-64 -mlong-double-128 @gol
1032 -mbackchain  -mno-backchain -mpacked-stack  -mno-packed-stack @gol
1033 -msmall-exec  -mno-small-exec  -mmvcle -mno-mvcle @gol
1034 -m64  -m31  -mdebug  -mno-debug  -mesa  -mzarch @gol
1035 -mhtm -mvx -mzvector @gol
1036 -mtpf-trace -mno-tpf-trace  -mfused-madd  -mno-fused-madd @gol
1037 -mwarn-framesize  -mwarn-dynamicstack  -mstack-size -mstack-guard @gol
1038 -mhotpatch=@var{halfwords},@var{halfwords}}
1040 @emph{Score Options}
1041 @gccoptlist{-meb -mel @gol
1042 -mnhwloop @gol
1043 -muls @gol
1044 -mmac @gol
1045 -mscore5 -mscore5u -mscore7 -mscore7d}
1047 @emph{SH Options}
1048 @gccoptlist{-m1  -m2  -m2e @gol
1049 -m2a-nofpu -m2a-single-only -m2a-single -m2a @gol
1050 -m3  -m3e @gol
1051 -m4-nofpu  -m4-single-only  -m4-single  -m4 @gol
1052 -m4a-nofpu -m4a-single-only -m4a-single -m4a -m4al @gol
1053 -mb  -ml  -mdalign  -mrelax @gol
1054 -mbigtable -mfmovd -mrenesas -mno-renesas -mnomacsave @gol
1055 -mieee -mno-ieee -mbitops  -misize  -minline-ic_invalidate -mpadstruct @gol
1056 -mprefergot -musermode -multcost=@var{number} -mdiv=@var{strategy} @gol
1057 -mdivsi3_libfunc=@var{name} -mfixed-range=@var{register-range} @gol
1058 -maccumulate-outgoing-args @gol
1059 -matomic-model=@var{atomic-model} @gol
1060 -mbranch-cost=@var{num} -mzdcbranch -mno-zdcbranch @gol
1061 -mcbranch-force-delay-slot @gol
1062 -mfused-madd -mno-fused-madd -mfsca -mno-fsca -mfsrra -mno-fsrra @gol
1063 -mpretend-cmove -mtas}
1065 @emph{Solaris 2 Options}
1066 @gccoptlist{-mclear-hwcap -mno-clear-hwcap -mimpure-text  -mno-impure-text @gol
1067 -pthreads -pthread}
1069 @emph{SPARC Options}
1070 @gccoptlist{-mcpu=@var{cpu-type} @gol
1071 -mtune=@var{cpu-type} @gol
1072 -mcmodel=@var{code-model} @gol
1073 -mmemory-model=@var{mem-model} @gol
1074 -m32  -m64  -mapp-regs  -mno-app-regs @gol
1075 -mfaster-structs  -mno-faster-structs  -mflat  -mno-flat @gol
1076 -mfpu  -mno-fpu  -mhard-float  -msoft-float @gol
1077 -mhard-quad-float  -msoft-quad-float @gol
1078 -mstack-bias  -mno-stack-bias @gol
1079 -mstd-struct-return  -mno-std-struct-return @gol
1080 -munaligned-doubles  -mno-unaligned-doubles @gol
1081 -muser-mode  -mno-user-mode @gol
1082 -mv8plus  -mno-v8plus  -mvis  -mno-vis @gol
1083 -mvis2  -mno-vis2  -mvis3  -mno-vis3 @gol
1084 -mcbcond -mno-cbcond @gol
1085 -mfmaf  -mno-fmaf  -mpopc  -mno-popc @gol
1086 -mfix-at697f -mfix-ut699}
1088 @emph{SPU Options}
1089 @gccoptlist{-mwarn-reloc -merror-reloc @gol
1090 -msafe-dma -munsafe-dma @gol
1091 -mbranch-hints @gol
1092 -msmall-mem -mlarge-mem -mstdmain @gol
1093 -mfixed-range=@var{register-range} @gol
1094 -mea32 -mea64 @gol
1095 -maddress-space-conversion -mno-address-space-conversion @gol
1096 -mcache-size=@var{cache-size} @gol
1097 -matomic-updates -mno-atomic-updates}
1099 @emph{System V Options}
1100 @gccoptlist{-Qy  -Qn  -YP,@var{paths}  -Ym,@var{dir}}
1102 @emph{TILE-Gx Options}
1103 @gccoptlist{-mcpu=CPU -m32 -m64 -mbig-endian -mlittle-endian @gol
1104 -mcmodel=@var{code-model}}
1106 @emph{TILEPro Options}
1107 @gccoptlist{-mcpu=@var{cpu} -m32}
1109 @emph{V850 Options}
1110 @gccoptlist{-mlong-calls  -mno-long-calls  -mep  -mno-ep @gol
1111 -mprolog-function  -mno-prolog-function  -mspace @gol
1112 -mtda=@var{n}  -msda=@var{n}  -mzda=@var{n} @gol
1113 -mapp-regs  -mno-app-regs @gol
1114 -mdisable-callt  -mno-disable-callt @gol
1115 -mv850e2v3 -mv850e2 -mv850e1 -mv850es @gol
1116 -mv850e -mv850 -mv850e3v5 @gol
1117 -mloop @gol
1118 -mrelax @gol
1119 -mlong-jumps @gol
1120 -msoft-float @gol
1121 -mhard-float @gol
1122 -mgcc-abi @gol
1123 -mrh850-abi @gol
1124 -mbig-switch}
1126 @emph{VAX Options}
1127 @gccoptlist{-mg  -mgnu  -munix}
1129 @emph{Visium Options}
1130 @gccoptlist{-mdebug -msim -mfpu -mno-fpu -mhard-float -msoft-float @gol
1131 -mcpu=@var{cpu-type} -mtune=@var{cpu-type} -msv-mode -muser-mode}
1133 @emph{VMS Options}
1134 @gccoptlist{-mvms-return-codes -mdebug-main=@var{prefix} -mmalloc64 @gol
1135 -mpointer-size=@var{size}}
1137 @emph{VxWorks Options}
1138 @gccoptlist{-mrtp  -non-static  -Bstatic  -Bdynamic @gol
1139 -Xbind-lazy  -Xbind-now}
1141 @emph{x86 Options}
1142 @gccoptlist{-mtune=@var{cpu-type}  -march=@var{cpu-type} @gol
1143 -mtune-ctrl=@var{feature-list} -mdump-tune-features -mno-default @gol
1144 -mfpmath=@var{unit} @gol
1145 -masm=@var{dialect}  -mno-fancy-math-387 @gol
1146 -mno-fp-ret-in-387  -msoft-float @gol
1147 -mno-wide-multiply  -mrtd  -malign-double @gol
1148 -mpreferred-stack-boundary=@var{num} @gol
1149 -mincoming-stack-boundary=@var{num} @gol
1150 -mcld -mcx16 -msahf -mmovbe -mcrc32 @gol
1151 -mrecip -mrecip=@var{opt} @gol
1152 -mvzeroupper -mprefer-avx128 @gol
1153 -mmmx  -msse  -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -msse4 -mavx @gol
1154 -mavx2 -mavx512f -mavx512pf -mavx512er -mavx512cd -mavx512vl @gol
1155 -mavx512bw -mavx512dq -mavx512ifma -mavx512vbmi -msha -maes @gol
1156 -mpclmul -mfsgsbase -mrdrnd -mf16c -mfma @gol
1157 -mprefetchwt1 -mclflushopt -mxsavec -mxsaves @gol
1158 -msse4a -m3dnow -mpopcnt -mabm -mbmi -mtbm -mfma4 -mxop -mlzcnt @gol
1159 -mbmi2 -mfxsr -mxsave -mxsaveopt -mrtm -mlwp -mmpx -mmwaitx -mclzero
1160 -mpku -mthreads @gol
1161 -mms-bitfields -mno-align-stringops  -minline-all-stringops @gol
1162 -minline-stringops-dynamically -mstringop-strategy=@var{alg} @gol
1163 -mmemcpy-strategy=@var{strategy} -mmemset-strategy=@var{strategy} @gol
1164 -mpush-args  -maccumulate-outgoing-args  -m128bit-long-double @gol
1165 -m96bit-long-double -mlong-double-64 -mlong-double-80 -mlong-double-128 @gol
1166 -mregparm=@var{num}  -msseregparm @gol
1167 -mveclibabi=@var{type} -mvect8-ret-in-mem @gol
1168 -mpc32 -mpc64 -mpc80 -mstackrealign @gol
1169 -momit-leaf-frame-pointer  -mno-red-zone -mno-tls-direct-seg-refs @gol
1170 -mcmodel=@var{code-model} -mabi=@var{name} -maddress-mode=@var{mode} @gol
1171 -m32 -m64 -mx32 -m16 -miamcu -mlarge-data-threshold=@var{num} @gol
1172 -msse2avx -mfentry -mrecord-mcount -mnop-mcount -m8bit-idiv @gol
1173 -mavx256-split-unaligned-load -mavx256-split-unaligned-store @gol
1174 -malign-data=@var{type} -mstack-protector-guard=@var{guard} @gol
1175 -mmitigate-rop}
1177 @emph{x86 Windows Options}
1178 @gccoptlist{-mconsole -mcygwin -mno-cygwin -mdll @gol
1179 -mnop-fun-dllimport -mthread @gol
1180 -municode -mwin32 -mwindows -fno-set-stack-executable}
1182 @emph{Xstormy16 Options}
1183 @gccoptlist{-msim}
1185 @emph{Xtensa Options}
1186 @gccoptlist{-mconst16 -mno-const16 @gol
1187 -mfused-madd  -mno-fused-madd @gol
1188 -mforce-no-pic @gol
1189 -mserialize-volatile  -mno-serialize-volatile @gol
1190 -mtext-section-literals  -mno-text-section-literals @gol
1191 -mauto-litpools  -mno-auto-litpools @gol
1192 -mtarget-align  -mno-target-align @gol
1193 -mlongcalls  -mno-longcalls}
1195 @emph{zSeries Options}
1196 See S/390 and zSeries Options.
1197 @end table
1200 @node Overall Options
1201 @section Options Controlling the Kind of Output
1203 Compilation can involve up to four stages: preprocessing, compilation
1204 proper, assembly and linking, always in that order.  GCC is capable of
1205 preprocessing and compiling several files either into several
1206 assembler input files, or into one assembler input file; then each
1207 assembler input file produces an object file, and linking combines all
1208 the object files (those newly compiled, and those specified as input)
1209 into an executable file.
1211 @cindex file name suffix
1212 For any given input file, the file name suffix determines what kind of
1213 compilation is done:
1215 @table @gcctabopt
1216 @item @var{file}.c
1217 C source code that must be preprocessed.
1219 @item @var{file}.i
1220 C source code that should not be preprocessed.
1222 @item @var{file}.ii
1223 C++ source code that should not be preprocessed.
1225 @item @var{file}.m
1226 Objective-C source code.  Note that you must link with the @file{libobjc}
1227 library to make an Objective-C program work.
1229 @item @var{file}.mi
1230 Objective-C source code that should not be preprocessed.
1232 @item @var{file}.mm
1233 @itemx @var{file}.M
1234 Objective-C++ source code.  Note that you must link with the @file{libobjc}
1235 library to make an Objective-C++ program work.  Note that @samp{.M} refers
1236 to a literal capital M@.
1238 @item @var{file}.mii
1239 Objective-C++ source code that should not be preprocessed.
1241 @item @var{file}.h
1242 C, C++, Objective-C or Objective-C++ header file to be turned into a
1243 precompiled header (default), or C, C++ header file to be turned into an
1244 Ada spec (via the @option{-fdump-ada-spec} switch).
1246 @item @var{file}.cc
1247 @itemx @var{file}.cp
1248 @itemx @var{file}.cxx
1249 @itemx @var{file}.cpp
1250 @itemx @var{file}.CPP
1251 @itemx @var{file}.c++
1252 @itemx @var{file}.C
1253 C++ source code that must be preprocessed.  Note that in @samp{.cxx},
1254 the last two letters must both be literally @samp{x}.  Likewise,
1255 @samp{.C} refers to a literal capital C@.
1257 @item @var{file}.mm
1258 @itemx @var{file}.M
1259 Objective-C++ source code that must be preprocessed.
1261 @item @var{file}.mii
1262 Objective-C++ source code that should not be preprocessed.
1264 @item @var{file}.hh
1265 @itemx @var{file}.H
1266 @itemx @var{file}.hp
1267 @itemx @var{file}.hxx
1268 @itemx @var{file}.hpp
1269 @itemx @var{file}.HPP
1270 @itemx @var{file}.h++
1271 @itemx @var{file}.tcc
1272 C++ header file to be turned into a precompiled header or Ada spec.
1274 @item @var{file}.f
1275 @itemx @var{file}.for
1276 @itemx @var{file}.ftn
1277 Fixed form Fortran source code that should not be preprocessed.
1279 @item @var{file}.F
1280 @itemx @var{file}.FOR
1281 @itemx @var{file}.fpp
1282 @itemx @var{file}.FPP
1283 @itemx @var{file}.FTN
1284 Fixed form Fortran source code that must be preprocessed (with the traditional
1285 preprocessor).
1287 @item @var{file}.f90
1288 @itemx @var{file}.f95
1289 @itemx @var{file}.f03
1290 @itemx @var{file}.f08
1291 Free form Fortran source code that should not be preprocessed.
1293 @item @var{file}.F90
1294 @itemx @var{file}.F95
1295 @itemx @var{file}.F03
1296 @itemx @var{file}.F08
1297 Free form Fortran source code that must be preprocessed (with the
1298 traditional preprocessor).
1300 @item @var{file}.go
1301 Go source code.
1303 @c FIXME: Descriptions of Java file types.
1304 @c @var{file}.java
1305 @c @var{file}.class
1306 @c @var{file}.zip
1307 @c @var{file}.jar
1309 @item @var{file}.ads
1310 Ada source code file that contains a library unit declaration (a
1311 declaration of a package, subprogram, or generic, or a generic
1312 instantiation), or a library unit renaming declaration (a package,
1313 generic, or subprogram renaming declaration).  Such files are also
1314 called @dfn{specs}.
1316 @item @var{file}.adb
1317 Ada source code file containing a library unit body (a subprogram or
1318 package body).  Such files are also called @dfn{bodies}.
1320 @c GCC also knows about some suffixes for languages not yet included:
1321 @c Pascal:
1322 @c @var{file}.p
1323 @c @var{file}.pas
1324 @c Ratfor:
1325 @c @var{file}.r
1327 @item @var{file}.s
1328 Assembler code.
1330 @item @var{file}.S
1331 @itemx @var{file}.sx
1332 Assembler code that must be preprocessed.
1334 @item @var{other}
1335 An object file to be fed straight into linking.
1336 Any file name with no recognized suffix is treated this way.
1337 @end table
1339 @opindex x
1340 You can specify the input language explicitly with the @option{-x} option:
1342 @table @gcctabopt
1343 @item -x @var{language}
1344 Specify explicitly the @var{language} for the following input files
1345 (rather than letting the compiler choose a default based on the file
1346 name suffix).  This option applies to all following input files until
1347 the next @option{-x} option.  Possible values for @var{language} are:
1348 @smallexample
1349 c  c-header  cpp-output
1350 c++  c++-header  c++-cpp-output
1351 objective-c  objective-c-header  objective-c-cpp-output
1352 objective-c++ objective-c++-header objective-c++-cpp-output
1353 assembler  assembler-with-cpp
1355 f77  f77-cpp-input f95  f95-cpp-input
1357 java
1358 @end smallexample
1360 @item -x none
1361 Turn off any specification of a language, so that subsequent files are
1362 handled according to their file name suffixes (as they are if @option{-x}
1363 has not been used at all).
1364 @end table
1366 If you only want some of the stages of compilation, you can use
1367 @option{-x} (or filename suffixes) to tell @command{gcc} where to start, and
1368 one of the options @option{-c}, @option{-S}, or @option{-E} to say where
1369 @command{gcc} is to stop.  Note that some combinations (for example,
1370 @samp{-x cpp-output -E}) instruct @command{gcc} to do nothing at all.
1372 @table @gcctabopt
1373 @item -c
1374 @opindex c
1375 Compile or assemble the source files, but do not link.  The linking
1376 stage simply is not done.  The ultimate output is in the form of an
1377 object file for each source file.
1379 By default, the object file name for a source file is made by replacing
1380 the suffix @samp{.c}, @samp{.i}, @samp{.s}, etc., with @samp{.o}.
1382 Unrecognized input files, not requiring compilation or assembly, are
1383 ignored.
1385 @item -S
1386 @opindex S
1387 Stop after the stage of compilation proper; do not assemble.  The output
1388 is in the form of an assembler code file for each non-assembler input
1389 file specified.
1391 By default, the assembler file name for a source file is made by
1392 replacing the suffix @samp{.c}, @samp{.i}, etc., with @samp{.s}.
1394 Input files that don't require compilation are ignored.
1396 @item -E
1397 @opindex E
1398 Stop after the preprocessing stage; do not run the compiler proper.  The
1399 output is in the form of preprocessed source code, which is sent to the
1400 standard output.
1402 Input files that don't require preprocessing are ignored.
1404 @cindex output file option
1405 @item -o @var{file}
1406 @opindex o
1407 Place output in file @var{file}.  This applies to whatever
1408 sort of output is being produced, whether it be an executable file,
1409 an object file, an assembler file or preprocessed C code.
1411 If @option{-o} is not specified, the default is to put an executable
1412 file in @file{a.out}, the object file for
1413 @file{@var{source}.@var{suffix}} in @file{@var{source}.o}, its
1414 assembler file in @file{@var{source}.s}, a precompiled header file in
1415 @file{@var{source}.@var{suffix}.gch}, and all preprocessed C source on
1416 standard output.
1418 @item -v
1419 @opindex v
1420 Print (on standard error output) the commands executed to run the stages
1421 of compilation.  Also print the version number of the compiler driver
1422 program and of the preprocessor and the compiler proper.
1424 @item -###
1425 @opindex ###
1426 Like @option{-v} except the commands are not executed and arguments
1427 are quoted unless they contain only alphanumeric characters or @code{./-_}.
1428 This is useful for shell scripts to capture the driver-generated command lines.
1430 @item --help
1431 @opindex help
1432 Print (on the standard output) a description of the command-line options
1433 understood by @command{gcc}.  If the @option{-v} option is also specified
1434 then @option{--help} is also passed on to the various processes
1435 invoked by @command{gcc}, so that they can display the command-line options
1436 they accept.  If the @option{-Wextra} option has also been specified
1437 (prior to the @option{--help} option), then command-line options that
1438 have no documentation associated with them are also displayed.
1440 @item --target-help
1441 @opindex target-help
1442 Print (on the standard output) a description of target-specific command-line
1443 options for each tool.  For some targets extra target-specific
1444 information may also be printed.
1446 @item --help=@{@var{class}@r{|[}^@r{]}@var{qualifier}@}@r{[},@dots{}@r{]}
1447 Print (on the standard output) a description of the command-line
1448 options understood by the compiler that fit into all specified classes
1449 and qualifiers.  These are the supported classes:
1451 @table @asis
1452 @item @samp{optimizers}
1453 Display all of the optimization options supported by the
1454 compiler.
1456 @item @samp{warnings}
1457 Display all of the options controlling warning messages
1458 produced by the compiler.
1460 @item @samp{target}
1461 Display target-specific options.  Unlike the
1462 @option{--target-help} option however, target-specific options of the
1463 linker and assembler are not displayed.  This is because those
1464 tools do not currently support the extended @option{--help=} syntax.
1466 @item @samp{params}
1467 Display the values recognized by the @option{--param}
1468 option.
1470 @item @var{language}
1471 Display the options supported for @var{language}, where
1472 @var{language} is the name of one of the languages supported in this
1473 version of GCC@.
1475 @item @samp{common}
1476 Display the options that are common to all languages.
1477 @end table
1479 These are the supported qualifiers:
1481 @table @asis
1482 @item @samp{undocumented}
1483 Display only those options that are undocumented.
1485 @item @samp{joined}
1486 Display options taking an argument that appears after an equal
1487 sign in the same continuous piece of text, such as:
1488 @samp{--help=target}.
1490 @item @samp{separate}
1491 Display options taking an argument that appears as a separate word
1492 following the original option, such as: @samp{-o output-file}.
1493 @end table
1495 Thus for example to display all the undocumented target-specific
1496 switches supported by the compiler, use:
1498 @smallexample
1499 --help=target,undocumented
1500 @end smallexample
1502 The sense of a qualifier can be inverted by prefixing it with the
1503 @samp{^} character, so for example to display all binary warning
1504 options (i.e., ones that are either on or off and that do not take an
1505 argument) that have a description, use:
1507 @smallexample
1508 --help=warnings,^joined,^undocumented
1509 @end smallexample
1511 The argument to @option{--help=} should not consist solely of inverted
1512 qualifiers.
1514 Combining several classes is possible, although this usually
1515 restricts the output so much that there is nothing to display.  One
1516 case where it does work, however, is when one of the classes is
1517 @var{target}.  For example, to display all the target-specific
1518 optimization options, use:
1520 @smallexample
1521 --help=target,optimizers
1522 @end smallexample
1524 The @option{--help=} option can be repeated on the command line.  Each
1525 successive use displays its requested class of options, skipping
1526 those that have already been displayed.
1528 If the @option{-Q} option appears on the command line before the
1529 @option{--help=} option, then the descriptive text displayed by
1530 @option{--help=} is changed.  Instead of describing the displayed
1531 options, an indication is given as to whether the option is enabled,
1532 disabled or set to a specific value (assuming that the compiler
1533 knows this at the point where the @option{--help=} option is used).
1535 Here is a truncated example from the ARM port of @command{gcc}:
1537 @smallexample
1538   % gcc -Q -mabi=2 --help=target -c
1539   The following options are target specific:
1540   -mabi=                                2
1541   -mabort-on-noreturn                   [disabled]
1542   -mapcs                                [disabled]
1543 @end smallexample
1545 The output is sensitive to the effects of previous command-line
1546 options, so for example it is possible to find out which optimizations
1547 are enabled at @option{-O2} by using:
1549 @smallexample
1550 -Q -O2 --help=optimizers
1551 @end smallexample
1553 Alternatively you can discover which binary optimizations are enabled
1554 by @option{-O3} by using:
1556 @smallexample
1557 gcc -c -Q -O3 --help=optimizers > /tmp/O3-opts
1558 gcc -c -Q -O2 --help=optimizers > /tmp/O2-opts
1559 diff /tmp/O2-opts /tmp/O3-opts | grep enabled
1560 @end smallexample
1562 @item --version
1563 @opindex version
1564 Display the version number and copyrights of the invoked GCC@.
1566 @item -pass-exit-codes
1567 @opindex pass-exit-codes
1568 Normally the @command{gcc} program exits with the code of 1 if any
1569 phase of the compiler returns a non-success return code.  If you specify
1570 @option{-pass-exit-codes}, the @command{gcc} program instead returns with
1571 the numerically highest error produced by any phase returning an error
1572 indication.  The C, C++, and Fortran front ends return 4 if an internal
1573 compiler error is encountered.
1575 @item -pipe
1576 @opindex pipe
1577 Use pipes rather than temporary files for communication between the
1578 various stages of compilation.  This fails to work on some systems where
1579 the assembler is unable to read from a pipe; but the GNU assembler has
1580 no trouble.
1582 @item -specs=@var{file}
1583 @opindex specs
1584 Process @var{file} after the compiler reads in the standard @file{specs}
1585 file, in order to override the defaults which the @command{gcc} driver
1586 program uses when determining what switches to pass to @command{cc1},
1587 @command{cc1plus}, @command{as}, @command{ld}, etc.  More than one
1588 @option{-specs=@var{file}} can be specified on the command line, and they
1589 are processed in order, from left to right.  @xref{Spec Files}, for
1590 information about the format of the @var{file}.
1592 @item -wrapper
1593 @opindex wrapper
1594 Invoke all subcommands under a wrapper program.  The name of the
1595 wrapper program and its parameters are passed as a comma separated
1596 list.
1598 @smallexample
1599 gcc -c t.c -wrapper gdb,--args
1600 @end smallexample
1602 @noindent
1603 This invokes all subprograms of @command{gcc} under
1604 @samp{gdb --args}, thus the invocation of @command{cc1} is
1605 @samp{gdb --args cc1 @dots{}}.
1607 @item -fplugin=@var{name}.so
1608 @opindex fplugin
1609 Load the plugin code in file @var{name}.so, assumed to be a
1610 shared object to be dlopen'd by the compiler.  The base name of
1611 the shared object file is used to identify the plugin for the
1612 purposes of argument parsing (See
1613 @option{-fplugin-arg-@var{name}-@var{key}=@var{value}} below).
1614 Each plugin should define the callback functions specified in the
1615 Plugins API.
1617 @item -fplugin-arg-@var{name}-@var{key}=@var{value}
1618 @opindex fplugin-arg
1619 Define an argument called @var{key} with a value of @var{value}
1620 for the plugin called @var{name}.
1622 @item -fdump-ada-spec@r{[}-slim@r{]}
1623 @opindex fdump-ada-spec
1624 For C and C++ source and include files, generate corresponding Ada specs.
1625 @xref{Generating Ada Bindings for C and C++ headers,,, gnat_ugn,
1626 GNAT User's Guide}, which provides detailed documentation on this feature.
1628 @item -fada-spec-parent=@var{unit}
1629 @opindex fada-spec-parent
1630 In conjunction with @option{-fdump-ada-spec@r{[}-slim@r{]}} above, generate
1631 Ada specs as child units of parent @var{unit}.
1633 @item -fdump-go-spec=@var{file}
1634 @opindex fdump-go-spec
1635 For input files in any language, generate corresponding Go
1636 declarations in @var{file}.  This generates Go @code{const},
1637 @code{type}, @code{var}, and @code{func} declarations which may be a
1638 useful way to start writing a Go interface to code written in some
1639 other language.
1641 @include @value{srcdir}/../libiberty/at-file.texi
1642 @end table
1644 @node Invoking G++
1645 @section Compiling C++ Programs
1647 @cindex suffixes for C++ source
1648 @cindex C++ source file suffixes
1649 C++ source files conventionally use one of the suffixes @samp{.C},
1650 @samp{.cc}, @samp{.cpp}, @samp{.CPP}, @samp{.c++}, @samp{.cp}, or
1651 @samp{.cxx}; C++ header files often use @samp{.hh}, @samp{.hpp},
1652 @samp{.H}, or (for shared template code) @samp{.tcc}; and
1653 preprocessed C++ files use the suffix @samp{.ii}.  GCC recognizes
1654 files with these names and compiles them as C++ programs even if you
1655 call the compiler the same way as for compiling C programs (usually
1656 with the name @command{gcc}).
1658 @findex g++
1659 @findex c++
1660 However, the use of @command{gcc} does not add the C++ library.
1661 @command{g++} is a program that calls GCC and automatically specifies linking
1662 against the C++ library.  It treats @samp{.c},
1663 @samp{.h} and @samp{.i} files as C++ source files instead of C source
1664 files unless @option{-x} is used.  This program is also useful when
1665 precompiling a C header file with a @samp{.h} extension for use in C++
1666 compilations.  On many systems, @command{g++} is also installed with
1667 the name @command{c++}.
1669 @cindex invoking @command{g++}
1670 When you compile C++ programs, you may specify many of the same
1671 command-line options that you use for compiling programs in any
1672 language; or command-line options meaningful for C and related
1673 languages; or options that are meaningful only for C++ programs.
1674 @xref{C Dialect Options,,Options Controlling C Dialect}, for
1675 explanations of options for languages related to C@.
1676 @xref{C++ Dialect Options,,Options Controlling C++ Dialect}, for
1677 explanations of options that are meaningful only for C++ programs.
1679 @node C Dialect Options
1680 @section Options Controlling C Dialect
1681 @cindex dialect options
1682 @cindex language dialect options
1683 @cindex options, dialect
1685 The following options control the dialect of C (or languages derived
1686 from C, such as C++, Objective-C and Objective-C++) that the compiler
1687 accepts:
1689 @table @gcctabopt
1690 @cindex ANSI support
1691 @cindex ISO support
1692 @item -ansi
1693 @opindex ansi
1694 In C mode, this is equivalent to @option{-std=c90}. In C++ mode, it is
1695 equivalent to @option{-std=c++98}.
1697 This turns off certain features of GCC that are incompatible with ISO
1698 C90 (when compiling C code), or of standard C++ (when compiling C++ code),
1699 such as the @code{asm} and @code{typeof} keywords, and
1700 predefined macros such as @code{unix} and @code{vax} that identify the
1701 type of system you are using.  It also enables the undesirable and
1702 rarely used ISO trigraph feature.  For the C compiler,
1703 it disables recognition of C++ style @samp{//} comments as well as
1704 the @code{inline} keyword.
1706 The alternate keywords @code{__asm__}, @code{__extension__},
1707 @code{__inline__} and @code{__typeof__} continue to work despite
1708 @option{-ansi}.  You would not want to use them in an ISO C program, of
1709 course, but it is useful to put them in header files that might be included
1710 in compilations done with @option{-ansi}.  Alternate predefined macros
1711 such as @code{__unix__} and @code{__vax__} are also available, with or
1712 without @option{-ansi}.
1714 The @option{-ansi} option does not cause non-ISO programs to be
1715 rejected gratuitously.  For that, @option{-Wpedantic} is required in
1716 addition to @option{-ansi}.  @xref{Warning Options}.
1718 The macro @code{__STRICT_ANSI__} is predefined when the @option{-ansi}
1719 option is used.  Some header files may notice this macro and refrain
1720 from declaring certain functions or defining certain macros that the
1721 ISO standard doesn't call for; this is to avoid interfering with any
1722 programs that might use these names for other things.
1724 Functions that are normally built in but do not have semantics
1725 defined by ISO C (such as @code{alloca} and @code{ffs}) are not built-in
1726 functions when @option{-ansi} is used.  @xref{Other Builtins,,Other
1727 built-in functions provided by GCC}, for details of the functions
1728 affected.
1730 @item -std=
1731 @opindex std
1732 Determine the language standard. @xref{Standards,,Language Standards
1733 Supported by GCC}, for details of these standard versions.  This option
1734 is currently only supported when compiling C or C++.
1736 The compiler can accept several base standards, such as @samp{c90} or
1737 @samp{c++98}, and GNU dialects of those standards, such as
1738 @samp{gnu90} or @samp{gnu++98}.  When a base standard is specified, the
1739 compiler accepts all programs following that standard plus those
1740 using GNU extensions that do not contradict it.  For example,
1741 @option{-std=c90} turns off certain features of GCC that are
1742 incompatible with ISO C90, such as the @code{asm} and @code{typeof}
1743 keywords, but not other GNU extensions that do not have a meaning in
1744 ISO C90, such as omitting the middle term of a @code{?:}
1745 expression. On the other hand, when a GNU dialect of a standard is
1746 specified, all features supported by the compiler are enabled, even when
1747 those features change the meaning of the base standard.  As a result, some
1748 strict-conforming programs may be rejected.  The particular standard
1749 is used by @option{-Wpedantic} to identify which features are GNU
1750 extensions given that version of the standard. For example
1751 @option{-std=gnu90 -Wpedantic} warns about C++ style @samp{//}
1752 comments, while @option{-std=gnu99 -Wpedantic} does not.
1754 A value for this option must be provided; possible values are
1756 @table @samp
1757 @item c90
1758 @itemx c89
1759 @itemx iso9899:1990
1760 Support all ISO C90 programs (certain GNU extensions that conflict
1761 with ISO C90 are disabled). Same as @option{-ansi} for C code.
1763 @item iso9899:199409
1764 ISO C90 as modified in amendment 1.
1766 @item c99
1767 @itemx c9x
1768 @itemx iso9899:1999
1769 @itemx iso9899:199x
1770 ISO C99.  This standard is substantially completely supported, modulo
1771 bugs and floating-point issues
1772 (mainly but not entirely relating to optional C99 features from
1773 Annexes F and G).  See
1774 @w{@uref{http://gcc.gnu.org/c99status.html}} for more information.  The
1775 names @samp{c9x} and @samp{iso9899:199x} are deprecated.
1777 @item c11
1778 @itemx c1x
1779 @itemx iso9899:2011
1780 ISO C11, the 2011 revision of the ISO C standard.  This standard is
1781 substantially completely supported, modulo bugs, floating-point issues
1782 (mainly but not entirely relating to optional C11 features from
1783 Annexes F and G) and the optional Annexes K (Bounds-checking
1784 interfaces) and L (Analyzability).  The name @samp{c1x} is deprecated.
1786 @item gnu90
1787 @itemx gnu89
1788 GNU dialect of ISO C90 (including some C99 features).
1790 @item gnu99
1791 @itemx gnu9x
1792 GNU dialect of ISO C99.  The name @samp{gnu9x} is deprecated.
1794 @item gnu11
1795 @itemx gnu1x
1796 GNU dialect of ISO C11.  This is the default for C code.
1797 The name @samp{gnu1x} is deprecated.
1799 @item c++98
1800 @itemx c++03
1801 The 1998 ISO C++ standard plus the 2003 technical corrigendum and some
1802 additional defect reports. Same as @option{-ansi} for C++ code.
1804 @item gnu++98
1805 @itemx gnu++03
1806 GNU dialect of @option{-std=c++98}.
1808 @item c++11
1809 @itemx c++0x
1810 The 2011 ISO C++ standard plus amendments.
1811 The name @samp{c++0x} is deprecated.
1813 @item gnu++11
1814 @itemx gnu++0x
1815 GNU dialect of @option{-std=c++11}.
1816 The name @samp{gnu++0x} is deprecated.
1818 @item c++14
1819 @itemx c++1y
1820 The 2014 ISO C++ standard plus amendments.
1821 The name @samp{c++1y} is deprecated.
1823 @item gnu++14
1824 @itemx gnu++1y
1825 GNU dialect of @option{-std=c++14}.
1826 This is the default for C++ code.
1827 The name @samp{gnu++1y} is deprecated.
1829 @item c++1z
1830 The next revision of the ISO C++ standard, tentatively planned for
1831 2017.  Support is highly experimental, and will almost certainly
1832 change in incompatible ways in future releases.
1834 @item gnu++1z
1835 GNU dialect of @option{-std=c++1z}.  Support is highly experimental,
1836 and will almost certainly change in incompatible ways in future
1837 releases.
1838 @end table
1840 @item -fgnu89-inline
1841 @opindex fgnu89-inline
1842 The option @option{-fgnu89-inline} tells GCC to use the traditional
1843 GNU semantics for @code{inline} functions when in C99 mode.
1844 @xref{Inline,,An Inline Function is As Fast As a Macro}.
1845 Using this option is roughly equivalent to adding the
1846 @code{gnu_inline} function attribute to all inline functions
1847 (@pxref{Function Attributes}).
1849 The option @option{-fno-gnu89-inline} explicitly tells GCC to use the
1850 C99 semantics for @code{inline} when in C99 or gnu99 mode (i.e., it
1851 specifies the default behavior).
1852 This option is not supported in @option{-std=c90} or
1853 @option{-std=gnu90} mode.
1855 The preprocessor macros @code{__GNUC_GNU_INLINE__} and
1856 @code{__GNUC_STDC_INLINE__} may be used to check which semantics are
1857 in effect for @code{inline} functions.  @xref{Common Predefined
1858 Macros,,,cpp,The C Preprocessor}.
1860 @item -aux-info @var{filename}
1861 @opindex aux-info
1862 Output to the given filename prototyped declarations for all functions
1863 declared and/or defined in a translation unit, including those in header
1864 files.  This option is silently ignored in any language other than C@.
1866 Besides declarations, the file indicates, in comments, the origin of
1867 each declaration (source file and line), whether the declaration was
1868 implicit, prototyped or unprototyped (@samp{I}, @samp{N} for new or
1869 @samp{O} for old, respectively, in the first character after the line
1870 number and the colon), and whether it came from a declaration or a
1871 definition (@samp{C} or @samp{F}, respectively, in the following
1872 character).  In the case of function definitions, a K&R-style list of
1873 arguments followed by their declarations is also provided, inside
1874 comments, after the declaration.
1876 @item -fallow-parameterless-variadic-functions
1877 @opindex fallow-parameterless-variadic-functions
1878 Accept variadic functions without named parameters.
1880 Although it is possible to define such a function, this is not very
1881 useful as it is not possible to read the arguments.  This is only
1882 supported for C as this construct is allowed by C++.
1884 @item -fno-asm
1885 @opindex fno-asm
1886 Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
1887 keyword, so that code can use these words as identifiers.  You can use
1888 the keywords @code{__asm__}, @code{__inline__} and @code{__typeof__}
1889 instead.  @option{-ansi} implies @option{-fno-asm}.
1891 In C++, this switch only affects the @code{typeof} keyword, since
1892 @code{asm} and @code{inline} are standard keywords.  You may want to
1893 use the @option{-fno-gnu-keywords} flag instead, which has the same
1894 effect.  In C99 mode (@option{-std=c99} or @option{-std=gnu99}), this
1895 switch only affects the @code{asm} and @code{typeof} keywords, since
1896 @code{inline} is a standard keyword in ISO C99.
1898 @item -fno-builtin
1899 @itemx -fno-builtin-@var{function}
1900 @opindex fno-builtin
1901 @cindex built-in functions
1902 Don't recognize built-in functions that do not begin with
1903 @samp{__builtin_} as prefix.  @xref{Other Builtins,,Other built-in
1904 functions provided by GCC}, for details of the functions affected,
1905 including those which are not built-in functions when @option{-ansi} or
1906 @option{-std} options for strict ISO C conformance are used because they
1907 do not have an ISO standard meaning.
1909 GCC normally generates special code to handle certain built-in functions
1910 more efficiently; for instance, calls to @code{alloca} may become single
1911 instructions which adjust the stack directly, and calls to @code{memcpy}
1912 may become inline copy loops.  The resulting code is often both smaller
1913 and faster, but since the function calls no longer appear as such, you
1914 cannot set a breakpoint on those calls, nor can you change the behavior
1915 of the functions by linking with a different library.  In addition,
1916 when a function is recognized as a built-in function, GCC may use
1917 information about that function to warn about problems with calls to
1918 that function, or to generate more efficient code, even if the
1919 resulting code still contains calls to that function.  For example,
1920 warnings are given with @option{-Wformat} for bad calls to
1921 @code{printf} when @code{printf} is built in and @code{strlen} is
1922 known not to modify global memory.
1924 With the @option{-fno-builtin-@var{function}} option
1925 only the built-in function @var{function} is
1926 disabled.  @var{function} must not begin with @samp{__builtin_}.  If a
1927 function is named that is not built-in in this version of GCC, this
1928 option is ignored.  There is no corresponding
1929 @option{-fbuiltin-@var{function}} option; if you wish to enable
1930 built-in functions selectively when using @option{-fno-builtin} or
1931 @option{-ffreestanding}, you may define macros such as:
1933 @smallexample
1934 #define abs(n)          __builtin_abs ((n))
1935 #define strcpy(d, s)    __builtin_strcpy ((d), (s))
1936 @end smallexample
1938 @item -fhosted
1939 @opindex fhosted
1940 @cindex hosted environment
1942 Assert that compilation targets a hosted environment.  This implies
1943 @option{-fbuiltin}.  A hosted environment is one in which the
1944 entire standard library is available, and in which @code{main} has a return
1945 type of @code{int}.  Examples are nearly everything except a kernel.
1946 This is equivalent to @option{-fno-freestanding}.
1948 @item -ffreestanding
1949 @opindex ffreestanding
1950 @cindex hosted environment
1952 Assert that compilation targets a freestanding environment.  This
1953 implies @option{-fno-builtin}.  A freestanding environment
1954 is one in which the standard library may not exist, and program startup may
1955 not necessarily be at @code{main}.  The most obvious example is an OS kernel.
1956 This is equivalent to @option{-fno-hosted}.
1958 @xref{Standards,,Language Standards Supported by GCC}, for details of
1959 freestanding and hosted environments.
1961 @item -fopenacc
1962 @opindex fopenacc
1963 @cindex OpenACC accelerator programming
1964 Enable handling of OpenACC directives @code{#pragma acc} in C/C++ and
1965 @code{!$acc} in Fortran.  When @option{-fopenacc} is specified, the
1966 compiler generates accelerated code according to the OpenACC Application
1967 Programming Interface v2.0 @w{@uref{http://www.openacc.org/}}.  This option
1968 implies @option{-pthread}, and thus is only supported on targets that
1969 have support for @option{-pthread}.
1971 @item -fopenacc-dim=@var{geom}
1972 @opindex fopenacc-dim
1973 @cindex OpenACC accelerator programming
1974 Specify default compute dimensions for parallel offload regions that do
1975 not explicitly specify.  The @var{geom} value is a triple of
1976 ':'-separated sizes, in order 'gang', 'worker' and, 'vector'.  A size
1977 can be omitted, to use a target-specific default value.
1979 @item -fopenmp
1980 @opindex fopenmp
1981 @cindex OpenMP parallel
1982 Enable handling of OpenMP directives @code{#pragma omp} in C/C++ and
1983 @code{!$omp} in Fortran.  When @option{-fopenmp} is specified, the
1984 compiler generates parallel code according to the OpenMP Application
1985 Program Interface v4.0 @w{@uref{http://www.openmp.org/}}.  This option
1986 implies @option{-pthread}, and thus is only supported on targets that
1987 have support for @option{-pthread}. @option{-fopenmp} implies
1988 @option{-fopenmp-simd}.
1990 @item -fopenmp-simd
1991 @opindex fopenmp-simd
1992 @cindex OpenMP SIMD
1993 @cindex SIMD
1994 Enable handling of OpenMP's SIMD directives with @code{#pragma omp}
1995 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
1996 are ignored.
1998 @item -fcilkplus
1999 @opindex fcilkplus
2000 @cindex Enable Cilk Plus
2001 Enable the usage of Cilk Plus language extension features for C/C++.
2002 When the option @option{-fcilkplus} is specified, enable the usage of
2003 the Cilk Plus Language extension features for C/C++.  The present
2004 implementation follows ABI version 1.2.  This is an experimental
2005 feature that is only partially complete, and whose interface may
2006 change in future versions of GCC as the official specification
2007 changes.  Currently, all features but @code{_Cilk_for} have been
2008 implemented.
2010 @item -fgnu-tm
2011 @opindex fgnu-tm
2012 When the option @option{-fgnu-tm} is specified, the compiler
2013 generates code for the Linux variant of Intel's current Transactional
2014 Memory ABI specification document (Revision 1.1, May 6 2009).  This is
2015 an experimental feature whose interface may change in future versions
2016 of GCC, as the official specification changes.  Please note that not
2017 all architectures are supported for this feature.
2019 For more information on GCC's support for transactional memory,
2020 @xref{Enabling libitm,,The GNU Transactional Memory Library,libitm,GNU
2021 Transactional Memory Library}.
2023 Note that the transactional memory feature is not supported with
2024 non-call exceptions (@option{-fnon-call-exceptions}).
2026 @item -fms-extensions
2027 @opindex fms-extensions
2028 Accept some non-standard constructs used in Microsoft header files.
2030 In C++ code, this allows member names in structures to be similar
2031 to previous types declarations.
2033 @smallexample
2034 typedef int UOW;
2035 struct ABC @{
2036   UOW UOW;
2038 @end smallexample
2040 Some cases of unnamed fields in structures and unions are only
2041 accepted with this option.  @xref{Unnamed Fields,,Unnamed struct/union
2042 fields within structs/unions}, for details.
2044 Note that this option is off for all targets but x86 
2045 targets using ms-abi.
2047 @item -fplan9-extensions
2048 @opindex fplan9-extensions
2049 Accept some non-standard constructs used in Plan 9 code.
2051 This enables @option{-fms-extensions}, permits passing pointers to
2052 structures with anonymous fields to functions that expect pointers to
2053 elements of the type of the field, and permits referring to anonymous
2054 fields declared using a typedef.  @xref{Unnamed Fields,,Unnamed
2055 struct/union fields within structs/unions}, for details.  This is only
2056 supported for C, not C++.
2058 @item -trigraphs
2059 @opindex trigraphs
2060 Support ISO C trigraphs.  The @option{-ansi} option (and @option{-std}
2061 options for strict ISO C conformance) implies @option{-trigraphs}.
2063 @cindex traditional C language
2064 @cindex C language, traditional
2065 @item -traditional
2066 @itemx -traditional-cpp
2067 @opindex traditional-cpp
2068 @opindex traditional
2069 Formerly, these options caused GCC to attempt to emulate a pre-standard
2070 C compiler.  They are now only supported with the @option{-E} switch.
2071 The preprocessor continues to support a pre-standard mode.  See the GNU
2072 CPP manual for details.
2074 @item -fcond-mismatch
2075 @opindex fcond-mismatch
2076 Allow conditional expressions with mismatched types in the second and
2077 third arguments.  The value of such an expression is void.  This option
2078 is not supported for C++.
2080 @item -flax-vector-conversions
2081 @opindex flax-vector-conversions
2082 Allow implicit conversions between vectors with differing numbers of
2083 elements and/or incompatible element types.  This option should not be
2084 used for new code.
2086 @item -funsigned-char
2087 @opindex funsigned-char
2088 Let the type @code{char} be unsigned, like @code{unsigned char}.
2090 Each kind of machine has a default for what @code{char} should
2091 be.  It is either like @code{unsigned char} by default or like
2092 @code{signed char} by default.
2094 Ideally, a portable program should always use @code{signed char} or
2095 @code{unsigned char} when it depends on the signedness of an object.
2096 But many programs have been written to use plain @code{char} and
2097 expect it to be signed, or expect it to be unsigned, depending on the
2098 machines they were written for.  This option, and its inverse, let you
2099 make such a program work with the opposite default.
2101 The type @code{char} is always a distinct type from each of
2102 @code{signed char} or @code{unsigned char}, even though its behavior
2103 is always just like one of those two.
2105 @item -fsigned-char
2106 @opindex fsigned-char
2107 Let the type @code{char} be signed, like @code{signed char}.
2109 Note that this is equivalent to @option{-fno-unsigned-char}, which is
2110 the negative form of @option{-funsigned-char}.  Likewise, the option
2111 @option{-fno-signed-char} is equivalent to @option{-funsigned-char}.
2113 @item -fsigned-bitfields
2114 @itemx -funsigned-bitfields
2115 @itemx -fno-signed-bitfields
2116 @itemx -fno-unsigned-bitfields
2117 @opindex fsigned-bitfields
2118 @opindex funsigned-bitfields
2119 @opindex fno-signed-bitfields
2120 @opindex fno-unsigned-bitfields
2121 These options control whether a bit-field is signed or unsigned, when the
2122 declaration does not use either @code{signed} or @code{unsigned}.  By
2123 default, such a bit-field is signed, because this is consistent: the
2124 basic integer types such as @code{int} are signed types.
2126 @item -fsso-struct=@var{endianness}
2127 @opindex fsso-struct
2128 Set the default scalar storage order of structures and unions to the
2129 specified endianness.  The accepted values are @samp{big-endian} and
2130 @samp{little-endian}.  If the option is not passed, the compiler uses
2131 the native endianness of the target.  This option is not supported for C++.
2133 @strong{Warning:} the @option{-fsso-struct} switch causes GCC to generate
2134 code that is not binary compatible with code generated without it if the
2135 specified endianness is not the native endianness of the target.
2136 @end table
2138 @node C++ Dialect Options
2139 @section Options Controlling C++ Dialect
2141 @cindex compiler options, C++
2142 @cindex C++ options, command-line
2143 @cindex options, C++
2144 This section describes the command-line options that are only meaningful
2145 for C++ programs.  You can also use most of the GNU compiler options
2146 regardless of what language your program is in.  For example, you
2147 might compile a file @file{firstClass.C} like this:
2149 @smallexample
2150 g++ -g -fstrict-enums -O -c firstClass.C
2151 @end smallexample
2153 @noindent
2154 In this example, only @option{-fstrict-enums} is an option meant
2155 only for C++ programs; you can use the other options with any
2156 language supported by GCC@.
2158 Some options for compiling C programs, such as @option{-std}, are also
2159 relevant for C++ programs.
2160 @xref{C Dialect Options,,Options Controlling C Dialect}.
2162 Here is a list of options that are @emph{only} for compiling C++ programs:
2164 @table @gcctabopt
2166 @item -fabi-version=@var{n}
2167 @opindex fabi-version
2168 Use version @var{n} of the C++ ABI@.  The default is version 0.
2170 Version 0 refers to the version conforming most closely to
2171 the C++ ABI specification.  Therefore, the ABI obtained using version 0
2172 will change in different versions of G++ as ABI bugs are fixed.
2174 Version 1 is the version of the C++ ABI that first appeared in G++ 3.2.
2176 Version 2 is the version of the C++ ABI that first appeared in G++
2177 3.4, and was the default through G++ 4.9.
2179 Version 3 corrects an error in mangling a constant address as a
2180 template argument.
2182 Version 4, which first appeared in G++ 4.5, implements a standard
2183 mangling for vector types.
2185 Version 5, which first appeared in G++ 4.6, corrects the mangling of
2186 attribute const/volatile on function pointer types, decltype of a
2187 plain decl, and use of a function parameter in the declaration of
2188 another parameter.
2190 Version 6, which first appeared in G++ 4.7, corrects the promotion
2191 behavior of C++11 scoped enums and the mangling of template argument
2192 packs, const/static_cast, prefix ++ and --, and a class scope function
2193 used as a template argument.
2195 Version 7, which first appeared in G++ 4.8, that treats nullptr_t as a
2196 builtin type and corrects the mangling of lambdas in default argument
2197 scope.
2199 Version 8, which first appeared in G++ 4.9, corrects the substitution
2200 behavior of function types with function-cv-qualifiers.
2202 Version 9, which first appeared in G++ 5.2, corrects the alignment of
2203 @code{nullptr_t}.
2205 Version 10, which first appeared in G++ 6.1, adds mangling of
2206 attributes that affect type identity, such as ia32 calling convention
2207 attributes (e.g. @samp{stdcall}).
2209 See also @option{-Wabi}.
2211 @item -fabi-compat-version=@var{n}
2212 @opindex fabi-compat-version
2213 On targets that support strong aliases, G++
2214 works around mangling changes by creating an alias with the correct
2215 mangled name when defining a symbol with an incorrect mangled name.
2216 This switch specifies which ABI version to use for the alias.
2218 With @option{-fabi-version=0} (the default), this defaults to 8 (GCC 5
2219 compatibility).  If another ABI version is explicitly selected, this
2220 defaults to 0.  For compatibility with GCC versions 3.2 through 4.9,
2221 use @option{-fabi-compat-version=2}.
2223 If this option is not provided but @option{-Wabi=@var{n}} is, that
2224 version is used for compatibility aliases.  If this option is provided
2225 along with @option{-Wabi} (without the version), the version from this
2226 option is used for the warning.
2228 @item -fno-access-control
2229 @opindex fno-access-control
2230 Turn off all access checking.  This switch is mainly useful for working
2231 around bugs in the access control code.
2233 @item -fcheck-new
2234 @opindex fcheck-new
2235 Check that the pointer returned by @code{operator new} is non-null
2236 before attempting to modify the storage allocated.  This check is
2237 normally unnecessary because the C++ standard specifies that
2238 @code{operator new} only returns @code{0} if it is declared
2239 @code{throw()}, in which case the compiler always checks the
2240 return value even without this option.  In all other cases, when
2241 @code{operator new} has a non-empty exception specification, memory
2242 exhaustion is signalled by throwing @code{std::bad_alloc}.  See also
2243 @samp{new (nothrow)}.
2245 @item -fconcepts
2246 @opindex fconcepts
2247 Enable support for the C++ Extensions for Concepts Technical
2248 Specification, ISO 19217 (2015), which allows code like
2250 @smallexample
2251 template <class T> concept bool Addable = requires (T t) @{ t + t; @};
2252 template <Addable T> T add (T a, T b) @{ return a + b; @}
2253 @end smallexample
2255 @item -fconstexpr-depth=@var{n}
2256 @opindex fconstexpr-depth
2257 Set the maximum nested evaluation depth for C++11 constexpr functions
2258 to @var{n}.  A limit is needed to detect endless recursion during
2259 constant expression evaluation.  The minimum specified by the standard
2260 is 512.
2262 @item -fdeduce-init-list
2263 @opindex fdeduce-init-list
2264 Enable deduction of a template type parameter as
2265 @code{std::initializer_list} from a brace-enclosed initializer list, i.e.@:
2267 @smallexample
2268 template <class T> auto forward(T t) -> decltype (realfn (t))
2270   return realfn (t);
2273 void f()
2275   forward(@{1,2@}); // call forward<std::initializer_list<int>>
2277 @end smallexample
2279 This deduction was implemented as a possible extension to the
2280 originally proposed semantics for the C++11 standard, but was not part
2281 of the final standard, so it is disabled by default.  This option is
2282 deprecated, and may be removed in a future version of G++.
2284 @item -ffriend-injection
2285 @opindex ffriend-injection
2286 Inject friend functions into the enclosing namespace, so that they are
2287 visible outside the scope of the class in which they are declared.
2288 Friend functions were documented to work this way in the old Annotated
2289 C++ Reference Manual.  
2290 However, in ISO C++ a friend function that is not declared
2291 in an enclosing scope can only be found using argument dependent
2292 lookup.  GCC defaults to the standard behavior.
2294 This option is for compatibility, and may be removed in a future
2295 release of G++.
2297 @item -fno-elide-constructors
2298 @opindex fno-elide-constructors
2299 The C++ standard allows an implementation to omit creating a temporary
2300 that is only used to initialize another object of the same type.
2301 Specifying this option disables that optimization, and forces G++ to
2302 call the copy constructor in all cases.
2304 @item -fno-enforce-eh-specs
2305 @opindex fno-enforce-eh-specs
2306 Don't generate code to check for violation of exception specifications
2307 at run time.  This option violates the C++ standard, but may be useful
2308 for reducing code size in production builds, much like defining
2309 @code{NDEBUG}.  This does not give user code permission to throw
2310 exceptions in violation of the exception specifications; the compiler
2311 still optimizes based on the specifications, so throwing an
2312 unexpected exception results in undefined behavior at run time.
2314 @item -fextern-tls-init
2315 @itemx -fno-extern-tls-init
2316 @opindex fextern-tls-init
2317 @opindex fno-extern-tls-init
2318 The C++11 and OpenMP standards allow @code{thread_local} and
2319 @code{threadprivate} variables to have dynamic (runtime)
2320 initialization.  To support this, any use of such a variable goes
2321 through a wrapper function that performs any necessary initialization.
2322 When the use and definition of the variable are in the same
2323 translation unit, this overhead can be optimized away, but when the
2324 use is in a different translation unit there is significant overhead
2325 even if the variable doesn't actually need dynamic initialization.  If
2326 the programmer can be sure that no use of the variable in a
2327 non-defining TU needs to trigger dynamic initialization (either
2328 because the variable is statically initialized, or a use of the
2329 variable in the defining TU will be executed before any uses in
2330 another TU), they can avoid this overhead with the
2331 @option{-fno-extern-tls-init} option.
2333 On targets that support symbol aliases, the default is
2334 @option{-fextern-tls-init}.  On targets that do not support symbol
2335 aliases, the default is @option{-fno-extern-tls-init}.
2337 @item -ffor-scope
2338 @itemx -fno-for-scope
2339 @opindex ffor-scope
2340 @opindex fno-for-scope
2341 If @option{-ffor-scope} is specified, the scope of variables declared in
2342 a @i{for-init-statement} is limited to the @code{for} loop itself,
2343 as specified by the C++ standard.
2344 If @option{-fno-for-scope} is specified, the scope of variables declared in
2345 a @i{for-init-statement} extends to the end of the enclosing scope,
2346 as was the case in old versions of G++, and other (traditional)
2347 implementations of C++.
2349 If neither flag is given, the default is to follow the standard,
2350 but to allow and give a warning for old-style code that would
2351 otherwise be invalid, or have different behavior.
2353 @item -fno-gnu-keywords
2354 @opindex fno-gnu-keywords
2355 Do not recognize @code{typeof} as a keyword, so that code can use this
2356 word as an identifier.  You can use the keyword @code{__typeof__} instead.
2357 This option is implied by the strict ISO C++ dialects: @option{-ansi},
2358 @option{-std=c++98}, @option{-std=c++11}, etc.
2360 @item -fno-implicit-templates
2361 @opindex fno-implicit-templates
2362 Never emit code for non-inline templates that are instantiated
2363 implicitly (i.e.@: by use); only emit code for explicit instantiations.
2364 @xref{Template Instantiation}, for more information.
2366 @item -fno-implicit-inline-templates
2367 @opindex fno-implicit-inline-templates
2368 Don't emit code for implicit instantiations of inline templates, either.
2369 The default is to handle inlines differently so that compiles with and
2370 without optimization need the same set of explicit instantiations.
2372 @item -fno-implement-inlines
2373 @opindex fno-implement-inlines
2374 To save space, do not emit out-of-line copies of inline functions
2375 controlled by @code{#pragma implementation}.  This causes linker
2376 errors if these functions are not inlined everywhere they are called.
2378 @item -fms-extensions
2379 @opindex fms-extensions
2380 Disable Wpedantic warnings about constructs used in MFC, such as implicit
2381 int and getting a pointer to member function via non-standard syntax.
2383 @item -fno-nonansi-builtins
2384 @opindex fno-nonansi-builtins
2385 Disable built-in declarations of functions that are not mandated by
2386 ANSI/ISO C@.  These include @code{ffs}, @code{alloca}, @code{_exit},
2387 @code{index}, @code{bzero}, @code{conjf}, and other related functions.
2389 @item -fnothrow-opt
2390 @opindex fnothrow-opt
2391 Treat a @code{throw()} exception specification as if it were a
2392 @code{noexcept} specification to reduce or eliminate the text size
2393 overhead relative to a function with no exception specification.  If
2394 the function has local variables of types with non-trivial
2395 destructors, the exception specification actually makes the
2396 function smaller because the EH cleanups for those variables can be
2397 optimized away.  The semantic effect is that an exception thrown out of
2398 a function with such an exception specification results in a call
2399 to @code{terminate} rather than @code{unexpected}.
2401 @item -fno-operator-names
2402 @opindex fno-operator-names
2403 Do not treat the operator name keywords @code{and}, @code{bitand},
2404 @code{bitor}, @code{compl}, @code{not}, @code{or} and @code{xor} as
2405 synonyms as keywords.
2407 @item -fno-optional-diags
2408 @opindex fno-optional-diags
2409 Disable diagnostics that the standard says a compiler does not need to
2410 issue.  Currently, the only such diagnostic issued by G++ is the one for
2411 a name having multiple meanings within a class.
2413 @item -fpermissive
2414 @opindex fpermissive
2415 Downgrade some diagnostics about nonconformant code from errors to
2416 warnings.  Thus, using @option{-fpermissive} allows some
2417 nonconforming code to compile.
2419 @item -fno-pretty-templates
2420 @opindex fno-pretty-templates
2421 When an error message refers to a specialization of a function
2422 template, the compiler normally prints the signature of the
2423 template followed by the template arguments and any typedefs or
2424 typenames in the signature (e.g. @code{void f(T) [with T = int]}
2425 rather than @code{void f(int)}) so that it's clear which template is
2426 involved.  When an error message refers to a specialization of a class
2427 template, the compiler omits any template arguments that match
2428 the default template arguments for that template.  If either of these
2429 behaviors make it harder to understand the error message rather than
2430 easier, you can use @option{-fno-pretty-templates} to disable them.
2432 @item -frepo
2433 @opindex frepo
2434 Enable automatic template instantiation at link time.  This option also
2435 implies @option{-fno-implicit-templates}.  @xref{Template
2436 Instantiation}, for more information.
2438 @item -fno-rtti
2439 @opindex fno-rtti
2440 Disable generation of information about every class with virtual
2441 functions for use by the C++ run-time type identification features
2442 (@code{dynamic_cast} and @code{typeid}).  If you don't use those parts
2443 of the language, you can save some space by using this flag.  Note that
2444 exception handling uses the same information, but G++ generates it as
2445 needed. The @code{dynamic_cast} operator can still be used for casts that
2446 do not require run-time type information, i.e.@: casts to @code{void *} or to
2447 unambiguous base classes.
2449 @item -fsized-deallocation
2450 @opindex fsized-deallocation
2451 Enable the built-in global declarations
2452 @smallexample
2453 void operator delete (void *, std::size_t) noexcept;
2454 void operator delete[] (void *, std::size_t) noexcept;
2455 @end smallexample
2456 as introduced in C++14.  This is useful for user-defined replacement
2457 deallocation functions that, for example, use the size of the object
2458 to make deallocation faster.  Enabled by default under
2459 @option{-std=c++14} and above.  The flag @option{-Wsized-deallocation}
2460 warns about places that might want to add a definition.
2462 @item -fstrict-enums
2463 @opindex fstrict-enums
2464 Allow the compiler to optimize using the assumption that a value of
2465 enumerated type can only be one of the values of the enumeration (as
2466 defined in the C++ standard; basically, a value that can be
2467 represented in the minimum number of bits needed to represent all the
2468 enumerators).  This assumption may not be valid if the program uses a
2469 cast to convert an arbitrary integer value to the enumerated type.
2471 @item -ftemplate-backtrace-limit=@var{n}
2472 @opindex ftemplate-backtrace-limit
2473 Set the maximum number of template instantiation notes for a single
2474 warning or error to @var{n}.  The default value is 10.
2476 @item -ftemplate-depth=@var{n}
2477 @opindex ftemplate-depth
2478 Set the maximum instantiation depth for template classes to @var{n}.
2479 A limit on the template instantiation depth is needed to detect
2480 endless recursions during template class instantiation.  ANSI/ISO C++
2481 conforming programs must not rely on a maximum depth greater than 17
2482 (changed to 1024 in C++11).  The default value is 900, as the compiler
2483 can run out of stack space before hitting 1024 in some situations.
2485 @item -fno-threadsafe-statics
2486 @opindex fno-threadsafe-statics
2487 Do not emit the extra code to use the routines specified in the C++
2488 ABI for thread-safe initialization of local statics.  You can use this
2489 option to reduce code size slightly in code that doesn't need to be
2490 thread-safe.
2492 @item -fuse-cxa-atexit
2493 @opindex fuse-cxa-atexit
2494 Register destructors for objects with static storage duration with the
2495 @code{__cxa_atexit} function rather than the @code{atexit} function.
2496 This option is required for fully standards-compliant handling of static
2497 destructors, but only works if your C library supports
2498 @code{__cxa_atexit}.
2500 @item -fno-use-cxa-get-exception-ptr
2501 @opindex fno-use-cxa-get-exception-ptr
2502 Don't use the @code{__cxa_get_exception_ptr} runtime routine.  This
2503 causes @code{std::uncaught_exception} to be incorrect, but is necessary
2504 if the runtime routine is not available.
2506 @item -fvisibility-inlines-hidden
2507 @opindex fvisibility-inlines-hidden
2508 This switch declares that the user does not attempt to compare
2509 pointers to inline functions or methods where the addresses of the two functions
2510 are taken in different shared objects.
2512 The effect of this is that GCC may, effectively, mark inline methods with
2513 @code{__attribute__ ((visibility ("hidden")))} so that they do not
2514 appear in the export table of a DSO and do not require a PLT indirection
2515 when used within the DSO@.  Enabling this option can have a dramatic effect
2516 on load and link times of a DSO as it massively reduces the size of the
2517 dynamic export table when the library makes heavy use of templates.
2519 The behavior of this switch is not quite the same as marking the
2520 methods as hidden directly, because it does not affect static variables
2521 local to the function or cause the compiler to deduce that
2522 the function is defined in only one shared object.
2524 You may mark a method as having a visibility explicitly to negate the
2525 effect of the switch for that method.  For example, if you do want to
2526 compare pointers to a particular inline method, you might mark it as
2527 having default visibility.  Marking the enclosing class with explicit
2528 visibility has no effect.
2530 Explicitly instantiated inline methods are unaffected by this option
2531 as their linkage might otherwise cross a shared library boundary.
2532 @xref{Template Instantiation}.
2534 @item -fvisibility-ms-compat
2535 @opindex fvisibility-ms-compat
2536 This flag attempts to use visibility settings to make GCC's C++
2537 linkage model compatible with that of Microsoft Visual Studio.
2539 The flag makes these changes to GCC's linkage model:
2541 @enumerate
2542 @item
2543 It sets the default visibility to @code{hidden}, like
2544 @option{-fvisibility=hidden}.
2546 @item
2547 Types, but not their members, are not hidden by default.
2549 @item
2550 The One Definition Rule is relaxed for types without explicit
2551 visibility specifications that are defined in more than one
2552 shared object: those declarations are permitted if they are
2553 permitted when this option is not used.
2554 @end enumerate
2556 In new code it is better to use @option{-fvisibility=hidden} and
2557 export those classes that are intended to be externally visible.
2558 Unfortunately it is possible for code to rely, perhaps accidentally,
2559 on the Visual Studio behavior.
2561 Among the consequences of these changes are that static data members
2562 of the same type with the same name but defined in different shared
2563 objects are different, so changing one does not change the other;
2564 and that pointers to function members defined in different shared
2565 objects may not compare equal.  When this flag is given, it is a
2566 violation of the ODR to define types with the same name differently.
2568 @item -fno-weak
2569 @opindex fno-weak
2570 Do not use weak symbol support, even if it is provided by the linker.
2571 By default, G++ uses weak symbols if they are available.  This
2572 option exists only for testing, and should not be used by end-users;
2573 it results in inferior code and has no benefits.  This option may
2574 be removed in a future release of G++.
2576 @item -nostdinc++
2577 @opindex nostdinc++
2578 Do not search for header files in the standard directories specific to
2579 C++, but do still search the other standard directories.  (This option
2580 is used when building the C++ library.)
2581 @end table
2583 In addition, these optimization, warning, and code generation options
2584 have meanings only for C++ programs:
2586 @table @gcctabopt
2587 @item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)}
2588 @opindex Wabi
2589 @opindex Wno-abi
2590 Warn when G++ it generates code that is probably not compatible with
2591 the vendor-neutral C++ ABI@.  Since G++ now defaults to updating the
2592 ABI with each major release, normally @option{-Wabi} will warn only if
2593 there is a check added later in a release series for an ABI issue
2594 discovered since the initial release.  @option{-Wabi} will warn about
2595 more things if an older ABI version is selected (with
2596 @option{-fabi-version=@var{n}}).
2598 @option{-Wabi} can also be used with an explicit version number to
2599 warn about compatibility with a particular @option{-fabi-version}
2600 level, e.g. @option{-Wabi=2} to warn about changes relative to
2601 @option{-fabi-version=2}.
2603 If an explicit version number is provided and
2604 @option{-fabi-compat-version} is not specified, the version number
2605 from this option is used for compatibility aliases.  If no explicit
2606 version number is provided with this option, but
2607 @option{-fabi-compat-version} is specified, that version number is
2608 used for ABI warnings.
2610 Although an effort has been made to warn about
2611 all such cases, there are probably some cases that are not warned about,
2612 even though G++ is generating incompatible code.  There may also be
2613 cases where warnings are emitted even though the code that is generated
2614 is compatible.
2616 You should rewrite your code to avoid these warnings if you are
2617 concerned about the fact that code generated by G++ may not be binary
2618 compatible with code generated by other compilers.
2620 Known incompatibilities in @option{-fabi-version=2} (which was the
2621 default from GCC 3.4 to 4.9) include:
2623 @itemize @bullet
2625 @item
2626 A template with a non-type template parameter of reference type was
2627 mangled incorrectly:
2628 @smallexample
2629 extern int N;
2630 template <int &> struct S @{@};
2631 void n (S<N>) @{2@}
2632 @end smallexample
2634 This was fixed in @option{-fabi-version=3}.
2636 @item
2637 SIMD vector types declared using @code{__attribute ((vector_size))} were
2638 mangled in a non-standard way that does not allow for overloading of
2639 functions taking vectors of different sizes.
2641 The mangling was changed in @option{-fabi-version=4}.
2643 @item
2644 @code{__attribute ((const))} and @code{noreturn} were mangled as type
2645 qualifiers, and @code{decltype} of a plain declaration was folded away.
2647 These mangling issues were fixed in @option{-fabi-version=5}.
2649 @item
2650 Scoped enumerators passed as arguments to a variadic function are
2651 promoted like unscoped enumerators, causing @code{va_arg} to complain.
2652 On most targets this does not actually affect the parameter passing
2653 ABI, as there is no way to pass an argument smaller than @code{int}.
2655 Also, the ABI changed the mangling of template argument packs,
2656 @code{const_cast}, @code{static_cast}, prefix increment/decrement, and
2657 a class scope function used as a template argument.
2659 These issues were corrected in @option{-fabi-version=6}.
2661 @item
2662 Lambdas in default argument scope were mangled incorrectly, and the
2663 ABI changed the mangling of @code{nullptr_t}.
2665 These issues were corrected in @option{-fabi-version=7}.
2667 @item
2668 When mangling a function type with function-cv-qualifiers, the
2669 un-qualified function type was incorrectly treated as a substitution
2670 candidate.
2672 This was fixed in @option{-fabi-version=8}, the default for GCC 5.1.
2674 @item
2675 @code{decltype(nullptr)} incorrectly had an alignment of 1, leading to
2676 unaligned accesses.  Note that this did not affect the ABI of a
2677 function with a @code{nullptr_t} parameter, as parameters have a
2678 minimum alignment.
2680 This was fixed in @option{-fabi-version=9}, the default for GCC 5.2.
2682 @item
2683 Target-specific attributes that affect the identity of a type, such as
2684 ia32 calling conventions on a function type (stdcall, regparm, etc.),
2685 did not affect the mangled name, leading to name collisions when
2686 function pointers were used as template arguments.
2688 This was fixed in @option{-fabi-version=10}, the default for GCC 6.1.
2690 @end itemize
2692 It also warns about psABI-related changes.  The known psABI changes at this
2693 point include:
2695 @itemize @bullet
2697 @item
2698 For SysV/x86-64, unions with @code{long double} members are 
2699 passed in memory as specified in psABI.  For example:
2701 @smallexample
2702 union U @{
2703   long double ld;
2704   int i;
2706 @end smallexample
2708 @noindent
2709 @code{union U} is always passed in memory.
2711 @end itemize
2713 @item -Wabi-tag @r{(C++ and Objective-C++ only)}
2714 @opindex Wabi-tag
2715 @opindex -Wabi-tag
2716 Warn when a type with an ABI tag is used in a context that does not
2717 have that ABI tag.  See @ref{C++ Attributes} for more information
2718 about ABI tags.
2720 @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)}
2721 @opindex Wctor-dtor-privacy
2722 @opindex Wno-ctor-dtor-privacy
2723 Warn when a class seems unusable because all the constructors or
2724 destructors in that class are private, and it has neither friends nor
2725 public static member functions.  Also warn if there are no non-private
2726 methods, and there's at least one private member function that isn't
2727 a constructor or destructor.
2729 @item -Wdelete-non-virtual-dtor @r{(C++ and Objective-C++ only)}
2730 @opindex Wdelete-non-virtual-dtor
2731 @opindex Wno-delete-non-virtual-dtor
2732 Warn when @code{delete} is used to destroy an instance of a class that
2733 has virtual functions and non-virtual destructor. It is unsafe to delete
2734 an instance of a derived class through a pointer to a base class if the
2735 base class does not have a virtual destructor.  This warning is enabled
2736 by @option{-Wall}.
2738 @item -Wliteral-suffix @r{(C++ and Objective-C++ only)}
2739 @opindex Wliteral-suffix
2740 @opindex Wno-literal-suffix
2741 Warn when a string or character literal is followed by a ud-suffix which does
2742 not begin with an underscore.  As a conforming extension, GCC treats such
2743 suffixes as separate preprocessing tokens in order to maintain backwards
2744 compatibility with code that uses formatting macros from @code{<inttypes.h>}.
2745 For example:
2747 @smallexample
2748 #define __STDC_FORMAT_MACROS
2749 #include <inttypes.h>
2750 #include <stdio.h>
2752 int main() @{
2753   int64_t i64 = 123;
2754   printf("My int64: %" PRId64"\n", i64);
2756 @end smallexample
2758 In this case, @code{PRId64} is treated as a separate preprocessing token.
2760 This warning is enabled by default.
2762 @item -Wlto-type-mismatch
2763 @opindex Wlto-type-mismatch
2764 @opindex Wno-lto-type-mismatch
2766 During the link-time optimization warn about type mismatches in
2767 global declarations from different compilation units.
2768 Requires @option{-flto} to be enabled.  Enabled by default.
2770 @item -Wnarrowing @r{(C++ and Objective-C++ only)}
2771 @opindex Wnarrowing
2772 @opindex Wno-narrowing
2773 With @option{-std=gnu++98} or @option{-std=c++98}, warn when a narrowing
2774 conversion prohibited by C++11 occurs within
2775 @samp{@{ @}}, e.g.
2777 @smallexample
2778 int i = @{ 2.2 @}; // error: narrowing from double to int
2779 @end smallexample
2781 This flag is included in @option{-Wall} and @option{-Wc++11-compat}.
2783 When a later standard is in effect, e.g. when using @option{-std=c++11},
2784 narrowing conversions are diagnosed by default, as required by the standard.
2785 A narrowing conversion from a constant produces an error,
2786 and a narrowing conversion from a non-constant produces a warning,
2787 but @option{-Wno-narrowing} suppresses the diagnostic.
2788 Note that this does not affect the meaning of well-formed code;
2789 narrowing conversions are still considered ill-formed in SFINAE contexts.
2791 @item -Wnoexcept @r{(C++ and Objective-C++ only)}
2792 @opindex Wnoexcept
2793 @opindex Wno-noexcept
2794 Warn when a noexcept-expression evaluates to false because of a call
2795 to a function that does not have a non-throwing exception
2796 specification (i.e. @code{throw()} or @code{noexcept}) but is known by
2797 the compiler to never throw an exception.
2799 @item -Wnon-virtual-dtor @r{(C++ and Objective-C++ only)}
2800 @opindex Wnon-virtual-dtor
2801 @opindex Wno-non-virtual-dtor
2802 Warn when a class has virtual functions and an accessible non-virtual
2803 destructor itself or in an accessible polymorphic base class, in which
2804 case it is possible but unsafe to delete an instance of a derived
2805 class through a pointer to the class itself or base class.  This
2806 warning is automatically enabled if @option{-Weffc++} is specified.
2808 @item -Wreorder @r{(C++ and Objective-C++ only)}
2809 @opindex Wreorder
2810 @opindex Wno-reorder
2811 @cindex reordering, warning
2812 @cindex warning for reordering of member initializers
2813 Warn when the order of member initializers given in the code does not
2814 match the order in which they must be executed.  For instance:
2816 @smallexample
2817 struct A @{
2818   int i;
2819   int j;
2820   A(): j (0), i (1) @{ @}
2822 @end smallexample
2824 @noindent
2825 The compiler rearranges the member initializers for @code{i}
2826 and @code{j} to match the declaration order of the members, emitting
2827 a warning to that effect.  This warning is enabled by @option{-Wall}.
2829 @item -fext-numeric-literals @r{(C++ and Objective-C++ only)}
2830 @opindex fext-numeric-literals
2831 @opindex fno-ext-numeric-literals
2832 Accept imaginary, fixed-point, or machine-defined
2833 literal number suffixes as GNU extensions.
2834 When this option is turned off these suffixes are treated
2835 as C++11 user-defined literal numeric suffixes.
2836 This is on by default for all pre-C++11 dialects and all GNU dialects:
2837 @option{-std=c++98}, @option{-std=gnu++98}, @option{-std=gnu++11},
2838 @option{-std=gnu++14}.
2839 This option is off by default
2840 for ISO C++11 onwards (@option{-std=c++11}, ...).
2841 @end table
2843 The following @option{-W@dots{}} options are not affected by @option{-Wall}.
2845 @table @gcctabopt
2846 @item -Weffc++ @r{(C++ and Objective-C++ only)}
2847 @opindex Weffc++
2848 @opindex Wno-effc++
2849 Warn about violations of the following style guidelines from Scott Meyers'
2850 @cite{Effective C++} series of books:
2852 @itemize @bullet
2853 @item
2854 Define a copy constructor and an assignment operator for classes
2855 with dynamically-allocated memory.
2857 @item
2858 Prefer initialization to assignment in constructors.
2860 @item
2861 Have @code{operator=} return a reference to @code{*this}.
2863 @item
2864 Don't try to return a reference when you must return an object.
2866 @item
2867 Distinguish between prefix and postfix forms of increment and
2868 decrement operators.
2870 @item
2871 Never overload @code{&&}, @code{||}, or @code{,}.
2873 @end itemize
2875 This option also enables @option{-Wnon-virtual-dtor}, which is also
2876 one of the effective C++ recommendations.  However, the check is
2877 extended to warn about the lack of virtual destructor in accessible
2878 non-polymorphic bases classes too.
2880 When selecting this option, be aware that the standard library
2881 headers do not obey all of these guidelines; use @samp{grep -v}
2882 to filter out those warnings.
2884 @item -Wstrict-null-sentinel @r{(C++ and Objective-C++ only)}
2885 @opindex Wstrict-null-sentinel
2886 @opindex Wno-strict-null-sentinel
2887 Warn about the use of an uncasted @code{NULL} as sentinel.  When
2888 compiling only with GCC this is a valid sentinel, as @code{NULL} is defined
2889 to @code{__null}.  Although it is a null pointer constant rather than a
2890 null pointer, it is guaranteed to be of the same size as a pointer.
2891 But this use is not portable across different compilers.
2893 @item -Wno-non-template-friend @r{(C++ and Objective-C++ only)}
2894 @opindex Wno-non-template-friend
2895 @opindex Wnon-template-friend
2896 Disable warnings when non-templatized friend functions are declared
2897 within a template.  Since the advent of explicit template specification
2898 support in G++, if the name of the friend is an unqualified-id (i.e.,
2899 @samp{friend foo(int)}), the C++ language specification demands that the
2900 friend declare or define an ordinary, nontemplate function.  (Section
2901 14.5.3).  Before G++ implemented explicit specification, unqualified-ids
2902 could be interpreted as a particular specialization of a templatized
2903 function.  Because this non-conforming behavior is no longer the default
2904 behavior for G++, @option{-Wnon-template-friend} allows the compiler to
2905 check existing code for potential trouble spots and is on by default.
2906 This new compiler behavior can be turned off with
2907 @option{-Wno-non-template-friend}, which keeps the conformant compiler code
2908 but disables the helpful warning.
2910 @item -Wold-style-cast @r{(C++ and Objective-C++ only)}
2911 @opindex Wold-style-cast
2912 @opindex Wno-old-style-cast
2913 Warn if an old-style (C-style) cast to a non-void type is used within
2914 a C++ program.  The new-style casts (@code{dynamic_cast},
2915 @code{static_cast}, @code{reinterpret_cast}, and @code{const_cast}) are
2916 less vulnerable to unintended effects and much easier to search for.
2918 @item -Woverloaded-virtual @r{(C++ and Objective-C++ only)}
2919 @opindex Woverloaded-virtual
2920 @opindex Wno-overloaded-virtual
2921 @cindex overloaded virtual function, warning
2922 @cindex warning for overloaded virtual function
2923 Warn when a function declaration hides virtual functions from a
2924 base class.  For example, in:
2926 @smallexample
2927 struct A @{
2928   virtual void f();
2931 struct B: public A @{
2932   void f(int);
2934 @end smallexample
2936 the @code{A} class version of @code{f} is hidden in @code{B}, and code
2937 like:
2939 @smallexample
2940 B* b;
2941 b->f();
2942 @end smallexample
2944 @noindent
2945 fails to compile.
2947 @item -Wno-pmf-conversions @r{(C++ and Objective-C++ only)}
2948 @opindex Wno-pmf-conversions
2949 @opindex Wpmf-conversions
2950 Disable the diagnostic for converting a bound pointer to member function
2951 to a plain pointer.
2953 @item -Wsign-promo @r{(C++ and Objective-C++ only)}
2954 @opindex Wsign-promo
2955 @opindex Wno-sign-promo
2956 Warn when overload resolution chooses a promotion from unsigned or
2957 enumerated type to a signed type, over a conversion to an unsigned type of
2958 the same size.  Previous versions of G++ tried to preserve
2959 unsignedness, but the standard mandates the current behavior.
2961 @item -Wtemplates @r{(C++ and Objective-C++ only)}
2962 @opindex Wtemplates
2963 Warn when a primary template declaration is encountered.  Some coding
2964 rules disallow templates, and this may be used to enforce that rule.
2965 The warning is inactive inside a system header file, such as the STL, so
2966 one can still use the STL.  One may also instantiate or specialize
2967 templates.
2969 @item -Wmultiple-inheritance @r{(C++ and Objective-C++ only)}
2970 @opindex Wmultiple-inheritance
2971 Warn when a class is defined with multiple direct base classes.  Some
2972 coding rules disallow multiple inheritance, and this may be used to
2973 enforce that rule.  The warning is inactive inside a system header file,
2974 such as the STL, so one can still use the STL.  One may also define
2975 classes that indirectly use multiple inheritance.
2977 @item -Wvirtual-inheritance
2978 @opindex Wvirtual-inheritance
2979 Warn when a class is defined with a virtual direct base classe.  Some
2980 coding rules disallow multiple inheritance, and this may be used to
2981 enforce that rule.  The warning is inactive inside a system header file,
2982 such as the STL, so one can still use the STL.  One may also define
2983 classes that indirectly use virtual inheritance.
2985 @item -Wnamespaces
2986 @opindex Wnamespaces
2987 Warn when a namespace definition is opened.  Some coding rules disallow
2988 namespaces, and this may be used to enforce that rule.  The warning is
2989 inactive inside a system header file, such as the STL, so one can still
2990 use the STL.  One may also use using directives and qualified names.
2992 @item -Wno-terminate @r{(C++ and Objective-C++ only)}
2993 @opindex Wterminate
2994 @opindex Wno-terminate
2995 Disable the warning about a throw-expression that will immediately
2996 result in a call to @code{terminate}.
2997 @end table
2999 @node Objective-C and Objective-C++ Dialect Options
3000 @section Options Controlling Objective-C and Objective-C++ Dialects
3002 @cindex compiler options, Objective-C and Objective-C++
3003 @cindex Objective-C and Objective-C++ options, command-line
3004 @cindex options, Objective-C and Objective-C++
3005 (NOTE: This manual does not describe the Objective-C and Objective-C++
3006 languages themselves.  @xref{Standards,,Language Standards
3007 Supported by GCC}, for references.)
3009 This section describes the command-line options that are only meaningful
3010 for Objective-C and Objective-C++ programs.  You can also use most of
3011 the language-independent GNU compiler options.
3012 For example, you might compile a file @file{some_class.m} like this:
3014 @smallexample
3015 gcc -g -fgnu-runtime -O -c some_class.m
3016 @end smallexample
3018 @noindent
3019 In this example, @option{-fgnu-runtime} is an option meant only for
3020 Objective-C and Objective-C++ programs; you can use the other options with
3021 any language supported by GCC@.
3023 Note that since Objective-C is an extension of the C language, Objective-C
3024 compilations may also use options specific to the C front-end (e.g.,
3025 @option{-Wtraditional}).  Similarly, Objective-C++ compilations may use
3026 C++-specific options (e.g., @option{-Wabi}).
3028 Here is a list of options that are @emph{only} for compiling Objective-C
3029 and Objective-C++ programs:
3031 @table @gcctabopt
3032 @item -fconstant-string-class=@var{class-name}
3033 @opindex fconstant-string-class
3034 Use @var{class-name} as the name of the class to instantiate for each
3035 literal string specified with the syntax @code{@@"@dots{}"}.  The default
3036 class name is @code{NXConstantString} if the GNU runtime is being used, and
3037 @code{NSConstantString} if the NeXT runtime is being used (see below).  The
3038 @option{-fconstant-cfstrings} option, if also present, overrides the
3039 @option{-fconstant-string-class} setting and cause @code{@@"@dots{}"} literals
3040 to be laid out as constant CoreFoundation strings.
3042 @item -fgnu-runtime
3043 @opindex fgnu-runtime
3044 Generate object code compatible with the standard GNU Objective-C
3045 runtime.  This is the default for most types of systems.
3047 @item -fnext-runtime
3048 @opindex fnext-runtime
3049 Generate output compatible with the NeXT runtime.  This is the default
3050 for NeXT-based systems, including Darwin and Mac OS X@.  The macro
3051 @code{__NEXT_RUNTIME__} is predefined if (and only if) this option is
3052 used.
3054 @item -fno-nil-receivers
3055 @opindex fno-nil-receivers
3056 Assume that all Objective-C message dispatches (@code{[receiver
3057 message:arg]}) in this translation unit ensure that the receiver is
3058 not @code{nil}.  This allows for more efficient entry points in the
3059 runtime to be used.  This option is only available in conjunction with
3060 the NeXT runtime and ABI version 0 or 1.
3062 @item -fobjc-abi-version=@var{n}
3063 @opindex fobjc-abi-version
3064 Use version @var{n} of the Objective-C ABI for the selected runtime.
3065 This option is currently supported only for the NeXT runtime.  In that
3066 case, Version 0 is the traditional (32-bit) ABI without support for
3067 properties and other Objective-C 2.0 additions.  Version 1 is the
3068 traditional (32-bit) ABI with support for properties and other
3069 Objective-C 2.0 additions.  Version 2 is the modern (64-bit) ABI.  If
3070 nothing is specified, the default is Version 0 on 32-bit target
3071 machines, and Version 2 on 64-bit target machines.
3073 @item -fobjc-call-cxx-cdtors
3074 @opindex fobjc-call-cxx-cdtors
3075 For each Objective-C class, check if any of its instance variables is a
3076 C++ object with a non-trivial default constructor.  If so, synthesize a
3077 special @code{- (id) .cxx_construct} instance method which runs
3078 non-trivial default constructors on any such instance variables, in order,
3079 and then return @code{self}.  Similarly, check if any instance variable
3080 is a C++ object with a non-trivial destructor, and if so, synthesize a
3081 special @code{- (void) .cxx_destruct} method which runs
3082 all such default destructors, in reverse order.
3084 The @code{- (id) .cxx_construct} and @code{- (void) .cxx_destruct}
3085 methods thusly generated only operate on instance variables
3086 declared in the current Objective-C class, and not those inherited
3087 from superclasses.  It is the responsibility of the Objective-C
3088 runtime to invoke all such methods in an object's inheritance
3089 hierarchy.  The @code{- (id) .cxx_construct} methods are invoked
3090 by the runtime immediately after a new object instance is allocated;
3091 the @code{- (void) .cxx_destruct} methods are invoked immediately
3092 before the runtime deallocates an object instance.
3094 As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
3095 support for invoking the @code{- (id) .cxx_construct} and
3096 @code{- (void) .cxx_destruct} methods.
3098 @item -fobjc-direct-dispatch
3099 @opindex fobjc-direct-dispatch
3100 Allow fast jumps to the message dispatcher.  On Darwin this is
3101 accomplished via the comm page.
3103 @item -fobjc-exceptions
3104 @opindex fobjc-exceptions
3105 Enable syntactic support for structured exception handling in
3106 Objective-C, similar to what is offered by C++ and Java.  This option
3107 is required to use the Objective-C keywords @code{@@try},
3108 @code{@@throw}, @code{@@catch}, @code{@@finally} and
3109 @code{@@synchronized}.  This option is available with both the GNU
3110 runtime and the NeXT runtime (but not available in conjunction with
3111 the NeXT runtime on Mac OS X 10.2 and earlier).
3113 @item -fobjc-gc
3114 @opindex fobjc-gc
3115 Enable garbage collection (GC) in Objective-C and Objective-C++
3116 programs.  This option is only available with the NeXT runtime; the
3117 GNU runtime has a different garbage collection implementation that
3118 does not require special compiler flags.
3120 @item -fobjc-nilcheck
3121 @opindex fobjc-nilcheck
3122 For the NeXT runtime with version 2 of the ABI, check for a nil
3123 receiver in method invocations before doing the actual method call.
3124 This is the default and can be disabled using
3125 @option{-fno-objc-nilcheck}.  Class methods and super calls are never
3126 checked for nil in this way no matter what this flag is set to.
3127 Currently this flag does nothing when the GNU runtime, or an older
3128 version of the NeXT runtime ABI, is used.
3130 @item -fobjc-std=objc1
3131 @opindex fobjc-std
3132 Conform to the language syntax of Objective-C 1.0, the language
3133 recognized by GCC 4.0.  This only affects the Objective-C additions to
3134 the C/C++ language; it does not affect conformance to C/C++ standards,
3135 which is controlled by the separate C/C++ dialect option flags.  When
3136 this option is used with the Objective-C or Objective-C++ compiler,
3137 any Objective-C syntax that is not recognized by GCC 4.0 is rejected.
3138 This is useful if you need to make sure that your Objective-C code can
3139 be compiled with older versions of GCC@.
3141 @item -freplace-objc-classes
3142 @opindex freplace-objc-classes
3143 Emit a special marker instructing @command{ld(1)} not to statically link in
3144 the resulting object file, and allow @command{dyld(1)} to load it in at
3145 run time instead.  This is used in conjunction with the Fix-and-Continue
3146 debugging mode, where the object file in question may be recompiled and
3147 dynamically reloaded in the course of program execution, without the need
3148 to restart the program itself.  Currently, Fix-and-Continue functionality
3149 is only available in conjunction with the NeXT runtime on Mac OS X 10.3
3150 and later.
3152 @item -fzero-link
3153 @opindex fzero-link
3154 When compiling for the NeXT runtime, the compiler ordinarily replaces calls
3155 to @code{objc_getClass("@dots{}")} (when the name of the class is known at
3156 compile time) with static class references that get initialized at load time,
3157 which improves run-time performance.  Specifying the @option{-fzero-link} flag
3158 suppresses this behavior and causes calls to @code{objc_getClass("@dots{}")}
3159 to be retained.  This is useful in Zero-Link debugging mode, since it allows
3160 for individual class implementations to be modified during program execution.
3161 The GNU runtime currently always retains calls to @code{objc_get_class("@dots{}")}
3162 regardless of command-line options.
3164 @item -fno-local-ivars
3165 @opindex fno-local-ivars
3166 @opindex flocal-ivars
3167 By default instance variables in Objective-C can be accessed as if
3168 they were local variables from within the methods of the class they're
3169 declared in.  This can lead to shadowing between instance variables
3170 and other variables declared either locally inside a class method or
3171 globally with the same name.  Specifying the @option{-fno-local-ivars}
3172 flag disables this behavior thus avoiding variable shadowing issues.
3174 @item -fivar-visibility=@r{[}public@r{|}protected@r{|}private@r{|}package@r{]}
3175 @opindex fivar-visibility
3176 Set the default instance variable visibility to the specified option
3177 so that instance variables declared outside the scope of any access
3178 modifier directives default to the specified visibility.
3180 @item -gen-decls
3181 @opindex gen-decls
3182 Dump interface declarations for all classes seen in the source file to a
3183 file named @file{@var{sourcename}.decl}.
3185 @item -Wassign-intercept @r{(Objective-C and Objective-C++ only)}
3186 @opindex Wassign-intercept
3187 @opindex Wno-assign-intercept
3188 Warn whenever an Objective-C assignment is being intercepted by the
3189 garbage collector.
3191 @item -Wno-protocol @r{(Objective-C and Objective-C++ only)}
3192 @opindex Wno-protocol
3193 @opindex Wprotocol
3194 If a class is declared to implement a protocol, a warning is issued for
3195 every method in the protocol that is not implemented by the class.  The
3196 default behavior is to issue a warning for every method not explicitly
3197 implemented in the class, even if a method implementation is inherited
3198 from the superclass.  If you use the @option{-Wno-protocol} option, then
3199 methods inherited from the superclass are considered to be implemented,
3200 and no warning is issued for them.
3202 @item -Wselector @r{(Objective-C and Objective-C++ only)}
3203 @opindex Wselector
3204 @opindex Wno-selector
3205 Warn if multiple methods of different types for the same selector are
3206 found during compilation.  The check is performed on the list of methods
3207 in the final stage of compilation.  Additionally, a check is performed
3208 for each selector appearing in a @code{@@selector(@dots{})}
3209 expression, and a corresponding method for that selector has been found
3210 during compilation.  Because these checks scan the method table only at
3211 the end of compilation, these warnings are not produced if the final
3212 stage of compilation is not reached, for example because an error is
3213 found during compilation, or because the @option{-fsyntax-only} option is
3214 being used.
3216 @item -Wstrict-selector-match @r{(Objective-C and Objective-C++ only)}
3217 @opindex Wstrict-selector-match
3218 @opindex Wno-strict-selector-match
3219 Warn if multiple methods with differing argument and/or return types are
3220 found for a given selector when attempting to send a message using this
3221 selector to a receiver of type @code{id} or @code{Class}.  When this flag
3222 is off (which is the default behavior), the compiler omits such warnings
3223 if any differences found are confined to types that share the same size
3224 and alignment.
3226 @item -Wundeclared-selector @r{(Objective-C and Objective-C++ only)}
3227 @opindex Wundeclared-selector
3228 @opindex Wno-undeclared-selector
3229 Warn if a @code{@@selector(@dots{})} expression referring to an
3230 undeclared selector is found.  A selector is considered undeclared if no
3231 method with that name has been declared before the
3232 @code{@@selector(@dots{})} expression, either explicitly in an
3233 @code{@@interface} or @code{@@protocol} declaration, or implicitly in
3234 an @code{@@implementation} section.  This option always performs its
3235 checks as soon as a @code{@@selector(@dots{})} expression is found,
3236 while @option{-Wselector} only performs its checks in the final stage of
3237 compilation.  This also enforces the coding style convention
3238 that methods and selectors must be declared before being used.
3240 @item -print-objc-runtime-info
3241 @opindex print-objc-runtime-info
3242 Generate C header describing the largest structure that is passed by
3243 value, if any.
3245 @end table
3247 @node Diagnostic Message Formatting Options
3248 @section Options to Control Diagnostic Messages Formatting
3249 @cindex options to control diagnostics formatting
3250 @cindex diagnostic messages
3251 @cindex message formatting
3253 Traditionally, diagnostic messages have been formatted irrespective of
3254 the output device's aspect (e.g.@: its width, @dots{}).  You can use the
3255 options described below
3256 to control the formatting algorithm for diagnostic messages, 
3257 e.g.@: how many characters per line, how often source location
3258 information should be reported.  Note that some language front ends may not
3259 honor these options.
3261 @table @gcctabopt
3262 @item -fmessage-length=@var{n}
3263 @opindex fmessage-length
3264 Try to format error messages so that they fit on lines of about
3265 @var{n} characters.  If @var{n} is zero, then no line-wrapping is
3266 done; each error message appears on a single line.  This is the
3267 default for all front ends.
3269 @item -fdiagnostics-show-location=once
3270 @opindex fdiagnostics-show-location
3271 Only meaningful in line-wrapping mode.  Instructs the diagnostic messages
3272 reporter to emit source location information @emph{once}; that is, in
3273 case the message is too long to fit on a single physical line and has to
3274 be wrapped, the source location won't be emitted (as prefix) again,
3275 over and over, in subsequent continuation lines.  This is the default
3276 behavior.
3278 @item -fdiagnostics-show-location=every-line
3279 Only meaningful in line-wrapping mode.  Instructs the diagnostic
3280 messages reporter to emit the same source location information (as
3281 prefix) for physical lines that result from the process of breaking
3282 a message which is too long to fit on a single line.
3284 @item -fdiagnostics-color[=@var{WHEN}]
3285 @itemx -fno-diagnostics-color
3286 @opindex fdiagnostics-color
3287 @cindex highlight, color
3288 @vindex GCC_COLORS @r{environment variable}
3289 Use color in diagnostics.  @var{WHEN} is @samp{never}, @samp{always},
3290 or @samp{auto}.  The default depends on how the compiler has been configured,
3291 it can be any of the above @var{WHEN} options or also @samp{never}
3292 if @env{GCC_COLORS} environment variable isn't present in the environment,
3293 and @samp{auto} otherwise.
3294 @samp{auto} means to use color only when the standard error is a terminal.
3295 The forms @option{-fdiagnostics-color} and @option{-fno-diagnostics-color} are
3296 aliases for @option{-fdiagnostics-color=always} and
3297 @option{-fdiagnostics-color=never}, respectively.
3299 The colors are defined by the environment variable @env{GCC_COLORS}.
3300 Its value is a colon-separated list of capabilities and Select Graphic
3301 Rendition (SGR) substrings. SGR commands are interpreted by the
3302 terminal or terminal emulator.  (See the section in the documentation
3303 of your text terminal for permitted values and their meanings as
3304 character attributes.)  These substring values are integers in decimal
3305 representation and can be concatenated with semicolons.
3306 Common values to concatenate include
3307 @samp{1} for bold,
3308 @samp{4} for underline,
3309 @samp{5} for blink,
3310 @samp{7} for inverse,
3311 @samp{39} for default foreground color,
3312 @samp{30} to @samp{37} for foreground colors,
3313 @samp{90} to @samp{97} for 16-color mode foreground colors,
3314 @samp{38;5;0} to @samp{38;5;255}
3315 for 88-color and 256-color modes foreground colors,
3316 @samp{49} for default background color,
3317 @samp{40} to @samp{47} for background colors,
3318 @samp{100} to @samp{107} for 16-color mode background colors,
3319 and @samp{48;5;0} to @samp{48;5;255}
3320 for 88-color and 256-color modes background colors.
3322 The default @env{GCC_COLORS} is
3323 @smallexample
3324 error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01
3325 @end smallexample
3326 @noindent
3327 where @samp{01;31} is bold red, @samp{01;35} is bold magenta,
3328 @samp{01;36} is bold cyan, @samp{01;32} is bold green and
3329 @samp{01} is bold. Setting @env{GCC_COLORS} to the empty
3330 string disables colors.
3331 Supported capabilities are as follows.
3333 @table @code
3334 @item error=
3335 @vindex error GCC_COLORS @r{capability}
3336 SGR substring for error: markers.
3338 @item warning=
3339 @vindex warning GCC_COLORS @r{capability}
3340 SGR substring for warning: markers.
3342 @item note=
3343 @vindex note GCC_COLORS @r{capability}
3344 SGR substring for note: markers.
3346 @item caret=
3347 @vindex caret GCC_COLORS @r{capability}
3348 SGR substring for caret line.
3350 @item locus=
3351 @vindex locus GCC_COLORS @r{capability}
3352 SGR substring for location information, @samp{file:line} or
3353 @samp{file:line:column} etc.
3355 @item quote=
3356 @vindex quote GCC_COLORS @r{capability}
3357 SGR substring for information printed within quotes.
3358 @end table
3360 @item -fno-diagnostics-show-option
3361 @opindex fno-diagnostics-show-option
3362 @opindex fdiagnostics-show-option
3363 By default, each diagnostic emitted includes text indicating the
3364 command-line option that directly controls the diagnostic (if such an
3365 option is known to the diagnostic machinery).  Specifying the
3366 @option{-fno-diagnostics-show-option} flag suppresses that behavior.
3368 @item -fno-diagnostics-show-caret
3369 @opindex fno-diagnostics-show-caret
3370 @opindex fdiagnostics-show-caret
3371 By default, each diagnostic emitted includes the original source line
3372 and a caret @samp{^} indicating the column.  This option suppresses this
3373 information.  The source line is truncated to @var{n} characters, if
3374 the @option{-fmessage-length=n} option is given.  When the output is done
3375 to the terminal, the width is limited to the width given by the
3376 @env{COLUMNS} environment variable or, if not set, to the terminal width.
3378 @end table
3380 @node Warning Options
3381 @section Options to Request or Suppress Warnings
3382 @cindex options to control warnings
3383 @cindex warning messages
3384 @cindex messages, warning
3385 @cindex suppressing warnings
3387 Warnings are diagnostic messages that report constructions that
3388 are not inherently erroneous but that are risky or suggest there
3389 may have been an error.
3391 The following language-independent options do not enable specific
3392 warnings but control the kinds of diagnostics produced by GCC@.
3394 @table @gcctabopt
3395 @cindex syntax checking
3396 @item -fsyntax-only
3397 @opindex fsyntax-only
3398 Check the code for syntax errors, but don't do anything beyond that.
3400 @item -fmax-errors=@var{n}
3401 @opindex fmax-errors
3402 Limits the maximum number of error messages to @var{n}, at which point
3403 GCC bails out rather than attempting to continue processing the source
3404 code.  If @var{n} is 0 (the default), there is no limit on the number
3405 of error messages produced.  If @option{-Wfatal-errors} is also
3406 specified, then @option{-Wfatal-errors} takes precedence over this
3407 option.
3409 @item -w
3410 @opindex w
3411 Inhibit all warning messages.
3413 @item -Werror
3414 @opindex Werror
3415 @opindex Wno-error
3416 Make all warnings into errors.
3418 @item -Werror=
3419 @opindex Werror=
3420 @opindex Wno-error=
3421 Make the specified warning into an error.  The specifier for a warning
3422 is appended; for example @option{-Werror=switch} turns the warnings
3423 controlled by @option{-Wswitch} into errors.  This switch takes a
3424 negative form, to be used to negate @option{-Werror} for specific
3425 warnings; for example @option{-Wno-error=switch} makes
3426 @option{-Wswitch} warnings not be errors, even when @option{-Werror}
3427 is in effect.
3429 The warning message for each controllable warning includes the
3430 option that controls the warning.  That option can then be used with
3431 @option{-Werror=} and @option{-Wno-error=} as described above.
3432 (Printing of the option in the warning message can be disabled using the
3433 @option{-fno-diagnostics-show-option} flag.)
3435 Note that specifying @option{-Werror=}@var{foo} automatically implies
3436 @option{-W}@var{foo}.  However, @option{-Wno-error=}@var{foo} does not
3437 imply anything.
3439 @item -Wfatal-errors
3440 @opindex Wfatal-errors
3441 @opindex Wno-fatal-errors
3442 This option causes the compiler to abort compilation on the first error
3443 occurred rather than trying to keep going and printing further error
3444 messages.
3446 @end table
3448 You can request many specific warnings with options beginning with
3449 @samp{-W}, for example @option{-Wimplicit} to request warnings on
3450 implicit declarations.  Each of these specific warning options also
3451 has a negative form beginning @samp{-Wno-} to turn off warnings; for
3452 example, @option{-Wno-implicit}.  This manual lists only one of the
3453 two forms, whichever is not the default.  For further
3454 language-specific options also refer to @ref{C++ Dialect Options} and
3455 @ref{Objective-C and Objective-C++ Dialect Options}.
3457 Some options, such as @option{-Wall} and @option{-Wextra}, turn on other
3458 options, such as @option{-Wunused}, which may turn on further options,
3459 such as @option{-Wunused-value}. The combined effect of positive and
3460 negative forms is that more specific options have priority over less
3461 specific ones, independently of their position in the command-line. For
3462 options of the same specificity, the last one takes effect. Options
3463 enabled or disabled via pragmas (@pxref{Diagnostic Pragmas}) take effect
3464 as if they appeared at the end of the command-line.
3466 When an unrecognized warning option is requested (e.g.,
3467 @option{-Wunknown-warning}), GCC emits a diagnostic stating
3468 that the option is not recognized.  However, if the @option{-Wno-} form
3469 is used, the behavior is slightly different: no diagnostic is
3470 produced for @option{-Wno-unknown-warning} unless other diagnostics
3471 are being produced.  This allows the use of new @option{-Wno-} options
3472 with old compilers, but if something goes wrong, the compiler
3473 warns that an unrecognized option is present.
3475 @table @gcctabopt
3476 @item -Wpedantic
3477 @itemx -pedantic
3478 @opindex pedantic
3479 @opindex Wpedantic
3480 Issue all the warnings demanded by strict ISO C and ISO C++;
3481 reject all programs that use forbidden extensions, and some other
3482 programs that do not follow ISO C and ISO C++.  For ISO C, follows the
3483 version of the ISO C standard specified by any @option{-std} option used.
3485 Valid ISO C and ISO C++ programs should compile properly with or without
3486 this option (though a rare few require @option{-ansi} or a
3487 @option{-std} option specifying the required version of ISO C)@.  However,
3488 without this option, certain GNU extensions and traditional C and C++
3489 features are supported as well.  With this option, they are rejected.
3491 @option{-Wpedantic} does not cause warning messages for use of the
3492 alternate keywords whose names begin and end with @samp{__}.  Pedantic
3493 warnings are also disabled in the expression that follows
3494 @code{__extension__}.  However, only system header files should use
3495 these escape routes; application programs should avoid them.
3496 @xref{Alternate Keywords}.
3498 Some users try to use @option{-Wpedantic} to check programs for strict ISO
3499 C conformance.  They soon find that it does not do quite what they want:
3500 it finds some non-ISO practices, but not all---only those for which
3501 ISO C @emph{requires} a diagnostic, and some others for which
3502 diagnostics have been added.
3504 A feature to report any failure to conform to ISO C might be useful in
3505 some instances, but would require considerable additional work and would
3506 be quite different from @option{-Wpedantic}.  We don't have plans to
3507 support such a feature in the near future.
3509 Where the standard specified with @option{-std} represents a GNU
3510 extended dialect of C, such as @samp{gnu90} or @samp{gnu99}, there is a
3511 corresponding @dfn{base standard}, the version of ISO C on which the GNU
3512 extended dialect is based.  Warnings from @option{-Wpedantic} are given
3513 where they are required by the base standard.  (It does not make sense
3514 for such warnings to be given only for features not in the specified GNU
3515 C dialect, since by definition the GNU dialects of C include all
3516 features the compiler supports with the given option, and there would be
3517 nothing to warn about.)
3519 @item -pedantic-errors
3520 @opindex pedantic-errors
3521 Give an error whenever the @dfn{base standard} (see @option{-Wpedantic})
3522 requires a diagnostic, in some cases where there is undefined behavior
3523 at compile-time and in some other cases that do not prevent compilation
3524 of programs that are valid according to the standard. This is not
3525 equivalent to @option{-Werror=pedantic}, since there are errors enabled
3526 by this option and not enabled by the latter and vice versa.
3528 @item -Wall
3529 @opindex Wall
3530 @opindex Wno-all
3531 This enables all the warnings about constructions that some users
3532 consider questionable, and that are easy to avoid (or modify to
3533 prevent the warning), even in conjunction with macros.  This also
3534 enables some language-specific warnings described in @ref{C++ Dialect
3535 Options} and @ref{Objective-C and Objective-C++ Dialect Options}.
3537 @option{-Wall} turns on the following warning flags:
3539 @gccoptlist{-Waddress   @gol
3540 -Warray-bounds=1 @r{(only with} @option{-O2}@r{)}  @gol
3541 -Wbool-compare  @gol
3542 -Wc++11-compat  -Wc++14-compat@gol
3543 -Wchar-subscripts  @gol
3544 -Wcomment  @gol
3545 -Wduplicate-decl-specifier @r{(C and Objective-C only)} @gol
3546 -Wenum-compare @r{(in C/ObjC; this is on by default in C++)} @gol
3547 -Wformat   @gol
3548 -Wimplicit @r{(C and Objective-C only)} @gol
3549 -Wimplicit-int @r{(C and Objective-C only)} @gol
3550 -Wimplicit-function-declaration @r{(C and Objective-C only)} @gol
3551 -Winit-self @r{(only for C++)} @gol
3552 -Wlogical-not-parentheses
3553 -Wmain @r{(only for C/ObjC and unless} @option{-ffreestanding}@r{)}  @gol
3554 -Wmaybe-uninitialized @gol
3555 -Wmemset-elt-size @gol
3556 -Wmemset-transposed-args @gol
3557 -Wmisleading-indentation @r{(only for C/C++)} @gol
3558 -Wmissing-braces @r{(only for C/ObjC)} @gol
3559 -Wnarrowing @r{(only for C++)}  @gol
3560 -Wnonnull  @gol
3561 -Wnonnull-compare  @gol
3562 -Wopenmp-simd @gol
3563 -Wparentheses  @gol
3564 -Wpointer-sign  @gol
3565 -Wreorder   @gol
3566 -Wreturn-type  @gol
3567 -Wsequence-point  @gol
3568 -Wsign-compare @r{(only in C++)}  @gol
3569 -Wsizeof-pointer-memaccess @gol
3570 -Wstrict-aliasing  @gol
3571 -Wstrict-overflow=1  @gol
3572 -Wswitch  @gol
3573 -Wtautological-compare  @gol
3574 -Wtrigraphs  @gol
3575 -Wuninitialized  @gol
3576 -Wunknown-pragmas  @gol
3577 -Wunused-function  @gol
3578 -Wunused-label     @gol
3579 -Wunused-value     @gol
3580 -Wunused-variable  @gol
3581 -Wvolatile-register-var @gol
3584 Note that some warning flags are not implied by @option{-Wall}.  Some of
3585 them warn about constructions that users generally do not consider
3586 questionable, but which occasionally you might wish to check for;
3587 others warn about constructions that are necessary or hard to avoid in
3588 some cases, and there is no simple way to modify the code to suppress
3589 the warning. Some of them are enabled by @option{-Wextra} but many of
3590 them must be enabled individually.
3592 @item -Wextra
3593 @opindex W
3594 @opindex Wextra
3595 @opindex Wno-extra
3596 This enables some extra warning flags that are not enabled by
3597 @option{-Wall}. (This option used to be called @option{-W}.  The older
3598 name is still supported, but the newer name is more descriptive.)
3600 @gccoptlist{-Wclobbered  @gol
3601 -Wempty-body  @gol
3602 -Wignored-qualifiers @gol
3603 -Wmissing-field-initializers  @gol
3604 -Wmissing-parameter-type @r{(C only)}  @gol
3605 -Wold-style-declaration @r{(C only)}  @gol
3606 -Woverride-init  @gol
3607 -Wsign-compare @r{(C only)} @gol
3608 -Wtype-limits  @gol
3609 -Wuninitialized  @gol
3610 -Wshift-negative-value @r{(in C++03 and in C99 and newer)}  @gol
3611 -Wunused-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)} @gol
3612 -Wunused-but-set-parameter @r{(only with} @option{-Wunused} @r{or} @option{-Wall}@r{)}  @gol
3615 The option @option{-Wextra} also prints warning messages for the
3616 following cases:
3618 @itemize @bullet
3620 @item
3621 A pointer is compared against integer zero with @code{<}, @code{<=},
3622 @code{>}, or @code{>=}.
3624 @item
3625 (C++ only) An enumerator and a non-enumerator both appear in a
3626 conditional expression.
3628 @item
3629 (C++ only) Ambiguous virtual bases.
3631 @item
3632 (C++ only) Subscripting an array that has been declared @code{register}.
3634 @item
3635 (C++ only) Taking the address of a variable that has been declared
3636 @code{register}.
3638 @item
3639 (C++ only) A base class is not initialized in a derived class's copy
3640 constructor.
3642 @end itemize
3644 @item -Wchar-subscripts
3645 @opindex Wchar-subscripts
3646 @opindex Wno-char-subscripts
3647 Warn if an array subscript has type @code{char}.  This is a common cause
3648 of error, as programmers often forget that this type is signed on some
3649 machines.
3650 This warning is enabled by @option{-Wall}.
3652 @item -Wcomment
3653 @opindex Wcomment
3654 @opindex Wno-comment
3655 Warn whenever a comment-start sequence @samp{/*} appears in a @samp{/*}
3656 comment, or whenever a Backslash-Newline appears in a @samp{//} comment.
3657 This warning is enabled by @option{-Wall}.
3659 @item -Wno-coverage-mismatch
3660 @opindex Wno-coverage-mismatch
3661 Warn if feedback profiles do not match when using the
3662 @option{-fprofile-use} option.
3663 If a source file is changed between compiling with @option{-fprofile-gen} and
3664 with @option{-fprofile-use}, the files with the profile feedback can fail
3665 to match the source file and GCC cannot use the profile feedback
3666 information.  By default, this warning is enabled and is treated as an
3667 error.  @option{-Wno-coverage-mismatch} can be used to disable the
3668 warning or @option{-Wno-error=coverage-mismatch} can be used to
3669 disable the error.  Disabling the error for this warning can result in
3670 poorly optimized code and is useful only in the
3671 case of very minor changes such as bug fixes to an existing code-base.
3672 Completely disabling the warning is not recommended.
3674 @item -Wno-cpp
3675 @r{(C, Objective-C, C++, Objective-C++ and Fortran only)}
3677 Suppress warning messages emitted by @code{#warning} directives.
3679 @item -Wdouble-promotion @r{(C, C++, Objective-C and Objective-C++ only)}
3680 @opindex Wdouble-promotion
3681 @opindex Wno-double-promotion
3682 Give a warning when a value of type @code{float} is implicitly
3683 promoted to @code{double}.  CPUs with a 32-bit ``single-precision''
3684 floating-point unit implement @code{float} in hardware, but emulate
3685 @code{double} in software.  On such a machine, doing computations
3686 using @code{double} values is much more expensive because of the
3687 overhead required for software emulation.
3689 It is easy to accidentally do computations with @code{double} because
3690 floating-point literals are implicitly of type @code{double}.  For
3691 example, in:
3692 @smallexample
3693 @group
3694 float area(float radius)
3696    return 3.14159 * radius * radius;
3698 @end group
3699 @end smallexample
3700 the compiler performs the entire computation with @code{double}
3701 because the floating-point literal is a @code{double}.
3703 @item -Wduplicate-decl-specifier @r{(C and Objective-C only)}
3704 @opindex Wduplicate-decl-specifier
3705 @opindex Wno-duplicate-decl-specifier
3706 Warn if a declaration has duplicate @code{const}, @code{volatile},
3707 @code{restrict} or @code{_Atomic} specifier.  This warning is enabled by
3708 @option{-Wall}.
3710 @item -Wformat
3711 @itemx -Wformat=@var{n}
3712 @opindex Wformat
3713 @opindex Wno-format
3714 @opindex ffreestanding
3715 @opindex fno-builtin
3716 @opindex Wformat=
3717 Check calls to @code{printf} and @code{scanf}, etc., to make sure that
3718 the arguments supplied have types appropriate to the format string
3719 specified, and that the conversions specified in the format string make
3720 sense.  This includes standard functions, and others specified by format
3721 attributes (@pxref{Function Attributes}), in the @code{printf},
3722 @code{scanf}, @code{strftime} and @code{strfmon} (an X/Open extension,
3723 not in the C standard) families (or other target-specific families).
3724 Which functions are checked without format attributes having been
3725 specified depends on the standard version selected, and such checks of
3726 functions without the attribute specified are disabled by
3727 @option{-ffreestanding} or @option{-fno-builtin}.
3729 The formats are checked against the format features supported by GNU
3730 libc version 2.2.  These include all ISO C90 and C99 features, as well
3731 as features from the Single Unix Specification and some BSD and GNU
3732 extensions.  Other library implementations may not support all these
3733 features; GCC does not support warning about features that go beyond a
3734 particular library's limitations.  However, if @option{-Wpedantic} is used
3735 with @option{-Wformat}, warnings are given about format features not
3736 in the selected standard version (but not for @code{strfmon} formats,
3737 since those are not in any version of the C standard).  @xref{C Dialect
3738 Options,,Options Controlling C Dialect}.
3740 @table @gcctabopt
3741 @item -Wformat=1
3742 @itemx -Wformat
3743 @opindex Wformat
3744 @opindex Wformat=1
3745 Option @option{-Wformat} is equivalent to @option{-Wformat=1}, and
3746 @option{-Wno-format} is equivalent to @option{-Wformat=0}.  Since
3747 @option{-Wformat} also checks for null format arguments for several
3748 functions, @option{-Wformat} also implies @option{-Wnonnull}.  Some
3749 aspects of this level of format checking can be disabled by the
3750 options: @option{-Wno-format-contains-nul},
3751 @option{-Wno-format-extra-args}, and @option{-Wno-format-zero-length}.
3752 @option{-Wformat} is enabled by @option{-Wall}.
3754 @item -Wno-format-contains-nul
3755 @opindex Wno-format-contains-nul
3756 @opindex Wformat-contains-nul
3757 If @option{-Wformat} is specified, do not warn about format strings that
3758 contain NUL bytes.
3760 @item -Wno-format-extra-args
3761 @opindex Wno-format-extra-args
3762 @opindex Wformat-extra-args
3763 If @option{-Wformat} is specified, do not warn about excess arguments to a
3764 @code{printf} or @code{scanf} format function.  The C standard specifies
3765 that such arguments are ignored.
3767 Where the unused arguments lie between used arguments that are
3768 specified with @samp{$} operand number specifications, normally
3769 warnings are still given, since the implementation could not know what
3770 type to pass to @code{va_arg} to skip the unused arguments.  However,
3771 in the case of @code{scanf} formats, this option suppresses the
3772 warning if the unused arguments are all pointers, since the Single
3773 Unix Specification says that such unused arguments are allowed.
3775 @item -Wno-format-zero-length
3776 @opindex Wno-format-zero-length
3777 @opindex Wformat-zero-length
3778 If @option{-Wformat} is specified, do not warn about zero-length formats.
3779 The C standard specifies that zero-length formats are allowed.
3782 @item -Wformat=2
3783 @opindex Wformat=2
3784 Enable @option{-Wformat} plus additional format checks.  Currently
3785 equivalent to @option{-Wformat -Wformat-nonliteral -Wformat-security
3786 -Wformat-y2k}.
3788 @item -Wformat-nonliteral
3789 @opindex Wformat-nonliteral
3790 @opindex Wno-format-nonliteral
3791 If @option{-Wformat} is specified, also warn if the format string is not a
3792 string literal and so cannot be checked, unless the format function
3793 takes its format arguments as a @code{va_list}.
3795 @item -Wformat-security
3796 @opindex Wformat-security
3797 @opindex Wno-format-security
3798 If @option{-Wformat} is specified, also warn about uses of format
3799 functions that represent possible security problems.  At present, this
3800 warns about calls to @code{printf} and @code{scanf} functions where the
3801 format string is not a string literal and there are no format arguments,
3802 as in @code{printf (foo);}.  This may be a security hole if the format
3803 string came from untrusted input and contains @samp{%n}.  (This is
3804 currently a subset of what @option{-Wformat-nonliteral} warns about, but
3805 in future warnings may be added to @option{-Wformat-security} that are not
3806 included in @option{-Wformat-nonliteral}.)
3808 @item -Wformat-signedness
3809 @opindex Wformat-signedness
3810 @opindex Wno-format-signedness
3811 If @option{-Wformat} is specified, also warn if the format string
3812 requires an unsigned argument and the argument is signed and vice versa.
3814 @item -Wformat-y2k
3815 @opindex Wformat-y2k
3816 @opindex Wno-format-y2k
3817 If @option{-Wformat} is specified, also warn about @code{strftime}
3818 formats that may yield only a two-digit year.
3819 @end table
3821 @item -Wnonnull
3822 @opindex Wnonnull
3823 @opindex Wno-nonnull
3824 Warn about passing a null pointer for arguments marked as
3825 requiring a non-null value by the @code{nonnull} function attribute.
3827 @option{-Wnonnull} is included in @option{-Wall} and @option{-Wformat}.  It
3828 can be disabled with the @option{-Wno-nonnull} option.
3830 @item -Wnonnull-compare
3831 @opindex Wnonnull-compare
3832 @opindex Wno-nonnull-compare
3833 Warn when comparing an argument marked with the @code{nonnull}
3834 function attribute against null inside the function.
3836 @option{-Wnonnull-compare} is included in @option{-Wall}.  It
3837 can be disabled with the @option{-Wno-nonnull-compare} option.
3839 @item -Wnull-dereference
3840 @opindex Wnull-dereference
3841 @opindex Wno-null-dereference
3842 Warn if the compiler detects paths that trigger erroneous or
3843 undefined behavior due to dereferencing a null pointer.  This option
3844 is only active when @option{-fdelete-null-pointer-checks} is active,
3845 which is enabled by optimizations in most targets.  The precision of
3846 the warnings depends on the optimization options used.
3848 @item -Winit-self @r{(C, C++, Objective-C and Objective-C++ only)}
3849 @opindex Winit-self
3850 @opindex Wno-init-self
3851 Warn about uninitialized variables that are initialized with themselves.
3852 Note this option can only be used with the @option{-Wuninitialized} option.
3854 For example, GCC warns about @code{i} being uninitialized in the
3855 following snippet only when @option{-Winit-self} has been specified:
3856 @smallexample
3857 @group
3858 int f()
3860   int i = i;
3861   return i;
3863 @end group
3864 @end smallexample
3866 This warning is enabled by @option{-Wall} in C++.
3868 @item -Wimplicit-int @r{(C and Objective-C only)}
3869 @opindex Wimplicit-int
3870 @opindex Wno-implicit-int
3871 Warn when a declaration does not specify a type.
3872 This warning is enabled by @option{-Wall}.
3874 @item -Wimplicit-function-declaration @r{(C and Objective-C only)}
3875 @opindex Wimplicit-function-declaration
3876 @opindex Wno-implicit-function-declaration
3877 Give a warning whenever a function is used before being declared. In
3878 C99 mode (@option{-std=c99} or @option{-std=gnu99}), this warning is
3879 enabled by default and it is made into an error by
3880 @option{-pedantic-errors}. This warning is also enabled by
3881 @option{-Wall}.
3883 @item -Wimplicit @r{(C and Objective-C only)}
3884 @opindex Wimplicit
3885 @opindex Wno-implicit
3886 Same as @option{-Wimplicit-int} and @option{-Wimplicit-function-declaration}.
3887 This warning is enabled by @option{-Wall}.
3889 @item -Wignored-qualifiers @r{(C and C++ only)}
3890 @opindex Wignored-qualifiers
3891 @opindex Wno-ignored-qualifiers
3892 Warn if the return type of a function has a type qualifier
3893 such as @code{const}.  For ISO C such a type qualifier has no effect,
3894 since the value returned by a function is not an lvalue.
3895 For C++, the warning is only emitted for scalar types or @code{void}.
3896 ISO C prohibits qualified @code{void} return types on function
3897 definitions, so such return types always receive a warning
3898 even without this option.
3900 This warning is also enabled by @option{-Wextra}.
3902 @item -Wignored-attributes @r{(C and C++ only)}
3903 @opindex Wignored-attributes
3904 @opindex Wno-ignored-attributes
3905 Warn when an attribute is ignored.  This is different from the
3906 @option{-Wattributes} option in that it warns whenever the compiler decides
3907 to drop an attribute, not that the attribute is either unknown, used in a
3908 wrong place, etc.  This warning is enabled by default.
3910 @item -Wmain
3911 @opindex Wmain
3912 @opindex Wno-main
3913 Warn if the type of @code{main} is suspicious.  @code{main} should be
3914 a function with external linkage, returning int, taking either zero
3915 arguments, two, or three arguments of appropriate types.  This warning
3916 is enabled by default in C++ and is enabled by either @option{-Wall}
3917 or @option{-Wpedantic}.
3919 @item -Wmisleading-indentation @r{(C and C++ only)}
3920 @opindex Wmisleading-indentation
3921 @opindex Wno-misleading-indentation
3922 Warn when the indentation of the code does not reflect the block structure.
3923 Specifically, a warning is issued for @code{if}, @code{else}, @code{while}, and
3924 @code{for} clauses with a guarded statement that does not use braces,
3925 followed by an unguarded statement with the same indentation.
3927 In the following example, the call to ``bar'' is misleadingly indented as
3928 if it were guarded by the ``if'' conditional.
3930 @smallexample
3931   if (some_condition ())
3932     foo ();
3933     bar ();  /* Gotcha: this is not guarded by the "if".  */
3934 @end smallexample
3936 In the case of mixed tabs and spaces, the warning uses the
3937 @option{-ftabstop=} option to determine if the statements line up
3938 (defaulting to 8).
3940 The warning is not issued for code involving multiline preprocessor logic
3941 such as the following example.
3943 @smallexample
3944   if (flagA)
3945     foo (0);
3946 #if SOME_CONDITION_THAT_DOES_NOT_HOLD
3947   if (flagB)
3948 #endif
3949     foo (1);
3950 @end smallexample
3952 The warning is not issued after a @code{#line} directive, since this
3953 typically indicates autogenerated code, and no assumptions can be made
3954 about the layout of the file that the directive references.
3956 This warning is enabled by @option{-Wall} in C and C++.
3958 @item -Wmissing-braces
3959 @opindex Wmissing-braces
3960 @opindex Wno-missing-braces
3961 Warn if an aggregate or union initializer is not fully bracketed.  In
3962 the following example, the initializer for @code{a} is not fully
3963 bracketed, but that for @code{b} is fully bracketed.  This warning is
3964 enabled by @option{-Wall} in C.
3966 @smallexample
3967 int a[2][2] = @{ 0, 1, 2, 3 @};
3968 int b[2][2] = @{ @{ 0, 1 @}, @{ 2, 3 @} @};
3969 @end smallexample
3971 This warning is enabled by @option{-Wall}.
3973 @item -Wmissing-include-dirs @r{(C, C++, Objective-C and Objective-C++ only)}
3974 @opindex Wmissing-include-dirs
3975 @opindex Wno-missing-include-dirs
3976 Warn if a user-supplied include directory does not exist.
3978 @item -Wparentheses
3979 @opindex Wparentheses
3980 @opindex Wno-parentheses
3981 Warn if parentheses are omitted in certain contexts, such
3982 as when there is an assignment in a context where a truth value
3983 is expected, or when operators are nested whose precedence people
3984 often get confused about.
3986 Also warn if a comparison like @code{x<=y<=z} appears; this is
3987 equivalent to @code{(x<=y ? 1 : 0) <= z}, which is a different
3988 interpretation from that of ordinary mathematical notation.
3990 Also warn for dangerous uses of the GNU extension to
3991 @code{?:} with omitted middle operand. When the condition
3992 in the @code{?}: operator is a boolean expression, the omitted value is
3993 always 1.  Often programmers expect it to be a value computed
3994 inside the conditional expression instead.
3996 This warning is enabled by @option{-Wall}.
3998 @item -Wsequence-point
3999 @opindex Wsequence-point
4000 @opindex Wno-sequence-point
4001 Warn about code that may have undefined semantics because of violations
4002 of sequence point rules in the C and C++ standards.
4004 The C and C++ standards define the order in which expressions in a C/C++
4005 program are evaluated in terms of @dfn{sequence points}, which represent
4006 a partial ordering between the execution of parts of the program: those
4007 executed before the sequence point, and those executed after it.  These
4008 occur after the evaluation of a full expression (one which is not part
4009 of a larger expression), after the evaluation of the first operand of a
4010 @code{&&}, @code{||}, @code{? :} or @code{,} (comma) operator, before a
4011 function is called (but after the evaluation of its arguments and the
4012 expression denoting the called function), and in certain other places.
4013 Other than as expressed by the sequence point rules, the order of
4014 evaluation of subexpressions of an expression is not specified.  All
4015 these rules describe only a partial order rather than a total order,
4016 since, for example, if two functions are called within one expression
4017 with no sequence point between them, the order in which the functions
4018 are called is not specified.  However, the standards committee have
4019 ruled that function calls do not overlap.
4021 It is not specified when between sequence points modifications to the
4022 values of objects take effect.  Programs whose behavior depends on this
4023 have undefined behavior; the C and C++ standards specify that ``Between
4024 the previous and next sequence point an object shall have its stored
4025 value modified at most once by the evaluation of an expression.
4026 Furthermore, the prior value shall be read only to determine the value
4027 to be stored.''.  If a program breaks these rules, the results on any
4028 particular implementation are entirely unpredictable.
4030 Examples of code with undefined behavior are @code{a = a++;}, @code{a[n]
4031 = b[n++]} and @code{a[i++] = i;}.  Some more complicated cases are not
4032 diagnosed by this option, and it may give an occasional false positive
4033 result, but in general it has been found fairly effective at detecting
4034 this sort of problem in programs.
4036 The standard is worded confusingly, therefore there is some debate
4037 over the precise meaning of the sequence point rules in subtle cases.
4038 Links to discussions of the problem, including proposed formal
4039 definitions, may be found on the GCC readings page, at
4040 @uref{http://gcc.gnu.org/@/readings.html}.
4042 This warning is enabled by @option{-Wall} for C and C++.
4044 @item -Wno-return-local-addr
4045 @opindex Wno-return-local-addr
4046 @opindex Wreturn-local-addr
4047 Do not warn about returning a pointer (or in C++, a reference) to a
4048 variable that goes out of scope after the function returns.
4050 @item -Wreturn-type
4051 @opindex Wreturn-type
4052 @opindex Wno-return-type
4053 Warn whenever a function is defined with a return type that defaults
4054 to @code{int}.  Also warn about any @code{return} statement with no
4055 return value in a function whose return type is not @code{void}
4056 (falling off the end of the function body is considered returning
4057 without a value), and about a @code{return} statement with an
4058 expression in a function whose return type is @code{void}.
4060 For C++, a function without return type always produces a diagnostic
4061 message, even when @option{-Wno-return-type} is specified.  The only
4062 exceptions are @code{main} and functions defined in system headers.
4064 This warning is enabled by @option{-Wall}.
4066 @item -Wshift-count-negative
4067 @opindex Wshift-count-negative
4068 @opindex Wno-shift-count-negative
4069 Warn if shift count is negative. This warning is enabled by default.
4071 @item -Wshift-count-overflow
4072 @opindex Wshift-count-overflow
4073 @opindex Wno-shift-count-overflow
4074 Warn if shift count >= width of type. This warning is enabled by default.
4076 @item -Wshift-negative-value
4077 @opindex Wshift-negative-value
4078 @opindex Wno-shift-negative-value
4079 Warn if left shifting a negative value.  This warning is enabled by
4080 @option{-Wextra} in C99 and C++11 modes (and newer).
4082 @item -Wshift-overflow
4083 @itemx -Wshift-overflow=@var{n}
4084 @opindex Wshift-overflow
4085 @opindex Wno-shift-overflow
4086 Warn about left shift overflows.  This warning is enabled by
4087 default in C99 and C++11 modes (and newer).
4089 @table @gcctabopt
4090 @item -Wshift-overflow=1
4091 This is the warning level of @option{-Wshift-overflow} and is enabled
4092 by default in C99 and C++11 modes (and newer).  This warning level does
4093 not warn about left-shifting 1 into the sign bit.  (However, in C, such
4094 an overflow is still rejected in contexts where an integer constant expression
4095 is required.)
4097 @item -Wshift-overflow=2
4098 This warning level also warns about left-shifting 1 into the sign bit,
4099 unless C++14 mode is active.
4100 @end table
4102 @item -Wswitch
4103 @opindex Wswitch
4104 @opindex Wno-switch
4105 Warn whenever a @code{switch} statement has an index of enumerated type
4106 and lacks a @code{case} for one or more of the named codes of that
4107 enumeration.  (The presence of a @code{default} label prevents this
4108 warning.)  @code{case} labels outside the enumeration range also
4109 provoke warnings when this option is used (even if there is a
4110 @code{default} label).
4111 This warning is enabled by @option{-Wall}.
4113 @item -Wswitch-default
4114 @opindex Wswitch-default
4115 @opindex Wno-switch-default
4116 Warn whenever a @code{switch} statement does not have a @code{default}
4117 case.
4119 @item -Wswitch-enum
4120 @opindex Wswitch-enum
4121 @opindex Wno-switch-enum
4122 Warn whenever a @code{switch} statement has an index of enumerated type
4123 and lacks a @code{case} for one or more of the named codes of that
4124 enumeration.  @code{case} labels outside the enumeration range also
4125 provoke warnings when this option is used.  The only difference
4126 between @option{-Wswitch} and this option is that this option gives a
4127 warning about an omitted enumeration code even if there is a
4128 @code{default} label.
4130 @item -Wswitch-bool
4131 @opindex Wswitch-bool
4132 @opindex Wno-switch-bool
4133 Warn whenever a @code{switch} statement has an index of boolean type
4134 and the case values are outside the range of a boolean type.
4135 It is possible to suppress this warning by casting the controlling
4136 expression to a type other than @code{bool}.  For example:
4137 @smallexample
4138 @group
4139 switch ((int) (a == 4))
4140   @{
4141   @dots{}
4142   @}
4143 @end group
4144 @end smallexample
4145 This warning is enabled by default for C and C++ programs.
4147 @item -Wsync-nand @r{(C and C++ only)}
4148 @opindex Wsync-nand
4149 @opindex Wno-sync-nand
4150 Warn when @code{__sync_fetch_and_nand} and @code{__sync_nand_and_fetch}
4151 built-in functions are used.  These functions changed semantics in GCC 4.4.
4153 @item -Wtrigraphs
4154 @opindex Wtrigraphs
4155 @opindex Wno-trigraphs
4156 Warn if any trigraphs are encountered that might change the meaning of
4157 the program (trigraphs within comments are not warned about).
4158 This warning is enabled by @option{-Wall}.
4160 @item -Wunused-but-set-parameter
4161 @opindex Wunused-but-set-parameter
4162 @opindex Wno-unused-but-set-parameter
4163 Warn whenever a function parameter is assigned to, but otherwise unused
4164 (aside from its declaration).
4166 To suppress this warning use the @code{unused} attribute
4167 (@pxref{Variable Attributes}).
4169 This warning is also enabled by @option{-Wunused} together with
4170 @option{-Wextra}.
4172 @item -Wunused-but-set-variable
4173 @opindex Wunused-but-set-variable
4174 @opindex Wno-unused-but-set-variable
4175 Warn whenever a local variable is assigned to, but otherwise unused
4176 (aside from its declaration).
4177 This warning is enabled by @option{-Wall}.
4179 To suppress this warning use the @code{unused} attribute
4180 (@pxref{Variable Attributes}).
4182 This warning is also enabled by @option{-Wunused}, which is enabled
4183 by @option{-Wall}.
4185 @item -Wunused-function
4186 @opindex Wunused-function
4187 @opindex Wno-unused-function
4188 Warn whenever a static function is declared but not defined or a
4189 non-inline static function is unused.
4190 This warning is enabled by @option{-Wall}.
4192 @item -Wunused-label
4193 @opindex Wunused-label
4194 @opindex Wno-unused-label
4195 Warn whenever a label is declared but not used.
4196 This warning is enabled by @option{-Wall}.
4198 To suppress this warning use the @code{unused} attribute
4199 (@pxref{Variable Attributes}).
4201 @item -Wunused-local-typedefs @r{(C, Objective-C, C++ and Objective-C++ only)}
4202 @opindex Wunused-local-typedefs
4203 Warn when a typedef locally defined in a function is not used.
4204 This warning is enabled by @option{-Wall}.
4206 @item -Wunused-parameter
4207 @opindex Wunused-parameter
4208 @opindex Wno-unused-parameter
4209 Warn whenever a function parameter is unused aside from its declaration.
4211 To suppress this warning use the @code{unused} attribute
4212 (@pxref{Variable Attributes}).
4214 @item -Wno-unused-result
4215 @opindex Wunused-result
4216 @opindex Wno-unused-result
4217 Do not warn if a caller of a function marked with attribute
4218 @code{warn_unused_result} (@pxref{Function Attributes}) does not use
4219 its return value. The default is @option{-Wunused-result}.
4221 @item -Wunused-variable
4222 @opindex Wunused-variable
4223 @opindex Wno-unused-variable
4224 Warn whenever a local or static variable is unused aside from its
4225 declaration. This option implies @option{-Wunused-const-variable=1} for C,
4226 but not for C++. This warning is enabled by @option{-Wall}.
4228 To suppress this warning use the @code{unused} attribute
4229 (@pxref{Variable Attributes}).
4231 @item -Wunused-const-variable
4232 @itemx -Wunused-const-variable=@var{n}
4233 @opindex Wunused-const-variable
4234 @opindex Wno-unused-const-variable
4235 Warn whenever a constant static variable is unused aside from its declaration.
4236 @option{-Wunused-const-variable=1} is enabled by @option{-Wunused-variable}
4237 for C, but not for C++. In C this declares variable storage, but in C++ this
4238 is not an error since const variables take the place of @code{#define}s.
4240 To suppress this warning use the @code{unused} attribute
4241 (@pxref{Variable Attributes}).
4243 @table @gcctabopt
4244 @item -Wunused-const-variable=1
4245 This is the warning level that is enabled by @option{-Wunused-variable} for
4246 C.  It warns only about unused static const variables defined in the main
4247 compilation unit, but not about static const variables declared in any
4248 header included.
4250 @item -Wunused-const-variable=2
4251 This warning level also warns for unused constant static variables in
4252 headers (excluding system headers).  This is the warning level of
4253 @option{-Wunused-const-variable} and must be explicitly requested since
4254 in C++ this isn't an error and in C it might be harder to clean up all
4255 headers included.
4256 @end table
4258 @item -Wunused-value
4259 @opindex Wunused-value
4260 @opindex Wno-unused-value
4261 Warn whenever a statement computes a result that is explicitly not
4262 used. To suppress this warning cast the unused expression to
4263 @code{void}. This includes an expression-statement or the left-hand
4264 side of a comma expression that contains no side effects. For example,
4265 an expression such as @code{x[i,j]} causes a warning, while
4266 @code{x[(void)i,j]} does not.
4268 This warning is enabled by @option{-Wall}.
4270 @item -Wunused
4271 @opindex Wunused
4272 @opindex Wno-unused
4273 All the above @option{-Wunused} options combined.
4275 In order to get a warning about an unused function parameter, you must
4276 either specify @option{-Wextra -Wunused} (note that @option{-Wall} implies
4277 @option{-Wunused}), or separately specify @option{-Wunused-parameter}.
4279 @item -Wuninitialized
4280 @opindex Wuninitialized
4281 @opindex Wno-uninitialized
4282 Warn if an automatic variable is used without first being initialized
4283 or if a variable may be clobbered by a @code{setjmp} call. In C++,
4284 warn if a non-static reference or non-static @code{const} member
4285 appears in a class without constructors.
4287 If you want to warn about code that uses the uninitialized value of the
4288 variable in its own initializer, use the @option{-Winit-self} option.
4290 These warnings occur for individual uninitialized or clobbered
4291 elements of structure, union or array variables as well as for
4292 variables that are uninitialized or clobbered as a whole.  They do
4293 not occur for variables or elements declared @code{volatile}.  Because
4294 these warnings depend on optimization, the exact variables or elements
4295 for which there are warnings depends on the precise optimization
4296 options and version of GCC used.
4298 Note that there may be no warning about a variable that is used only
4299 to compute a value that itself is never used, because such
4300 computations may be deleted by data flow analysis before the warnings
4301 are printed.
4303 @item -Winvalid-memory-model
4304 @opindex Winvalid-memory-model
4305 @opindex Wno-invalid-memory-model
4306 Warn for invocations of @ref{__atomic Builtins}, @ref{__sync Builtins},
4307 and the C11 atomic generic functions with a memory consistency argument
4308 that is either invalid for the operation or outside the range of values
4309 of the @code{memory_order} enumeration.  For example, since the
4310 @code{__atomic_store} and @code{__atomic_store_n} built-ins are only
4311 defined for the relaxed, release, and sequentially consistent memory
4312 orders the following code is diagnosed:
4314 @smallexample
4315 void store (int *i)
4317   __atomic_store_n (i, 0, memory_order_consume);
4319 @end smallexample
4321 @option{-Winvalid-memory-model} is enabled by default.
4323 @item -Wmaybe-uninitialized
4324 @opindex Wmaybe-uninitialized
4325 @opindex Wno-maybe-uninitialized
4326 For an automatic variable, if there exists a path from the function
4327 entry to a use of the variable that is initialized, but there exist
4328 some other paths for which the variable is not initialized, the compiler
4329 emits a warning if it cannot prove the uninitialized paths are not
4330 executed at run time. These warnings are made optional because GCC is
4331 not smart enough to see all the reasons why the code might be correct
4332 in spite of appearing to have an error.  Here is one example of how
4333 this can happen:
4335 @smallexample
4336 @group
4338   int x;
4339   switch (y)
4340     @{
4341     case 1: x = 1;
4342       break;
4343     case 2: x = 4;
4344       break;
4345     case 3: x = 5;
4346     @}
4347   foo (x);
4349 @end group
4350 @end smallexample
4352 @noindent
4353 If the value of @code{y} is always 1, 2 or 3, then @code{x} is
4354 always initialized, but GCC doesn't know this. To suppress the
4355 warning, you need to provide a default case with assert(0) or
4356 similar code.
4358 @cindex @code{longjmp} warnings
4359 This option also warns when a non-volatile automatic variable might be
4360 changed by a call to @code{longjmp}.  These warnings as well are possible
4361 only in optimizing compilation.
4363 The compiler sees only the calls to @code{setjmp}.  It cannot know
4364 where @code{longjmp} will be called; in fact, a signal handler could
4365 call it at any point in the code.  As a result, you may get a warning
4366 even when there is in fact no problem because @code{longjmp} cannot
4367 in fact be called at the place that would cause a problem.
4369 Some spurious warnings can be avoided if you declare all the functions
4370 you use that never return as @code{noreturn}.  @xref{Function
4371 Attributes}.
4373 This warning is enabled by @option{-Wall} or @option{-Wextra}.
4375 @item -Wunknown-pragmas
4376 @opindex Wunknown-pragmas
4377 @opindex Wno-unknown-pragmas
4378 @cindex warning for unknown pragmas
4379 @cindex unknown pragmas, warning
4380 @cindex pragmas, warning of unknown
4381 Warn when a @code{#pragma} directive is encountered that is not understood by 
4382 GCC@.  If this command-line option is used, warnings are even issued
4383 for unknown pragmas in system header files.  This is not the case if
4384 the warnings are only enabled by the @option{-Wall} command-line option.
4386 @item -Wno-pragmas
4387 @opindex Wno-pragmas
4388 @opindex Wpragmas
4389 Do not warn about misuses of pragmas, such as incorrect parameters,
4390 invalid syntax, or conflicts between pragmas.  See also
4391 @option{-Wunknown-pragmas}.
4393 @item -Wstrict-aliasing
4394 @opindex Wstrict-aliasing
4395 @opindex Wno-strict-aliasing
4396 This option is only active when @option{-fstrict-aliasing} is active.
4397 It warns about code that might break the strict aliasing rules that the
4398 compiler is using for optimization.  The warning does not catch all
4399 cases, but does attempt to catch the more common pitfalls.  It is
4400 included in @option{-Wall}.
4401 It is equivalent to @option{-Wstrict-aliasing=3}
4403 @item -Wstrict-aliasing=n
4404 @opindex Wstrict-aliasing=n
4405 This option is only active when @option{-fstrict-aliasing} is active.
4406 It warns about code that might break the strict aliasing rules that the
4407 compiler is using for optimization.
4408 Higher levels correspond to higher accuracy (fewer false positives).
4409 Higher levels also correspond to more effort, similar to the way @option{-O} 
4410 works.
4411 @option{-Wstrict-aliasing} is equivalent to @option{-Wstrict-aliasing=3}.
4413 Level 1: Most aggressive, quick, least accurate.
4414 Possibly useful when higher levels
4415 do not warn but @option{-fstrict-aliasing} still breaks the code, as it has very few
4416 false negatives.  However, it has many false positives.
4417 Warns for all pointer conversions between possibly incompatible types,
4418 even if never dereferenced.  Runs in the front end only.
4420 Level 2: Aggressive, quick, not too precise.
4421 May still have many false positives (not as many as level 1 though),
4422 and few false negatives (but possibly more than level 1).
4423 Unlike level 1, it only warns when an address is taken.  Warns about
4424 incomplete types.  Runs in the front end only.
4426 Level 3 (default for @option{-Wstrict-aliasing}):
4427 Should have very few false positives and few false
4428 negatives.  Slightly slower than levels 1 or 2 when optimization is enabled.
4429 Takes care of the common pun+dereference pattern in the front end:
4430 @code{*(int*)&some_float}.
4431 If optimization is enabled, it also runs in the back end, where it deals
4432 with multiple statement cases using flow-sensitive points-to information.
4433 Only warns when the converted pointer is dereferenced.
4434 Does not warn about incomplete types.
4436 @item -Wstrict-overflow
4437 @itemx -Wstrict-overflow=@var{n}
4438 @opindex Wstrict-overflow
4439 @opindex Wno-strict-overflow
4440 This option is only active when @option{-fstrict-overflow} is active.
4441 It warns about cases where the compiler optimizes based on the
4442 assumption that signed overflow does not occur.  Note that it does not
4443 warn about all cases where the code might overflow: it only warns
4444 about cases where the compiler implements some optimization.  Thus
4445 this warning depends on the optimization level.
4447 An optimization that assumes that signed overflow does not occur is
4448 perfectly safe if the values of the variables involved are such that
4449 overflow never does, in fact, occur.  Therefore this warning can
4450 easily give a false positive: a warning about code that is not
4451 actually a problem.  To help focus on important issues, several
4452 warning levels are defined.  No warnings are issued for the use of
4453 undefined signed overflow when estimating how many iterations a loop
4454 requires, in particular when determining whether a loop will be
4455 executed at all.
4457 @table @gcctabopt
4458 @item -Wstrict-overflow=1
4459 Warn about cases that are both questionable and easy to avoid.  For
4460 example,  with @option{-fstrict-overflow}, the compiler simplifies
4461 @code{x + 1 > x} to @code{1}.  This level of
4462 @option{-Wstrict-overflow} is enabled by @option{-Wall}; higher levels
4463 are not, and must be explicitly requested.
4465 @item -Wstrict-overflow=2
4466 Also warn about other cases where a comparison is simplified to a
4467 constant.  For example: @code{abs (x) >= 0}.  This can only be
4468 simplified when @option{-fstrict-overflow} is in effect, because
4469 @code{abs (INT_MIN)} overflows to @code{INT_MIN}, which is less than
4470 zero.  @option{-Wstrict-overflow} (with no level) is the same as
4471 @option{-Wstrict-overflow=2}.
4473 @item -Wstrict-overflow=3
4474 Also warn about other cases where a comparison is simplified.  For
4475 example: @code{x + 1 > 1} is simplified to @code{x > 0}.
4477 @item -Wstrict-overflow=4
4478 Also warn about other simplifications not covered by the above cases.
4479 For example: @code{(x * 10) / 5} is simplified to @code{x * 2}.
4481 @item -Wstrict-overflow=5
4482 Also warn about cases where the compiler reduces the magnitude of a
4483 constant involved in a comparison.  For example: @code{x + 2 > y} is
4484 simplified to @code{x + 1 >= y}.  This is reported only at the
4485 highest warning level because this simplification applies to many
4486 comparisons, so this warning level gives a very large number of
4487 false positives.
4488 @end table
4490 @item -Wsuggest-attribute=@r{[}pure@r{|}const@r{|}noreturn@r{|}format@r{]}
4491 @opindex Wsuggest-attribute=
4492 @opindex Wno-suggest-attribute=
4493 Warn for cases where adding an attribute may be beneficial. The
4494 attributes currently supported are listed below.
4496 @table @gcctabopt
4497 @item -Wsuggest-attribute=pure
4498 @itemx -Wsuggest-attribute=const
4499 @itemx -Wsuggest-attribute=noreturn
4500 @opindex Wsuggest-attribute=pure
4501 @opindex Wno-suggest-attribute=pure
4502 @opindex Wsuggest-attribute=const
4503 @opindex Wno-suggest-attribute=const
4504 @opindex Wsuggest-attribute=noreturn
4505 @opindex Wno-suggest-attribute=noreturn
4507 Warn about functions that might be candidates for attributes
4508 @code{pure}, @code{const} or @code{noreturn}.  The compiler only warns for
4509 functions visible in other compilation units or (in the case of @code{pure} and
4510 @code{const}) if it cannot prove that the function returns normally. A function
4511 returns normally if it doesn't contain an infinite loop or return abnormally
4512 by throwing, calling @code{abort} or trapping.  This analysis requires option
4513 @option{-fipa-pure-const}, which is enabled by default at @option{-O} and
4514 higher.  Higher optimization levels improve the accuracy of the analysis.
4516 @item -Wsuggest-attribute=format
4517 @itemx -Wmissing-format-attribute
4518 @opindex Wsuggest-attribute=format
4519 @opindex Wmissing-format-attribute
4520 @opindex Wno-suggest-attribute=format
4521 @opindex Wno-missing-format-attribute
4522 @opindex Wformat
4523 @opindex Wno-format
4525 Warn about function pointers that might be candidates for @code{format}
4526 attributes.  Note these are only possible candidates, not absolute ones.
4527 GCC guesses that function pointers with @code{format} attributes that
4528 are used in assignment, initialization, parameter passing or return
4529 statements should have a corresponding @code{format} attribute in the
4530 resulting type.  I.e.@: the left-hand side of the assignment or
4531 initialization, the type of the parameter variable, or the return type
4532 of the containing function respectively should also have a @code{format}
4533 attribute to avoid the warning.
4535 GCC also warns about function definitions that might be
4536 candidates for @code{format} attributes.  Again, these are only
4537 possible candidates.  GCC guesses that @code{format} attributes
4538 might be appropriate for any function that calls a function like
4539 @code{vprintf} or @code{vscanf}, but this might not always be the
4540 case, and some functions for which @code{format} attributes are
4541 appropriate may not be detected.
4542 @end table
4544 @item -Wsuggest-final-types
4545 @opindex Wno-suggest-final-types
4546 @opindex Wsuggest-final-types
4547 Warn about types with virtual methods where code quality would be improved
4548 if the type were declared with the C++11 @code{final} specifier, 
4549 or, if possible,
4550 declared in an anonymous namespace. This allows GCC to more aggressively
4551 devirtualize the polymorphic calls. This warning is more effective with link
4552 time optimization, where the information about the class hierarchy graph is
4553 more complete.
4555 @item -Wsuggest-final-methods
4556 @opindex Wno-suggest-final-methods
4557 @opindex Wsuggest-final-methods
4558 Warn about virtual methods where code quality would be improved if the method
4559 were declared with the C++11 @code{final} specifier, 
4560 or, if possible, its type were
4561 declared in an anonymous namespace or with the @code{final} specifier.
4562 This warning is
4563 more effective with link time optimization, where the information about the
4564 class hierarchy graph is more complete. It is recommended to first consider
4565 suggestions of @option{-Wsuggest-final-types} and then rebuild with new
4566 annotations.
4568 @item -Wsuggest-override
4569 Warn about overriding virtual functions that are not marked with the override
4570 keyword.
4572 @item -Warray-bounds
4573 @itemx -Warray-bounds=@var{n}
4574 @opindex Wno-array-bounds
4575 @opindex Warray-bounds
4576 This option is only active when @option{-ftree-vrp} is active
4577 (default for @option{-O2} and above). It warns about subscripts to arrays
4578 that are always out of bounds. This warning is enabled by @option{-Wall}.
4580 @table @gcctabopt
4581 @item -Warray-bounds=1
4582 This is the warning level of @option{-Warray-bounds} and is enabled
4583 by @option{-Wall}; higher levels are not, and must be explicitly requested.
4585 @item -Warray-bounds=2
4586 This warning level also warns about out of bounds access for
4587 arrays at the end of a struct and for arrays accessed through
4588 pointers. This warning level may give a larger number of
4589 false positives and is deactivated by default.
4590 @end table
4592 @item -Wbool-compare
4593 @opindex Wno-bool-compare
4594 @opindex Wbool-compare
4595 Warn about boolean expression compared with an integer value different from
4596 @code{true}/@code{false}.  For instance, the following comparison is
4597 always false:
4598 @smallexample
4599 int n = 5;
4600 @dots{}
4601 if ((n > 1) == 2) @{ @dots{} @}
4602 @end smallexample
4603 This warning is enabled by @option{-Wall}.
4605 @item -Wduplicated-cond
4606 @opindex Wno-duplicated-cond
4607 @opindex Wduplicated-cond
4608 Warn about duplicated conditions in an if-else-if chain.  For instance,
4609 warn for the following code:
4610 @smallexample
4611 if (p->q != NULL) @{ @dots{} @}
4612 else if (p->q != NULL) @{ @dots{} @}
4613 @end smallexample
4615 @item -Wframe-address
4616 @opindex Wno-frame-address
4617 @opindex Wframe-address
4618 Warn when the @samp{__builtin_frame_address} or @samp{__builtin_return_address}
4619 is called with an argument greater than 0.  Such calls may return indeterminate
4620 values or crash the program.  The warning is included in @option{-Wall}.
4622 @item -Wno-discarded-qualifiers @r{(C and Objective-C only)}
4623 @opindex Wno-discarded-qualifiers
4624 @opindex Wdiscarded-qualifiers
4625 Do not warn if type qualifiers on pointers are being discarded.
4626 Typically, the compiler warns if a @code{const char *} variable is
4627 passed to a function that takes a @code{char *} parameter.  This option
4628 can be used to suppress such a warning.
4630 @item -Wno-discarded-array-qualifiers @r{(C and Objective-C only)}
4631 @opindex Wno-discarded-array-qualifiers
4632 @opindex Wdiscarded-array-qualifiers
4633 Do not warn if type qualifiers on arrays which are pointer targets
4634 are being discarded. Typically, the compiler warns if a
4635 @code{const int (*)[]} variable is passed to a function that
4636 takes a @code{int (*)[]} parameter.  This option can be used to
4637 suppress such a warning.
4639 @item -Wno-incompatible-pointer-types @r{(C and Objective-C only)}
4640 @opindex Wno-incompatible-pointer-types
4641 @opindex Wincompatible-pointer-types
4642 Do not warn when there is a conversion between pointers that have incompatible
4643 types.  This warning is for cases not covered by @option{-Wno-pointer-sign},
4644 which warns for pointer argument passing or assignment with different
4645 signedness.
4647 @item -Wno-int-conversion @r{(C and Objective-C only)}
4648 @opindex Wno-int-conversion
4649 @opindex Wint-conversion
4650 Do not warn about incompatible integer to pointer and pointer to integer
4651 conversions.  This warning is about implicit conversions; for explicit
4652 conversions the warnings @option{-Wno-int-to-pointer-cast} and
4653 @option{-Wno-pointer-to-int-cast} may be used.
4655 @item -Wno-div-by-zero
4656 @opindex Wno-div-by-zero
4657 @opindex Wdiv-by-zero
4658 Do not warn about compile-time integer division by zero.  Floating-point
4659 division by zero is not warned about, as it can be a legitimate way of
4660 obtaining infinities and NaNs.
4662 @item -Wsystem-headers
4663 @opindex Wsystem-headers
4664 @opindex Wno-system-headers
4665 @cindex warnings from system headers
4666 @cindex system headers, warnings from
4667 Print warning messages for constructs found in system header files.
4668 Warnings from system headers are normally suppressed, on the assumption
4669 that they usually do not indicate real problems and would only make the
4670 compiler output harder to read.  Using this command-line option tells
4671 GCC to emit warnings from system headers as if they occurred in user
4672 code.  However, note that using @option{-Wall} in conjunction with this
4673 option does @emph{not} warn about unknown pragmas in system
4674 headers---for that, @option{-Wunknown-pragmas} must also be used.
4676 @item -Wtautological-compare
4677 @opindex Wtautological-compare
4678 @opindex Wno-tautological-compare
4679 Warn if a self-comparison always evaluates to true or false.  This
4680 warning detects various mistakes such as:
4681 @smallexample
4682 int i = 1;
4683 @dots{}
4684 if (i > i) @{ @dots{} @}
4685 @end smallexample
4686 This warning is enabled by @option{-Wall}.
4688 @item -Wtrampolines
4689 @opindex Wtrampolines
4690 @opindex Wno-trampolines
4691 Warn about trampolines generated for pointers to nested functions.
4692 A trampoline is a small piece of data or code that is created at run
4693 time on the stack when the address of a nested function is taken, and is
4694 used to call the nested function indirectly.  For some targets, it is
4695 made up of data only and thus requires no special treatment.  But, for
4696 most targets, it is made up of code and thus requires the stack to be
4697 made executable in order for the program to work properly.
4699 @item -Wfloat-equal
4700 @opindex Wfloat-equal
4701 @opindex Wno-float-equal
4702 Warn if floating-point values are used in equality comparisons.
4704 The idea behind this is that sometimes it is convenient (for the
4705 programmer) to consider floating-point values as approximations to
4706 infinitely precise real numbers.  If you are doing this, then you need
4707 to compute (by analyzing the code, or in some other way) the maximum or
4708 likely maximum error that the computation introduces, and allow for it
4709 when performing comparisons (and when producing output, but that's a
4710 different problem).  In particular, instead of testing for equality, you
4711 should check to see whether the two values have ranges that overlap; and
4712 this is done with the relational operators, so equality comparisons are
4713 probably mistaken.
4715 @item -Wtraditional @r{(C and Objective-C only)}
4716 @opindex Wtraditional
4717 @opindex Wno-traditional
4718 Warn about certain constructs that behave differently in traditional and
4719 ISO C@.  Also warn about ISO C constructs that have no traditional C
4720 equivalent, and/or problematic constructs that should be avoided.
4722 @itemize @bullet
4723 @item
4724 Macro parameters that appear within string literals in the macro body.
4725 In traditional C macro replacement takes place within string literals,
4726 but in ISO C it does not.
4728 @item
4729 In traditional C, some preprocessor directives did not exist.
4730 Traditional preprocessors only considered a line to be a directive
4731 if the @samp{#} appeared in column 1 on the line.  Therefore
4732 @option{-Wtraditional} warns about directives that traditional C
4733 understands but ignores because the @samp{#} does not appear as the
4734 first character on the line.  It also suggests you hide directives like
4735 @code{#pragma} not understood by traditional C by indenting them.  Some
4736 traditional implementations do not recognize @code{#elif}, so this option
4737 suggests avoiding it altogether.
4739 @item
4740 A function-like macro that appears without arguments.
4742 @item
4743 The unary plus operator.
4745 @item
4746 The @samp{U} integer constant suffix, or the @samp{F} or @samp{L} floating-point
4747 constant suffixes.  (Traditional C does support the @samp{L} suffix on integer
4748 constants.)  Note, these suffixes appear in macros defined in the system
4749 headers of most modern systems, e.g.@: the @samp{_MIN}/@samp{_MAX} macros in @code{<limits.h>}.
4750 Use of these macros in user code might normally lead to spurious
4751 warnings, however GCC's integrated preprocessor has enough context to
4752 avoid warning in these cases.
4754 @item
4755 A function declared external in one block and then used after the end of
4756 the block.
4758 @item
4759 A @code{switch} statement has an operand of type @code{long}.
4761 @item
4762 A non-@code{static} function declaration follows a @code{static} one.
4763 This construct is not accepted by some traditional C compilers.
4765 @item
4766 The ISO type of an integer constant has a different width or
4767 signedness from its traditional type.  This warning is only issued if
4768 the base of the constant is ten.  I.e.@: hexadecimal or octal values, which
4769 typically represent bit patterns, are not warned about.
4771 @item
4772 Usage of ISO string concatenation is detected.
4774 @item
4775 Initialization of automatic aggregates.
4777 @item
4778 Identifier conflicts with labels.  Traditional C lacks a separate
4779 namespace for labels.
4781 @item
4782 Initialization of unions.  If the initializer is zero, the warning is
4783 omitted.  This is done under the assumption that the zero initializer in
4784 user code appears conditioned on e.g.@: @code{__STDC__} to avoid missing
4785 initializer warnings and relies on default initialization to zero in the
4786 traditional C case.
4788 @item
4789 Conversions by prototypes between fixed/floating-point values and vice
4790 versa.  The absence of these prototypes when compiling with traditional
4791 C causes serious problems.  This is a subset of the possible
4792 conversion warnings; for the full set use @option{-Wtraditional-conversion}.
4794 @item
4795 Use of ISO C style function definitions.  This warning intentionally is
4796 @emph{not} issued for prototype declarations or variadic functions
4797 because these ISO C features appear in your code when using
4798 libiberty's traditional C compatibility macros, @code{PARAMS} and
4799 @code{VPARAMS}.  This warning is also bypassed for nested functions
4800 because that feature is already a GCC extension and thus not relevant to
4801 traditional C compatibility.
4802 @end itemize
4804 @item -Wtraditional-conversion @r{(C and Objective-C only)}
4805 @opindex Wtraditional-conversion
4806 @opindex Wno-traditional-conversion
4807 Warn if a prototype causes a type conversion that is different from what
4808 would happen to the same argument in the absence of a prototype.  This
4809 includes conversions of fixed point to floating and vice versa, and
4810 conversions changing the width or signedness of a fixed-point argument
4811 except when the same as the default promotion.
4813 @item -Wdeclaration-after-statement @r{(C and Objective-C only)}
4814 @opindex Wdeclaration-after-statement
4815 @opindex Wno-declaration-after-statement
4816 Warn when a declaration is found after a statement in a block.  This
4817 construct, known from C++, was introduced with ISO C99 and is by default
4818 allowed in GCC@.  It is not supported by ISO C90.  @xref{Mixed Declarations}.
4820 @item -Wundef
4821 @opindex Wundef
4822 @opindex Wno-undef
4823 Warn if an undefined identifier is evaluated in an @code{#if} directive.
4825 @item -Wno-endif-labels
4826 @opindex Wno-endif-labels
4827 @opindex Wendif-labels
4828 Do not warn whenever an @code{#else} or an @code{#endif} are followed by text.
4830 @item -Wshadow
4831 @opindex Wshadow
4832 @opindex Wno-shadow
4833 Warn whenever a local variable or type declaration shadows another
4834 variable, parameter, type, class member (in C++), or instance variable
4835 (in Objective-C) or whenever a built-in function is shadowed. Note
4836 that in C++, the compiler warns if a local variable shadows an
4837 explicit typedef, but not if it shadows a struct/class/enum.
4839 @item -Wno-shadow-ivar @r{(Objective-C only)}
4840 @opindex Wno-shadow-ivar
4841 @opindex Wshadow-ivar
4842 Do not warn whenever a local variable shadows an instance variable in an
4843 Objective-C method.
4845 @item -Wlarger-than=@var{len}
4846 @opindex Wlarger-than=@var{len}
4847 @opindex Wlarger-than-@var{len}
4848 Warn whenever an object of larger than @var{len} bytes is defined.
4850 @item -Wframe-larger-than=@var{len}
4851 @opindex Wframe-larger-than
4852 Warn if the size of a function frame is larger than @var{len} bytes.
4853 The computation done to determine the stack frame size is approximate
4854 and not conservative.
4855 The actual requirements may be somewhat greater than @var{len}
4856 even if you do not get a warning.  In addition, any space allocated
4857 via @code{alloca}, variable-length arrays, or related constructs
4858 is not included by the compiler when determining
4859 whether or not to issue a warning.
4861 @item -Wno-free-nonheap-object
4862 @opindex Wno-free-nonheap-object
4863 @opindex Wfree-nonheap-object
4864 Do not warn when attempting to free an object that was not allocated
4865 on the heap.
4867 @item -Wstack-usage=@var{len}
4868 @opindex Wstack-usage
4869 Warn if the stack usage of a function might be larger than @var{len} bytes.
4870 The computation done to determine the stack usage is conservative.
4871 Any space allocated via @code{alloca}, variable-length arrays, or related
4872 constructs is included by the compiler when determining whether or not to
4873 issue a warning.
4875 The message is in keeping with the output of @option{-fstack-usage}.
4877 @itemize
4878 @item
4879 If the stack usage is fully static but exceeds the specified amount, it's:
4881 @smallexample
4882   warning: stack usage is 1120 bytes
4883 @end smallexample
4884 @item
4885 If the stack usage is (partly) dynamic but bounded, it's:
4887 @smallexample
4888   warning: stack usage might be 1648 bytes
4889 @end smallexample
4890 @item
4891 If the stack usage is (partly) dynamic and not bounded, it's:
4893 @smallexample
4894   warning: stack usage might be unbounded
4895 @end smallexample
4896 @end itemize
4898 @item -Wunsafe-loop-optimizations
4899 @opindex Wunsafe-loop-optimizations
4900 @opindex Wno-unsafe-loop-optimizations
4901 Warn if the loop cannot be optimized because the compiler cannot
4902 assume anything on the bounds of the loop indices.  With
4903 @option{-funsafe-loop-optimizations} warn if the compiler makes
4904 such assumptions.
4906 @item -Wno-pedantic-ms-format @r{(MinGW targets only)}
4907 @opindex Wno-pedantic-ms-format
4908 @opindex Wpedantic-ms-format
4909 When used in combination with @option{-Wformat}
4910 and @option{-pedantic} without GNU extensions, this option
4911 disables the warnings about non-ISO @code{printf} / @code{scanf} format
4912 width specifiers @code{I32}, @code{I64}, and @code{I} used on Windows targets,
4913 which depend on the MS runtime.
4915 @item -Wplacement-new
4916 @itemx -Wplacement-new=@var{n}
4917 @opindex Wplacement-new
4918 @opindex Wno-placement-new
4919 Warn about placement new expressions with undefined behavior, such as
4920 constructing an object in a buffer that is smaller than the type of
4921 the object.  For example, the placement new expression below is diagnosed
4922 because it attempts to construct an array of 64 integers in a buffer only
4923 64 bytes large.
4924 @smallexample
4925 char buf [64];
4926 new (buf) int[64];
4927 @end smallexample
4928 This warning is enabled by default.
4930 @table @gcctabopt
4931 @item -Wplacement-new=1
4932 This is the default warning level of @option{-Wplacement-new}.  At this
4933 level the warning is not issued for some strictly undefined constructs that
4934 GCC allows as extensions for compatibility with legacy code.  For example,
4935 the following @code{new} expression is not diagnosed at this level even
4936 though it has undefined behavior according to the C++ standard because
4937 it writes past the end of the one-element array.
4938 @smallexample
4939 struct S @{ int n, a[1]; @};
4940 S *s = (S *)malloc (sizeof *s + 31 * sizeof s->a[0]);
4941 new (s->a)int [32]();
4942 @end smallexample
4944 @item -Wplacement-new=2
4945 At this level, in addition to diagnosing all the same constructs as at level
4946 1, a diagnostic is also issued for placement new expressions that construct
4947 an object in the last member of structure whose type is an array of a single
4948 element and whose size is less than the size of the object being constructed.
4949 While the previous example would be diagnosed, the following construct makes
4950 use of the flexible member array extension to avoid the warning at level 2.
4951 @smallexample
4952 struct S @{ int n, a[]; @};
4953 S *s = (S *)malloc (sizeof *s + 32 * sizeof s->a[0]);
4954 new (s->a)int [32]();
4955 @end smallexample
4957 @end table
4959 @item -Wpointer-arith
4960 @opindex Wpointer-arith
4961 @opindex Wno-pointer-arith
4962 Warn about anything that depends on the ``size of'' a function type or
4963 of @code{void}.  GNU C assigns these types a size of 1, for
4964 convenience in calculations with @code{void *} pointers and pointers
4965 to functions.  In C++, warn also when an arithmetic operation involves
4966 @code{NULL}.  This warning is also enabled by @option{-Wpedantic}.
4968 @item -Wtype-limits
4969 @opindex Wtype-limits
4970 @opindex Wno-type-limits
4971 Warn if a comparison is always true or always false due to the limited
4972 range of the data type, but do not warn for constant expressions.  For
4973 example, warn if an unsigned variable is compared against zero with
4974 @code{<} or @code{>=}.  This warning is also enabled by
4975 @option{-Wextra}.
4977 @item -Wbad-function-cast @r{(C and Objective-C only)}
4978 @opindex Wbad-function-cast
4979 @opindex Wno-bad-function-cast
4980 Warn when a function call is cast to a non-matching type.
4981 For example, warn if a call to a function returning an integer type 
4982 is cast to a pointer type.
4984 @item -Wc90-c99-compat @r{(C and Objective-C only)}
4985 @opindex Wc90-c99-compat
4986 @opindex Wno-c90-c99-compat
4987 Warn about features not present in ISO C90, but present in ISO C99.
4988 For instance, warn about use of variable length arrays, @code{long long}
4989 type, @code{bool} type, compound literals, designated initializers, and so
4990 on.  This option is independent of the standards mode.  Warnings are disabled
4991 in the expression that follows @code{__extension__}.
4993 @item -Wc99-c11-compat @r{(C and Objective-C only)}
4994 @opindex Wc99-c11-compat
4995 @opindex Wno-c99-c11-compat
4996 Warn about features not present in ISO C99, but present in ISO C11.
4997 For instance, warn about use of anonymous structures and unions,
4998 @code{_Atomic} type qualifier, @code{_Thread_local} storage-class specifier,
4999 @code{_Alignas} specifier, @code{Alignof} operator, @code{_Generic} keyword,
5000 and so on.  This option is independent of the standards mode.  Warnings are
5001 disabled in the expression that follows @code{__extension__}.
5003 @item -Wc++-compat @r{(C and Objective-C only)}
5004 @opindex Wc++-compat
5005 Warn about ISO C constructs that are outside of the common subset of
5006 ISO C and ISO C++, e.g.@: request for implicit conversion from
5007 @code{void *} to a pointer to non-@code{void} type.
5009 @item -Wc++11-compat @r{(C++ and Objective-C++ only)}
5010 @opindex Wc++11-compat
5011 Warn about C++ constructs whose meaning differs between ISO C++ 1998
5012 and ISO C++ 2011, e.g., identifiers in ISO C++ 1998 that are keywords
5013 in ISO C++ 2011.  This warning turns on @option{-Wnarrowing} and is
5014 enabled by @option{-Wall}.
5016 @item -Wc++14-compat @r{(C++ and Objective-C++ only)}
5017 @opindex Wc++14-compat
5018 Warn about C++ constructs whose meaning differs between ISO C++ 2011
5019 and ISO C++ 2014.  This warning is enabled by @option{-Wall}.
5021 @item -Wcast-qual
5022 @opindex Wcast-qual
5023 @opindex Wno-cast-qual
5024 Warn whenever a pointer is cast so as to remove a type qualifier from
5025 the target type.  For example, warn if a @code{const char *} is cast
5026 to an ordinary @code{char *}.
5028 Also warn when making a cast that introduces a type qualifier in an
5029 unsafe way.  For example, casting @code{char **} to @code{const char **}
5030 is unsafe, as in this example:
5032 @smallexample
5033   /* p is char ** value.  */
5034   const char **q = (const char **) p;
5035   /* Assignment of readonly string to const char * is OK.  */
5036   *q = "string";
5037   /* Now char** pointer points to read-only memory.  */
5038   **p = 'b';
5039 @end smallexample
5041 @item -Wcast-align
5042 @opindex Wcast-align
5043 @opindex Wno-cast-align
5044 Warn whenever a pointer is cast such that the required alignment of the
5045 target is increased.  For example, warn if a @code{char *} is cast to
5046 an @code{int *} on machines where integers can only be accessed at
5047 two- or four-byte boundaries.
5049 @item -Wwrite-strings
5050 @opindex Wwrite-strings
5051 @opindex Wno-write-strings
5052 When compiling C, give string constants the type @code{const
5053 char[@var{length}]} so that copying the address of one into a
5054 non-@code{const} @code{char *} pointer produces a warning.  These
5055 warnings help you find at compile time code that can try to write
5056 into a string constant, but only if you have been very careful about
5057 using @code{const} in declarations and prototypes.  Otherwise, it is
5058 just a nuisance. This is why we did not make @option{-Wall} request
5059 these warnings.
5061 When compiling C++, warn about the deprecated conversion from string
5062 literals to @code{char *}.  This warning is enabled by default for C++
5063 programs.
5065 @item -Wclobbered
5066 @opindex Wclobbered
5067 @opindex Wno-clobbered
5068 Warn for variables that might be changed by @code{longjmp} or
5069 @code{vfork}.  This warning is also enabled by @option{-Wextra}.
5071 @item -Wconditionally-supported @r{(C++ and Objective-C++ only)}
5072 @opindex Wconditionally-supported
5073 @opindex Wno-conditionally-supported
5074 Warn for conditionally-supported (C++11 [intro.defs]) constructs.
5076 @item -Wconversion
5077 @opindex Wconversion
5078 @opindex Wno-conversion
5079 Warn for implicit conversions that may alter a value. This includes
5080 conversions between real and integer, like @code{abs (x)} when
5081 @code{x} is @code{double}; conversions between signed and unsigned,
5082 like @code{unsigned ui = -1}; and conversions to smaller types, like
5083 @code{sqrtf (M_PI)}. Do not warn for explicit casts like @code{abs
5084 ((int) x)} and @code{ui = (unsigned) -1}, or if the value is not
5085 changed by the conversion like in @code{abs (2.0)}.  Warnings about
5086 conversions between signed and unsigned integers can be disabled by
5087 using @option{-Wno-sign-conversion}.
5089 For C++, also warn for confusing overload resolution for user-defined
5090 conversions; and conversions that never use a type conversion
5091 operator: conversions to @code{void}, the same type, a base class or a
5092 reference to them. Warnings about conversions between signed and
5093 unsigned integers are disabled by default in C++ unless
5094 @option{-Wsign-conversion} is explicitly enabled.
5096 @item -Wno-conversion-null @r{(C++ and Objective-C++ only)}
5097 @opindex Wconversion-null
5098 @opindex Wno-conversion-null
5099 Do not warn for conversions between @code{NULL} and non-pointer
5100 types. @option{-Wconversion-null} is enabled by default.
5102 @item -Wzero-as-null-pointer-constant @r{(C++ and Objective-C++ only)}
5103 @opindex Wzero-as-null-pointer-constant
5104 @opindex Wno-zero-as-null-pointer-constant
5105 Warn when a literal @samp{0} is used as null pointer constant.  This can
5106 be useful to facilitate the conversion to @code{nullptr} in C++11.
5108 @item -Wsubobject-linkage @r{(C++ and Objective-C++ only)}
5109 @opindex Wsubobject-linkage
5110 @opindex Wno-subobject-linkage
5111 Warn if a class type has a base or a field whose type uses the anonymous
5112 namespace or depends on a type with no linkage.  If a type A depends on
5113 a type B with no or internal linkage, defining it in multiple
5114 translation units would be an ODR violation because the meaning of B
5115 is different in each translation unit.  If A only appears in a single
5116 translation unit, the best way to silence the warning is to give it
5117 internal linkage by putting it in an anonymous namespace as well.  The
5118 compiler doesn't give this warning for types defined in the main .C
5119 file, as those are unlikely to have multiple definitions.
5120 @option{-Wsubobject-linkage} is enabled by default.
5122 @item -Wdangling-else
5123 @opindex Wdangling-else
5124 @opindex Wno-dangling-else
5125 Warn about constructions where there may be confusion to which
5126 @code{if} statement an @code{else} branch belongs.  Here is an example of
5127 such a case:
5129 @smallexample
5130 @group
5132   if (a)
5133     if (b)
5134       foo ();
5135   else
5136     bar ();
5138 @end group
5139 @end smallexample
5141 In C/C++, every @code{else} branch belongs to the innermost possible
5142 @code{if} statement, which in this example is @code{if (b)}.  This is
5143 often not what the programmer expected, as illustrated in the above
5144 example by indentation the programmer chose.  When there is the
5145 potential for this confusion, GCC issues a warning when this flag
5146 is specified.  To eliminate the warning, add explicit braces around
5147 the innermost @code{if} statement so there is no way the @code{else}
5148 can belong to the enclosing @code{if}.  The resulting code
5149 looks like this:
5151 @smallexample
5152 @group
5154   if (a)
5155     @{
5156       if (b)
5157         foo ();
5158       else
5159         bar ();
5160     @}
5162 @end group
5163 @end smallexample
5165 This warning is enabled by @option{-Wparentheses}.
5167 @item -Wdate-time
5168 @opindex Wdate-time
5169 @opindex Wno-date-time
5170 Warn when macros @code{__TIME__}, @code{__DATE__} or @code{__TIMESTAMP__}
5171 are encountered as they might prevent bit-wise-identical reproducible
5172 compilations.
5174 @item -Wdelete-incomplete @r{(C++ and Objective-C++ only)}
5175 @opindex Wdelete-incomplete
5176 @opindex Wno-delete-incomplete
5177 Warn when deleting a pointer to incomplete type, which may cause
5178 undefined behavior at runtime.  This warning is enabled by default.
5180 @item -Wuseless-cast @r{(C++ and Objective-C++ only)}
5181 @opindex Wuseless-cast
5182 @opindex Wno-useless-cast
5183 Warn when an expression is casted to its own type.
5185 @item -Wempty-body
5186 @opindex Wempty-body
5187 @opindex Wno-empty-body
5188 Warn if an empty body occurs in an @code{if}, @code{else} or @code{do
5189 while} statement.  This warning is also enabled by @option{-Wextra}.
5191 @item -Wenum-compare
5192 @opindex Wenum-compare
5193 @opindex Wno-enum-compare
5194 Warn about a comparison between values of different enumerated types.
5195 In C++ enumeral mismatches in conditional expressions are also
5196 diagnosed and the warning is enabled by default.  In C this warning is 
5197 enabled by @option{-Wall}.
5199 @item -Wjump-misses-init @r{(C, Objective-C only)}
5200 @opindex Wjump-misses-init
5201 @opindex Wno-jump-misses-init
5202 Warn if a @code{goto} statement or a @code{switch} statement jumps
5203 forward across the initialization of a variable, or jumps backward to a
5204 label after the variable has been initialized.  This only warns about
5205 variables that are initialized when they are declared.  This warning is
5206 only supported for C and Objective-C; in C++ this sort of branch is an
5207 error in any case.
5209 @option{-Wjump-misses-init} is included in @option{-Wc++-compat}.  It
5210 can be disabled with the @option{-Wno-jump-misses-init} option.
5212 @item -Wsign-compare
5213 @opindex Wsign-compare
5214 @opindex Wno-sign-compare
5215 @cindex warning for comparison of signed and unsigned values
5216 @cindex comparison of signed and unsigned values, warning
5217 @cindex signed and unsigned values, comparison warning
5218 Warn when a comparison between signed and unsigned values could produce
5219 an incorrect result when the signed value is converted to unsigned.
5220 In C++, this warning is also enabled by @option{-Wall}.  In C, it is
5221 also enabled by @option{-Wextra}.
5223 @item -Wsign-conversion
5224 @opindex Wsign-conversion
5225 @opindex Wno-sign-conversion
5226 Warn for implicit conversions that may change the sign of an integer
5227 value, like assigning a signed integer expression to an unsigned
5228 integer variable. An explicit cast silences the warning. In C, this
5229 option is enabled also by @option{-Wconversion}.
5231 @item -Wfloat-conversion
5232 @opindex Wfloat-conversion
5233 @opindex Wno-float-conversion
5234 Warn for implicit conversions that reduce the precision of a real value.
5235 This includes conversions from real to integer, and from higher precision
5236 real to lower precision real values.  This option is also enabled by
5237 @option{-Wconversion}.
5239 @item -Wno-scalar-storage-order
5240 @opindex -Wno-scalar-storage-order
5241 @opindex -Wscalar-storage-order
5242 Do not warn on suspicious constructs involving reverse scalar storage order.
5244 @item -Wsized-deallocation @r{(C++ and Objective-C++ only)}
5245 @opindex Wsized-deallocation
5246 @opindex Wno-sized-deallocation
5247 Warn about a definition of an unsized deallocation function
5248 @smallexample
5249 void operator delete (void *) noexcept;
5250 void operator delete[] (void *) noexcept;
5251 @end smallexample
5252 without a definition of the corresponding sized deallocation function
5253 @smallexample
5254 void operator delete (void *, std::size_t) noexcept;
5255 void operator delete[] (void *, std::size_t) noexcept;
5256 @end smallexample
5257 or vice versa.  Enabled by @option{-Wextra} along with
5258 @option{-fsized-deallocation}.
5260 @item -Wsizeof-pointer-memaccess
5261 @opindex Wsizeof-pointer-memaccess
5262 @opindex Wno-sizeof-pointer-memaccess
5263 Warn for suspicious length parameters to certain string and memory built-in
5264 functions if the argument uses @code{sizeof}.  This warning warns e.g.@:
5265 about @code{memset (ptr, 0, sizeof (ptr));} if @code{ptr} is not an array,
5266 but a pointer, and suggests a possible fix, or about
5267 @code{memcpy (&foo, ptr, sizeof (&foo));}.  This warning is enabled by
5268 @option{-Wall}.
5270 @item -Wsizeof-array-argument
5271 @opindex Wsizeof-array-argument
5272 @opindex Wno-sizeof-array-argument
5273 Warn when the @code{sizeof} operator is applied to a parameter that is
5274 declared as an array in a function definition.  This warning is enabled by
5275 default for C and C++ programs.
5277 @item -Wmemset-elt-size
5278 @opindex Wmemset-elt-size
5279 @opindex Wno-memset-elt-size
5280 Warn for suspicious calls to the @code{memset} built-in function, if the
5281 first argument references an array, and the third argument is a number
5282 equal to the number of elements, but not equal to the size of the array
5283 in memory.  This indicates that the user has omitted a multiplication by
5284 the element size.  This warning is enabled by @option{-Wall}.
5286 @item -Wmemset-transposed-args
5287 @opindex Wmemset-transposed-args
5288 @opindex Wno-memset-transposed-args
5289 Warn for suspicious calls to the @code{memset} built-in function, if the
5290 second argument is not zero and the third argument is zero.  This warns e.g.@
5291 about @code{memset (buf, sizeof buf, 0)} where most probably
5292 @code{memset (buf, 0, sizeof buf)} was meant instead.  The diagnostics
5293 is only emitted if the third argument is literal zero.  If it is some
5294 expression that is folded to zero, a cast of zero to some type, etc., 
5295 it is far less likely that the user has mistakenly exchanged the arguments 
5296 and no warning is emitted.  This warning is enabled by @option{-Wall}.
5298 @item -Waddress
5299 @opindex Waddress
5300 @opindex Wno-address
5301 Warn about suspicious uses of memory addresses. These include using
5302 the address of a function in a conditional expression, such as
5303 @code{void func(void); if (func)}, and comparisons against the memory
5304 address of a string literal, such as @code{if (x == "abc")}.  Such
5305 uses typically indicate a programmer error: the address of a function
5306 always evaluates to true, so their use in a conditional usually
5307 indicate that the programmer forgot the parentheses in a function
5308 call; and comparisons against string literals result in unspecified
5309 behavior and are not portable in C, so they usually indicate that the
5310 programmer intended to use @code{strcmp}.  This warning is enabled by
5311 @option{-Wall}.
5313 @item -Wlogical-op
5314 @opindex Wlogical-op
5315 @opindex Wno-logical-op
5316 Warn about suspicious uses of logical operators in expressions.
5317 This includes using logical operators in contexts where a
5318 bit-wise operator is likely to be expected.  Also warns when
5319 the operands of a logical operator are the same:
5320 @smallexample
5321 extern int a;
5322 if (a < 0 && a < 0) @{ @dots{} @}
5323 @end smallexample
5325 @item -Wlogical-not-parentheses
5326 @opindex Wlogical-not-parentheses
5327 @opindex Wno-logical-not-parentheses
5328 Warn about logical not used on the left hand side operand of a comparison.
5329 This option does not warn if the RHS operand is of a boolean type.  Its
5330 purpose is to detect suspicious code like the following:
5331 @smallexample
5332 int a;
5333 @dots{}
5334 if (!a > 1) @{ @dots{} @}
5335 @end smallexample
5337 It is possible to suppress the warning by wrapping the LHS into
5338 parentheses:
5339 @smallexample
5340 if ((!a) > 1) @{ @dots{} @}
5341 @end smallexample
5343 This warning is enabled by @option{-Wall}.
5345 @item -Waggregate-return
5346 @opindex Waggregate-return
5347 @opindex Wno-aggregate-return
5348 Warn if any functions that return structures or unions are defined or
5349 called.  (In languages where you can return an array, this also elicits
5350 a warning.)
5352 @item -Wno-aggressive-loop-optimizations
5353 @opindex Wno-aggressive-loop-optimizations
5354 @opindex Waggressive-loop-optimizations
5355 Warn if in a loop with constant number of iterations the compiler detects
5356 undefined behavior in some statement during one or more of the iterations.
5358 @item -Wno-attributes
5359 @opindex Wno-attributes
5360 @opindex Wattributes
5361 Do not warn if an unexpected @code{__attribute__} is used, such as
5362 unrecognized attributes, function attributes applied to variables,
5363 etc.  This does not stop errors for incorrect use of supported
5364 attributes.
5366 @item -Wno-builtin-macro-redefined
5367 @opindex Wno-builtin-macro-redefined
5368 @opindex Wbuiltin-macro-redefined
5369 Do not warn if certain built-in macros are redefined.  This suppresses
5370 warnings for redefinition of @code{__TIMESTAMP__}, @code{__TIME__},
5371 @code{__DATE__}, @code{__FILE__}, and @code{__BASE_FILE__}.
5373 @item -Wstrict-prototypes @r{(C and Objective-C only)}
5374 @opindex Wstrict-prototypes
5375 @opindex Wno-strict-prototypes
5376 Warn if a function is declared or defined without specifying the
5377 argument types.  (An old-style function definition is permitted without
5378 a warning if preceded by a declaration that specifies the argument
5379 types.)
5381 @item -Wold-style-declaration @r{(C and Objective-C only)}
5382 @opindex Wold-style-declaration
5383 @opindex Wno-old-style-declaration
5384 Warn for obsolescent usages, according to the C Standard, in a
5385 declaration. For example, warn if storage-class specifiers like
5386 @code{static} are not the first things in a declaration.  This warning
5387 is also enabled by @option{-Wextra}.
5389 @item -Wold-style-definition @r{(C and Objective-C only)}
5390 @opindex Wold-style-definition
5391 @opindex Wno-old-style-definition
5392 Warn if an old-style function definition is used.  A warning is given
5393 even if there is a previous prototype.
5395 @item -Wmissing-parameter-type @r{(C and Objective-C only)}
5396 @opindex Wmissing-parameter-type
5397 @opindex Wno-missing-parameter-type
5398 A function parameter is declared without a type specifier in K&R-style
5399 functions:
5401 @smallexample
5402 void foo(bar) @{ @}
5403 @end smallexample
5405 This warning is also enabled by @option{-Wextra}.
5407 @item -Wmissing-prototypes @r{(C and Objective-C only)}
5408 @opindex Wmissing-prototypes
5409 @opindex Wno-missing-prototypes
5410 Warn if a global function is defined without a previous prototype
5411 declaration.  This warning is issued even if the definition itself
5412 provides a prototype.  Use this option to detect global functions
5413 that do not have a matching prototype declaration in a header file.
5414 This option is not valid for C++ because all function declarations
5415 provide prototypes and a non-matching declaration declares an
5416 overload rather than conflict with an earlier declaration.
5417 Use @option{-Wmissing-declarations} to detect missing declarations in C++.
5419 @item -Wmissing-declarations
5420 @opindex Wmissing-declarations
5421 @opindex Wno-missing-declarations
5422 Warn if a global function is defined without a previous declaration.
5423 Do so even if the definition itself provides a prototype.
5424 Use this option to detect global functions that are not declared in
5425 header files.  In C, no warnings are issued for functions with previous
5426 non-prototype declarations; use @option{-Wmissing-prototypes} to detect
5427 missing prototypes.  In C++, no warnings are issued for function templates,
5428 or for inline functions, or for functions in anonymous namespaces.
5430 @item -Wmissing-field-initializers
5431 @opindex Wmissing-field-initializers
5432 @opindex Wno-missing-field-initializers
5433 @opindex W
5434 @opindex Wextra
5435 @opindex Wno-extra
5436 Warn if a structure's initializer has some fields missing.  For
5437 example, the following code causes such a warning, because
5438 @code{x.h} is implicitly zero:
5440 @smallexample
5441 struct s @{ int f, g, h; @};
5442 struct s x = @{ 3, 4 @};
5443 @end smallexample
5445 This option does not warn about designated initializers, so the following
5446 modification does not trigger a warning:
5448 @smallexample
5449 struct s @{ int f, g, h; @};
5450 struct s x = @{ .f = 3, .g = 4 @};
5451 @end smallexample
5453 In C++ this option does not warn either about the empty @{ @}
5454 initializer, for example:
5456 @smallexample
5457 struct s @{ int f, g, h; @};
5458 s x = @{ @};
5459 @end smallexample
5461 This warning is included in @option{-Wextra}.  To get other @option{-Wextra}
5462 warnings without this one, use @option{-Wextra -Wno-missing-field-initializers}.
5464 @item -Wno-multichar
5465 @opindex Wno-multichar
5466 @opindex Wmultichar
5467 Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
5468 Usually they indicate a typo in the user's code, as they have
5469 implementation-defined values, and should not be used in portable code.
5471 @item -Wnormalized@r{[}=@r{<}none@r{|}id@r{|}nfc@r{|}nfkc@r{>]}
5472 @opindex Wnormalized=
5473 @opindex Wnormalized
5474 @opindex Wno-normalized
5475 @cindex NFC
5476 @cindex NFKC
5477 @cindex character set, input normalization
5478 In ISO C and ISO C++, two identifiers are different if they are
5479 different sequences of characters.  However, sometimes when characters
5480 outside the basic ASCII character set are used, you can have two
5481 different character sequences that look the same.  To avoid confusion,
5482 the ISO 10646 standard sets out some @dfn{normalization rules} which
5483 when applied ensure that two sequences that look the same are turned into
5484 the same sequence.  GCC can warn you if you are using identifiers that
5485 have not been normalized; this option controls that warning.
5487 There are four levels of warning supported by GCC@.  The default is
5488 @option{-Wnormalized=nfc}, which warns about any identifier that is
5489 not in the ISO 10646 ``C'' normalized form, @dfn{NFC}.  NFC is the
5490 recommended form for most uses.  It is equivalent to
5491 @option{-Wnormalized}.
5493 Unfortunately, there are some characters allowed in identifiers by
5494 ISO C and ISO C++ that, when turned into NFC, are not allowed in 
5495 identifiers.  That is, there's no way to use these symbols in portable
5496 ISO C or C++ and have all your identifiers in NFC@.
5497 @option{-Wnormalized=id} suppresses the warning for these characters.
5498 It is hoped that future versions of the standards involved will correct
5499 this, which is why this option is not the default.
5501 You can switch the warning off for all characters by writing
5502 @option{-Wnormalized=none} or @option{-Wno-normalized}.  You should
5503 only do this if you are using some other normalization scheme (like
5504 ``D''), because otherwise you can easily create bugs that are
5505 literally impossible to see.
5507 Some characters in ISO 10646 have distinct meanings but look identical
5508 in some fonts or display methodologies, especially once formatting has
5509 been applied.  For instance @code{\u207F}, ``SUPERSCRIPT LATIN SMALL
5510 LETTER N'', displays just like a regular @code{n} that has been
5511 placed in a superscript.  ISO 10646 defines the @dfn{NFKC}
5512 normalization scheme to convert all these into a standard form as
5513 well, and GCC warns if your code is not in NFKC if you use
5514 @option{-Wnormalized=nfkc}.  This warning is comparable to warning
5515 about every identifier that contains the letter O because it might be
5516 confused with the digit 0, and so is not the default, but may be
5517 useful as a local coding convention if the programming environment 
5518 cannot be fixed to display these characters distinctly.
5520 @item -Wno-deprecated
5521 @opindex Wno-deprecated
5522 @opindex Wdeprecated
5523 Do not warn about usage of deprecated features.  @xref{Deprecated Features}.
5525 @item -Wno-deprecated-declarations
5526 @opindex Wno-deprecated-declarations
5527 @opindex Wdeprecated-declarations
5528 Do not warn about uses of functions (@pxref{Function Attributes}),
5529 variables (@pxref{Variable Attributes}), and types (@pxref{Type
5530 Attributes}) marked as deprecated by using the @code{deprecated}
5531 attribute.
5533 @item -Wno-overflow
5534 @opindex Wno-overflow
5535 @opindex Woverflow
5536 Do not warn about compile-time overflow in constant expressions.
5538 @item -Wno-odr
5539 @opindex Wno-odr
5540 @opindex Wodr
5541 Warn about One Definition Rule violations during link-time optimization.
5542 Requires @option{-flto-odr-type-merging} to be enabled.  Enabled by default.
5544 @item -Wopenmp-simd
5545 @opindex Wopenm-simd
5546 Warn if the vectorizer cost model overrides the OpenMP or the Cilk Plus
5547 simd directive set by user.  The @option{-fsimd-cost-model=unlimited}
5548 option can be used to relax the cost model.
5550 @item -Woverride-init @r{(C and Objective-C only)}
5551 @opindex Woverride-init
5552 @opindex Wno-override-init
5553 @opindex W
5554 @opindex Wextra
5555 @opindex Wno-extra
5556 Warn if an initialized field without side effects is overridden when
5557 using designated initializers (@pxref{Designated Inits, , Designated
5558 Initializers}).
5560 This warning is included in @option{-Wextra}.  To get other
5561 @option{-Wextra} warnings without this one, use @option{-Wextra
5562 -Wno-override-init}.
5564 @item -Woverride-init-side-effects @r{(C and Objective-C only)}
5565 @opindex Woverride-init-side-effects
5566 @opindex Wno-override-init-side-effects
5567 Warn if an initialized field with side effects is overridden when
5568 using designated initializers (@pxref{Designated Inits, , Designated
5569 Initializers}).  This warning is enabled by default.
5571 @item -Wpacked
5572 @opindex Wpacked
5573 @opindex Wno-packed
5574 Warn if a structure is given the packed attribute, but the packed
5575 attribute has no effect on the layout or size of the structure.
5576 Such structures may be mis-aligned for little benefit.  For
5577 instance, in this code, the variable @code{f.x} in @code{struct bar}
5578 is misaligned even though @code{struct bar} does not itself
5579 have the packed attribute:
5581 @smallexample
5582 @group
5583 struct foo @{
5584   int x;
5585   char a, b, c, d;
5586 @} __attribute__((packed));
5587 struct bar @{
5588   char z;
5589   struct foo f;
5591 @end group
5592 @end smallexample
5594 @item -Wpacked-bitfield-compat
5595 @opindex Wpacked-bitfield-compat
5596 @opindex Wno-packed-bitfield-compat
5597 The 4.1, 4.2 and 4.3 series of GCC ignore the @code{packed} attribute
5598 on bit-fields of type @code{char}.  This has been fixed in GCC 4.4 but
5599 the change can lead to differences in the structure layout.  GCC
5600 informs you when the offset of such a field has changed in GCC 4.4.
5601 For example there is no longer a 4-bit padding between field @code{a}
5602 and @code{b} in this structure:
5604 @smallexample
5605 struct foo
5607   char a:4;
5608   char b:8;
5609 @} __attribute__ ((packed));
5610 @end smallexample
5612 This warning is enabled by default.  Use
5613 @option{-Wno-packed-bitfield-compat} to disable this warning.
5615 @item -Wpadded
5616 @opindex Wpadded
5617 @opindex Wno-padded
5618 Warn if padding is included in a structure, either to align an element
5619 of the structure or to align the whole structure.  Sometimes when this
5620 happens it is possible to rearrange the fields of the structure to
5621 reduce the padding and so make the structure smaller.
5623 @item -Wredundant-decls
5624 @opindex Wredundant-decls
5625 @opindex Wno-redundant-decls
5626 Warn if anything is declared more than once in the same scope, even in
5627 cases where multiple declaration is valid and changes nothing.
5629 @item -Wnested-externs @r{(C and Objective-C only)}
5630 @opindex Wnested-externs
5631 @opindex Wno-nested-externs
5632 Warn if an @code{extern} declaration is encountered within a function.
5634 @item -Wno-inherited-variadic-ctor
5635 @opindex Winherited-variadic-ctor
5636 @opindex Wno-inherited-variadic-ctor
5637 Suppress warnings about use of C++11 inheriting constructors when the
5638 base class inherited from has a C variadic constructor; the warning is
5639 on by default because the ellipsis is not inherited.
5641 @item -Winline
5642 @opindex Winline
5643 @opindex Wno-inline
5644 Warn if a function that is declared as inline cannot be inlined.
5645 Even with this option, the compiler does not warn about failures to
5646 inline functions declared in system headers.
5648 The compiler uses a variety of heuristics to determine whether or not
5649 to inline a function.  For example, the compiler takes into account
5650 the size of the function being inlined and the amount of inlining
5651 that has already been done in the current function.  Therefore,
5652 seemingly insignificant changes in the source program can cause the
5653 warnings produced by @option{-Winline} to appear or disappear.
5655 @item -Wno-invalid-offsetof @r{(C++ and Objective-C++ only)}
5656 @opindex Wno-invalid-offsetof
5657 @opindex Winvalid-offsetof
5658 Suppress warnings from applying the @code{offsetof} macro to a non-POD
5659 type.  According to the 2014 ISO C++ standard, applying @code{offsetof}
5660 to a non-standard-layout type is undefined.  In existing C++ implementations,
5661 however, @code{offsetof} typically gives meaningful results.
5662 This flag is for users who are aware that they are
5663 writing nonportable code and who have deliberately chosen to ignore the
5664 warning about it.
5666 The restrictions on @code{offsetof} may be relaxed in a future version
5667 of the C++ standard.
5669 @item -Wno-int-to-pointer-cast
5670 @opindex Wno-int-to-pointer-cast
5671 @opindex Wint-to-pointer-cast
5672 Suppress warnings from casts to pointer type of an integer of a
5673 different size. In C++, casting to a pointer type of smaller size is
5674 an error. @option{Wint-to-pointer-cast} is enabled by default.
5677 @item -Wno-pointer-to-int-cast @r{(C and Objective-C only)}
5678 @opindex Wno-pointer-to-int-cast
5679 @opindex Wpointer-to-int-cast
5680 Suppress warnings from casts from a pointer to an integer type of a
5681 different size.
5683 @item -Winvalid-pch
5684 @opindex Winvalid-pch
5685 @opindex Wno-invalid-pch
5686 Warn if a precompiled header (@pxref{Precompiled Headers}) is found in
5687 the search path but can't be used.
5689 @item -Wlong-long
5690 @opindex Wlong-long
5691 @opindex Wno-long-long
5692 Warn if @code{long long} type is used.  This is enabled by either
5693 @option{-Wpedantic} or @option{-Wtraditional} in ISO C90 and C++98
5694 modes.  To inhibit the warning messages, use @option{-Wno-long-long}.
5696 @item -Wvariadic-macros
5697 @opindex Wvariadic-macros
5698 @opindex Wno-variadic-macros
5699 Warn if variadic macros are used in ISO C90 mode, or if the GNU
5700 alternate syntax is used in ISO C99 mode.  This is enabled by either
5701 @option{-Wpedantic} or @option{-Wtraditional}.  To inhibit the warning
5702 messages, use @option{-Wno-variadic-macros}.
5704 @item -Wvarargs
5705 @opindex Wvarargs
5706 @opindex Wno-varargs
5707 Warn upon questionable usage of the macros used to handle variable
5708 arguments like @code{va_start}.  This is default.  To inhibit the
5709 warning messages, use @option{-Wno-varargs}.
5711 @item -Wvector-operation-performance
5712 @opindex Wvector-operation-performance
5713 @opindex Wno-vector-operation-performance
5714 Warn if vector operation is not implemented via SIMD capabilities of the
5715 architecture.  Mainly useful for the performance tuning.
5716 Vector operation can be implemented @code{piecewise}, which means that the
5717 scalar operation is performed on every vector element; 
5718 @code{in parallel}, which means that the vector operation is implemented
5719 using scalars of wider type, which normally is more performance efficient;
5720 and @code{as a single scalar}, which means that vector fits into a
5721 scalar type.
5723 @item -Wno-virtual-move-assign
5724 @opindex Wvirtual-move-assign
5725 @opindex Wno-virtual-move-assign
5726 Suppress warnings about inheriting from a virtual base with a
5727 non-trivial C++11 move assignment operator.  This is dangerous because
5728 if the virtual base is reachable along more than one path, it is
5729 moved multiple times, which can mean both objects end up in the
5730 moved-from state.  If the move assignment operator is written to avoid
5731 moving from a moved-from object, this warning can be disabled.
5733 @item -Wvla
5734 @opindex Wvla
5735 @opindex Wno-vla
5736 Warn if variable length array is used in the code.
5737 @option{-Wno-vla} prevents the @option{-Wpedantic} warning of
5738 the variable length array.
5740 @item -Wvolatile-register-var
5741 @opindex Wvolatile-register-var
5742 @opindex Wno-volatile-register-var
5743 Warn if a register variable is declared volatile.  The volatile
5744 modifier does not inhibit all optimizations that may eliminate reads
5745 and/or writes to register variables.  This warning is enabled by
5746 @option{-Wall}.
5748 @item -Wdisabled-optimization
5749 @opindex Wdisabled-optimization
5750 @opindex Wno-disabled-optimization
5751 Warn if a requested optimization pass is disabled.  This warning does
5752 not generally indicate that there is anything wrong with your code; it
5753 merely indicates that GCC's optimizers are unable to handle the code
5754 effectively.  Often, the problem is that your code is too big or too
5755 complex; GCC refuses to optimize programs when the optimization
5756 itself is likely to take inordinate amounts of time.
5758 @item -Wpointer-sign @r{(C and Objective-C only)}
5759 @opindex Wpointer-sign
5760 @opindex Wno-pointer-sign
5761 Warn for pointer argument passing or assignment with different signedness.
5762 This option is only supported for C and Objective-C@.  It is implied by
5763 @option{-Wall} and by @option{-Wpedantic}, which can be disabled with
5764 @option{-Wno-pointer-sign}.
5766 @item -Wstack-protector
5767 @opindex Wstack-protector
5768 @opindex Wno-stack-protector
5769 This option is only active when @option{-fstack-protector} is active.  It
5770 warns about functions that are not protected against stack smashing.
5772 @item -Woverlength-strings
5773 @opindex Woverlength-strings
5774 @opindex Wno-overlength-strings
5775 Warn about string constants that are longer than the ``minimum
5776 maximum'' length specified in the C standard.  Modern compilers
5777 generally allow string constants that are much longer than the
5778 standard's minimum limit, but very portable programs should avoid
5779 using longer strings.
5781 The limit applies @emph{after} string constant concatenation, and does
5782 not count the trailing NUL@.  In C90, the limit was 509 characters; in
5783 C99, it was raised to 4095.  C++98 does not specify a normative
5784 minimum maximum, so we do not diagnose overlength strings in C++@.
5786 This option is implied by @option{-Wpedantic}, and can be disabled with
5787 @option{-Wno-overlength-strings}.
5789 @item -Wunsuffixed-float-constants @r{(C and Objective-C only)}
5790 @opindex Wunsuffixed-float-constants
5792 Issue a warning for any floating constant that does not have
5793 a suffix.  When used together with @option{-Wsystem-headers} it
5794 warns about such constants in system header files.  This can be useful
5795 when preparing code to use with the @code{FLOAT_CONST_DECIMAL64} pragma
5796 from the decimal floating-point extension to C99.
5798 @item -Wno-designated-init @r{(C and Objective-C only)}
5799 Suppress warnings when a positional initializer is used to initialize
5800 a structure that has been marked with the @code{designated_init}
5801 attribute.
5803 @item -Whsa
5804 Issue a warning when HSAIL cannot be emitted for the compiled function or
5805 OpenMP construct.
5807 @end table
5809 @node Debugging Options
5810 @section Options for Debugging Your Program
5811 @cindex options, debugging
5812 @cindex debugging information options
5814 To tell GCC to emit extra information for use by a debugger, in almost 
5815 all cases you need only to add @option{-g} to your other options.
5817 GCC allows you to use @option{-g} with
5818 @option{-O}.  The shortcuts taken by optimized code may occasionally
5819 be surprising: some variables you declared may not exist
5820 at all; flow of control may briefly move where you did not expect it;
5821 some statements may not be executed because they compute constant
5822 results or their values are already at hand; some statements may
5823 execute in different places because they have been moved out of loops.
5824 Nevertheless it is possible to debug optimized output.  This makes
5825 it reasonable to use the optimizer for programs that might have bugs.
5827 If you are not using some other optimization option, consider
5828 using @option{-Og} (@pxref{Optimize Options}) with @option{-g}.  
5829 With no @option{-O} option at all, some compiler passes that collect
5830 information useful for debugging do not run at all, so that
5831 @option{-Og} may result in a better debugging experience.
5833 @table @gcctabopt
5834 @item -g
5835 @opindex g
5836 Produce debugging information in the operating system's native format
5837 (stabs, COFF, XCOFF, or DWARF)@.  GDB can work with this debugging
5838 information.
5840 On most systems that use stabs format, @option{-g} enables use of extra
5841 debugging information that only GDB can use; this extra information
5842 makes debugging work better in GDB but probably makes other debuggers
5843 crash or
5844 refuse to read the program.  If you want to control for certain whether
5845 to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
5846 @option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
5848 @item -ggdb
5849 @opindex ggdb
5850 Produce debugging information for use by GDB@.  This means to use the
5851 most expressive format available (DWARF, stabs, or the native format
5852 if neither of those are supported), including GDB extensions if at all
5853 possible.
5855 @item -gdwarf
5856 @itemx -gdwarf-@var{version}
5857 @opindex gdwarf
5858 Produce debugging information in DWARF format (if that is supported).
5859 The value of @var{version} may be either 2, 3, 4 or 5; the default version
5860 for most targets is 4.  DWARF Version 5 is only experimental.
5862 Note that with DWARF Version 2, some ports require and always
5863 use some non-conflicting DWARF 3 extensions in the unwind tables.
5865 Version 4 may require GDB 7.0 and @option{-fvar-tracking-assignments}
5866 for maximum benefit.
5868 GCC no longer supports DWARF Version 1, which is substantially
5869 different than Version 2 and later.  For historical reasons, some
5870 other DWARF-related options (including @option{-feliminate-dwarf2-dups} 
5871 and @option{-fno-dwarf2-cfi-asm}) retain a reference to DWARF Version 2
5872 in their names, but apply to all currently-supported versions of DWARF.
5874 @item -gstabs
5875 @opindex gstabs
5876 Produce debugging information in stabs format (if that is supported),
5877 without GDB extensions.  This is the format used by DBX on most BSD
5878 systems.  On MIPS, Alpha and System V Release 4 systems this option
5879 produces stabs debugging output that is not understood by DBX or SDB@.
5880 On System V Release 4 systems this option requires the GNU assembler.
5882 @item -gstabs+
5883 @opindex gstabs+
5884 Produce debugging information in stabs format (if that is supported),
5885 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5886 use of these extensions is likely to make other debuggers crash or
5887 refuse to read the program.
5889 @item -gcoff
5890 @opindex gcoff
5891 Produce debugging information in COFF format (if that is supported).
5892 This is the format used by SDB on most System V systems prior to
5893 System V Release 4.
5895 @item -gxcoff
5896 @opindex gxcoff
5897 Produce debugging information in XCOFF format (if that is supported).
5898 This is the format used by the DBX debugger on IBM RS/6000 systems.
5900 @item -gxcoff+
5901 @opindex gxcoff+
5902 Produce debugging information in XCOFF format (if that is supported),
5903 using GNU extensions understood only by the GNU debugger (GDB)@.  The
5904 use of these extensions is likely to make other debuggers crash or
5905 refuse to read the program, and may cause assemblers other than the GNU
5906 assembler (GAS) to fail with an error.
5908 @item -gvms
5909 @opindex gvms
5910 Produce debugging information in Alpha/VMS debug format (if that is
5911 supported).  This is the format used by DEBUG on Alpha/VMS systems.
5913 @item -g@var{level}
5914 @itemx -ggdb@var{level}
5915 @itemx -gstabs@var{level}
5916 @itemx -gcoff@var{level}
5917 @itemx -gxcoff@var{level}
5918 @itemx -gvms@var{level}
5919 Request debugging information and also use @var{level} to specify how
5920 much information.  The default level is 2.
5922 Level 0 produces no debug information at all.  Thus, @option{-g0} negates
5923 @option{-g}.
5925 Level 1 produces minimal information, enough for making backtraces in
5926 parts of the program that you don't plan to debug.  This includes
5927 descriptions of functions and external variables, and line number
5928 tables, but no information about local variables.
5930 Level 3 includes extra information, such as all the macro definitions
5931 present in the program.  Some debuggers support macro expansion when
5932 you use @option{-g3}.
5934 @option{-gdwarf} does not accept a concatenated debug level, to avoid
5935 confusion with @option{-gdwarf-@var{level}}.
5936 Instead use an additional @option{-g@var{level}} option to change the
5937 debug level for DWARF.
5939 @item -feliminate-unused-debug-symbols
5940 @opindex feliminate-unused-debug-symbols
5941 Produce debugging information in stabs format (if that is supported),
5942 for only symbols that are actually used.
5944 @item -femit-class-debug-always
5945 @opindex femit-class-debug-always
5946 Instead of emitting debugging information for a C++ class in only one
5947 object file, emit it in all object files using the class.  This option
5948 should be used only with debuggers that are unable to handle the way GCC
5949 normally emits debugging information for classes because using this
5950 option increases the size of debugging information by as much as a
5951 factor of two.
5953 @item -fno-merge-debug-strings
5954 @opindex fmerge-debug-strings
5955 @opindex fno-merge-debug-strings
5956 Direct the linker to not merge together strings in the debugging
5957 information that are identical in different object files.  Merging is
5958 not supported by all assemblers or linkers.  Merging decreases the size
5959 of the debug information in the output file at the cost of increasing
5960 link processing time.  Merging is enabled by default.
5962 @item -fdebug-prefix-map=@var{old}=@var{new}
5963 @opindex fdebug-prefix-map
5964 When compiling files in directory @file{@var{old}}, record debugging
5965 information describing them as in @file{@var{new}} instead.
5967 @item -fvar-tracking
5968 @opindex fvar-tracking
5969 Run variable tracking pass.  It computes where variables are stored at each
5970 position in code.  Better debugging information is then generated
5971 (if the debugging information format supports this information).
5973 It is enabled by default when compiling with optimization (@option{-Os},
5974 @option{-O}, @option{-O2}, @dots{}), debugging information (@option{-g}) and
5975 the debug info format supports it.
5977 @item -fvar-tracking-assignments
5978 @opindex fvar-tracking-assignments
5979 @opindex fno-var-tracking-assignments
5980 Annotate assignments to user variables early in the compilation and
5981 attempt to carry the annotations over throughout the compilation all the
5982 way to the end, in an attempt to improve debug information while
5983 optimizing.  Use of @option{-gdwarf-4} is recommended along with it.
5985 It can be enabled even if var-tracking is disabled, in which case
5986 annotations are created and maintained, but discarded at the end.
5987 By default, this flag is enabled together with @option{-fvar-tracking},
5988 except when selective scheduling is enabled.
5990 @item -gsplit-dwarf
5991 @opindex gsplit-dwarf
5992 Separate as much DWARF debugging information as possible into a
5993 separate output file with the extension @file{.dwo}.  This option allows
5994 the build system to avoid linking files with debug information.  To
5995 be useful, this option requires a debugger capable of reading @file{.dwo}
5996 files.
5998 @item -gpubnames
5999 @opindex gpubnames
6000 Generate DWARF @code{.debug_pubnames} and @code{.debug_pubtypes} sections.
6002 @item -ggnu-pubnames
6003 @opindex ggnu-pubnames
6004 Generate @code{.debug_pubnames} and @code{.debug_pubtypes} sections in a format
6005 suitable for conversion into a GDB@ index.  This option is only useful
6006 with a linker that can produce GDB@ index version 7.
6008 @item -fdebug-types-section
6009 @opindex fdebug-types-section
6010 @opindex fno-debug-types-section
6011 When using DWARF Version 4 or higher, type DIEs can be put into
6012 their own @code{.debug_types} section instead of making them part of the
6013 @code{.debug_info} section.  It is more efficient to put them in a separate
6014 comdat sections since the linker can then remove duplicates.
6015 But not all DWARF consumers support @code{.debug_types} sections yet
6016 and on some objects @code{.debug_types} produces larger instead of smaller
6017 debugging information.
6019 @item -grecord-gcc-switches
6020 @item -gno-record-gcc-switches
6021 @opindex grecord-gcc-switches
6022 @opindex gno-record-gcc-switches
6023 This switch causes the command-line options used to invoke the
6024 compiler that may affect code generation to be appended to the
6025 DW_AT_producer attribute in DWARF debugging information.  The options
6026 are concatenated with spaces separating them from each other and from
6027 the compiler version.  
6028 It is enabled by default.
6029 See also @option{-frecord-gcc-switches} for another
6030 way of storing compiler options into the object file.  
6032 @item -gstrict-dwarf
6033 @opindex gstrict-dwarf
6034 Disallow using extensions of later DWARF standard version than selected
6035 with @option{-gdwarf-@var{version}}.  On most targets using non-conflicting
6036 DWARF extensions from later standard versions is allowed.
6038 @item -gno-strict-dwarf
6039 @opindex gno-strict-dwarf
6040 Allow using extensions of later DWARF standard version than selected with
6041 @option{-gdwarf-@var{version}}.
6043 @item -gz@r{[}=@var{type}@r{]}
6044 @opindex gz
6045 Produce compressed debug sections in DWARF format, if that is supported.
6046 If @var{type} is not given, the default type depends on the capabilities
6047 of the assembler and linker used.  @var{type} may be one of
6048 @samp{none} (don't compress debug sections), @samp{zlib} (use zlib
6049 compression in ELF gABI format), or @samp{zlib-gnu} (use zlib
6050 compression in traditional GNU format).  If the linker doesn't support
6051 writing compressed debug sections, the option is rejected.  Otherwise,
6052 if the assembler does not support them, @option{-gz} is silently ignored
6053 when producing object files.
6055 @item -feliminate-dwarf2-dups
6056 @opindex feliminate-dwarf2-dups
6057 Compress DWARF debugging information by eliminating duplicated
6058 information about each symbol.  This option only makes sense when
6059 generating DWARF debugging information.
6061 @item -femit-struct-debug-baseonly
6062 @opindex femit-struct-debug-baseonly
6063 Emit debug information for struct-like types
6064 only when the base name of the compilation source file
6065 matches the base name of file in which the struct is defined.
6067 This option substantially reduces the size of debugging information,
6068 but at significant potential loss in type information to the debugger.
6069 See @option{-femit-struct-debug-reduced} for a less aggressive option.
6070 See @option{-femit-struct-debug-detailed} for more detailed control.
6072 This option works only with DWARF debug output.
6074 @item -femit-struct-debug-reduced
6075 @opindex femit-struct-debug-reduced
6076 Emit debug information for struct-like types
6077 only when the base name of the compilation source file
6078 matches the base name of file in which the type is defined,
6079 unless the struct is a template or defined in a system header.
6081 This option significantly reduces the size of debugging information,
6082 with some potential loss in type information to the debugger.
6083 See @option{-femit-struct-debug-baseonly} for a more aggressive option.
6084 See @option{-femit-struct-debug-detailed} for more detailed control.
6086 This option works only with DWARF debug output.
6088 @item -femit-struct-debug-detailed@r{[}=@var{spec-list}@r{]}
6089 @opindex femit-struct-debug-detailed
6090 Specify the struct-like types
6091 for which the compiler generates debug information.
6092 The intent is to reduce duplicate struct debug information
6093 between different object files within the same program.
6095 This option is a detailed version of
6096 @option{-femit-struct-debug-reduced} and @option{-femit-struct-debug-baseonly},
6097 which serves for most needs.
6099 A specification has the syntax@*
6100 [@samp{dir:}|@samp{ind:}][@samp{ord:}|@samp{gen:}](@samp{any}|@samp{sys}|@samp{base}|@samp{none})
6102 The optional first word limits the specification to
6103 structs that are used directly (@samp{dir:}) or used indirectly (@samp{ind:}).
6104 A struct type is used directly when it is the type of a variable, member.
6105 Indirect uses arise through pointers to structs.
6106 That is, when use of an incomplete struct is valid, the use is indirect.
6107 An example is
6108 @samp{struct one direct; struct two * indirect;}.
6110 The optional second word limits the specification to
6111 ordinary structs (@samp{ord:}) or generic structs (@samp{gen:}).
6112 Generic structs are a bit complicated to explain.
6113 For C++, these are non-explicit specializations of template classes,
6114 or non-template classes within the above.
6115 Other programming languages have generics,
6116 but @option{-femit-struct-debug-detailed} does not yet implement them.
6118 The third word specifies the source files for those
6119 structs for which the compiler should emit debug information.
6120 The values @samp{none} and @samp{any} have the normal meaning.
6121 The value @samp{base} means that
6122 the base of name of the file in which the type declaration appears
6123 must match the base of the name of the main compilation file.
6124 In practice, this means that when compiling @file{foo.c}, debug information
6125 is generated for types declared in that file and @file{foo.h},
6126 but not other header files.
6127 The value @samp{sys} means those types satisfying @samp{base}
6128 or declared in system or compiler headers.
6130 You may need to experiment to determine the best settings for your application.
6132 The default is @option{-femit-struct-debug-detailed=all}.
6134 This option works only with DWARF debug output.
6136 @item -fno-dwarf2-cfi-asm
6137 @opindex fdwarf2-cfi-asm
6138 @opindex fno-dwarf2-cfi-asm
6139 Emit DWARF unwind info as compiler generated @code{.eh_frame} section
6140 instead of using GAS @code{.cfi_*} directives.
6142 @item -fno-eliminate-unused-debug-types
6143 @opindex feliminate-unused-debug-types
6144 @opindex fno-eliminate-unused-debug-types
6145 Normally, when producing DWARF output, GCC avoids producing debug symbol 
6146 output for types that are nowhere used in the source file being compiled.
6147 Sometimes it is useful to have GCC emit debugging
6148 information for all types declared in a compilation
6149 unit, regardless of whether or not they are actually used
6150 in that compilation unit, for example 
6151 if, in the debugger, you want to cast a value to a type that is
6152 not actually used in your program (but is declared).  More often,
6153 however, this results in a significant amount of wasted space.
6154 @end table
6156 @node Optimize Options
6157 @section Options That Control Optimization
6158 @cindex optimize options
6159 @cindex options, optimization
6161 These options control various sorts of optimizations.
6163 Without any optimization option, the compiler's goal is to reduce the
6164 cost of compilation and to make debugging produce the expected
6165 results.  Statements are independent: if you stop the program with a
6166 breakpoint between statements, you can then assign a new value to any
6167 variable or change the program counter to any other statement in the
6168 function and get exactly the results you expect from the source
6169 code.
6171 Turning on optimization flags makes the compiler attempt to improve
6172 the performance and/or code size at the expense of compilation time
6173 and possibly the ability to debug the program.
6175 The compiler performs optimization based on the knowledge it has of the
6176 program.  Compiling multiple files at once to a single output file mode allows
6177 the compiler to use information gained from all of the files when compiling
6178 each of them.
6180 Not all optimizations are controlled directly by a flag.  Only
6181 optimizations that have a flag are listed in this section.
6183 Most optimizations are only enabled if an @option{-O} level is set on
6184 the command line.  Otherwise they are disabled, even if individual
6185 optimization flags are specified.
6187 Depending on the target and how GCC was configured, a slightly different
6188 set of optimizations may be enabled at each @option{-O} level than
6189 those listed here.  You can invoke GCC with @option{-Q --help=optimizers}
6190 to find out the exact set of optimizations that are enabled at each level.
6191 @xref{Overall Options}, for examples.
6193 @table @gcctabopt
6194 @item -O
6195 @itemx -O1
6196 @opindex O
6197 @opindex O1
6198 Optimize.  Optimizing compilation takes somewhat more time, and a lot
6199 more memory for a large function.
6201 With @option{-O}, the compiler tries to reduce code size and execution
6202 time, without performing any optimizations that take a great deal of
6203 compilation time.
6205 @option{-O} turns on the following optimization flags:
6206 @gccoptlist{
6207 -fauto-inc-dec @gol
6208 -fbranch-count-reg @gol
6209 -fcombine-stack-adjustments @gol
6210 -fcompare-elim @gol
6211 -fcprop-registers @gol
6212 -fdce @gol
6213 -fdefer-pop @gol
6214 -fdelayed-branch @gol
6215 -fdse @gol
6216 -fforward-propagate @gol
6217 -fguess-branch-probability @gol
6218 -fif-conversion2 @gol
6219 -fif-conversion @gol
6220 -finline-functions-called-once @gol
6221 -fipa-pure-const @gol
6222 -fipa-profile @gol
6223 -fipa-reference @gol
6224 -fmerge-constants @gol
6225 -fmove-loop-invariants @gol
6226 -freorder-blocks @gol
6227 -fshrink-wrap @gol
6228 -fsplit-wide-types @gol
6229 -fssa-backprop @gol
6230 -fssa-phiopt @gol
6231 -ftree-bit-ccp @gol
6232 -ftree-ccp @gol
6233 -ftree-ch @gol
6234 -ftree-coalesce-vars @gol
6235 -ftree-copy-prop @gol
6236 -ftree-dce @gol
6237 -ftree-dominator-opts @gol
6238 -ftree-dse @gol
6239 -ftree-forwprop @gol
6240 -ftree-fre @gol
6241 -ftree-phiprop @gol
6242 -ftree-sink @gol
6243 -ftree-slsr @gol
6244 -ftree-sra @gol
6245 -ftree-pta @gol
6246 -ftree-ter @gol
6247 -funit-at-a-time}
6249 @option{-O} also turns on @option{-fomit-frame-pointer} on machines
6250 where doing so does not interfere with debugging.
6252 @item -O2
6253 @opindex O2
6254 Optimize even more.  GCC performs nearly all supported optimizations
6255 that do not involve a space-speed tradeoff.
6256 As compared to @option{-O}, this option increases both compilation time
6257 and the performance of the generated code.
6259 @option{-O2} turns on all optimization flags specified by @option{-O}.  It
6260 also turns on the following optimization flags:
6261 @gccoptlist{-fthread-jumps @gol
6262 -falign-functions  -falign-jumps @gol
6263 -falign-loops  -falign-labels @gol
6264 -fcaller-saves @gol
6265 -fcrossjumping @gol
6266 -fcse-follow-jumps  -fcse-skip-blocks @gol
6267 -fdelete-null-pointer-checks @gol
6268 -fdevirtualize -fdevirtualize-speculatively @gol
6269 -fexpensive-optimizations @gol
6270 -fgcse  -fgcse-lm  @gol
6271 -fhoist-adjacent-loads @gol
6272 -finline-small-functions @gol
6273 -findirect-inlining @gol
6274 -fipa-cp @gol
6275 -fipa-cp-alignment @gol
6276 -fipa-sra @gol
6277 -fipa-icf @gol
6278 -fisolate-erroneous-paths-dereference @gol
6279 -flra-remat @gol
6280 -foptimize-sibling-calls @gol
6281 -foptimize-strlen @gol
6282 -fpartial-inlining @gol
6283 -fpeephole2 @gol
6284 -freorder-blocks-algorithm=stc @gol
6285 -freorder-blocks-and-partition -freorder-functions @gol
6286 -frerun-cse-after-loop  @gol
6287 -fsched-interblock  -fsched-spec @gol
6288 -fschedule-insns  -fschedule-insns2 @gol
6289 -fstrict-aliasing -fstrict-overflow @gol
6290 -ftree-builtin-call-dce @gol
6291 -ftree-switch-conversion -ftree-tail-merge @gol
6292 -ftree-pre @gol
6293 -ftree-vrp @gol
6294 -fipa-ra}
6296 Please note the warning under @option{-fgcse} about
6297 invoking @option{-O2} on programs that use computed gotos.
6299 @item -O3
6300 @opindex O3
6301 Optimize yet more.  @option{-O3} turns on all optimizations specified
6302 by @option{-O2} and also turns on the @option{-finline-functions},
6303 @option{-funswitch-loops}, @option{-fpredictive-commoning},
6304 @option{-fgcse-after-reload}, @option{-ftree-loop-vectorize},
6305 @option{-ftree-loop-distribute-patterns}, @option{-fsplit-paths}
6306 @option{-ftree-slp-vectorize}, @option{-fvect-cost-model},
6307 @option{-ftree-partial-pre} and @option{-fipa-cp-clone} options.
6309 @item -O0
6310 @opindex O0
6311 Reduce compilation time and make debugging produce the expected
6312 results.  This is the default.
6314 @item -Os
6315 @opindex Os
6316 Optimize for size.  @option{-Os} enables all @option{-O2} optimizations that
6317 do not typically increase code size.  It also performs further
6318 optimizations designed to reduce code size.
6320 @option{-Os} disables the following optimization flags:
6321 @gccoptlist{-falign-functions  -falign-jumps  -falign-loops @gol
6322 -falign-labels  -freorder-blocks  -freorder-blocks-algorithm=stc @gol
6323 -freorder-blocks-and-partition  -fprefetch-loop-arrays}
6325 @item -Ofast
6326 @opindex Ofast
6327 Disregard strict standards compliance.  @option{-Ofast} enables all
6328 @option{-O3} optimizations.  It also enables optimizations that are not
6329 valid for all standard-compliant programs.
6330 It turns on @option{-ffast-math} and the Fortran-specific
6331 @option{-fno-protect-parens} and @option{-fstack-arrays}.
6333 @item -Og
6334 @opindex Og
6335 Optimize debugging experience.  @option{-Og} enables optimizations
6336 that do not interfere with debugging. It should be the optimization
6337 level of choice for the standard edit-compile-debug cycle, offering
6338 a reasonable level of optimization while maintaining fast compilation
6339 and a good debugging experience.
6340 @end table
6342 If you use multiple @option{-O} options, with or without level numbers,
6343 the last such option is the one that is effective.
6345 Options of the form @option{-f@var{flag}} specify machine-independent
6346 flags.  Most flags have both positive and negative forms; the negative
6347 form of @option{-ffoo} is @option{-fno-foo}.  In the table
6348 below, only one of the forms is listed---the one you typically 
6349 use.  You can figure out the other form by either removing @samp{no-}
6350 or adding it.
6352 The following options control specific optimizations.  They are either
6353 activated by @option{-O} options or are related to ones that are.  You
6354 can use the following flags in the rare cases when ``fine-tuning'' of
6355 optimizations to be performed is desired.
6357 @table @gcctabopt
6358 @item -fno-defer-pop
6359 @opindex fno-defer-pop
6360 Always pop the arguments to each function call as soon as that function
6361 returns.  For machines that must pop arguments after a function call,
6362 the compiler normally lets arguments accumulate on the stack for several
6363 function calls and pops them all at once.
6365 Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6367 @item -fforward-propagate
6368 @opindex fforward-propagate
6369 Perform a forward propagation pass on RTL@.  The pass tries to combine two
6370 instructions and checks if the result can be simplified.  If loop unrolling
6371 is active, two passes are performed and the second is scheduled after
6372 loop unrolling.
6374 This option is enabled by default at optimization levels @option{-O},
6375 @option{-O2}, @option{-O3}, @option{-Os}.
6377 @item -ffp-contract=@var{style}
6378 @opindex ffp-contract
6379 @option{-ffp-contract=off} disables floating-point expression contraction.
6380 @option{-ffp-contract=fast} enables floating-point expression contraction
6381 such as forming of fused multiply-add operations if the target has
6382 native support for them.
6383 @option{-ffp-contract=on} enables floating-point expression contraction
6384 if allowed by the language standard.  This is currently not implemented
6385 and treated equal to @option{-ffp-contract=off}.
6387 The default is @option{-ffp-contract=fast}.
6389 @item -fomit-frame-pointer
6390 @opindex fomit-frame-pointer
6391 Don't keep the frame pointer in a register for functions that
6392 don't need one.  This avoids the instructions to save, set up and
6393 restore frame pointers; it also makes an extra register available
6394 in many functions.  @strong{It also makes debugging impossible on
6395 some machines.}
6397 On some machines, such as the VAX, this flag has no effect, because
6398 the standard calling sequence automatically handles the frame pointer
6399 and nothing is saved by pretending it doesn't exist.  The
6400 machine-description macro @code{FRAME_POINTER_REQUIRED} controls
6401 whether a target machine supports this flag.  @xref{Registers,,Register
6402 Usage, gccint, GNU Compiler Collection (GCC) Internals}.
6404 The default setting (when not optimizing for
6405 size) for 32-bit GNU/Linux x86 and 32-bit Darwin x86 targets is
6406 @option{-fomit-frame-pointer}.  You can configure GCC with the
6407 @option{--enable-frame-pointer} configure option to change the default.
6409 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6411 @item -foptimize-sibling-calls
6412 @opindex foptimize-sibling-calls
6413 Optimize sibling and tail recursive calls.
6415 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6417 @item -foptimize-strlen
6418 @opindex foptimize-strlen
6419 Optimize various standard C string functions (e.g. @code{strlen},
6420 @code{strchr} or @code{strcpy}) and
6421 their @code{_FORTIFY_SOURCE} counterparts into faster alternatives.
6423 Enabled at levels @option{-O2}, @option{-O3}.
6425 @item -fno-inline
6426 @opindex fno-inline
6427 Do not expand any functions inline apart from those marked with
6428 the @code{always_inline} attribute.  This is the default when not
6429 optimizing.
6431 Single functions can be exempted from inlining by marking them
6432 with the @code{noinline} attribute.
6434 @item -finline-small-functions
6435 @opindex finline-small-functions
6436 Integrate functions into their callers when their body is smaller than expected
6437 function call code (so overall size of program gets smaller).  The compiler
6438 heuristically decides which functions are simple enough to be worth integrating
6439 in this way.  This inlining applies to all functions, even those not declared
6440 inline.
6442 Enabled at level @option{-O2}.
6444 @item -findirect-inlining
6445 @opindex findirect-inlining
6446 Inline also indirect calls that are discovered to be known at compile
6447 time thanks to previous inlining.  This option has any effect only
6448 when inlining itself is turned on by the @option{-finline-functions}
6449 or @option{-finline-small-functions} options.
6451 Enabled at level @option{-O2}.
6453 @item -finline-functions
6454 @opindex finline-functions
6455 Consider all functions for inlining, even if they are not declared inline.
6456 The compiler heuristically decides which functions are worth integrating
6457 in this way.
6459 If all calls to a given function are integrated, and the function is
6460 declared @code{static}, then the function is normally not output as
6461 assembler code in its own right.
6463 Enabled at level @option{-O3}.
6465 @item -finline-functions-called-once
6466 @opindex finline-functions-called-once
6467 Consider all @code{static} functions called once for inlining into their
6468 caller even if they are not marked @code{inline}.  If a call to a given
6469 function is integrated, then the function is not output as assembler code
6470 in its own right.
6472 Enabled at levels @option{-O1}, @option{-O2}, @option{-O3} and @option{-Os}.
6474 @item -fearly-inlining
6475 @opindex fearly-inlining
6476 Inline functions marked by @code{always_inline} and functions whose body seems
6477 smaller than the function call overhead early before doing
6478 @option{-fprofile-generate} instrumentation and real inlining pass.  Doing so
6479 makes profiling significantly cheaper and usually inlining faster on programs
6480 having large chains of nested wrapper functions.
6482 Enabled by default.
6484 @item -fipa-sra
6485 @opindex fipa-sra
6486 Perform interprocedural scalar replacement of aggregates, removal of
6487 unused parameters and replacement of parameters passed by reference
6488 by parameters passed by value.
6490 Enabled at levels @option{-O2}, @option{-O3} and @option{-Os}.
6492 @item -finline-limit=@var{n}
6493 @opindex finline-limit
6494 By default, GCC limits the size of functions that can be inlined.  This flag
6495 allows coarse control of this limit.  @var{n} is the size of functions that
6496 can be inlined in number of pseudo instructions.
6498 Inlining is actually controlled by a number of parameters, which may be
6499 specified individually by using @option{--param @var{name}=@var{value}}.
6500 The @option{-finline-limit=@var{n}} option sets some of these parameters
6501 as follows:
6503 @table @gcctabopt
6504 @item max-inline-insns-single
6505 is set to @var{n}/2.
6506 @item max-inline-insns-auto
6507 is set to @var{n}/2.
6508 @end table
6510 See below for a documentation of the individual
6511 parameters controlling inlining and for the defaults of these parameters.
6513 @emph{Note:} there may be no value to @option{-finline-limit} that results
6514 in default behavior.
6516 @emph{Note:} pseudo instruction represents, in this particular context, an
6517 abstract measurement of function's size.  In no way does it represent a count
6518 of assembly instructions and as such its exact meaning might change from one
6519 release to an another.
6521 @item -fno-keep-inline-dllexport
6522 @opindex fno-keep-inline-dllexport
6523 This is a more fine-grained version of @option{-fkeep-inline-functions},
6524 which applies only to functions that are declared using the @code{dllexport}
6525 attribute or declspec (@xref{Function Attributes,,Declaring Attributes of
6526 Functions}.)
6528 @item -fkeep-inline-functions
6529 @opindex fkeep-inline-functions
6530 In C, emit @code{static} functions that are declared @code{inline}
6531 into the object file, even if the function has been inlined into all
6532 of its callers.  This switch does not affect functions using the
6533 @code{extern inline} extension in GNU C90@.  In C++, emit any and all
6534 inline functions into the object file.
6536 @item -fkeep-static-functions
6537 @opindex fkeep-static-functions
6538 Emit @code{static} functions into the object file, even if the function
6539 is never used.
6541 @item -fkeep-static-consts
6542 @opindex fkeep-static-consts
6543 Emit variables declared @code{static const} when optimization isn't turned
6544 on, even if the variables aren't referenced.
6546 GCC enables this option by default.  If you want to force the compiler to
6547 check if a variable is referenced, regardless of whether or not
6548 optimization is turned on, use the @option{-fno-keep-static-consts} option.
6550 @item -fmerge-constants
6551 @opindex fmerge-constants
6552 Attempt to merge identical constants (string constants and floating-point
6553 constants) across compilation units.
6555 This option is the default for optimized compilation if the assembler and
6556 linker support it.  Use @option{-fno-merge-constants} to inhibit this
6557 behavior.
6559 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6561 @item -fmerge-all-constants
6562 @opindex fmerge-all-constants
6563 Attempt to merge identical constants and identical variables.
6565 This option implies @option{-fmerge-constants}.  In addition to
6566 @option{-fmerge-constants} this considers e.g.@: even constant initialized
6567 arrays or initialized constant variables with integral or floating-point
6568 types.  Languages like C or C++ require each variable, including multiple
6569 instances of the same variable in recursive calls, to have distinct locations,
6570 so using this option results in non-conforming
6571 behavior.
6573 @item -fmodulo-sched
6574 @opindex fmodulo-sched
6575 Perform swing modulo scheduling immediately before the first scheduling
6576 pass.  This pass looks at innermost loops and reorders their
6577 instructions by overlapping different iterations.
6579 @item -fmodulo-sched-allow-regmoves
6580 @opindex fmodulo-sched-allow-regmoves
6581 Perform more aggressive SMS-based modulo scheduling with register moves
6582 allowed.  By setting this flag certain anti-dependences edges are
6583 deleted, which triggers the generation of reg-moves based on the
6584 life-range analysis.  This option is effective only with
6585 @option{-fmodulo-sched} enabled.
6587 @item -fno-branch-count-reg
6588 @opindex fno-branch-count-reg
6589 Avoid running a pass scanning for opportunities to use ``decrement and
6590 branch'' instructions on a count register instead of generating sequences
6591 of instructions that decrement a register, compare it against zero, and
6592 then branch based upon the result.  This option is only meaningful on
6593 architectures that support such instructions, which include x86, PowerPC,
6594 IA-64 and S/390.  Note that the @option{-fno-branch-count-reg} option
6595 doesn't remove the decrement and branch instructions from the generated
6596 instruction stream introduced by other optimization passes.
6598 Enabled by default at @option{-O1} and higher.
6600 The default is @option{-fbranch-count-reg}.
6602 @item -fno-function-cse
6603 @opindex fno-function-cse
6604 Do not put function addresses in registers; make each instruction that
6605 calls a constant function contain the function's address explicitly.
6607 This option results in less efficient code, but some strange hacks
6608 that alter the assembler output may be confused by the optimizations
6609 performed when this option is not used.
6611 The default is @option{-ffunction-cse}
6613 @item -fno-zero-initialized-in-bss
6614 @opindex fno-zero-initialized-in-bss
6615 If the target supports a BSS section, GCC by default puts variables that
6616 are initialized to zero into BSS@.  This can save space in the resulting
6617 code.
6619 This option turns off this behavior because some programs explicitly
6620 rely on variables going to the data section---e.g., so that the
6621 resulting executable can find the beginning of that section and/or make
6622 assumptions based on that.
6624 The default is @option{-fzero-initialized-in-bss}.
6626 @item -fthread-jumps
6627 @opindex fthread-jumps
6628 Perform optimizations that check to see if a jump branches to a
6629 location where another comparison subsumed by the first is found.  If
6630 so, the first branch is redirected to either the destination of the
6631 second branch or a point immediately following it, depending on whether
6632 the condition is known to be true or false.
6634 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6636 @item -fsplit-wide-types
6637 @opindex fsplit-wide-types
6638 When using a type that occupies multiple registers, such as @code{long
6639 long} on a 32-bit system, split the registers apart and allocate them
6640 independently.  This normally generates better code for those types,
6641 but may make debugging more difficult.
6643 Enabled at levels @option{-O}, @option{-O2}, @option{-O3},
6644 @option{-Os}.
6646 @item -fcse-follow-jumps
6647 @opindex fcse-follow-jumps
6648 In common subexpression elimination (CSE), scan through jump instructions
6649 when the target of the jump is not reached by any other path.  For
6650 example, when CSE encounters an @code{if} statement with an
6651 @code{else} clause, CSE follows the jump when the condition
6652 tested is false.
6654 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6656 @item -fcse-skip-blocks
6657 @opindex fcse-skip-blocks
6658 This is similar to @option{-fcse-follow-jumps}, but causes CSE to
6659 follow jumps that conditionally skip over blocks.  When CSE
6660 encounters a simple @code{if} statement with no else clause,
6661 @option{-fcse-skip-blocks} causes CSE to follow the jump around the
6662 body of the @code{if}.
6664 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6666 @item -frerun-cse-after-loop
6667 @opindex frerun-cse-after-loop
6668 Re-run common subexpression elimination after loop optimizations are
6669 performed.
6671 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6673 @item -fgcse
6674 @opindex fgcse
6675 Perform a global common subexpression elimination pass.
6676 This pass also performs global constant and copy propagation.
6678 @emph{Note:} When compiling a program using computed gotos, a GCC
6679 extension, you may get better run-time performance if you disable
6680 the global common subexpression elimination pass by adding
6681 @option{-fno-gcse} to the command line.
6683 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6685 @item -fgcse-lm
6686 @opindex fgcse-lm
6687 When @option{-fgcse-lm} is enabled, global common subexpression elimination
6688 attempts to move loads that are only killed by stores into themselves.  This
6689 allows a loop containing a load/store sequence to be changed to a load outside
6690 the loop, and a copy/store within the loop.
6692 Enabled by default when @option{-fgcse} is enabled.
6694 @item -fgcse-sm
6695 @opindex fgcse-sm
6696 When @option{-fgcse-sm} is enabled, a store motion pass is run after
6697 global common subexpression elimination.  This pass attempts to move
6698 stores out of loops.  When used in conjunction with @option{-fgcse-lm},
6699 loops containing a load/store sequence can be changed to a load before
6700 the loop and a store after the loop.
6702 Not enabled at any optimization level.
6704 @item -fgcse-las
6705 @opindex fgcse-las
6706 When @option{-fgcse-las} is enabled, the global common subexpression
6707 elimination pass eliminates redundant loads that come after stores to the
6708 same memory location (both partial and full redundancies).
6710 Not enabled at any optimization level.
6712 @item -fgcse-after-reload
6713 @opindex fgcse-after-reload
6714 When @option{-fgcse-after-reload} is enabled, a redundant load elimination
6715 pass is performed after reload.  The purpose of this pass is to clean up
6716 redundant spilling.
6718 @item -faggressive-loop-optimizations
6719 @opindex faggressive-loop-optimizations
6720 This option tells the loop optimizer to use language constraints to
6721 derive bounds for the number of iterations of a loop.  This assumes that
6722 loop code does not invoke undefined behavior by for example causing signed
6723 integer overflows or out-of-bound array accesses.  The bounds for the
6724 number of iterations of a loop are used to guide loop unrolling and peeling
6725 and loop exit test optimizations.
6726 This option is enabled by default.
6728 @item -funsafe-loop-optimizations
6729 @opindex funsafe-loop-optimizations
6730 This option tells the loop optimizer to assume that loop indices do not
6731 overflow, and that loops with nontrivial exit condition are not
6732 infinite.  This enables a wider range of loop optimizations even if
6733 the loop optimizer itself cannot prove that these assumptions are valid.
6734 If you use @option{-Wunsafe-loop-optimizations}, the compiler warns you
6735 if it finds this kind of loop.
6737 @item -funconstrained-commons
6738 @opindex funconstrained-commons
6739 This option tells the compiler that variables declared in common blocks
6740 (e.g. Fortran) may later be overridden with longer trailing arrays. This
6741 prevents certain optimizations that depend on knowing the array bounds.
6743 @item -fcrossjumping
6744 @opindex fcrossjumping
6745 Perform cross-jumping transformation.
6746 This transformation unifies equivalent code and saves code size.  The
6747 resulting code may or may not perform better than without cross-jumping.
6749 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6751 @item -fauto-inc-dec
6752 @opindex fauto-inc-dec
6753 Combine increments or decrements of addresses with memory accesses.
6754 This pass is always skipped on architectures that do not have
6755 instructions to support this.  Enabled by default at @option{-O} and
6756 higher on architectures that support this.
6758 @item -fdce
6759 @opindex fdce
6760 Perform dead code elimination (DCE) on RTL@.
6761 Enabled by default at @option{-O} and higher.
6763 @item -fdse
6764 @opindex fdse
6765 Perform dead store elimination (DSE) on RTL@.
6766 Enabled by default at @option{-O} and higher.
6768 @item -fif-conversion
6769 @opindex fif-conversion
6770 Attempt to transform conditional jumps into branch-less equivalents.  This
6771 includes use of conditional moves, min, max, set flags and abs instructions, and
6772 some tricks doable by standard arithmetics.  The use of conditional execution
6773 on chips where it is available is controlled by @option{-fif-conversion2}.
6775 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6777 @item -fif-conversion2
6778 @opindex fif-conversion2
6779 Use conditional execution (where available) to transform conditional jumps into
6780 branch-less equivalents.
6782 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6784 @item -fdeclone-ctor-dtor
6785 @opindex fdeclone-ctor-dtor
6786 The C++ ABI requires multiple entry points for constructors and
6787 destructors: one for a base subobject, one for a complete object, and
6788 one for a virtual destructor that calls operator delete afterwards.
6789 For a hierarchy with virtual bases, the base and complete variants are
6790 clones, which means two copies of the function.  With this option, the
6791 base and complete variants are changed to be thunks that call a common
6792 implementation.
6794 Enabled by @option{-Os}.
6796 @item -fdelete-null-pointer-checks
6797 @opindex fdelete-null-pointer-checks
6798 Assume that programs cannot safely dereference null pointers, and that
6799 no code or data element resides at address zero.
6800 This option enables simple constant
6801 folding optimizations at all optimization levels.  In addition, other
6802 optimization passes in GCC use this flag to control global dataflow
6803 analyses that eliminate useless checks for null pointers; these assume
6804 that a memory access to address zero always results in a trap, so
6805 that if a pointer is checked after it has already been dereferenced,
6806 it cannot be null.
6808 Note however that in some environments this assumption is not true.
6809 Use @option{-fno-delete-null-pointer-checks} to disable this optimization
6810 for programs that depend on that behavior.
6812 This option is enabled by default on most targets.  On Nios II ELF, it
6813 defaults to off.  On AVR and CR16, this option is completely disabled.  
6815 Passes that use the dataflow information
6816 are enabled independently at different optimization levels.
6818 @item -fdevirtualize
6819 @opindex fdevirtualize
6820 Attempt to convert calls to virtual functions to direct calls.  This
6821 is done both within a procedure and interprocedurally as part of
6822 indirect inlining (@option{-findirect-inlining}) and interprocedural constant
6823 propagation (@option{-fipa-cp}).
6824 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6826 @item -fdevirtualize-speculatively
6827 @opindex fdevirtualize-speculatively
6828 Attempt to convert calls to virtual functions to speculative direct calls.
6829 Based on the analysis of the type inheritance graph, determine for a given call
6830 the set of likely targets. If the set is small, preferably of size 1, change
6831 the call into a conditional deciding between direct and indirect calls.  The
6832 speculative calls enable more optimizations, such as inlining.  When they seem
6833 useless after further optimization, they are converted back into original form.
6835 @item -fdevirtualize-at-ltrans
6836 @opindex fdevirtualize-at-ltrans
6837 Stream extra information needed for aggressive devirtualization when running
6838 the link-time optimizer in local transformation mode.  
6839 This option enables more devirtualization but
6840 significantly increases the size of streamed data. For this reason it is
6841 disabled by default.
6843 @item -fexpensive-optimizations
6844 @opindex fexpensive-optimizations
6845 Perform a number of minor optimizations that are relatively expensive.
6847 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6849 @item -free
6850 @opindex free
6851 Attempt to remove redundant extension instructions.  This is especially
6852 helpful for the x86-64 architecture, which implicitly zero-extends in 64-bit
6853 registers after writing to their lower 32-bit half.
6855 Enabled for Alpha, AArch64 and x86 at levels @option{-O2},
6856 @option{-O3}, @option{-Os}.
6858 @item -fno-lifetime-dse
6859 @opindex fno-lifetime-dse
6860 In C++ the value of an object is only affected by changes within its
6861 lifetime: when the constructor begins, the object has an indeterminate
6862 value, and any changes during the lifetime of the object are dead when
6863 the object is destroyed.  Normally dead store elimination will take
6864 advantage of this; if your code relies on the value of the object
6865 storage persisting beyond the lifetime of the object, you can use this
6866 flag to disable this optimization.  To preserve stores before the
6867 constructor starts (e.g. because your operator new clears the object
6868 storage) but still treat the object as dead after the destructor you,
6869 can use @option{-flifetime-dse=1}.  The default behavior can be
6870 explicitly selected with @option{-flifetime-dse=2}.
6871 @option{-flifetime-dse=0} is equivalent to @option{-fno-lifetime-dse}.
6873 @item -flive-range-shrinkage
6874 @opindex flive-range-shrinkage
6875 Attempt to decrease register pressure through register live range
6876 shrinkage.  This is helpful for fast processors with small or moderate
6877 size register sets.
6879 @item -fira-algorithm=@var{algorithm}
6880 @opindex fira-algorithm
6881 Use the specified coloring algorithm for the integrated register
6882 allocator.  The @var{algorithm} argument can be @samp{priority}, which
6883 specifies Chow's priority coloring, or @samp{CB}, which specifies
6884 Chaitin-Briggs coloring.  Chaitin-Briggs coloring is not implemented
6885 for all architectures, but for those targets that do support it, it is
6886 the default because it generates better code.
6888 @item -fira-region=@var{region}
6889 @opindex fira-region
6890 Use specified regions for the integrated register allocator.  The
6891 @var{region} argument should be one of the following:
6893 @table @samp
6895 @item all
6896 Use all loops as register allocation regions.
6897 This can give the best results for machines with a small and/or
6898 irregular register set.
6900 @item mixed
6901 Use all loops except for loops with small register pressure 
6902 as the regions.  This value usually gives
6903 the best results in most cases and for most architectures,
6904 and is enabled by default when compiling with optimization for speed
6905 (@option{-O}, @option{-O2}, @dots{}).
6907 @item one
6908 Use all functions as a single region.  
6909 This typically results in the smallest code size, and is enabled by default for
6910 @option{-Os} or @option{-O0}.
6912 @end table
6914 @item -fira-hoist-pressure
6915 @opindex fira-hoist-pressure
6916 Use IRA to evaluate register pressure in the code hoisting pass for
6917 decisions to hoist expressions.  This option usually results in smaller
6918 code, but it can slow the compiler down.
6920 This option is enabled at level @option{-Os} for all targets.
6922 @item -fira-loop-pressure
6923 @opindex fira-loop-pressure
6924 Use IRA to evaluate register pressure in loops for decisions to move
6925 loop invariants.  This option usually results in generation
6926 of faster and smaller code on machines with large register files (>= 32
6927 registers), but it can slow the compiler down.
6929 This option is enabled at level @option{-O3} for some targets.
6931 @item -fno-ira-share-save-slots
6932 @opindex fno-ira-share-save-slots
6933 Disable sharing of stack slots used for saving call-used hard
6934 registers living through a call.  Each hard register gets a
6935 separate stack slot, and as a result function stack frames are
6936 larger.
6938 @item -fno-ira-share-spill-slots
6939 @opindex fno-ira-share-spill-slots
6940 Disable sharing of stack slots allocated for pseudo-registers.  Each
6941 pseudo-register that does not get a hard register gets a separate
6942 stack slot, and as a result function stack frames are larger.
6944 @item -flra-remat
6945 @opindex flra-remat
6946 Enable CFG-sensitive rematerialization in LRA.  Instead of loading
6947 values of spilled pseudos, LRA tries to rematerialize (recalculate)
6948 values if it is profitable.
6950 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6952 @item -fdelayed-branch
6953 @opindex fdelayed-branch
6954 If supported for the target machine, attempt to reorder instructions
6955 to exploit instruction slots available after delayed branch
6956 instructions.
6958 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
6960 @item -fschedule-insns
6961 @opindex fschedule-insns
6962 If supported for the target machine, attempt to reorder instructions to
6963 eliminate execution stalls due to required data being unavailable.  This
6964 helps machines that have slow floating point or memory load instructions
6965 by allowing other instructions to be issued until the result of the load
6966 or floating-point instruction is required.
6968 Enabled at levels @option{-O2}, @option{-O3}.
6970 @item -fschedule-insns2
6971 @opindex fschedule-insns2
6972 Similar to @option{-fschedule-insns}, but requests an additional pass of
6973 instruction scheduling after register allocation has been done.  This is
6974 especially useful on machines with a relatively small number of
6975 registers and where memory load instructions take more than one cycle.
6977 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
6979 @item -fno-sched-interblock
6980 @opindex fno-sched-interblock
6981 Don't schedule instructions across basic blocks.  This is normally
6982 enabled by default when scheduling before register allocation, i.e.@:
6983 with @option{-fschedule-insns} or at @option{-O2} or higher.
6985 @item -fno-sched-spec
6986 @opindex fno-sched-spec
6987 Don't allow speculative motion of non-load instructions.  This is normally
6988 enabled by default when scheduling before register allocation, i.e.@:
6989 with @option{-fschedule-insns} or at @option{-O2} or higher.
6991 @item -fsched-pressure
6992 @opindex fsched-pressure
6993 Enable register pressure sensitive insn scheduling before register
6994 allocation.  This only makes sense when scheduling before register
6995 allocation is enabled, i.e.@: with @option{-fschedule-insns} or at
6996 @option{-O2} or higher.  Usage of this option can improve the
6997 generated code and decrease its size by preventing register pressure
6998 increase above the number of available hard registers and subsequent
6999 spills in register allocation.
7001 @item -fsched-spec-load
7002 @opindex fsched-spec-load
7003 Allow speculative motion of some load instructions.  This only makes
7004 sense when scheduling before register allocation, i.e.@: with
7005 @option{-fschedule-insns} or at @option{-O2} or higher.
7007 @item -fsched-spec-load-dangerous
7008 @opindex fsched-spec-load-dangerous
7009 Allow speculative motion of more load instructions.  This only makes
7010 sense when scheduling before register allocation, i.e.@: with
7011 @option{-fschedule-insns} or at @option{-O2} or higher.
7013 @item -fsched-stalled-insns
7014 @itemx -fsched-stalled-insns=@var{n}
7015 @opindex fsched-stalled-insns
7016 Define how many insns (if any) can be moved prematurely from the queue
7017 of stalled insns into the ready list during the second scheduling pass.
7018 @option{-fno-sched-stalled-insns} means that no insns are moved
7019 prematurely, @option{-fsched-stalled-insns=0} means there is no limit
7020 on how many queued insns can be moved prematurely.
7021 @option{-fsched-stalled-insns} without a value is equivalent to
7022 @option{-fsched-stalled-insns=1}.
7024 @item -fsched-stalled-insns-dep
7025 @itemx -fsched-stalled-insns-dep=@var{n}
7026 @opindex fsched-stalled-insns-dep
7027 Define how many insn groups (cycles) are examined for a dependency
7028 on a stalled insn that is a candidate for premature removal from the queue
7029 of stalled insns.  This has an effect only during the second scheduling pass,
7030 and only if @option{-fsched-stalled-insns} is used.
7031 @option{-fno-sched-stalled-insns-dep} is equivalent to
7032 @option{-fsched-stalled-insns-dep=0}.
7033 @option{-fsched-stalled-insns-dep} without a value is equivalent to
7034 @option{-fsched-stalled-insns-dep=1}.
7036 @item -fsched2-use-superblocks
7037 @opindex fsched2-use-superblocks
7038 When scheduling after register allocation, use superblock scheduling.
7039 This allows motion across basic block boundaries,
7040 resulting in faster schedules.  This option is experimental, as not all machine
7041 descriptions used by GCC model the CPU closely enough to avoid unreliable
7042 results from the algorithm.
7044 This only makes sense when scheduling after register allocation, i.e.@: with
7045 @option{-fschedule-insns2} or at @option{-O2} or higher.
7047 @item -fsched-group-heuristic
7048 @opindex fsched-group-heuristic
7049 Enable the group heuristic in the scheduler.  This heuristic favors
7050 the instruction that belongs to a schedule group.  This is enabled
7051 by default when scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7052 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7054 @item -fsched-critical-path-heuristic
7055 @opindex fsched-critical-path-heuristic
7056 Enable the critical-path heuristic in the scheduler.  This heuristic favors
7057 instructions on the critical path.  This is enabled by default when
7058 scheduling is enabled, i.e.@: with @option{-fschedule-insns}
7059 or @option{-fschedule-insns2} or at @option{-O2} or higher.
7061 @item -fsched-spec-insn-heuristic
7062 @opindex fsched-spec-insn-heuristic
7063 Enable the speculative instruction heuristic in the scheduler.  This
7064 heuristic favors speculative instructions with greater dependency weakness.
7065 This is enabled by default when scheduling is enabled, i.e.@:
7066 with @option{-fschedule-insns} or @option{-fschedule-insns2}
7067 or at @option{-O2} or higher.
7069 @item -fsched-rank-heuristic
7070 @opindex fsched-rank-heuristic
7071 Enable the rank heuristic in the scheduler.  This heuristic favors
7072 the instruction belonging to a basic block with greater size or frequency.
7073 This is enabled by default when scheduling is enabled, i.e.@:
7074 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7075 at @option{-O2} or higher.
7077 @item -fsched-last-insn-heuristic
7078 @opindex fsched-last-insn-heuristic
7079 Enable the last-instruction heuristic in the scheduler.  This heuristic
7080 favors the instruction that is less dependent on the last instruction
7081 scheduled.  This is enabled by default when scheduling is enabled,
7082 i.e.@: with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7083 at @option{-O2} or higher.
7085 @item -fsched-dep-count-heuristic
7086 @opindex fsched-dep-count-heuristic
7087 Enable the dependent-count heuristic in the scheduler.  This heuristic
7088 favors the instruction that has more instructions depending on it.
7089 This is enabled by default when scheduling is enabled, i.e.@:
7090 with @option{-fschedule-insns} or @option{-fschedule-insns2} or
7091 at @option{-O2} or higher.
7093 @item -freschedule-modulo-scheduled-loops
7094 @opindex freschedule-modulo-scheduled-loops
7095 Modulo scheduling is performed before traditional scheduling.  If a loop
7096 is modulo scheduled, later scheduling passes may change its schedule.  
7097 Use this option to control that behavior.
7099 @item -fselective-scheduling
7100 @opindex fselective-scheduling
7101 Schedule instructions using selective scheduling algorithm.  Selective
7102 scheduling runs instead of the first scheduler pass.
7104 @item -fselective-scheduling2
7105 @opindex fselective-scheduling2
7106 Schedule instructions using selective scheduling algorithm.  Selective
7107 scheduling runs instead of the second scheduler pass.
7109 @item -fsel-sched-pipelining
7110 @opindex fsel-sched-pipelining
7111 Enable software pipelining of innermost loops during selective scheduling.
7112 This option has no effect unless one of @option{-fselective-scheduling} or
7113 @option{-fselective-scheduling2} is turned on.
7115 @item -fsel-sched-pipelining-outer-loops
7116 @opindex fsel-sched-pipelining-outer-loops
7117 When pipelining loops during selective scheduling, also pipeline outer loops.
7118 This option has no effect unless @option{-fsel-sched-pipelining} is turned on.
7120 @item -fsemantic-interposition
7121 @opindex fsemantic-interposition
7122 Some object formats, like ELF, allow interposing of symbols by the 
7123 dynamic linker.
7124 This means that for symbols exported from the DSO, the compiler cannot perform
7125 interprocedural propagation, inlining and other optimizations in anticipation
7126 that the function or variable in question may change. While this feature is
7127 useful, for example, to rewrite memory allocation functions by a debugging
7128 implementation, it is expensive in the terms of code quality.
7129 With @option{-fno-semantic-interposition} the compiler assumes that 
7130 if interposition happens for functions the overwriting function will have 
7131 precisely the same semantics (and side effects). 
7132 Similarly if interposition happens
7133 for variables, the constructor of the variable will be the same. The flag
7134 has no effect for functions explicitly declared inline 
7135 (where it is never allowed for interposition to change semantics) 
7136 and for symbols explicitly declared weak.
7138 @item -fshrink-wrap
7139 @opindex fshrink-wrap
7140 Emit function prologues only before parts of the function that need it,
7141 rather than at the top of the function.  This flag is enabled by default at
7142 @option{-O} and higher.
7144 @item -fcaller-saves
7145 @opindex fcaller-saves
7146 Enable allocation of values to registers that are clobbered by
7147 function calls, by emitting extra instructions to save and restore the
7148 registers around such calls.  Such allocation is done only when it
7149 seems to result in better code.
7151 This option is always enabled by default on certain machines, usually
7152 those which have no call-preserved registers to use instead.
7154 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7156 @item -fcombine-stack-adjustments
7157 @opindex fcombine-stack-adjustments
7158 Tracks stack adjustments (pushes and pops) and stack memory references
7159 and then tries to find ways to combine them.
7161 Enabled by default at @option{-O1} and higher.
7163 @item -fipa-ra
7164 @opindex fipa-ra
7165 Use caller save registers for allocation if those registers are not used by
7166 any called function.  In that case it is not necessary to save and restore
7167 them around calls.  This is only possible if called functions are part of
7168 same compilation unit as current function and they are compiled before it.
7170 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7172 @item -fconserve-stack
7173 @opindex fconserve-stack
7174 Attempt to minimize stack usage.  The compiler attempts to use less
7175 stack space, even if that makes the program slower.  This option
7176 implies setting the @option{large-stack-frame} parameter to 100
7177 and the @option{large-stack-frame-growth} parameter to 400.
7179 @item -ftree-reassoc
7180 @opindex ftree-reassoc
7181 Perform reassociation on trees.  This flag is enabled by default
7182 at @option{-O} and higher.
7184 @item -ftree-pre
7185 @opindex ftree-pre
7186 Perform partial redundancy elimination (PRE) on trees.  This flag is
7187 enabled by default at @option{-O2} and @option{-O3}.
7189 @item -ftree-partial-pre
7190 @opindex ftree-partial-pre
7191 Make partial redundancy elimination (PRE) more aggressive.  This flag is
7192 enabled by default at @option{-O3}.
7194 @item -ftree-forwprop
7195 @opindex ftree-forwprop
7196 Perform forward propagation on trees.  This flag is enabled by default
7197 at @option{-O} and higher.
7199 @item -ftree-fre
7200 @opindex ftree-fre
7201 Perform full redundancy elimination (FRE) on trees.  The difference
7202 between FRE and PRE is that FRE only considers expressions
7203 that are computed on all paths leading to the redundant computation.
7204 This analysis is faster than PRE, though it exposes fewer redundancies.
7205 This flag is enabled by default at @option{-O} and higher.
7207 @item -ftree-phiprop
7208 @opindex ftree-phiprop
7209 Perform hoisting of loads from conditional pointers on trees.  This
7210 pass is enabled by default at @option{-O} and higher.
7212 @item -fhoist-adjacent-loads
7213 @opindex fhoist-adjacent-loads
7214 Speculatively hoist loads from both branches of an if-then-else if the
7215 loads are from adjacent locations in the same structure and the target
7216 architecture has a conditional move instruction.  This flag is enabled
7217 by default at @option{-O2} and higher.
7219 @item -ftree-copy-prop
7220 @opindex ftree-copy-prop
7221 Perform copy propagation on trees.  This pass eliminates unnecessary
7222 copy operations.  This flag is enabled by default at @option{-O} and
7223 higher.
7225 @item -fipa-pure-const
7226 @opindex fipa-pure-const
7227 Discover which functions are pure or constant.
7228 Enabled by default at @option{-O} and higher.
7230 @item -fipa-reference
7231 @opindex fipa-reference
7232 Discover which static variables do not escape the
7233 compilation unit.
7234 Enabled by default at @option{-O} and higher.
7236 @item -fipa-pta
7237 @opindex fipa-pta
7238 Perform interprocedural pointer analysis and interprocedural modification
7239 and reference analysis.  This option can cause excessive memory and
7240 compile-time usage on large compilation units.  It is not enabled by
7241 default at any optimization level.
7243 @item -fipa-profile
7244 @opindex fipa-profile
7245 Perform interprocedural profile propagation.  The functions called only from
7246 cold functions are marked as cold. Also functions executed once (such as
7247 @code{cold}, @code{noreturn}, static constructors or destructors) are identified. Cold
7248 functions and loop less parts of functions executed once are then optimized for
7249 size.
7250 Enabled by default at @option{-O} and higher.
7252 @item -fipa-cp
7253 @opindex fipa-cp
7254 Perform interprocedural constant propagation.
7255 This optimization analyzes the program to determine when values passed
7256 to functions are constants and then optimizes accordingly.
7257 This optimization can substantially increase performance
7258 if the application has constants passed to functions.
7259 This flag is enabled by default at @option{-O2}, @option{-Os} and @option{-O3}.
7261 @item -fipa-cp-clone
7262 @opindex fipa-cp-clone
7263 Perform function cloning to make interprocedural constant propagation stronger.
7264 When enabled, interprocedural constant propagation performs function cloning
7265 when externally visible function can be called with constant arguments.
7266 Because this optimization can create multiple copies of functions,
7267 it may significantly increase code size
7268 (see @option{--param ipcp-unit-growth=@var{value}}).
7269 This flag is enabled by default at @option{-O3}.
7271 @item -fipa-cp-alignment
7272 @opindex -fipa-cp-alignment
7273 When enabled, this optimization propagates alignment of function
7274 parameters to support better vectorization and string operations.
7276 This flag is enabled by default at @option{-O2} and @option{-Os}.  It
7277 requires that @option{-fipa-cp} is enabled.
7279 @item -fipa-icf
7280 @opindex fipa-icf
7281 Perform Identical Code Folding for functions and read-only variables.
7282 The optimization reduces code size and may disturb unwind stacks by replacing
7283 a function by equivalent one with a different name. The optimization works
7284 more effectively with link time optimization enabled.
7286 Nevertheless the behavior is similar to Gold Linker ICF optimization, GCC ICF
7287 works on different levels and thus the optimizations are not same - there are
7288 equivalences that are found only by GCC and equivalences found only by Gold.
7290 This flag is enabled by default at @option{-O2} and @option{-Os}.
7292 @item -fisolate-erroneous-paths-dereference
7293 @opindex fisolate-erroneous-paths-dereference
7294 Detect paths that trigger erroneous or undefined behavior due to
7295 dereferencing a null pointer.  Isolate those paths from the main control
7296 flow and turn the statement with erroneous or undefined behavior into a trap.
7297 This flag is enabled by default at @option{-O2} and higher and depends on
7298 @option{-fdelete-null-pointer-checks} also being enabled.
7300 @item -fisolate-erroneous-paths-attribute
7301 @opindex fisolate-erroneous-paths-attribute
7302 Detect paths that trigger erroneous or undefined behavior due a null value
7303 being used in a way forbidden by a @code{returns_nonnull} or @code{nonnull}
7304 attribute.  Isolate those paths from the main control flow and turn the
7305 statement with erroneous or undefined behavior into a trap.  This is not
7306 currently enabled, but may be enabled by @option{-O2} in the future.
7308 @item -ftree-sink
7309 @opindex ftree-sink
7310 Perform forward store motion on trees.  This flag is
7311 enabled by default at @option{-O} and higher.
7313 @item -ftree-bit-ccp
7314 @opindex ftree-bit-ccp
7315 Perform sparse conditional bit constant propagation on trees and propagate
7316 pointer alignment information.
7317 This pass only operates on local scalar variables and is enabled by default
7318 at @option{-O} and higher.  It requires that @option{-ftree-ccp} is enabled.
7320 @item -ftree-ccp
7321 @opindex ftree-ccp
7322 Perform sparse conditional constant propagation (CCP) on trees.  This
7323 pass only operates on local scalar variables and is enabled by default
7324 at @option{-O} and higher.
7326 @item -fssa-backprop
7327 @opindex fssa-backprop
7328 Propagate information about uses of a value up the definition chain
7329 in order to simplify the definitions.  For example, this pass strips
7330 sign operations if the sign of a value never matters.  The flag is
7331 enabled by default at @option{-O} and higher.
7333 @item -fssa-phiopt
7334 @opindex fssa-phiopt
7335 Perform pattern matching on SSA PHI nodes to optimize conditional
7336 code.  This pass is enabled by default at @option{-O} and higher.
7338 @item -ftree-switch-conversion
7339 @opindex ftree-switch-conversion
7340 Perform conversion of simple initializations in a switch to
7341 initializations from a scalar array.  This flag is enabled by default
7342 at @option{-O2} and higher.
7344 @item -ftree-tail-merge
7345 @opindex ftree-tail-merge
7346 Look for identical code sequences.  When found, replace one with a jump to the
7347 other.  This optimization is known as tail merging or cross jumping.  This flag
7348 is enabled by default at @option{-O2} and higher.  The compilation time
7349 in this pass can
7350 be limited using @option{max-tail-merge-comparisons} parameter and
7351 @option{max-tail-merge-iterations} parameter.
7353 @item -ftree-dce
7354 @opindex ftree-dce
7355 Perform dead code elimination (DCE) on trees.  This flag is enabled by
7356 default at @option{-O} and higher.
7358 @item -ftree-builtin-call-dce
7359 @opindex ftree-builtin-call-dce
7360 Perform conditional dead code elimination (DCE) for calls to built-in functions
7361 that may set @code{errno} but are otherwise side-effect free.  This flag is
7362 enabled by default at @option{-O2} and higher if @option{-Os} is not also
7363 specified.
7365 @item -ftree-dominator-opts
7366 @opindex ftree-dominator-opts
7367 Perform a variety of simple scalar cleanups (constant/copy
7368 propagation, redundancy elimination, range propagation and expression
7369 simplification) based on a dominator tree traversal.  This also
7370 performs jump threading (to reduce jumps to jumps). This flag is
7371 enabled by default at @option{-O} and higher.
7373 @item -ftree-dse
7374 @opindex ftree-dse
7375 Perform dead store elimination (DSE) on trees.  A dead store is a store into
7376 a memory location that is later overwritten by another store without
7377 any intervening loads.  In this case the earlier store can be deleted.  This
7378 flag is enabled by default at @option{-O} and higher.
7380 @item -ftree-ch
7381 @opindex ftree-ch
7382 Perform loop header copying on trees.  This is beneficial since it increases
7383 effectiveness of code motion optimizations.  It also saves one jump.  This flag
7384 is enabled by default at @option{-O} and higher.  It is not enabled
7385 for @option{-Os}, since it usually increases code size.
7387 @item -ftree-loop-optimize
7388 @opindex ftree-loop-optimize
7389 Perform loop optimizations on trees.  This flag is enabled by default
7390 at @option{-O} and higher.
7392 @item -ftree-loop-linear
7393 @itemx -floop-interchange
7394 @itemx -floop-strip-mine
7395 @itemx -floop-block
7396 @itemx -floop-unroll-and-jam
7397 @opindex ftree-loop-linear
7398 @opindex floop-interchange
7399 @opindex floop-strip-mine
7400 @opindex floop-block
7401 @opindex floop-unroll-and-jam
7402 Perform loop nest optimizations.  Same as
7403 @option{-floop-nest-optimize}.  To use this code transformation, GCC has
7404 to be configured with @option{--with-isl} to enable the Graphite loop
7405 transformation infrastructure.
7407 @item -fgraphite-identity
7408 @opindex fgraphite-identity
7409 Enable the identity transformation for graphite.  For every SCoP we generate
7410 the polyhedral representation and transform it back to gimple.  Using
7411 @option{-fgraphite-identity} we can check the costs or benefits of the
7412 GIMPLE -> GRAPHITE -> GIMPLE transformation.  Some minimal optimizations
7413 are also performed by the code generator isl, like index splitting and
7414 dead code elimination in loops.
7416 @item -floop-nest-optimize
7417 @opindex floop-nest-optimize
7418 Enable the isl based loop nest optimizer.  This is a generic loop nest
7419 optimizer based on the Pluto optimization algorithms.  It calculates a loop
7420 structure optimized for data-locality and parallelism.  This option
7421 is experimental.
7423 @item -floop-parallelize-all
7424 @opindex floop-parallelize-all
7425 Use the Graphite data dependence analysis to identify loops that can
7426 be parallelized.  Parallelize all the loops that can be analyzed to
7427 not contain loop carried dependences without checking that it is
7428 profitable to parallelize the loops.
7430 @item -ftree-coalesce-vars
7431 @opindex ftree-coalesce-vars
7432 While transforming the program out of the SSA representation, attempt to
7433 reduce copying by coalescing versions of different user-defined
7434 variables, instead of just compiler temporaries.  This may severely
7435 limit the ability to debug an optimized program compiled with
7436 @option{-fno-var-tracking-assignments}.  In the negated form, this flag
7437 prevents SSA coalescing of user variables.  This option is enabled by
7438 default if optimization is enabled, and it does very little otherwise.
7440 @item -ftree-loop-if-convert
7441 @opindex ftree-loop-if-convert
7442 Attempt to transform conditional jumps in the innermost loops to
7443 branch-less equivalents.  The intent is to remove control-flow from
7444 the innermost loops in order to improve the ability of the
7445 vectorization pass to handle these loops.  This is enabled by default
7446 if vectorization is enabled.
7448 @item -ftree-loop-if-convert-stores
7449 @opindex ftree-loop-if-convert-stores
7450 Attempt to also if-convert conditional jumps containing memory writes.
7451 This transformation can be unsafe for multi-threaded programs as it
7452 transforms conditional memory writes into unconditional memory writes.
7453 For example,
7454 @smallexample
7455 for (i = 0; i < N; i++)
7456   if (cond)
7457     A[i] = expr;
7458 @end smallexample
7459 is transformed to
7460 @smallexample
7461 for (i = 0; i < N; i++)
7462   A[i] = cond ? expr : A[i];
7463 @end smallexample
7464 potentially producing data races.
7466 @item -ftree-loop-distribution
7467 @opindex ftree-loop-distribution
7468 Perform loop distribution.  This flag can improve cache performance on
7469 big loop bodies and allow further loop optimizations, like
7470 parallelization or vectorization, to take place.  For example, the loop
7471 @smallexample
7472 DO I = 1, N
7473   A(I) = B(I) + C
7474   D(I) = E(I) * F
7475 ENDDO
7476 @end smallexample
7477 is transformed to
7478 @smallexample
7479 DO I = 1, N
7480    A(I) = B(I) + C
7481 ENDDO
7482 DO I = 1, N
7483    D(I) = E(I) * F
7484 ENDDO
7485 @end smallexample
7487 @item -ftree-loop-distribute-patterns
7488 @opindex ftree-loop-distribute-patterns
7489 Perform loop distribution of patterns that can be code generated with
7490 calls to a library.  This flag is enabled by default at @option{-O3}.
7492 This pass distributes the initialization loops and generates a call to
7493 memset zero.  For example, the loop
7494 @smallexample
7495 DO I = 1, N
7496   A(I) = 0
7497   B(I) = A(I) + I
7498 ENDDO
7499 @end smallexample
7500 is transformed to
7501 @smallexample
7502 DO I = 1, N
7503    A(I) = 0
7504 ENDDO
7505 DO I = 1, N
7506    B(I) = A(I) + I
7507 ENDDO
7508 @end smallexample
7509 and the initialization loop is transformed into a call to memset zero.
7511 @item -ftree-loop-im
7512 @opindex ftree-loop-im
7513 Perform loop invariant motion on trees.  This pass moves only invariants that
7514 are hard to handle at RTL level (function calls, operations that expand to
7515 nontrivial sequences of insns).  With @option{-funswitch-loops} it also moves
7516 operands of conditions that are invariant out of the loop, so that we can use
7517 just trivial invariantness analysis in loop unswitching.  The pass also includes
7518 store motion.
7520 @item -ftree-loop-ivcanon
7521 @opindex ftree-loop-ivcanon
7522 Create a canonical counter for number of iterations in loops for which
7523 determining number of iterations requires complicated analysis.  Later
7524 optimizations then may determine the number easily.  Useful especially
7525 in connection with unrolling.
7527 @item -fivopts
7528 @opindex fivopts
7529 Perform induction variable optimizations (strength reduction, induction
7530 variable merging and induction variable elimination) on trees.
7532 @item -ftree-parallelize-loops=n
7533 @opindex ftree-parallelize-loops
7534 Parallelize loops, i.e., split their iteration space to run in n threads.
7535 This is only possible for loops whose iterations are independent
7536 and can be arbitrarily reordered.  The optimization is only
7537 profitable on multiprocessor machines, for loops that are CPU-intensive,
7538 rather than constrained e.g.@: by memory bandwidth.  This option
7539 implies @option{-pthread}, and thus is only supported on targets
7540 that have support for @option{-pthread}.
7542 @item -ftree-pta
7543 @opindex ftree-pta
7544 Perform function-local points-to analysis on trees.  This flag is
7545 enabled by default at @option{-O} and higher.
7547 @item -ftree-sra
7548 @opindex ftree-sra
7549 Perform scalar replacement of aggregates.  This pass replaces structure
7550 references with scalars to prevent committing structures to memory too
7551 early.  This flag is enabled by default at @option{-O} and higher.
7553 @item -ftree-ter
7554 @opindex ftree-ter
7555 Perform temporary expression replacement during the SSA->normal phase.  Single
7556 use/single def temporaries are replaced at their use location with their
7557 defining expression.  This results in non-GIMPLE code, but gives the expanders
7558 much more complex trees to work on resulting in better RTL generation.  This is
7559 enabled by default at @option{-O} and higher.
7561 @item -ftree-slsr
7562 @opindex ftree-slsr
7563 Perform straight-line strength reduction on trees.  This recognizes related
7564 expressions involving multiplications and replaces them by less expensive
7565 calculations when possible.  This is enabled by default at @option{-O} and
7566 higher.
7568 @item -ftree-vectorize
7569 @opindex ftree-vectorize
7570 Perform vectorization on trees. This flag enables @option{-ftree-loop-vectorize}
7571 and @option{-ftree-slp-vectorize} if not explicitly specified.
7573 @item -ftree-loop-vectorize
7574 @opindex ftree-loop-vectorize
7575 Perform loop vectorization on trees. This flag is enabled by default at
7576 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7578 @item -ftree-slp-vectorize
7579 @opindex ftree-slp-vectorize
7580 Perform basic block vectorization on trees. This flag is enabled by default at
7581 @option{-O3} and when @option{-ftree-vectorize} is enabled.
7583 @item -fvect-cost-model=@var{model}
7584 @opindex fvect-cost-model
7585 Alter the cost model used for vectorization.  The @var{model} argument
7586 should be one of @samp{unlimited}, @samp{dynamic} or @samp{cheap}.
7587 With the @samp{unlimited} model the vectorized code-path is assumed
7588 to be profitable while with the @samp{dynamic} model a runtime check
7589 guards the vectorized code-path to enable it only for iteration
7590 counts that will likely execute faster than when executing the original
7591 scalar loop.  The @samp{cheap} model disables vectorization of
7592 loops where doing so would be cost prohibitive for example due to
7593 required runtime checks for data dependence or alignment but otherwise
7594 is equal to the @samp{dynamic} model.
7595 The default cost model depends on other optimization flags and is
7596 either @samp{dynamic} or @samp{cheap}.
7598 @item -fsimd-cost-model=@var{model}
7599 @opindex fsimd-cost-model
7600 Alter the cost model used for vectorization of loops marked with the OpenMP
7601 or Cilk Plus simd directive.  The @var{model} argument should be one of
7602 @samp{unlimited}, @samp{dynamic}, @samp{cheap}.  All values of @var{model}
7603 have the same meaning as described in @option{-fvect-cost-model} and by
7604 default a cost model defined with @option{-fvect-cost-model} is used.
7606 @item -ftree-vrp
7607 @opindex ftree-vrp
7608 Perform Value Range Propagation on trees.  This is similar to the
7609 constant propagation pass, but instead of values, ranges of values are
7610 propagated.  This allows the optimizers to remove unnecessary range
7611 checks like array bound checks and null pointer checks.  This is
7612 enabled by default at @option{-O2} and higher.  Null pointer check
7613 elimination is only done if @option{-fdelete-null-pointer-checks} is
7614 enabled.
7616 @item -fsplit-paths
7617 @opindex fsplit-paths
7618 Split paths leading to loop backedges.  This can improve dead code
7619 elimination and common subexpression elimination.  This is enabled by
7620 default at @option{-O2} and above.
7622 @item -fsplit-ivs-in-unroller
7623 @opindex fsplit-ivs-in-unroller
7624 Enables expression of values of induction variables in later iterations
7625 of the unrolled loop using the value in the first iteration.  This breaks
7626 long dependency chains, thus improving efficiency of the scheduling passes.
7628 A combination of @option{-fweb} and CSE is often sufficient to obtain the
7629 same effect.  However, that is not reliable in cases where the loop body
7630 is more complicated than a single basic block.  It also does not work at all
7631 on some architectures due to restrictions in the CSE pass.
7633 This optimization is enabled by default.
7635 @item -fvariable-expansion-in-unroller
7636 @opindex fvariable-expansion-in-unroller
7637 With this option, the compiler creates multiple copies of some
7638 local variables when unrolling a loop, which can result in superior code.
7640 @item -fpartial-inlining
7641 @opindex fpartial-inlining
7642 Inline parts of functions.  This option has any effect only
7643 when inlining itself is turned on by the @option{-finline-functions}
7644 or @option{-finline-small-functions} options.
7646 Enabled at level @option{-O2}.
7648 @item -fpredictive-commoning
7649 @opindex fpredictive-commoning
7650 Perform predictive commoning optimization, i.e., reusing computations
7651 (especially memory loads and stores) performed in previous
7652 iterations of loops.
7654 This option is enabled at level @option{-O3}.
7656 @item -fprefetch-loop-arrays
7657 @opindex fprefetch-loop-arrays
7658 If supported by the target machine, generate instructions to prefetch
7659 memory to improve the performance of loops that access large arrays.
7661 This option may generate better or worse code; results are highly
7662 dependent on the structure of loops within the source code.
7664 Disabled at level @option{-Os}.
7666 @item -fno-peephole
7667 @itemx -fno-peephole2
7668 @opindex fno-peephole
7669 @opindex fno-peephole2
7670 Disable any machine-specific peephole optimizations.  The difference
7671 between @option{-fno-peephole} and @option{-fno-peephole2} is in how they
7672 are implemented in the compiler; some targets use one, some use the
7673 other, a few use both.
7675 @option{-fpeephole} is enabled by default.
7676 @option{-fpeephole2} enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7678 @item -fno-guess-branch-probability
7679 @opindex fno-guess-branch-probability
7680 Do not guess branch probabilities using heuristics.
7682 GCC uses heuristics to guess branch probabilities if they are
7683 not provided by profiling feedback (@option{-fprofile-arcs}).  These
7684 heuristics are based on the control flow graph.  If some branch probabilities
7685 are specified by @code{__builtin_expect}, then the heuristics are
7686 used to guess branch probabilities for the rest of the control flow graph,
7687 taking the @code{__builtin_expect} info into account.  The interactions
7688 between the heuristics and @code{__builtin_expect} can be complex, and in
7689 some cases, it may be useful to disable the heuristics so that the effects
7690 of @code{__builtin_expect} are easier to understand.
7692 The default is @option{-fguess-branch-probability} at levels
7693 @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7695 @item -freorder-blocks
7696 @opindex freorder-blocks
7697 Reorder basic blocks in the compiled function in order to reduce number of
7698 taken branches and improve code locality.
7700 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
7702 @item -freorder-blocks-algorithm=@var{algorithm}
7703 @opindex freorder-blocks-algorithm
7704 Use the specified algorithm for basic block reordering.  The
7705 @var{algorithm} argument can be @samp{simple}, which does not increase
7706 code size (except sometimes due to secondary effects like alignment),
7707 or @samp{stc}, the ``software trace cache'' algorithm, which tries to
7708 put all often executed code together, minimizing the number of branches
7709 executed by making extra copies of code.
7711 The default is @samp{simple} at levels @option{-O}, @option{-Os}, and
7712 @samp{stc} at levels @option{-O2}, @option{-O3}.
7714 @item -freorder-blocks-and-partition
7715 @opindex freorder-blocks-and-partition
7716 In addition to reordering basic blocks in the compiled function, in order
7717 to reduce number of taken branches, partitions hot and cold basic blocks
7718 into separate sections of the assembly and @file{.o} files, to improve
7719 paging and cache locality performance.
7721 This optimization is automatically turned off in the presence of
7722 exception handling, for linkonce sections, for functions with a user-defined
7723 section attribute and on any architecture that does not support named
7724 sections.
7726 Enabled for x86 at levels @option{-O2}, @option{-O3}.
7728 @item -freorder-functions
7729 @opindex freorder-functions
7730 Reorder functions in the object file in order to
7731 improve code locality.  This is implemented by using special
7732 subsections @code{.text.hot} for most frequently executed functions and
7733 @code{.text.unlikely} for unlikely executed functions.  Reordering is done by
7734 the linker so object file format must support named sections and linker must
7735 place them in a reasonable way.
7737 Also profile feedback must be available to make this option effective.  See
7738 @option{-fprofile-arcs} for details.
7740 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
7742 @item -fstrict-aliasing
7743 @opindex fstrict-aliasing
7744 Allow the compiler to assume the strictest aliasing rules applicable to
7745 the language being compiled.  For C (and C++), this activates
7746 optimizations based on the type of expressions.  In particular, an
7747 object of one type is assumed never to reside at the same address as an
7748 object of a different type, unless the types are almost the same.  For
7749 example, an @code{unsigned int} can alias an @code{int}, but not a
7750 @code{void*} or a @code{double}.  A character type may alias any other
7751 type.
7753 @anchor{Type-punning}Pay special attention to code like this:
7754 @smallexample
7755 union a_union @{
7756   int i;
7757   double d;
7760 int f() @{
7761   union a_union t;
7762   t.d = 3.0;
7763   return t.i;
7765 @end smallexample
7766 The practice of reading from a different union member than the one most
7767 recently written to (called ``type-punning'') is common.  Even with
7768 @option{-fstrict-aliasing}, type-punning is allowed, provided the memory
7769 is accessed through the union type.  So, the code above works as
7770 expected.  @xref{Structures unions enumerations and bit-fields
7771 implementation}.  However, this code might not:
7772 @smallexample
7773 int f() @{
7774   union a_union t;
7775   int* ip;
7776   t.d = 3.0;
7777   ip = &t.i;
7778   return *ip;
7780 @end smallexample
7782 Similarly, access by taking the address, casting the resulting pointer
7783 and dereferencing the result has undefined behavior, even if the cast
7784 uses a union type, e.g.:
7785 @smallexample
7786 int f() @{
7787   double d = 3.0;
7788   return ((union a_union *) &d)->i;
7790 @end smallexample
7792 The @option{-fstrict-aliasing} option is enabled at levels
7793 @option{-O2}, @option{-O3}, @option{-Os}.
7795 @item -fstrict-overflow
7796 @opindex fstrict-overflow
7797 Allow the compiler to assume strict signed overflow rules, depending
7798 on the language being compiled.  For C (and C++) this means that
7799 overflow when doing arithmetic with signed numbers is undefined, which
7800 means that the compiler may assume that it does not happen.  This
7801 permits various optimizations.  For example, the compiler assumes
7802 that an expression like @code{i + 10 > i} is always true for
7803 signed @code{i}.  This assumption is only valid if signed overflow is
7804 undefined, as the expression is false if @code{i + 10} overflows when
7805 using twos complement arithmetic.  When this option is in effect any
7806 attempt to determine whether an operation on signed numbers 
7807 overflows must be written carefully to not actually involve overflow.
7809 This option also allows the compiler to assume strict pointer
7810 semantics: given a pointer to an object, if adding an offset to that
7811 pointer does not produce a pointer to the same object, the addition is
7812 undefined.  This permits the compiler to conclude that @code{p + u >
7813 p} is always true for a pointer @code{p} and unsigned integer
7814 @code{u}.  This assumption is only valid because pointer wraparound is
7815 undefined, as the expression is false if @code{p + u} overflows using
7816 twos complement arithmetic.
7818 See also the @option{-fwrapv} option.  Using @option{-fwrapv} means
7819 that integer signed overflow is fully defined: it wraps.  When
7820 @option{-fwrapv} is used, there is no difference between
7821 @option{-fstrict-overflow} and @option{-fno-strict-overflow} for
7822 integers.  With @option{-fwrapv} certain types of overflow are
7823 permitted.  For example, if the compiler gets an overflow when doing
7824 arithmetic on constants, the overflowed value can still be used with
7825 @option{-fwrapv}, but not otherwise.
7827 The @option{-fstrict-overflow} option is enabled at levels
7828 @option{-O2}, @option{-O3}, @option{-Os}.
7830 @item -falign-functions
7831 @itemx -falign-functions=@var{n}
7832 @opindex falign-functions
7833 Align the start of functions to the next power-of-two greater than
7834 @var{n}, skipping up to @var{n} bytes.  For instance,
7835 @option{-falign-functions=32} aligns functions to the next 32-byte
7836 boundary, but @option{-falign-functions=24} aligns to the next
7837 32-byte boundary only if this can be done by skipping 23 bytes or less.
7839 @option{-fno-align-functions} and @option{-falign-functions=1} are
7840 equivalent and mean that functions are not aligned.
7842 Some assemblers only support this flag when @var{n} is a power of two;
7843 in that case, it is rounded up.
7845 If @var{n} is not specified or is zero, use a machine-dependent default.
7847 Enabled at levels @option{-O2}, @option{-O3}.
7849 @item -falign-labels
7850 @itemx -falign-labels=@var{n}
7851 @opindex falign-labels
7852 Align all branch targets to a power-of-two boundary, skipping up to
7853 @var{n} bytes like @option{-falign-functions}.  This option can easily
7854 make code slower, because it must insert dummy operations for when the
7855 branch target is reached in the usual flow of the code.
7857 @option{-fno-align-labels} and @option{-falign-labels=1} are
7858 equivalent and mean that labels are not aligned.
7860 If @option{-falign-loops} or @option{-falign-jumps} are applicable and
7861 are greater than this value, then their values are used instead.
7863 If @var{n} is not specified or is zero, use a machine-dependent default
7864 which is very likely to be @samp{1}, meaning no alignment.
7866 Enabled at levels @option{-O2}, @option{-O3}.
7868 @item -falign-loops
7869 @itemx -falign-loops=@var{n}
7870 @opindex falign-loops
7871 Align loops to a power-of-two boundary, skipping up to @var{n} bytes
7872 like @option{-falign-functions}.  If the loops are
7873 executed many times, this makes up for any execution of the dummy
7874 operations.
7876 @option{-fno-align-loops} and @option{-falign-loops=1} are
7877 equivalent and mean that loops are not aligned.
7879 If @var{n} is not specified or is zero, use a machine-dependent default.
7881 Enabled at levels @option{-O2}, @option{-O3}.
7883 @item -falign-jumps
7884 @itemx -falign-jumps=@var{n}
7885 @opindex falign-jumps
7886 Align branch targets to a power-of-two boundary, for branch targets
7887 where the targets can only be reached by jumping, skipping up to @var{n}
7888 bytes like @option{-falign-functions}.  In this case, no dummy operations
7889 need be executed.
7891 @option{-fno-align-jumps} and @option{-falign-jumps=1} are
7892 equivalent and mean that loops are not aligned.
7894 If @var{n} is not specified or is zero, use a machine-dependent default.
7896 Enabled at levels @option{-O2}, @option{-O3}.
7898 @item -funit-at-a-time
7899 @opindex funit-at-a-time
7900 This option is left for compatibility reasons. @option{-funit-at-a-time}
7901 has no effect, while @option{-fno-unit-at-a-time} implies
7902 @option{-fno-toplevel-reorder} and @option{-fno-section-anchors}.
7904 Enabled by default.
7906 @item -fno-toplevel-reorder
7907 @opindex fno-toplevel-reorder
7908 Do not reorder top-level functions, variables, and @code{asm}
7909 statements.  Output them in the same order that they appear in the
7910 input file.  When this option is used, unreferenced static variables
7911 are not removed.  This option is intended to support existing code
7912 that relies on a particular ordering.  For new code, it is better to
7913 use attributes when possible.
7915 Enabled at level @option{-O0}.  When disabled explicitly, it also implies
7916 @option{-fno-section-anchors}, which is otherwise enabled at @option{-O0} on some
7917 targets.
7919 @item -fweb
7920 @opindex fweb
7921 Constructs webs as commonly used for register allocation purposes and assign
7922 each web individual pseudo register.  This allows the register allocation pass
7923 to operate on pseudos directly, but also strengthens several other optimization
7924 passes, such as CSE, loop optimizer and trivial dead code remover.  It can,
7925 however, make debugging impossible, since variables no longer stay in a
7926 ``home register''.
7928 Enabled by default with @option{-funroll-loops}.
7930 @item -fwhole-program
7931 @opindex fwhole-program
7932 Assume that the current compilation unit represents the whole program being
7933 compiled.  All public functions and variables with the exception of @code{main}
7934 and those merged by attribute @code{externally_visible} become static functions
7935 and in effect are optimized more aggressively by interprocedural optimizers.
7937 This option should not be used in combination with @option{-flto}.
7938 Instead relying on a linker plugin should provide safer and more precise
7939 information.
7941 @item -flto[=@var{n}]
7942 @opindex flto
7943 This option runs the standard link-time optimizer.  When invoked
7944 with source code, it generates GIMPLE (one of GCC's internal
7945 representations) and writes it to special ELF sections in the object
7946 file.  When the object files are linked together, all the function
7947 bodies are read from these ELF sections and instantiated as if they
7948 had been part of the same translation unit.
7950 To use the link-time optimizer, @option{-flto} and optimization
7951 options should be specified at compile time and during the final link.
7952 It is recommended that you compile all the files participating in the
7953 same link with the same options and also specify those options at
7954 link time.  
7955 For example:
7957 @smallexample
7958 gcc -c -O2 -flto foo.c
7959 gcc -c -O2 -flto bar.c
7960 gcc -o myprog -flto -O2 foo.o bar.o
7961 @end smallexample
7963 The first two invocations to GCC save a bytecode representation
7964 of GIMPLE into special ELF sections inside @file{foo.o} and
7965 @file{bar.o}.  The final invocation reads the GIMPLE bytecode from
7966 @file{foo.o} and @file{bar.o}, merges the two files into a single
7967 internal image, and compiles the result as usual.  Since both
7968 @file{foo.o} and @file{bar.o} are merged into a single image, this
7969 causes all the interprocedural analyses and optimizations in GCC to
7970 work across the two files as if they were a single one.  This means,
7971 for example, that the inliner is able to inline functions in
7972 @file{bar.o} into functions in @file{foo.o} and vice-versa.
7974 Another (simpler) way to enable link-time optimization is:
7976 @smallexample
7977 gcc -o myprog -flto -O2 foo.c bar.c
7978 @end smallexample
7980 The above generates bytecode for @file{foo.c} and @file{bar.c},
7981 merges them together into a single GIMPLE representation and optimizes
7982 them as usual to produce @file{myprog}.
7984 The only important thing to keep in mind is that to enable link-time
7985 optimizations you need to use the GCC driver to perform the link step.
7986 GCC then automatically performs link-time optimization if any of the
7987 objects involved were compiled with the @option{-flto} command-line option.  
7988 You generally
7989 should specify the optimization options to be used for link-time
7990 optimization though GCC tries to be clever at guessing an
7991 optimization level to use from the options used at compile time
7992 if you fail to specify one at link time.  You can always override
7993 the automatic decision to do link-time optimization at link time
7994 by passing @option{-fno-lto} to the link command.
7996 To make whole program optimization effective, it is necessary to make
7997 certain whole program assumptions.  The compiler needs to know
7998 what functions and variables can be accessed by libraries and runtime
7999 outside of the link-time optimized unit.  When supported by the linker,
8000 the linker plugin (see @option{-fuse-linker-plugin}) passes information
8001 to the compiler about used and externally visible symbols.  When
8002 the linker plugin is not available, @option{-fwhole-program} should be
8003 used to allow the compiler to make these assumptions, which leads
8004 to more aggressive optimization decisions.
8006 When @option{-fuse-linker-plugin} is not enabled, when a file is
8007 compiled with @option{-flto}, the generated object file is larger than
8008 a regular object file because it contains GIMPLE bytecodes and the usual
8009 final code (see @option{-ffat-lto-objects}.  This means that
8010 object files with LTO information can be linked as normal object
8011 files; if @option{-fno-lto} is passed to the linker, no
8012 interprocedural optimizations are applied.  Note that when
8013 @option{-fno-fat-lto-objects} is enabled the compile stage is faster
8014 but you cannot perform a regular, non-LTO link on them.
8016 Additionally, the optimization flags used to compile individual files
8017 are not necessarily related to those used at link time.  For instance,
8019 @smallexample
8020 gcc -c -O0 -ffat-lto-objects -flto foo.c
8021 gcc -c -O0 -ffat-lto-objects -flto bar.c
8022 gcc -o myprog -O3 foo.o bar.o
8023 @end smallexample
8025 This produces individual object files with unoptimized assembler
8026 code, but the resulting binary @file{myprog} is optimized at
8027 @option{-O3}.  If, instead, the final binary is generated with
8028 @option{-fno-lto}, then @file{myprog} is not optimized.
8030 When producing the final binary, GCC only
8031 applies link-time optimizations to those files that contain bytecode.
8032 Therefore, you can mix and match object files and libraries with
8033 GIMPLE bytecodes and final object code.  GCC automatically selects
8034 which files to optimize in LTO mode and which files to link without
8035 further processing.
8037 There are some code generation flags preserved by GCC when
8038 generating bytecodes, as they need to be used during the final link
8039 stage.  Generally options specified at link time override those
8040 specified at compile time.
8042 If you do not specify an optimization level option @option{-O} at
8043 link time, then GCC uses the highest optimization level 
8044 used when compiling the object files.
8046 Currently, the following options and their settings are taken from
8047 the first object file that explicitly specifies them: 
8048 @option{-fPIC}, @option{-fpic}, @option{-fpie}, @option{-fcommon},
8049 @option{-fexceptions}, @option{-fnon-call-exceptions}, @option{-fgnu-tm}
8050 and all the @option{-m} target flags.
8052 Certain ABI-changing flags are required to match in all compilation units,
8053 and trying to override this at link time with a conflicting value
8054 is ignored.  This includes options such as @option{-freg-struct-return}
8055 and @option{-fpcc-struct-return}. 
8057 Other options such as @option{-ffp-contract}, @option{-fno-strict-overflow},
8058 @option{-fwrapv}, @option{-fno-trapv} or @option{-fno-strict-aliasing}
8059 are passed through to the link stage and merged conservatively for
8060 conflicting translation units.  Specifically
8061 @option{-fno-strict-overflow}, @option{-fwrapv} and @option{-fno-trapv} take
8062 precedence; and for example @option{-ffp-contract=off} takes precedence
8063 over @option{-ffp-contract=fast}.  You can override them at link time.
8065 If LTO encounters objects with C linkage declared with incompatible
8066 types in separate translation units to be linked together (undefined
8067 behavior according to ISO C99 6.2.7), a non-fatal diagnostic may be
8068 issued.  The behavior is still undefined at run time.  Similar
8069 diagnostics may be raised for other languages.
8071 Another feature of LTO is that it is possible to apply interprocedural
8072 optimizations on files written in different languages:
8074 @smallexample
8075 gcc -c -flto foo.c
8076 g++ -c -flto bar.cc
8077 gfortran -c -flto baz.f90
8078 g++ -o myprog -flto -O3 foo.o bar.o baz.o -lgfortran
8079 @end smallexample
8081 Notice that the final link is done with @command{g++} to get the C++
8082 runtime libraries and @option{-lgfortran} is added to get the Fortran
8083 runtime libraries.  In general, when mixing languages in LTO mode, you
8084 should use the same link command options as when mixing languages in a
8085 regular (non-LTO) compilation.
8087 If object files containing GIMPLE bytecode are stored in a library archive, say
8088 @file{libfoo.a}, it is possible to extract and use them in an LTO link if you
8089 are using a linker with plugin support.  To create static libraries suitable
8090 for LTO, use @command{gcc-ar} and @command{gcc-ranlib} instead of @command{ar}
8091 and @command{ranlib}; 
8092 to show the symbols of object files with GIMPLE bytecode, use
8093 @command{gcc-nm}.  Those commands require that @command{ar}, @command{ranlib}
8094 and @command{nm} have been compiled with plugin support.  At link time, use the the
8095 flag @option{-fuse-linker-plugin} to ensure that the library participates in
8096 the LTO optimization process:
8098 @smallexample
8099 gcc -o myprog -O2 -flto -fuse-linker-plugin a.o b.o -lfoo
8100 @end smallexample
8102 With the linker plugin enabled, the linker extracts the needed
8103 GIMPLE files from @file{libfoo.a} and passes them on to the running GCC
8104 to make them part of the aggregated GIMPLE image to be optimized.
8106 If you are not using a linker with plugin support and/or do not
8107 enable the linker plugin, then the objects inside @file{libfoo.a}
8108 are extracted and linked as usual, but they do not participate
8109 in the LTO optimization process.  In order to make a static library suitable
8110 for both LTO optimization and usual linkage, compile its object files with
8111 @option{-flto} @option{-ffat-lto-objects}.
8113 Link-time optimizations do not require the presence of the whole program to
8114 operate.  If the program does not require any symbols to be exported, it is
8115 possible to combine @option{-flto} and @option{-fwhole-program} to allow
8116 the interprocedural optimizers to use more aggressive assumptions which may
8117 lead to improved optimization opportunities.
8118 Use of @option{-fwhole-program} is not needed when linker plugin is
8119 active (see @option{-fuse-linker-plugin}).
8121 The current implementation of LTO makes no
8122 attempt to generate bytecode that is portable between different
8123 types of hosts.  The bytecode files are versioned and there is a
8124 strict version check, so bytecode files generated in one version of
8125 GCC do not work with an older or newer version of GCC.
8127 Link-time optimization does not work well with generation of debugging
8128 information.  Combining @option{-flto} with
8129 @option{-g} is currently experimental and expected to produce unexpected
8130 results.
8132 If you specify the optional @var{n}, the optimization and code
8133 generation done at link time is executed in parallel using @var{n}
8134 parallel jobs by utilizing an installed @command{make} program.  The
8135 environment variable @env{MAKE} may be used to override the program
8136 used.  The default value for @var{n} is 1.
8138 You can also specify @option{-flto=jobserver} to use GNU make's
8139 job server mode to determine the number of parallel jobs. This
8140 is useful when the Makefile calling GCC is already executing in parallel.
8141 You must prepend a @samp{+} to the command recipe in the parent Makefile
8142 for this to work.  This option likely only works if @env{MAKE} is
8143 GNU make.
8145 @item -flto-partition=@var{alg}
8146 @opindex flto-partition
8147 Specify the partitioning algorithm used by the link-time optimizer.
8148 The value is either @samp{1to1} to specify a partitioning mirroring
8149 the original source files or @samp{balanced} to specify partitioning
8150 into equally sized chunks (whenever possible) or @samp{max} to create
8151 new partition for every symbol where possible.  Specifying @samp{none}
8152 as an algorithm disables partitioning and streaming completely. 
8153 The default value is @samp{balanced}. While @samp{1to1} can be used
8154 as an workaround for various code ordering issues, the @samp{max}
8155 partitioning is intended for internal testing only.
8156 The value @samp{one} specifies that exactly one partition should be
8157 used while the value @samp{none} bypasses partitioning and executes
8158 the link-time optimization step directly from the WPA phase.
8160 @item -flto-odr-type-merging
8161 @opindex flto-odr-type-merging
8162 Enable streaming of mangled types names of C++ types and their unification
8163 at link time.  This increases size of LTO object files, but enables
8164 diagnostics about One Definition Rule violations.
8166 @item -flto-compression-level=@var{n}
8167 @opindex flto-compression-level
8168 This option specifies the level of compression used for intermediate
8169 language written to LTO object files, and is only meaningful in
8170 conjunction with LTO mode (@option{-flto}).  Valid
8171 values are 0 (no compression) to 9 (maximum compression).  Values
8172 outside this range are clamped to either 0 or 9.  If the option is not
8173 given, a default balanced compression setting is used.
8175 @item -fuse-linker-plugin
8176 @opindex fuse-linker-plugin
8177 Enables the use of a linker plugin during link-time optimization.  This
8178 option relies on plugin support in the linker, which is available in gold
8179 or in GNU ld 2.21 or newer.
8181 This option enables the extraction of object files with GIMPLE bytecode out
8182 of library archives. This improves the quality of optimization by exposing
8183 more code to the link-time optimizer.  This information specifies what
8184 symbols can be accessed externally (by non-LTO object or during dynamic
8185 linking).  Resulting code quality improvements on binaries (and shared
8186 libraries that use hidden visibility) are similar to @option{-fwhole-program}.
8187 See @option{-flto} for a description of the effect of this flag and how to
8188 use it.
8190 This option is enabled by default when LTO support in GCC is enabled
8191 and GCC was configured for use with
8192 a linker supporting plugins (GNU ld 2.21 or newer or gold).
8194 @item -ffat-lto-objects
8195 @opindex ffat-lto-objects
8196 Fat LTO objects are object files that contain both the intermediate language
8197 and the object code. This makes them usable for both LTO linking and normal
8198 linking. This option is effective only when compiling with @option{-flto}
8199 and is ignored at link time.
8201 @option{-fno-fat-lto-objects} improves compilation time over plain LTO, but
8202 requires the complete toolchain to be aware of LTO. It requires a linker with
8203 linker plugin support for basic functionality.  Additionally,
8204 @command{nm}, @command{ar} and @command{ranlib}
8205 need to support linker plugins to allow a full-featured build environment
8206 (capable of building static libraries etc).  GCC provides the @command{gcc-ar},
8207 @command{gcc-nm}, @command{gcc-ranlib} wrappers to pass the right options
8208 to these tools. With non fat LTO makefiles need to be modified to use them.
8210 The default is @option{-fno-fat-lto-objects} on targets with linker plugin
8211 support.
8213 @item -fcompare-elim
8214 @opindex fcompare-elim
8215 After register allocation and post-register allocation instruction splitting,
8216 identify arithmetic instructions that compute processor flags similar to a
8217 comparison operation based on that arithmetic.  If possible, eliminate the
8218 explicit comparison operation.
8220 This pass only applies to certain targets that cannot explicitly represent
8221 the comparison operation before register allocation is complete.
8223 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8225 @item -fcprop-registers
8226 @opindex fcprop-registers
8227 After register allocation and post-register allocation instruction splitting,
8228 perform a copy-propagation pass to try to reduce scheduling dependencies
8229 and occasionally eliminate the copy.
8231 Enabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
8233 @item -fprofile-correction
8234 @opindex fprofile-correction
8235 Profiles collected using an instrumented binary for multi-threaded programs may
8236 be inconsistent due to missed counter updates. When this option is specified,
8237 GCC uses heuristics to correct or smooth out such inconsistencies. By
8238 default, GCC emits an error message when an inconsistent profile is detected.
8240 @item -fprofile-use
8241 @itemx -fprofile-use=@var{path}
8242 @opindex fprofile-use
8243 Enable profile feedback-directed optimizations, 
8244 and the following optimizations
8245 which are generally profitable only with profile feedback available:
8246 @option{-fbranch-probabilities}, @option{-fvpt},
8247 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8248 @option{-ftree-vectorize}, and @option{ftree-loop-distribute-patterns}.
8250 Before you can use this option, you must first generate profiling information.
8251 @xref{Optimize Options}, for information about the @option{-fprofile-generate}
8252 option.
8254 By default, GCC emits an error message if the feedback profiles do not
8255 match the source code.  This error can be turned into a warning by using
8256 @option{-Wcoverage-mismatch}.  Note this may result in poorly optimized
8257 code.
8259 If @var{path} is specified, GCC looks at the @var{path} to find
8260 the profile feedback data files. See @option{-fprofile-dir}.
8262 @item -fauto-profile
8263 @itemx -fauto-profile=@var{path}
8264 @opindex fauto-profile
8265 Enable sampling-based feedback-directed optimizations, 
8266 and the following optimizations
8267 which are generally profitable only with profile feedback available:
8268 @option{-fbranch-probabilities}, @option{-fvpt},
8269 @option{-funroll-loops}, @option{-fpeel-loops}, @option{-ftracer}, 
8270 @option{-ftree-vectorize},
8271 @option{-finline-functions}, @option{-fipa-cp}, @option{-fipa-cp-clone},
8272 @option{-fpredictive-commoning}, @option{-funswitch-loops},
8273 @option{-fgcse-after-reload}, and @option{-ftree-loop-distribute-patterns}.
8275 @var{path} is the name of a file containing AutoFDO profile information.
8276 If omitted, it defaults to @file{fbdata.afdo} in the current directory.
8278 Producing an AutoFDO profile data file requires running your program
8279 with the @command{perf} utility on a supported GNU/Linux target system.
8280 For more information, see @uref{https://perf.wiki.kernel.org/}.
8282 E.g.
8283 @smallexample
8284 perf record -e br_inst_retired:near_taken -b -o perf.data \
8285     -- your_program
8286 @end smallexample
8288 Then use the @command{create_gcov} tool to convert the raw profile data
8289 to a format that can be used by GCC.@  You must also supply the 
8290 unstripped binary for your program to this tool.  
8291 See @uref{https://github.com/google/autofdo}.
8293 E.g.
8294 @smallexample
8295 create_gcov --binary=your_program.unstripped --profile=perf.data \
8296     --gcov=profile.afdo
8297 @end smallexample
8298 @end table
8300 The following options control compiler behavior regarding floating-point 
8301 arithmetic.  These options trade off between speed and
8302 correctness.  All must be specifically enabled.
8304 @table @gcctabopt
8305 @item -ffloat-store
8306 @opindex ffloat-store
8307 Do not store floating-point variables in registers, and inhibit other
8308 options that might change whether a floating-point value is taken from a
8309 register or memory.
8311 @cindex floating-point precision
8312 This option prevents undesirable excess precision on machines such as
8313 the 68000 where the floating registers (of the 68881) keep more
8314 precision than a @code{double} is supposed to have.  Similarly for the
8315 x86 architecture.  For most programs, the excess precision does only
8316 good, but a few programs rely on the precise definition of IEEE floating
8317 point.  Use @option{-ffloat-store} for such programs, after modifying
8318 them to store all pertinent intermediate computations into variables.
8320 @item -fexcess-precision=@var{style}
8321 @opindex fexcess-precision
8322 This option allows further control over excess precision on machines
8323 where floating-point registers have more precision than the IEEE
8324 @code{float} and @code{double} types and the processor does not
8325 support operations rounding to those types.  By default,
8326 @option{-fexcess-precision=fast} is in effect; this means that
8327 operations are carried out in the precision of the registers and that
8328 it is unpredictable when rounding to the types specified in the source
8329 code takes place.  When compiling C, if
8330 @option{-fexcess-precision=standard} is specified then excess
8331 precision follows the rules specified in ISO C99; in particular,
8332 both casts and assignments cause values to be rounded to their
8333 semantic types (whereas @option{-ffloat-store} only affects
8334 assignments).  This option is enabled by default for C if a strict
8335 conformance option such as @option{-std=c99} is used.
8337 @opindex mfpmath
8338 @option{-fexcess-precision=standard} is not implemented for languages
8339 other than C, and has no effect if
8340 @option{-funsafe-math-optimizations} or @option{-ffast-math} is
8341 specified.  On the x86, it also has no effect if @option{-mfpmath=sse}
8342 or @option{-mfpmath=sse+387} is specified; in the former case, IEEE
8343 semantics apply without excess precision, and in the latter, rounding
8344 is unpredictable.
8346 @item -ffast-math
8347 @opindex ffast-math
8348 Sets the options @option{-fno-math-errno}, @option{-funsafe-math-optimizations},
8349 @option{-ffinite-math-only}, @option{-fno-rounding-math},
8350 @option{-fno-signaling-nans} and @option{-fcx-limited-range}.
8352 This option causes the preprocessor macro @code{__FAST_MATH__} to be defined.
8354 This option is not turned on by any @option{-O} option besides
8355 @option{-Ofast} since it can result in incorrect output for programs
8356 that depend on an exact implementation of IEEE or ISO rules/specifications
8357 for math functions. It may, however, yield faster code for programs
8358 that do not require the guarantees of these specifications.
8360 @item -fno-math-errno
8361 @opindex fno-math-errno
8362 Do not set @code{errno} after calling math functions that are executed
8363 with a single instruction, e.g., @code{sqrt}.  A program that relies on
8364 IEEE exceptions for math error handling may want to use this flag
8365 for speed while maintaining IEEE arithmetic compatibility.
8367 This option is not turned on by any @option{-O} option since
8368 it can result in incorrect output for programs that depend on
8369 an exact implementation of IEEE or ISO rules/specifications for
8370 math functions. It may, however, yield faster code for programs
8371 that do not require the guarantees of these specifications.
8373 The default is @option{-fmath-errno}.
8375 On Darwin systems, the math library never sets @code{errno}.  There is
8376 therefore no reason for the compiler to consider the possibility that
8377 it might, and @option{-fno-math-errno} is the default.
8379 @item -funsafe-math-optimizations
8380 @opindex funsafe-math-optimizations
8382 Allow optimizations for floating-point arithmetic that (a) assume
8383 that arguments and results are valid and (b) may violate IEEE or
8384 ANSI standards.  When used at link time, it may include libraries
8385 or startup files that change the default FPU control word or other
8386 similar optimizations.
8388 This option is not turned on by any @option{-O} option since
8389 it can result in incorrect output for programs that depend on
8390 an exact implementation of IEEE or ISO rules/specifications for
8391 math functions. It may, however, yield faster code for programs
8392 that do not require the guarantees of these specifications.
8393 Enables @option{-fno-signed-zeros}, @option{-fno-trapping-math},
8394 @option{-fassociative-math} and @option{-freciprocal-math}.
8396 The default is @option{-fno-unsafe-math-optimizations}.
8398 @item -fassociative-math
8399 @opindex fassociative-math
8401 Allow re-association of operands in series of floating-point operations.
8402 This violates the ISO C and C++ language standard by possibly changing
8403 computation result.  NOTE: re-ordering may change the sign of zero as
8404 well as ignore NaNs and inhibit or create underflow or overflow (and
8405 thus cannot be used on code that relies on rounding behavior like
8406 @code{(x + 2**52) - 2**52}.  May also reorder floating-point comparisons
8407 and thus may not be used when ordered comparisons are required.
8408 This option requires that both @option{-fno-signed-zeros} and
8409 @option{-fno-trapping-math} be in effect.  Moreover, it doesn't make
8410 much sense with @option{-frounding-math}. For Fortran the option
8411 is automatically enabled when both @option{-fno-signed-zeros} and
8412 @option{-fno-trapping-math} are in effect.
8414 The default is @option{-fno-associative-math}.
8416 @item -freciprocal-math
8417 @opindex freciprocal-math
8419 Allow the reciprocal of a value to be used instead of dividing by
8420 the value if this enables optimizations.  For example @code{x / y}
8421 can be replaced with @code{x * (1/y)}, which is useful if @code{(1/y)}
8422 is subject to common subexpression elimination.  Note that this loses
8423 precision and increases the number of flops operating on the value.
8425 The default is @option{-fno-reciprocal-math}.
8427 @item -ffinite-math-only
8428 @opindex ffinite-math-only
8429 Allow optimizations for floating-point arithmetic that assume
8430 that arguments and results are not NaNs or +-Infs.
8432 This option is not turned on by any @option{-O} option since
8433 it can result in incorrect output for programs that depend on
8434 an exact implementation of IEEE or ISO rules/specifications for
8435 math functions. It may, however, yield faster code for programs
8436 that do not require the guarantees of these specifications.
8438 The default is @option{-fno-finite-math-only}.
8440 @item -fno-signed-zeros
8441 @opindex fno-signed-zeros
8442 Allow optimizations for floating-point arithmetic that ignore the
8443 signedness of zero.  IEEE arithmetic specifies the behavior of
8444 distinct +0.0 and @minus{}0.0 values, which then prohibits simplification
8445 of expressions such as x+0.0 or 0.0*x (even with @option{-ffinite-math-only}).
8446 This option implies that the sign of a zero result isn't significant.
8448 The default is @option{-fsigned-zeros}.
8450 @item -fno-trapping-math
8451 @opindex fno-trapping-math
8452 Compile code assuming that floating-point operations cannot generate
8453 user-visible traps.  These traps include division by zero, overflow,
8454 underflow, inexact result and invalid operation.  This option requires
8455 that @option{-fno-signaling-nans} be in effect.  Setting this option may
8456 allow faster code if one relies on ``non-stop'' IEEE arithmetic, for example.
8458 This option should never be turned on by any @option{-O} option since
8459 it can result in incorrect output for programs that depend on
8460 an exact implementation of IEEE or ISO rules/specifications for
8461 math functions.
8463 The default is @option{-ftrapping-math}.
8465 @item -frounding-math
8466 @opindex frounding-math
8467 Disable transformations and optimizations that assume default floating-point
8468 rounding behavior.  This is round-to-zero for all floating point
8469 to integer conversions, and round-to-nearest for all other arithmetic
8470 truncations.  This option should be specified for programs that change
8471 the FP rounding mode dynamically, or that may be executed with a
8472 non-default rounding mode.  This option disables constant folding of
8473 floating-point expressions at compile time (which may be affected by
8474 rounding mode) and arithmetic transformations that are unsafe in the
8475 presence of sign-dependent rounding modes.
8477 The default is @option{-fno-rounding-math}.
8479 This option is experimental and does not currently guarantee to
8480 disable all GCC optimizations that are affected by rounding mode.
8481 Future versions of GCC may provide finer control of this setting
8482 using C99's @code{FENV_ACCESS} pragma.  This command-line option
8483 will be used to specify the default state for @code{FENV_ACCESS}.
8485 @item -fsignaling-nans
8486 @opindex fsignaling-nans
8487 Compile code assuming that IEEE signaling NaNs may generate user-visible
8488 traps during floating-point operations.  Setting this option disables
8489 optimizations that may change the number of exceptions visible with
8490 signaling NaNs.  This option implies @option{-ftrapping-math}.
8492 This option causes the preprocessor macro @code{__SUPPORT_SNAN__} to
8493 be defined.
8495 The default is @option{-fno-signaling-nans}.
8497 This option is experimental and does not currently guarantee to
8498 disable all GCC optimizations that affect signaling NaN behavior.
8500 @item -fsingle-precision-constant
8501 @opindex fsingle-precision-constant
8502 Treat floating-point constants as single precision instead of
8503 implicitly converting them to double-precision constants.
8505 @item -fcx-limited-range
8506 @opindex fcx-limited-range
8507 When enabled, this option states that a range reduction step is not
8508 needed when performing complex division.  Also, there is no checking
8509 whether the result of a complex multiplication or division is @code{NaN
8510 + I*NaN}, with an attempt to rescue the situation in that case.  The
8511 default is @option{-fno-cx-limited-range}, but is enabled by
8512 @option{-ffast-math}.
8514 This option controls the default setting of the ISO C99
8515 @code{CX_LIMITED_RANGE} pragma.  Nevertheless, the option applies to
8516 all languages.
8518 @item -fcx-fortran-rules
8519 @opindex fcx-fortran-rules
8520 Complex multiplication and division follow Fortran rules.  Range
8521 reduction is done as part of complex division, but there is no checking
8522 whether the result of a complex multiplication or division is @code{NaN
8523 + I*NaN}, with an attempt to rescue the situation in that case.
8525 The default is @option{-fno-cx-fortran-rules}.
8527 @end table
8529 The following options control optimizations that may improve
8530 performance, but are not enabled by any @option{-O} options.  This
8531 section includes experimental options that may produce broken code.
8533 @table @gcctabopt
8534 @item -fbranch-probabilities
8535 @opindex fbranch-probabilities
8536 After running a program compiled with @option{-fprofile-arcs}
8537 (@pxref{Instrumentation Options}),
8538 you can compile it a second time using
8539 @option{-fbranch-probabilities}, to improve optimizations based on
8540 the number of times each branch was taken.  When a program
8541 compiled with @option{-fprofile-arcs} exits, it saves arc execution
8542 counts to a file called @file{@var{sourcename}.gcda} for each source
8543 file.  The information in this data file is very dependent on the
8544 structure of the generated code, so you must use the same source code
8545 and the same optimization options for both compilations.
8547 With @option{-fbranch-probabilities}, GCC puts a
8548 @samp{REG_BR_PROB} note on each @samp{JUMP_INSN} and @samp{CALL_INSN}.
8549 These can be used to improve optimization.  Currently, they are only
8550 used in one place: in @file{reorg.c}, instead of guessing which path a
8551 branch is most likely to take, the @samp{REG_BR_PROB} values are used to
8552 exactly determine which path is taken more often.
8554 @item -fprofile-values
8555 @opindex fprofile-values
8556 If combined with @option{-fprofile-arcs}, it adds code so that some
8557 data about values of expressions in the program is gathered.
8559 With @option{-fbranch-probabilities}, it reads back the data gathered
8560 from profiling values of expressions for usage in optimizations.
8562 Enabled with @option{-fprofile-generate} and @option{-fprofile-use}.
8564 @item -fprofile-reorder-functions
8565 @opindex fprofile-reorder-functions
8566 Function reordering based on profile instrumentation collects
8567 first time of execution of a function and orders these functions
8568 in ascending order.
8570 Enabled with @option{-fprofile-use}.
8572 @item -fvpt
8573 @opindex fvpt
8574 If combined with @option{-fprofile-arcs}, this option instructs the compiler
8575 to add code to gather information about values of expressions.
8577 With @option{-fbranch-probabilities}, it reads back the data gathered
8578 and actually performs the optimizations based on them.
8579 Currently the optimizations include specialization of division operations
8580 using the knowledge about the value of the denominator.
8582 @item -frename-registers
8583 @opindex frename-registers
8584 Attempt to avoid false dependencies in scheduled code by making use
8585 of registers left over after register allocation.  This optimization
8586 most benefits processors with lots of registers.  Depending on the
8587 debug information format adopted by the target, however, it can
8588 make debugging impossible, since variables no longer stay in
8589 a ``home register''.
8591 Enabled by default with @option{-funroll-loops} and @option{-fpeel-loops}.
8593 @item -fschedule-fusion
8594 @opindex fschedule-fusion
8595 Performs a target dependent pass over the instruction stream to schedule
8596 instructions of same type together because target machine can execute them
8597 more efficiently if they are adjacent to each other in the instruction flow.
8599 Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
8601 @item -ftracer
8602 @opindex ftracer
8603 Perform tail duplication to enlarge superblock size.  This transformation
8604 simplifies the control flow of the function allowing other optimizations to do
8605 a better job.
8607 Enabled with @option{-fprofile-use}.
8609 @item -funroll-loops
8610 @opindex funroll-loops
8611 Unroll loops whose number of iterations can be determined at compile time or
8612 upon entry to the loop.  @option{-funroll-loops} implies
8613 @option{-frerun-cse-after-loop}, @option{-fweb} and @option{-frename-registers}.
8614 It also turns on complete loop peeling (i.e.@: complete removal of loops with
8615 a small constant number of iterations).  This option makes code larger, and may
8616 or may not make it run faster.
8618 Enabled with @option{-fprofile-use}.
8620 @item -funroll-all-loops
8621 @opindex funroll-all-loops
8622 Unroll all loops, even if their number of iterations is uncertain when
8623 the loop is entered.  This usually makes programs run more slowly.
8624 @option{-funroll-all-loops} implies the same options as
8625 @option{-funroll-loops}.
8627 @item -fpeel-loops
8628 @opindex fpeel-loops
8629 Peels loops for which there is enough information that they do not
8630 roll much (from profile feedback).  It also turns on complete loop peeling
8631 (i.e.@: complete removal of loops with small constant number of iterations).
8633 Enabled with @option{-fprofile-use}.
8635 @item -fmove-loop-invariants
8636 @opindex fmove-loop-invariants
8637 Enables the loop invariant motion pass in the RTL loop optimizer.  Enabled
8638 at level @option{-O1}
8640 @item -funswitch-loops
8641 @opindex funswitch-loops
8642 Move branches with loop invariant conditions out of the loop, with duplicates
8643 of the loop on both branches (modified according to result of the condition).
8645 @item -ffunction-sections
8646 @itemx -fdata-sections
8647 @opindex ffunction-sections
8648 @opindex fdata-sections
8649 Place each function or data item into its own section in the output
8650 file if the target supports arbitrary sections.  The name of the
8651 function or the name of the data item determines the section's name
8652 in the output file.
8654 Use these options on systems where the linker can perform optimizations
8655 to improve locality of reference in the instruction space.  Most systems
8656 using the ELF object format and SPARC processors running Solaris 2 have
8657 linkers with such optimizations.  AIX may have these optimizations in
8658 the future.
8660 Only use these options when there are significant benefits from doing
8661 so.  When you specify these options, the assembler and linker
8662 create larger object and executable files and are also slower.
8663 You cannot use @command{gprof} on all systems if you
8664 specify this option, and you may have problems with debugging if
8665 you specify both this option and @option{-g}.
8667 @item -fbranch-target-load-optimize
8668 @opindex fbranch-target-load-optimize
8669 Perform branch target register load optimization before prologue / epilogue
8670 threading.
8671 The use of target registers can typically be exposed only during reload,
8672 thus hoisting loads out of loops and doing inter-block scheduling needs
8673 a separate optimization pass.
8675 @item -fbranch-target-load-optimize2
8676 @opindex fbranch-target-load-optimize2
8677 Perform branch target register load optimization after prologue / epilogue
8678 threading.
8680 @item -fbtr-bb-exclusive
8681 @opindex fbtr-bb-exclusive
8682 When performing branch target register load optimization, don't reuse
8683 branch target registers within any basic block.
8685 @item -fstdarg-opt
8686 @opindex fstdarg-opt
8687 Optimize the prologue of variadic argument functions with respect to usage of
8688 those arguments.
8690 @item -fsection-anchors
8691 @opindex fsection-anchors
8692 Try to reduce the number of symbolic address calculations by using
8693 shared ``anchor'' symbols to address nearby objects.  This transformation
8694 can help to reduce the number of GOT entries and GOT accesses on some
8695 targets.
8697 For example, the implementation of the following function @code{foo}:
8699 @smallexample
8700 static int a, b, c;
8701 int foo (void) @{ return a + b + c; @}
8702 @end smallexample
8704 @noindent
8705 usually calculates the addresses of all three variables, but if you
8706 compile it with @option{-fsection-anchors}, it accesses the variables
8707 from a common anchor point instead.  The effect is similar to the
8708 following pseudocode (which isn't valid C):
8710 @smallexample
8711 int foo (void)
8713   register int *xr = &x;
8714   return xr[&a - &x] + xr[&b - &x] + xr[&c - &x];
8716 @end smallexample
8718 Not all targets support this option.
8720 @item --param @var{name}=@var{value}
8721 @opindex param
8722 In some places, GCC uses various constants to control the amount of
8723 optimization that is done.  For example, GCC does not inline functions
8724 that contain more than a certain number of instructions.  You can
8725 control some of these constants on the command line using the
8726 @option{--param} option.
8728 The names of specific parameters, and the meaning of the values, are
8729 tied to the internals of the compiler, and are subject to change
8730 without notice in future releases.
8732 In each case, the @var{value} is an integer.  The allowable choices for
8733 @var{name} are:
8735 @table @gcctabopt
8736 @item predictable-branch-outcome
8737 When branch is predicted to be taken with probability lower than this threshold
8738 (in percent), then it is considered well predictable. The default is 10.
8740 @item max-rtl-if-conversion-insns
8741 RTL if-conversion tries to remove conditional branches around a block and
8742 replace them with conditionally executed instructions.  This parameter
8743 gives the maximum number of instructions in a block which should be
8744 considered for if-conversion.  The default is 10, though the compiler will
8745 also use other heuristics to decide whether if-conversion is likely to be
8746 profitable.
8748 @item max-crossjump-edges
8749 The maximum number of incoming edges to consider for cross-jumping.
8750 The algorithm used by @option{-fcrossjumping} is @math{O(N^2)} in
8751 the number of edges incoming to each block.  Increasing values mean
8752 more aggressive optimization, making the compilation time increase with
8753 probably small improvement in executable size.
8755 @item min-crossjump-insns
8756 The minimum number of instructions that must be matched at the end
8757 of two blocks before cross-jumping is performed on them.  This
8758 value is ignored in the case where all instructions in the block being
8759 cross-jumped from are matched.  The default value is 5.
8761 @item max-grow-copy-bb-insns
8762 The maximum code size expansion factor when copying basic blocks
8763 instead of jumping.  The expansion is relative to a jump instruction.
8764 The default value is 8.
8766 @item max-goto-duplication-insns
8767 The maximum number of instructions to duplicate to a block that jumps
8768 to a computed goto.  To avoid @math{O(N^2)} behavior in a number of
8769 passes, GCC factors computed gotos early in the compilation process,
8770 and unfactors them as late as possible.  Only computed jumps at the
8771 end of a basic blocks with no more than max-goto-duplication-insns are
8772 unfactored.  The default value is 8.
8774 @item max-delay-slot-insn-search
8775 The maximum number of instructions to consider when looking for an
8776 instruction to fill a delay slot.  If more than this arbitrary number of
8777 instructions are searched, the time savings from filling the delay slot
8778 are minimal, so stop searching.  Increasing values mean more
8779 aggressive optimization, making the compilation time increase with probably
8780 small improvement in execution time.
8782 @item max-delay-slot-live-search
8783 When trying to fill delay slots, the maximum number of instructions to
8784 consider when searching for a block with valid live register
8785 information.  Increasing this arbitrarily chosen value means more
8786 aggressive optimization, increasing the compilation time.  This parameter
8787 should be removed when the delay slot code is rewritten to maintain the
8788 control-flow graph.
8790 @item max-gcse-memory
8791 The approximate maximum amount of memory that can be allocated in
8792 order to perform the global common subexpression elimination
8793 optimization.  If more memory than specified is required, the
8794 optimization is not done.
8796 @item max-gcse-insertion-ratio
8797 If the ratio of expression insertions to deletions is larger than this value
8798 for any expression, then RTL PRE inserts or removes the expression and thus
8799 leaves partially redundant computations in the instruction stream.  The default value is 20.
8801 @item max-pending-list-length
8802 The maximum number of pending dependencies scheduling allows
8803 before flushing the current state and starting over.  Large functions
8804 with few branches or calls can create excessively large lists which
8805 needlessly consume memory and resources.
8807 @item max-modulo-backtrack-attempts
8808 The maximum number of backtrack attempts the scheduler should make
8809 when modulo scheduling a loop.  Larger values can exponentially increase
8810 compilation time.
8812 @item max-inline-insns-single
8813 Several parameters control the tree inliner used in GCC@.
8814 This number sets the maximum number of instructions (counted in GCC's
8815 internal representation) in a single function that the tree inliner
8816 considers for inlining.  This only affects functions declared
8817 inline and methods implemented in a class declaration (C++).
8818 The default value is 400.
8820 @item max-inline-insns-auto
8821 When you use @option{-finline-functions} (included in @option{-O3}),
8822 a lot of functions that would otherwise not be considered for inlining
8823 by the compiler are investigated.  To those functions, a different
8824 (more restrictive) limit compared to functions declared inline can
8825 be applied.
8826 The default value is 40.
8828 @item inline-min-speedup
8829 When estimated performance improvement of caller + callee runtime exceeds this
8830 threshold (in precent), the function can be inlined regardless the limit on
8831 @option{--param max-inline-insns-single} and @option{--param
8832 max-inline-insns-auto}.
8834 @item large-function-insns
8835 The limit specifying really large functions.  For functions larger than this
8836 limit after inlining, inlining is constrained by
8837 @option{--param large-function-growth}.  This parameter is useful primarily
8838 to avoid extreme compilation time caused by non-linear algorithms used by the
8839 back end.
8840 The default value is 2700.
8842 @item large-function-growth
8843 Specifies maximal growth of large function caused by inlining in percents.
8844 The default value is 100 which limits large function growth to 2.0 times
8845 the original size.
8847 @item large-unit-insns
8848 The limit specifying large translation unit.  Growth caused by inlining of
8849 units larger than this limit is limited by @option{--param inline-unit-growth}.
8850 For small units this might be too tight.
8851 For example, consider a unit consisting of function A
8852 that is inline and B that just calls A three times.  If B is small relative to
8853 A, the growth of unit is 300\% and yet such inlining is very sane.  For very
8854 large units consisting of small inlineable functions, however, the overall unit
8855 growth limit is needed to avoid exponential explosion of code size.  Thus for
8856 smaller units, the size is increased to @option{--param large-unit-insns}
8857 before applying @option{--param inline-unit-growth}.  The default is 10000.
8859 @item inline-unit-growth
8860 Specifies maximal overall growth of the compilation unit caused by inlining.
8861 The default value is 20 which limits unit growth to 1.2 times the original
8862 size. Cold functions (either marked cold via an attribute or by profile
8863 feedback) are not accounted into the unit size.
8865 @item ipcp-unit-growth
8866 Specifies maximal overall growth of the compilation unit caused by
8867 interprocedural constant propagation.  The default value is 10 which limits
8868 unit growth to 1.1 times the original size.
8870 @item large-stack-frame
8871 The limit specifying large stack frames.  While inlining the algorithm is trying
8872 to not grow past this limit too much.  The default value is 256 bytes.
8874 @item large-stack-frame-growth
8875 Specifies maximal growth of large stack frames caused by inlining in percents.
8876 The default value is 1000 which limits large stack frame growth to 11 times
8877 the original size.
8879 @item max-inline-insns-recursive
8880 @itemx max-inline-insns-recursive-auto
8881 Specifies the maximum number of instructions an out-of-line copy of a
8882 self-recursive inline
8883 function can grow into by performing recursive inlining.
8885 @option{--param max-inline-insns-recursive} applies to functions
8886 declared inline.
8887 For functions not declared inline, recursive inlining
8888 happens only when @option{-finline-functions} (included in @option{-O3}) is
8889 enabled; @option{--param max-inline-insns-recursive-auto} applies instead.  The
8890 default value is 450.
8892 @item max-inline-recursive-depth
8893 @itemx max-inline-recursive-depth-auto
8894 Specifies the maximum recursion depth used for recursive inlining.
8896 @option{--param max-inline-recursive-depth} applies to functions
8897 declared inline.  For functions not declared inline, recursive inlining
8898 happens only when @option{-finline-functions} (included in @option{-O3}) is
8899 enabled; @option{--param max-inline-recursive-depth-auto} applies instead.  The
8900 default value is 8.
8902 @item min-inline-recursive-probability
8903 Recursive inlining is profitable only for function having deep recursion
8904 in average and can hurt for function having little recursion depth by
8905 increasing the prologue size or complexity of function body to other
8906 optimizers.
8908 When profile feedback is available (see @option{-fprofile-generate}) the actual
8909 recursion depth can be guessed from probability that function recurses via a
8910 given call expression.  This parameter limits inlining only to call expressions
8911 whose probability exceeds the given threshold (in percents).
8912 The default value is 10.
8914 @item early-inlining-insns
8915 Specify growth that the early inliner can make.  In effect it increases
8916 the amount of inlining for code having a large abstraction penalty.
8917 The default value is 14.
8919 @item max-early-inliner-iterations
8920 Limit of iterations of the early inliner.  This basically bounds
8921 the number of nested indirect calls the early inliner can resolve.
8922 Deeper chains are still handled by late inlining.
8924 @item comdat-sharing-probability
8925 Probability (in percent) that C++ inline function with comdat visibility
8926 are shared across multiple compilation units.  The default value is 20.
8928 @item profile-func-internal-id
8929 A parameter to control whether to use function internal id in profile
8930 database lookup. If the value is 0, the compiler uses an id that
8931 is based on function assembler name and filename, which makes old profile
8932 data more tolerant to source changes such as function reordering etc.
8933 The default value is 0.
8935 @item min-vect-loop-bound
8936 The minimum number of iterations under which loops are not vectorized
8937 when @option{-ftree-vectorize} is used.  The number of iterations after
8938 vectorization needs to be greater than the value specified by this option
8939 to allow vectorization.  The default value is 0.
8941 @item gcse-cost-distance-ratio
8942 Scaling factor in calculation of maximum distance an expression
8943 can be moved by GCSE optimizations.  This is currently supported only in the
8944 code hoisting pass.  The bigger the ratio, the more aggressive code hoisting
8945 is with simple expressions, i.e., the expressions that have cost
8946 less than @option{gcse-unrestricted-cost}.  Specifying 0 disables
8947 hoisting of simple expressions.  The default value is 10.
8949 @item gcse-unrestricted-cost
8950 Cost, roughly measured as the cost of a single typical machine
8951 instruction, at which GCSE optimizations do not constrain
8952 the distance an expression can travel.  This is currently
8953 supported only in the code hoisting pass.  The lesser the cost,
8954 the more aggressive code hoisting is.  Specifying 0 
8955 allows all expressions to travel unrestricted distances.
8956 The default value is 3.
8958 @item max-hoist-depth
8959 The depth of search in the dominator tree for expressions to hoist.
8960 This is used to avoid quadratic behavior in hoisting algorithm.
8961 The value of 0 does not limit on the search, but may slow down compilation
8962 of huge functions.  The default value is 30.
8964 @item max-tail-merge-comparisons
8965 The maximum amount of similar bbs to compare a bb with.  This is used to
8966 avoid quadratic behavior in tree tail merging.  The default value is 10.
8968 @item max-tail-merge-iterations
8969 The maximum amount of iterations of the pass over the function.  This is used to
8970 limit compilation time in tree tail merging.  The default value is 2.
8972 @item max-unrolled-insns
8973 The maximum number of instructions that a loop may have to be unrolled.
8974 If a loop is unrolled, this parameter also determines how many times
8975 the loop code is unrolled.
8977 @item max-average-unrolled-insns
8978 The maximum number of instructions biased by probabilities of their execution
8979 that a loop may have to be unrolled.  If a loop is unrolled,
8980 this parameter also determines how many times the loop code is unrolled.
8982 @item max-unroll-times
8983 The maximum number of unrollings of a single loop.
8985 @item max-peeled-insns
8986 The maximum number of instructions that a loop may have to be peeled.
8987 If a loop is peeled, this parameter also determines how many times
8988 the loop code is peeled.
8990 @item max-peel-times
8991 The maximum number of peelings of a single loop.
8993 @item max-peel-branches
8994 The maximum number of branches on the hot path through the peeled sequence.
8996 @item max-completely-peeled-insns
8997 The maximum number of insns of a completely peeled loop.
8999 @item max-completely-peel-times
9000 The maximum number of iterations of a loop to be suitable for complete peeling.
9002 @item max-completely-peel-loop-nest-depth
9003 The maximum depth of a loop nest suitable for complete peeling.
9005 @item max-unswitch-insns
9006 The maximum number of insns of an unswitched loop.
9008 @item max-unswitch-level
9009 The maximum number of branches unswitched in a single loop.
9011 @item lim-expensive
9012 The minimum cost of an expensive expression in the loop invariant motion.
9014 @item iv-consider-all-candidates-bound
9015 Bound on number of candidates for induction variables, below which
9016 all candidates are considered for each use in induction variable
9017 optimizations.  If there are more candidates than this,
9018 only the most relevant ones are considered to avoid quadratic time complexity.
9020 @item iv-max-considered-uses
9021 The induction variable optimizations give up on loops that contain more
9022 induction variable uses.
9024 @item iv-always-prune-cand-set-bound
9025 If the number of candidates in the set is smaller than this value,
9026 always try to remove unnecessary ivs from the set
9027 when adding a new one.
9029 @item scev-max-expr-size
9030 Bound on size of expressions used in the scalar evolutions analyzer.
9031 Large expressions slow the analyzer.
9033 @item scev-max-expr-complexity
9034 Bound on the complexity of the expressions in the scalar evolutions analyzer.
9035 Complex expressions slow the analyzer.
9037 @item max-tree-if-conversion-phi-args
9038 Maximum number of arguments in a PHI supported by TREE if conversion
9039 unless the loop is marked with simd pragma.
9041 @item vect-max-version-for-alignment-checks
9042 The maximum number of run-time checks that can be performed when
9043 doing loop versioning for alignment in the vectorizer.
9045 @item vect-max-version-for-alias-checks
9046 The maximum number of run-time checks that can be performed when
9047 doing loop versioning for alias in the vectorizer.
9049 @item vect-max-peeling-for-alignment
9050 The maximum number of loop peels to enhance access alignment
9051 for vectorizer. Value -1 means no limit.
9053 @item max-iterations-to-track
9054 The maximum number of iterations of a loop the brute-force algorithm
9055 for analysis of the number of iterations of the loop tries to evaluate.
9057 @item hot-bb-count-ws-permille
9058 A basic block profile count is considered hot if it contributes to 
9059 the given permillage (i.e. 0...1000) of the entire profiled execution.
9061 @item hot-bb-frequency-fraction
9062 Select fraction of the entry block frequency of executions of basic block in
9063 function given basic block needs to have to be considered hot.
9065 @item max-predicted-iterations
9066 The maximum number of loop iterations we predict statically.  This is useful
9067 in cases where a function contains a single loop with known bound and
9068 another loop with unknown bound.
9069 The known number of iterations is predicted correctly, while
9070 the unknown number of iterations average to roughly 10.  This means that the
9071 loop without bounds appears artificially cold relative to the other one.
9073 @item builtin-expect-probability
9074 Control the probability of the expression having the specified value. This
9075 parameter takes a percentage (i.e. 0 ... 100) as input.
9076 The default probability of 90 is obtained empirically.
9078 @item align-threshold
9080 Select fraction of the maximal frequency of executions of a basic block in
9081 a function to align the basic block.
9083 @item align-loop-iterations
9085 A loop expected to iterate at least the selected number of iterations is
9086 aligned.
9088 @item tracer-dynamic-coverage
9089 @itemx tracer-dynamic-coverage-feedback
9091 This value is used to limit superblock formation once the given percentage of
9092 executed instructions is covered.  This limits unnecessary code size
9093 expansion.
9095 The @option{tracer-dynamic-coverage-feedback} parameter
9096 is used only when profile
9097 feedback is available.  The real profiles (as opposed to statically estimated
9098 ones) are much less balanced allowing the threshold to be larger value.
9100 @item tracer-max-code-growth
9101 Stop tail duplication once code growth has reached given percentage.  This is
9102 a rather artificial limit, as most of the duplicates are eliminated later in
9103 cross jumping, so it may be set to much higher values than is the desired code
9104 growth.
9106 @item tracer-min-branch-ratio
9108 Stop reverse growth when the reverse probability of best edge is less than this
9109 threshold (in percent).
9111 @item tracer-min-branch-probability
9112 @itemx tracer-min-branch-probability-feedback
9114 Stop forward growth if the best edge has probability lower than this
9115 threshold.
9117 Similarly to @option{tracer-dynamic-coverage} two parameters are
9118 provided.  @option{tracer-min-branch-probability-feedback} is used for
9119 compilation with profile feedback and @option{tracer-min-branch-probability}
9120 compilation without.  The value for compilation with profile feedback
9121 needs to be more conservative (higher) in order to make tracer
9122 effective.
9124 @item max-cse-path-length
9126 The maximum number of basic blocks on path that CSE considers.
9127 The default is 10.
9129 @item max-cse-insns
9130 The maximum number of instructions CSE processes before flushing.
9131 The default is 1000.
9133 @item ggc-min-expand
9135 GCC uses a garbage collector to manage its own memory allocation.  This
9136 parameter specifies the minimum percentage by which the garbage
9137 collector's heap should be allowed to expand between collections.
9138 Tuning this may improve compilation speed; it has no effect on code
9139 generation.
9141 The default is 30% + 70% * (RAM/1GB) with an upper bound of 100% when
9142 RAM >= 1GB@.  If @code{getrlimit} is available, the notion of ``RAM'' is
9143 the smallest of actual RAM and @code{RLIMIT_DATA} or @code{RLIMIT_AS}.  If
9144 GCC is not able to calculate RAM on a particular platform, the lower
9145 bound of 30% is used.  Setting this parameter and
9146 @option{ggc-min-heapsize} to zero causes a full collection to occur at
9147 every opportunity.  This is extremely slow, but can be useful for
9148 debugging.
9150 @item ggc-min-heapsize
9152 Minimum size of the garbage collector's heap before it begins bothering
9153 to collect garbage.  The first collection occurs after the heap expands
9154 by @option{ggc-min-expand}% beyond @option{ggc-min-heapsize}.  Again,
9155 tuning this may improve compilation speed, and has no effect on code
9156 generation.
9158 The default is the smaller of RAM/8, RLIMIT_RSS, or a limit that
9159 tries to ensure that RLIMIT_DATA or RLIMIT_AS are not exceeded, but
9160 with a lower bound of 4096 (four megabytes) and an upper bound of
9161 131072 (128 megabytes).  If GCC is not able to calculate RAM on a
9162 particular platform, the lower bound is used.  Setting this parameter
9163 very large effectively disables garbage collection.  Setting this
9164 parameter and @option{ggc-min-expand} to zero causes a full collection
9165 to occur at every opportunity.
9167 @item max-reload-search-insns
9168 The maximum number of instruction reload should look backward for equivalent
9169 register.  Increasing values mean more aggressive optimization, making the
9170 compilation time increase with probably slightly better performance.
9171 The default value is 100.
9173 @item max-cselib-memory-locations
9174 The maximum number of memory locations cselib should take into account.
9175 Increasing values mean more aggressive optimization, making the compilation time
9176 increase with probably slightly better performance.  The default value is 500.
9178 @item max-sched-ready-insns
9179 The maximum number of instructions ready to be issued the scheduler should
9180 consider at any given time during the first scheduling pass.  Increasing
9181 values mean more thorough searches, making the compilation time increase
9182 with probably little benefit.  The default value is 100.
9184 @item max-sched-region-blocks
9185 The maximum number of blocks in a region to be considered for
9186 interblock scheduling.  The default value is 10.
9188 @item max-pipeline-region-blocks
9189 The maximum number of blocks in a region to be considered for
9190 pipelining in the selective scheduler.  The default value is 15.
9192 @item max-sched-region-insns
9193 The maximum number of insns in a region to be considered for
9194 interblock scheduling.  The default value is 100.
9196 @item max-pipeline-region-insns
9197 The maximum number of insns in a region to be considered for
9198 pipelining in the selective scheduler.  The default value is 200.
9200 @item min-spec-prob
9201 The minimum probability (in percents) of reaching a source block
9202 for interblock speculative scheduling.  The default value is 40.
9204 @item max-sched-extend-regions-iters
9205 The maximum number of iterations through CFG to extend regions.
9206 A value of 0 (the default) disables region extensions.
9208 @item max-sched-insn-conflict-delay
9209 The maximum conflict delay for an insn to be considered for speculative motion.
9210 The default value is 3.
9212 @item sched-spec-prob-cutoff
9213 The minimal probability of speculation success (in percents), so that
9214 speculative insns are scheduled.
9215 The default value is 40.
9217 @item sched-state-edge-prob-cutoff
9218 The minimum probability an edge must have for the scheduler to save its
9219 state across it.
9220 The default value is 10.
9222 @item sched-mem-true-dep-cost
9223 Minimal distance (in CPU cycles) between store and load targeting same
9224 memory locations.  The default value is 1.
9226 @item selsched-max-lookahead
9227 The maximum size of the lookahead window of selective scheduling.  It is a
9228 depth of search for available instructions.
9229 The default value is 50.
9231 @item selsched-max-sched-times
9232 The maximum number of times that an instruction is scheduled during
9233 selective scheduling.  This is the limit on the number of iterations
9234 through which the instruction may be pipelined.  The default value is 2.
9236 @item selsched-insns-to-rename
9237 The maximum number of best instructions in the ready list that are considered
9238 for renaming in the selective scheduler.  The default value is 2.
9240 @item sms-min-sc
9241 The minimum value of stage count that swing modulo scheduler
9242 generates.  The default value is 2.
9244 @item max-last-value-rtl
9245 The maximum size measured as number of RTLs that can be recorded in an expression
9246 in combiner for a pseudo register as last known value of that register.  The default
9247 is 10000.
9249 @item max-combine-insns
9250 The maximum number of instructions the RTL combiner tries to combine.
9251 The default value is 2 at @option{-Og} and 4 otherwise.
9253 @item integer-share-limit
9254 Small integer constants can use a shared data structure, reducing the
9255 compiler's memory usage and increasing its speed.  This sets the maximum
9256 value of a shared integer constant.  The default value is 256.
9258 @item ssp-buffer-size
9259 The minimum size of buffers (i.e.@: arrays) that receive stack smashing
9260 protection when @option{-fstack-protection} is used.
9262 @item min-size-for-stack-sharing
9263 The minimum size of variables taking part in stack slot sharing when not
9264 optimizing. The default value is 32.
9266 @item max-jump-thread-duplication-stmts
9267 Maximum number of statements allowed in a block that needs to be
9268 duplicated when threading jumps.
9270 @item max-fields-for-field-sensitive
9271 Maximum number of fields in a structure treated in
9272 a field sensitive manner during pointer analysis.  The default is zero
9273 for @option{-O0} and @option{-O1},
9274 and 100 for @option{-Os}, @option{-O2}, and @option{-O3}.
9276 @item prefetch-latency
9277 Estimate on average number of instructions that are executed before
9278 prefetch finishes.  The distance prefetched ahead is proportional
9279 to this constant.  Increasing this number may also lead to less
9280 streams being prefetched (see @option{simultaneous-prefetches}).
9282 @item simultaneous-prefetches
9283 Maximum number of prefetches that can run at the same time.
9285 @item l1-cache-line-size
9286 The size of cache line in L1 cache, in bytes.
9288 @item l1-cache-size
9289 The size of L1 cache, in kilobytes.
9291 @item l2-cache-size
9292 The size of L2 cache, in kilobytes.
9294 @item min-insn-to-prefetch-ratio
9295 The minimum ratio between the number of instructions and the
9296 number of prefetches to enable prefetching in a loop.
9298 @item prefetch-min-insn-to-mem-ratio
9299 The minimum ratio between the number of instructions and the
9300 number of memory references to enable prefetching in a loop.
9302 @item use-canonical-types
9303 Whether the compiler should use the ``canonical'' type system.  By
9304 default, this should always be 1, which uses a more efficient internal
9305 mechanism for comparing types in C++ and Objective-C++.  However, if
9306 bugs in the canonical type system are causing compilation failures,
9307 set this value to 0 to disable canonical types.
9309 @item switch-conversion-max-branch-ratio
9310 Switch initialization conversion refuses to create arrays that are
9311 bigger than @option{switch-conversion-max-branch-ratio} times the number of
9312 branches in the switch.
9314 @item max-partial-antic-length
9315 Maximum length of the partial antic set computed during the tree
9316 partial redundancy elimination optimization (@option{-ftree-pre}) when
9317 optimizing at @option{-O3} and above.  For some sorts of source code
9318 the enhanced partial redundancy elimination optimization can run away,
9319 consuming all of the memory available on the host machine.  This
9320 parameter sets a limit on the length of the sets that are computed,
9321 which prevents the runaway behavior.  Setting a value of 0 for
9322 this parameter allows an unlimited set length.
9324 @item sccvn-max-scc-size
9325 Maximum size of a strongly connected component (SCC) during SCCVN
9326 processing.  If this limit is hit, SCCVN processing for the whole
9327 function is not done and optimizations depending on it are
9328 disabled.  The default maximum SCC size is 10000.
9330 @item sccvn-max-alias-queries-per-access
9331 Maximum number of alias-oracle queries we perform when looking for
9332 redundancies for loads and stores.  If this limit is hit the search
9333 is aborted and the load or store is not considered redundant.  The
9334 number of queries is algorithmically limited to the number of
9335 stores on all paths from the load to the function entry.
9336 The default maximum number of queries is 1000.
9338 @item ira-max-loops-num
9339 IRA uses regional register allocation by default.  If a function
9340 contains more loops than the number given by this parameter, only at most
9341 the given number of the most frequently-executed loops form regions
9342 for regional register allocation.  The default value of the
9343 parameter is 100.
9345 @item ira-max-conflict-table-size 
9346 Although IRA uses a sophisticated algorithm to compress the conflict
9347 table, the table can still require excessive amounts of memory for
9348 huge functions.  If the conflict table for a function could be more
9349 than the size in MB given by this parameter, the register allocator
9350 instead uses a faster, simpler, and lower-quality
9351 algorithm that does not require building a pseudo-register conflict table.  
9352 The default value of the parameter is 2000.
9354 @item ira-loop-reserved-regs
9355 IRA can be used to evaluate more accurate register pressure in loops
9356 for decisions to move loop invariants (see @option{-O3}).  The number
9357 of available registers reserved for some other purposes is given
9358 by this parameter.  The default value of the parameter is 2, which is
9359 the minimal number of registers needed by typical instructions.
9360 This value is the best found from numerous experiments.
9362 @item lra-inheritance-ebb-probability-cutoff
9363 LRA tries to reuse values reloaded in registers in subsequent insns.
9364 This optimization is called inheritance.  EBB is used as a region to
9365 do this optimization.  The parameter defines a minimal fall-through
9366 edge probability in percentage used to add BB to inheritance EBB in
9367 LRA.  The default value of the parameter is 40.  The value was chosen
9368 from numerous runs of SPEC2000 on x86-64.
9370 @item loop-invariant-max-bbs-in-loop
9371 Loop invariant motion can be very expensive, both in compilation time and
9372 in amount of needed compile-time memory, with very large loops.  Loops
9373 with more basic blocks than this parameter won't have loop invariant
9374 motion optimization performed on them.  The default value of the
9375 parameter is 1000 for @option{-O1} and 10000 for @option{-O2} and above.
9377 @item loop-max-datarefs-for-datadeps
9378 Building data dependencies is expensive for very large loops.  This
9379 parameter limits the number of data references in loops that are
9380 considered for data dependence analysis.  These large loops are no
9381 handled by the optimizations using loop data dependencies.
9382 The default value is 1000.
9384 @item max-vartrack-size
9385 Sets a maximum number of hash table slots to use during variable
9386 tracking dataflow analysis of any function.  If this limit is exceeded
9387 with variable tracking at assignments enabled, analysis for that
9388 function is retried without it, after removing all debug insns from
9389 the function.  If the limit is exceeded even without debug insns, var
9390 tracking analysis is completely disabled for the function.  Setting
9391 the parameter to zero makes it unlimited.
9393 @item max-vartrack-expr-depth
9394 Sets a maximum number of recursion levels when attempting to map
9395 variable names or debug temporaries to value expressions.  This trades
9396 compilation time for more complete debug information.  If this is set too
9397 low, value expressions that are available and could be represented in
9398 debug information may end up not being used; setting this higher may
9399 enable the compiler to find more complex debug expressions, but compile
9400 time and memory use may grow.  The default is 12.
9402 @item min-nondebug-insn-uid
9403 Use uids starting at this parameter for nondebug insns.  The range below
9404 the parameter is reserved exclusively for debug insns created by
9405 @option{-fvar-tracking-assignments}, but debug insns may get
9406 (non-overlapping) uids above it if the reserved range is exhausted.
9408 @item ipa-sra-ptr-growth-factor
9409 IPA-SRA replaces a pointer to an aggregate with one or more new
9410 parameters only when their cumulative size is less or equal to
9411 @option{ipa-sra-ptr-growth-factor} times the size of the original
9412 pointer parameter.
9414 @item sra-max-scalarization-size-Ospeed
9415 @item sra-max-scalarization-size-Osize
9416 The two Scalar Reduction of Aggregates passes (SRA and IPA-SRA) aim to
9417 replace scalar parts of aggregates with uses of independent scalar
9418 variables.  These parameters control the maximum size, in storage units,
9419 of aggregate which is considered for replacement when compiling for
9420 speed
9421 (@option{sra-max-scalarization-size-Ospeed}) or size
9422 (@option{sra-max-scalarization-size-Osize}) respectively.
9424 @item tm-max-aggregate-size
9425 When making copies of thread-local variables in a transaction, this
9426 parameter specifies the size in bytes after which variables are
9427 saved with the logging functions as opposed to save/restore code
9428 sequence pairs.  This option only applies when using
9429 @option{-fgnu-tm}.
9431 @item graphite-max-nb-scop-params
9432 To avoid exponential effects in the Graphite loop transforms, the
9433 number of parameters in a Static Control Part (SCoP) is bounded.  The
9434 default value is 10 parameters.  A variable whose value is unknown at
9435 compilation time and defined outside a SCoP is a parameter of the SCoP.
9437 @item graphite-max-bbs-per-function
9438 To avoid exponential effects in the detection of SCoPs, the size of
9439 the functions analyzed by Graphite is bounded.  The default value is
9440 100 basic blocks.
9442 @item loop-block-tile-size
9443 Loop blocking or strip mining transforms, enabled with
9444 @option{-floop-block} or @option{-floop-strip-mine}, strip mine each
9445 loop in the loop nest by a given number of iterations.  The strip
9446 length can be changed using the @option{loop-block-tile-size}
9447 parameter.  The default value is 51 iterations.
9449 @item loop-unroll-jam-size
9450 Specify the unroll factor for the @option{-floop-unroll-and-jam} option.  The 
9451 default value is 4.
9453 @item loop-unroll-jam-depth
9454 Specify the dimension to be unrolled (counting from the most inner loop)
9455 for the  @option{-floop-unroll-and-jam}.  The default value is 2.
9457 @item ipa-cp-value-list-size
9458 IPA-CP attempts to track all possible values and types passed to a function's
9459 parameter in order to propagate them and perform devirtualization.
9460 @option{ipa-cp-value-list-size} is the maximum number of values and types it
9461 stores per one formal parameter of a function.
9463 @item ipa-cp-eval-threshold
9464 IPA-CP calculates its own score of cloning profitability heuristics
9465 and performs those cloning opportunities with scores that exceed
9466 @option{ipa-cp-eval-threshold}.
9468 @item ipa-cp-recursion-penalty
9469 Percentage penalty the recursive functions will receive when they
9470 are evaluated for cloning.
9472 @item ipa-cp-single-call-penalty
9473 Percentage penalty functions containg a single call to another
9474 function will receive when they are evaluated for cloning.
9477 @item ipa-max-agg-items
9478 IPA-CP is also capable to propagate a number of scalar values passed
9479 in an aggregate. @option{ipa-max-agg-items} controls the maximum
9480 number of such values per one parameter.
9482 @item ipa-cp-loop-hint-bonus
9483 When IPA-CP determines that a cloning candidate would make the number
9484 of iterations of a loop known, it adds a bonus of
9485 @option{ipa-cp-loop-hint-bonus} to the profitability score of
9486 the candidate.
9488 @item ipa-cp-array-index-hint-bonus
9489 When IPA-CP determines that a cloning candidate would make the index of
9490 an array access known, it adds a bonus of
9491 @option{ipa-cp-array-index-hint-bonus} to the profitability
9492 score of the candidate.
9494 @item ipa-max-aa-steps
9495 During its analysis of function bodies, IPA-CP employs alias analysis
9496 in order to track values pointed to by function parameters.  In order
9497 not spend too much time analyzing huge functions, it gives up and
9498 consider all memory clobbered after examining
9499 @option{ipa-max-aa-steps} statements modifying memory.
9501 @item lto-partitions
9502 Specify desired number of partitions produced during WHOPR compilation.
9503 The number of partitions should exceed the number of CPUs used for compilation.
9504 The default value is 32.
9506 @item lto-min-partition
9507 Size of minimal partition for WHOPR (in estimated instructions).
9508 This prevents expenses of splitting very small programs into too many
9509 partitions.
9511 @item lto-max-partition
9512 Size of max partition for WHOPR (in estimated instructions).
9513 to provide an upper bound for individual size of partition.
9514 Meant to be used only with balanced partitioning.
9516 @item cxx-max-namespaces-for-diagnostic-help
9517 The maximum number of namespaces to consult for suggestions when C++
9518 name lookup fails for an identifier.  The default is 1000.
9520 @item sink-frequency-threshold
9521 The maximum relative execution frequency (in percents) of the target block
9522 relative to a statement's original block to allow statement sinking of a
9523 statement.  Larger numbers result in more aggressive statement sinking.
9524 The default value is 75.  A small positive adjustment is applied for
9525 statements with memory operands as those are even more profitable so sink.
9527 @item max-stores-to-sink
9528 The maximum number of conditional store pairs that can be sunk.  Set to 0
9529 if either vectorization (@option{-ftree-vectorize}) or if-conversion
9530 (@option{-ftree-loop-if-convert}) is disabled.  The default is 2.
9532 @item allow-store-data-races
9533 Allow optimizers to introduce new data races on stores.
9534 Set to 1 to allow, otherwise to 0.  This option is enabled by default
9535 at optimization level @option{-Ofast}.
9537 @item case-values-threshold
9538 The smallest number of different values for which it is best to use a
9539 jump-table instead of a tree of conditional branches.  If the value is
9540 0, use the default for the machine.  The default is 0.
9542 @item tree-reassoc-width
9543 Set the maximum number of instructions executed in parallel in
9544 reassociated tree. This parameter overrides target dependent
9545 heuristics used by default if has non zero value.
9547 @item sched-pressure-algorithm
9548 Choose between the two available implementations of
9549 @option{-fsched-pressure}.  Algorithm 1 is the original implementation
9550 and is the more likely to prevent instructions from being reordered.
9551 Algorithm 2 was designed to be a compromise between the relatively
9552 conservative approach taken by algorithm 1 and the rather aggressive
9553 approach taken by the default scheduler.  It relies more heavily on
9554 having a regular register file and accurate register pressure classes.
9555 See @file{haifa-sched.c} in the GCC sources for more details.
9557 The default choice depends on the target.
9559 @item max-slsr-cand-scan
9560 Set the maximum number of existing candidates that are considered when
9561 seeking a basis for a new straight-line strength reduction candidate.
9563 @item asan-globals
9564 Enable buffer overflow detection for global objects.  This kind
9565 of protection is enabled by default if you are using
9566 @option{-fsanitize=address} option.
9567 To disable global objects protection use @option{--param asan-globals=0}.
9569 @item asan-stack
9570 Enable buffer overflow detection for stack objects.  This kind of
9571 protection is enabled by default when using @option{-fsanitize=address}.
9572 To disable stack protection use @option{--param asan-stack=0} option.
9574 @item asan-instrument-reads
9575 Enable buffer overflow detection for memory reads.  This kind of
9576 protection is enabled by default when using @option{-fsanitize=address}.
9577 To disable memory reads protection use
9578 @option{--param asan-instrument-reads=0}.
9580 @item asan-instrument-writes
9581 Enable buffer overflow detection for memory writes.  This kind of
9582 protection is enabled by default when using @option{-fsanitize=address}.
9583 To disable memory writes protection use
9584 @option{--param asan-instrument-writes=0} option.
9586 @item asan-memintrin
9587 Enable detection for built-in functions.  This kind of protection
9588 is enabled by default when using @option{-fsanitize=address}.
9589 To disable built-in functions protection use
9590 @option{--param asan-memintrin=0}.
9592 @item asan-use-after-return
9593 Enable detection of use-after-return.  This kind of protection
9594 is enabled by default when using @option{-fsanitize=address} option.
9595 To disable use-after-return detection use 
9596 @option{--param asan-use-after-return=0}.
9598 @item asan-instrumentation-with-call-threshold
9599 If number of memory accesses in function being instrumented
9600 is greater or equal to this number, use callbacks instead of inline checks.
9601 E.g. to disable inline code use
9602 @option{--param asan-instrumentation-with-call-threshold=0}.
9604 @item chkp-max-ctor-size
9605 Static constructors generated by Pointer Bounds Checker may become very
9606 large and significantly increase compile time at optimization level
9607 @option{-O1} and higher.  This parameter is a maximum nubmer of statements
9608 in a single generated constructor.  Default value is 5000.
9610 @item max-fsm-thread-path-insns
9611 Maximum number of instructions to copy when duplicating blocks on a
9612 finite state automaton jump thread path.  The default is 100.
9614 @item max-fsm-thread-length
9615 Maximum number of basic blocks on a finite state automaton jump thread
9616 path.  The default is 10.
9618 @item max-fsm-thread-paths
9619 Maximum number of new jump thread paths to create for a finite state
9620 automaton.  The default is 50.
9622 @item parloops-chunk-size
9623 Chunk size of omp schedule for loops parallelized by parloops.  The default
9624 is 0.
9626 @item parloops-schedule
9627 Schedule type of omp schedule for loops parallelized by parloops (static,
9628 dynamic, guided, auto, runtime).  The default is static.
9630 @item max-ssa-name-query-depth
9631 Maximum depth of recursion when querying properties of SSA names in things
9632 like fold routines.  One level of recursion corresponds to following a
9633 use-def chain.
9635 @item hsa-gen-debug-stores
9636 Enable emission of special debug stores within HSA kernels which are
9637 then read and reported by libgomp plugin.  Generation of these stores
9638 is disabled by default, use @option{--param hsa-gen-debug-stores=1} to
9639 enable it.
9641 @item max-speculative-devirt-maydefs
9642 The maximum number of may-defs we analyze when looking for a must-def
9643 specifying the dynamic type of an object that invokes a virtual call
9644 we may be able to devirtualize speculatively.
9645 @end table
9646 @end table
9648 @node Instrumentation Options
9649 @section Program Instrumentation Options
9650 @cindex instrumentation options
9651 @cindex program instrumentation options
9652 @cindex run-time error checking options
9653 @cindex profiling options
9654 @cindex options, program instrumentation
9655 @cindex options, run-time error checking
9656 @cindex options, profiling
9658 GCC supports a number of command-line options that control adding
9659 run-time instrumentation to the code it normally generates.  
9660 For example, one purpose of instrumentation is collect profiling
9661 statistics for use in finding program hot spots, code coverage
9662 analysis, or profile-guided optimizations.
9663 Another class of program instrumentation is adding run-time checking 
9664 to detect programming errors like invalid pointer
9665 dereferences or out-of-bounds array accesses, as well as deliberately
9666 hostile attacks such as stack smashing or C++ vtable hijacking.
9667 There is also a general hook which can be used to implement other
9668 forms of tracing or function-level instrumentation for debug or
9669 program analysis purposes.
9671 @table @gcctabopt
9672 @cindex @command{prof}
9673 @item -p
9674 @opindex p
9675 Generate extra code to write profile information suitable for the
9676 analysis program @command{prof}.  You must use this option when compiling
9677 the source files you want data about, and you must also use it when
9678 linking.
9680 @cindex @command{gprof}
9681 @item -pg
9682 @opindex pg
9683 Generate extra code to write profile information suitable for the
9684 analysis program @command{gprof}.  You must use this option when compiling
9685 the source files you want data about, and you must also use it when
9686 linking.
9688 @item -fprofile-arcs
9689 @opindex fprofile-arcs
9690 Add code so that program flow @dfn{arcs} are instrumented.  During
9691 execution the program records how many times each branch and call is
9692 executed and how many times it is taken or returns.  When the compiled
9693 program exits it saves this data to a file called
9694 @file{@var{auxname}.gcda} for each source file.  The data may be used for
9695 profile-directed optimizations (@option{-fbranch-probabilities}), or for
9696 test coverage analysis (@option{-ftest-coverage}).  Each object file's
9697 @var{auxname} is generated from the name of the output file, if
9698 explicitly specified and it is not the final executable, otherwise it is
9699 the basename of the source file.  In both cases any suffix is removed
9700 (e.g.@: @file{foo.gcda} for input file @file{dir/foo.c}, or
9701 @file{dir/foo.gcda} for output file specified as @option{-o dir/foo.o}).
9702 @xref{Cross-profiling}.
9704 @cindex @command{gcov}
9705 @item --coverage
9706 @opindex coverage
9708 This option is used to compile and link code instrumented for coverage
9709 analysis.  The option is a synonym for @option{-fprofile-arcs}
9710 @option{-ftest-coverage} (when compiling) and @option{-lgcov} (when
9711 linking).  See the documentation for those options for more details.
9713 @itemize
9715 @item
9716 Compile the source files with @option{-fprofile-arcs} plus optimization
9717 and code generation options.  For test coverage analysis, use the
9718 additional @option{-ftest-coverage} option.  You do not need to profile
9719 every source file in a program.
9721 @item
9722 Link your object files with @option{-lgcov} or @option{-fprofile-arcs}
9723 (the latter implies the former).
9725 @item
9726 Run the program on a representative workload to generate the arc profile
9727 information.  This may be repeated any number of times.  You can run
9728 concurrent instances of your program, and provided that the file system
9729 supports locking, the data files will be correctly updated.  Also
9730 @code{fork} calls are detected and correctly handled (double counting
9731 will not happen).
9733 @item
9734 For profile-directed optimizations, compile the source files again with
9735 the same optimization and code generation options plus
9736 @option{-fbranch-probabilities} (@pxref{Optimize Options,,Options that
9737 Control Optimization}).
9739 @item
9740 For test coverage analysis, use @command{gcov} to produce human readable
9741 information from the @file{.gcno} and @file{.gcda} files.  Refer to the
9742 @command{gcov} documentation for further information.
9744 @end itemize
9746 With @option{-fprofile-arcs}, for each function of your program GCC
9747 creates a program flow graph, then finds a spanning tree for the graph.
9748 Only arcs that are not on the spanning tree have to be instrumented: the
9749 compiler adds code to count the number of times that these arcs are
9750 executed.  When an arc is the only exit or only entrance to a block, the
9751 instrumentation code can be added to the block; otherwise, a new basic
9752 block must be created to hold the instrumentation code.
9754 @need 2000
9755 @item -ftest-coverage
9756 @opindex ftest-coverage
9757 Produce a notes file that the @command{gcov} code-coverage utility
9758 (@pxref{Gcov,, @command{gcov}---a Test Coverage Program}) can use to
9759 show program coverage.  Each source file's note file is called
9760 @file{@var{auxname}.gcno}.  Refer to the @option{-fprofile-arcs} option
9761 above for a description of @var{auxname} and instructions on how to
9762 generate test coverage data.  Coverage data matches the source files
9763 more closely if you do not optimize.
9765 @item -fprofile-dir=@var{path}
9766 @opindex fprofile-dir
9768 Set the directory to search for the profile data files in to @var{path}.
9769 This option affects only the profile data generated by
9770 @option{-fprofile-generate}, @option{-ftest-coverage}, @option{-fprofile-arcs}
9771 and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
9772 and its related options.  Both absolute and relative paths can be used.
9773 By default, GCC uses the current directory as @var{path}, thus the
9774 profile data file appears in the same directory as the object file.
9776 @item -fprofile-generate
9777 @itemx -fprofile-generate=@var{path}
9778 @opindex fprofile-generate
9780 Enable options usually used for instrumenting application to produce
9781 profile useful for later recompilation with profile feedback based
9782 optimization.  You must use @option{-fprofile-generate} both when
9783 compiling and when linking your program.
9785 The following options are enabled: @option{-fprofile-arcs}, @option{-fprofile-values}, @option{-fvpt}.
9787 If @var{path} is specified, GCC looks at the @var{path} to find
9788 the profile feedback data files. See @option{-fprofile-dir}.
9790 To optimize the program based on the collected profile information, use
9791 @option{-fprofile-use}.  @xref{Optimize Options}, for more information.
9793 @item -fsanitize=address
9794 @opindex fsanitize=address
9795 Enable AddressSanitizer, a fast memory error detector.
9796 Memory access instructions are instrumented to detect
9797 out-of-bounds and use-after-free bugs.
9798 See @uref{https://github.com/google/sanitizers/wiki/AddressSanitizer} for
9799 more details.  The run-time behavior can be influenced using the
9800 @env{ASAN_OPTIONS} environment variable.  When set to @code{help=1},
9801 the available options are shown at startup of the instrumented program.  See
9802 @url{https://github.com/google/sanitizers/wiki/AddressSanitizerFlags#run-time-flags}
9803 for a list of supported options.
9805 @item -fsanitize=kernel-address
9806 @opindex fsanitize=kernel-address
9807 Enable AddressSanitizer for Linux kernel.
9808 See @uref{https://github.com/google/kasan/wiki} for more details.
9810 @item -fsanitize=thread
9811 @opindex fsanitize=thread
9812 Enable ThreadSanitizer, a fast data race detector.
9813 Memory access instructions are instrumented to detect
9814 data race bugs.  See @uref{https://github.com/google/sanitizers/wiki#threadsanitizer} for more
9815 details. The run-time behavior can be influenced using the @env{TSAN_OPTIONS}
9816 environment variable; see
9817 @url{https://github.com/google/sanitizers/wiki/ThreadSanitizerFlags} for a list of
9818 supported options.
9820 @item -fsanitize=leak
9821 @opindex fsanitize=leak
9822 Enable LeakSanitizer, a memory leak detector.
9823 This option only matters for linking of executables and if neither
9824 @option{-fsanitize=address} nor @option{-fsanitize=thread} is used.  In that
9825 case the executable is linked against a library that overrides @code{malloc}
9826 and other allocator functions.  See
9827 @uref{https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer} for more
9828 details.  The run-time behavior can be influenced using the
9829 @env{LSAN_OPTIONS} environment variable.
9831 @item -fsanitize=undefined
9832 @opindex fsanitize=undefined
9833 Enable UndefinedBehaviorSanitizer, a fast undefined behavior detector.
9834 Various computations are instrumented to detect undefined behavior
9835 at runtime.  Current suboptions are:
9837 @table @gcctabopt
9839 @item -fsanitize=shift
9840 @opindex fsanitize=shift
9841 This option enables checking that the result of a shift operation is
9842 not undefined.  Note that what exactly is considered undefined differs
9843 slightly between C and C++, as well as between ISO C90 and C99, etc.
9845 @item -fsanitize=integer-divide-by-zero
9846 @opindex fsanitize=integer-divide-by-zero
9847 Detect integer division by zero as well as @code{INT_MIN / -1} division.
9849 @item -fsanitize=unreachable
9850 @opindex fsanitize=unreachable
9851 With this option, the compiler turns the @code{__builtin_unreachable}
9852 call into a diagnostics message call instead.  When reaching the
9853 @code{__builtin_unreachable} call, the behavior is undefined.
9855 @item -fsanitize=vla-bound
9856 @opindex fsanitize=vla-bound
9857 This option instructs the compiler to check that the size of a variable
9858 length array is positive.
9860 @item -fsanitize=null
9861 @opindex fsanitize=null
9862 This option enables pointer checking.  Particularly, the application
9863 built with this option turned on will issue an error message when it
9864 tries to dereference a NULL pointer, or if a reference (possibly an
9865 rvalue reference) is bound to a NULL pointer, or if a method is invoked
9866 on an object pointed by a NULL pointer.
9868 @item -fsanitize=return
9869 @opindex fsanitize=return
9870 This option enables return statement checking.  Programs
9871 built with this option turned on will issue an error message
9872 when the end of a non-void function is reached without actually
9873 returning a value.  This option works in C++ only.
9875 @item -fsanitize=signed-integer-overflow
9876 @opindex fsanitize=signed-integer-overflow
9877 This option enables signed integer overflow checking.  We check that
9878 the result of @code{+}, @code{*}, and both unary and binary @code{-}
9879 does not overflow in the signed arithmetics.  Note, integer promotion
9880 rules must be taken into account.  That is, the following is not an
9881 overflow:
9882 @smallexample
9883 signed char a = SCHAR_MAX;
9884 a++;
9885 @end smallexample
9887 @item -fsanitize=bounds
9888 @opindex fsanitize=bounds
9889 This option enables instrumentation of array bounds.  Various out of bounds
9890 accesses are detected.  Flexible array members, flexible array member-like
9891 arrays, and initializers of variables with static storage are not instrumented.
9893 @item -fsanitize=bounds-strict
9894 @opindex fsanitize=bounds-strict
9895 This option enables strict instrumentation of array bounds.  Most out of bounds
9896 accesses are detected, including flexible array members and flexible array
9897 member-like arrays.  Initializers of variables with static storage are not
9898 instrumented.
9900 @item -fsanitize=alignment
9901 @opindex fsanitize=alignment
9903 This option enables checking of alignment of pointers when they are
9904 dereferenced, or when a reference is bound to insufficiently aligned target,
9905 or when a method or constructor is invoked on insufficiently aligned object.
9907 @item -fsanitize=object-size
9908 @opindex fsanitize=object-size
9909 This option enables instrumentation of memory references using the
9910 @code{__builtin_object_size} function.  Various out of bounds pointer
9911 accesses are detected.
9913 @item -fsanitize=float-divide-by-zero
9914 @opindex fsanitize=float-divide-by-zero
9915 Detect floating-point division by zero.  Unlike other similar options,
9916 @option{-fsanitize=float-divide-by-zero} is not enabled by
9917 @option{-fsanitize=undefined}, since floating-point division by zero can
9918 be a legitimate way of obtaining infinities and NaNs.
9920 @item -fsanitize=float-cast-overflow
9921 @opindex fsanitize=float-cast-overflow
9922 This option enables floating-point type to integer conversion checking.
9923 We check that the result of the conversion does not overflow.
9924 Unlike other similar options, @option{-fsanitize=float-cast-overflow} is
9925 not enabled by @option{-fsanitize=undefined}.
9926 This option does not work well with @code{FE_INVALID} exceptions enabled.
9928 @item -fsanitize=nonnull-attribute
9929 @opindex fsanitize=nonnull-attribute
9931 This option enables instrumentation of calls, checking whether null values
9932 are not passed to arguments marked as requiring a non-null value by the
9933 @code{nonnull} function attribute.
9935 @item -fsanitize=returns-nonnull-attribute
9936 @opindex fsanitize=returns-nonnull-attribute
9938 This option enables instrumentation of return statements in functions
9939 marked with @code{returns_nonnull} function attribute, to detect returning
9940 of null values from such functions.
9942 @item -fsanitize=bool
9943 @opindex fsanitize=bool
9945 This option enables instrumentation of loads from bool.  If a value other
9946 than 0/1 is loaded, a run-time error is issued.
9948 @item -fsanitize=enum
9949 @opindex fsanitize=enum
9951 This option enables instrumentation of loads from an enum type.  If
9952 a value outside the range of values for the enum type is loaded,
9953 a run-time error is issued.
9955 @item -fsanitize=vptr
9956 @opindex fsanitize=vptr
9958 This option enables instrumentation of C++ member function calls, member
9959 accesses and some conversions between pointers to base and derived classes,
9960 to verify the referenced object has the correct dynamic type.
9962 @end table
9964 While @option{-ftrapv} causes traps for signed overflows to be emitted,
9965 @option{-fsanitize=undefined} gives a diagnostic message.
9966 This currently works only for the C family of languages.
9968 @item -fno-sanitize=all
9969 @opindex fno-sanitize=all
9971 This option disables all previously enabled sanitizers.
9972 @option{-fsanitize=all} is not allowed, as some sanitizers cannot be used
9973 together.
9975 @item -fasan-shadow-offset=@var{number}
9976 @opindex fasan-shadow-offset
9977 This option forces GCC to use custom shadow offset in AddressSanitizer checks.
9978 It is useful for experimenting with different shadow memory layouts in
9979 Kernel AddressSanitizer.
9981 @item -fsanitize-sections=@var{s1},@var{s2},...
9982 @opindex fsanitize-sections
9983 Sanitize global variables in selected user-defined sections.  @var{si} may
9984 contain wildcards.
9986 @item -fsanitize-recover@r{[}=@var{opts}@r{]}
9987 @opindex fsanitize-recover
9988 @opindex fno-sanitize-recover
9989 @option{-fsanitize-recover=} controls error recovery mode for sanitizers
9990 mentioned in comma-separated list of @var{opts}.  Enabling this option
9991 for a sanitizer component causes it to attempt to continue
9992 running the program as if no error happened.  This means multiple
9993 runtime errors can be reported in a single program run, and the exit
9994 code of the program may indicate success even when errors
9995 have been reported.  The @option{-fno-sanitize-recover=} option
9996 can be used to alter
9997 this behavior: only the first detected error is reported
9998 and program then exits with a non-zero exit code.
10000 Currently this feature only works for @option{-fsanitize=undefined} (and its suboptions
10001 except for @option{-fsanitize=unreachable} and @option{-fsanitize=return}),
10002 @option{-fsanitize=float-cast-overflow}, @option{-fsanitize=float-divide-by-zero},
10003 @option{-fsanitize=kernel-address} and @option{-fsanitize=address}.
10004 For these sanitizers error recovery is turned on by default, except @option{-fsanitize=address},
10005 for which this feature is experimental.
10006 @option{-fsanitize-recover=all} and @option{-fno-sanitize-recover=all} is also
10007 accepted, the former enables recovery for all sanitizers that support it,
10008 the latter disables recovery for all sanitizers that support it.
10010 Even if a recovery mode is turned on the compiler side, it needs to be also
10011 enabled on the runtime library side, otherwise the failures are still fatal.
10012 The runtime library defaults to @code{halt_on_error=0} for
10013 ThreadSanitizer and UndefinedBehaviorSanitizer, while default value for
10014 AddressSanitizer is @code{halt_on_error=1}. This can be overridden through
10015 setting the @code{halt_on_error} flag in the corresponding environment variable.
10017 Syntax without explicit @var{opts} parameter is deprecated.  It is equivalent to
10018 @smallexample
10019 -fsanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
10020 @end smallexample
10021 @noindent
10022 Similarly @option{-fno-sanitize-recover} is equivalent to
10023 @smallexample
10024 -fno-sanitize-recover=undefined,float-cast-overflow,float-divide-by-zero
10025 @end smallexample
10027 @item -fsanitize-undefined-trap-on-error
10028 @opindex fsanitize-undefined-trap-on-error
10029 The @option{-fsanitize-undefined-trap-on-error} option instructs the compiler to
10030 report undefined behavior using @code{__builtin_trap} rather than
10031 a @code{libubsan} library routine.  The advantage of this is that the
10032 @code{libubsan} library is not needed and is not linked in, so this
10033 is usable even in freestanding environments.
10035 @item -fsanitize-coverage=trace-pc
10036 @opindex fsanitize-coverage=trace-pc
10037 Enable coverage-guided fuzzing code instrumentation.
10038 Inserts a call to @code{__sanitizer_cov_trace_pc} into every basic block.
10040 @item -fbounds-check
10041 @opindex fbounds-check
10042 For front ends that support it, generate additional code to check that
10043 indices used to access arrays are within the declared range.  This is
10044 currently only supported by the Java and Fortran front ends, where
10045 this option defaults to true and false respectively.
10047 @item -fcheck-pointer-bounds
10048 @opindex fcheck-pointer-bounds
10049 @opindex fno-check-pointer-bounds
10050 @cindex Pointer Bounds Checker options
10051 Enable Pointer Bounds Checker instrumentation.  Each memory reference
10052 is instrumented with checks of the pointer used for memory access against
10053 bounds associated with that pointer.  
10055 Currently there
10056 is only an implementation for Intel MPX available, thus x86 GNU/Linux target
10057 and @option{-mmpx} are required to enable this feature.  
10058 MPX-based instrumentation requires
10059 a runtime library to enable MPX in hardware and handle bounds
10060 violation signals.  By default when @option{-fcheck-pointer-bounds}
10061 and @option{-mmpx} options are used to link a program, the GCC driver
10062 links against the @file{libmpx} and @file{libmpxwrappers} libraries.
10063 Bounds checking on calls to dynamic libraries requires a linker
10064 with @option{-z bndplt} support; if GCC was configured with a linker
10065 without support for this option (including the Gold linker and older
10066 versions of ld), a warning is given if you link with @option{-mmpx}
10067 without also specifying @option{-static}, since the overall effectiveness
10068 of the bounds checking protection is reduced.
10069 See also @option{-static-libmpxwrappers}.
10071 MPX-based instrumentation
10072 may be used for debugging and also may be included in production code
10073 to increase program security.  Depending on usage, you may
10074 have different requirements for the runtime library.  The current version
10075 of the MPX runtime library is more oriented for use as a debugging
10076 tool.  MPX runtime library usage implies @option{-lpthread}.  See
10077 also @option{-static-libmpx}.  The runtime library  behavior can be
10078 influenced using various @env{CHKP_RT_*} environment variables.  See
10079 @uref{https://gcc.gnu.org/wiki/Intel%20MPX%20support%20in%20the%20GCC%20compiler}
10080 for more details.
10082 Generated instrumentation may be controlled by various
10083 @option{-fchkp-*} options and by the @code{bnd_variable_size}
10084 structure field attribute (@pxref{Type Attributes}) and
10085 @code{bnd_legacy}, and @code{bnd_instrument} function attributes
10086 (@pxref{Function Attributes}).  GCC also provides a number of built-in
10087 functions for controlling the Pointer Bounds Checker.  @xref{Pointer
10088 Bounds Checker builtins}, for more information.
10090 @item -fchkp-check-incomplete-type
10091 @opindex fchkp-check-incomplete-type
10092 @opindex fno-chkp-check-incomplete-type
10093 Generate pointer bounds checks for variables with incomplete type.
10094 Enabled by default.
10096 @item -fchkp-narrow-bounds
10097 @opindex fchkp-narrow-bounds
10098 @opindex fno-chkp-narrow-bounds
10099 Controls bounds used by Pointer Bounds Checker for pointers to object
10100 fields.  If narrowing is enabled then field bounds are used.  Otherwise
10101 object bounds are used.  See also @option{-fchkp-narrow-to-innermost-array}
10102 and @option{-fchkp-first-field-has-own-bounds}.  Enabled by default.
10104 @item -fchkp-first-field-has-own-bounds
10105 @opindex fchkp-first-field-has-own-bounds
10106 @opindex fno-chkp-first-field-has-own-bounds
10107 Forces Pointer Bounds Checker to use narrowed bounds for the address of the
10108 first field in the structure.  By default a pointer to the first field has
10109 the same bounds as a pointer to the whole structure.
10111 @item -fchkp-narrow-to-innermost-array
10112 @opindex fchkp-narrow-to-innermost-array
10113 @opindex fno-chkp-narrow-to-innermost-array
10114 Forces Pointer Bounds Checker to use bounds of the innermost arrays in
10115 case of nested static array access.  By default this option is disabled and
10116 bounds of the outermost array are used.
10118 @item -fchkp-optimize
10119 @opindex fchkp-optimize
10120 @opindex fno-chkp-optimize
10121 Enables Pointer Bounds Checker optimizations.  Enabled by default at
10122 optimization levels @option{-O}, @option{-O2}, @option{-O3}.
10124 @item -fchkp-use-fast-string-functions
10125 @opindex fchkp-use-fast-string-functions
10126 @opindex fno-chkp-use-fast-string-functions
10127 Enables use of @code{*_nobnd} versions of string functions (not copying bounds)
10128 by Pointer Bounds Checker.  Disabled by default.
10130 @item -fchkp-use-nochk-string-functions
10131 @opindex fchkp-use-nochk-string-functions
10132 @opindex fno-chkp-use-nochk-string-functions
10133 Enables use of @code{*_nochk} versions of string functions (not checking bounds)
10134 by Pointer Bounds Checker.  Disabled by default.
10136 @item -fchkp-use-static-bounds
10137 @opindex fchkp-use-static-bounds
10138 @opindex fno-chkp-use-static-bounds
10139 Allow Pointer Bounds Checker to generate static bounds holding
10140 bounds of static variables.  Enabled by default.
10142 @item -fchkp-use-static-const-bounds
10143 @opindex fchkp-use-static-const-bounds
10144 @opindex fno-chkp-use-static-const-bounds
10145 Use statically-initialized bounds for constant bounds instead of
10146 generating them each time they are required.  By default enabled when
10147 @option{-fchkp-use-static-bounds} is enabled.
10149 @item -fchkp-treat-zero-dynamic-size-as-infinite
10150 @opindex fchkp-treat-zero-dynamic-size-as-infinite
10151 @opindex fno-chkp-treat-zero-dynamic-size-as-infinite
10152 With this option, objects with incomplete type whose
10153 dynamically-obtained size is zero are treated as having infinite size
10154 instead by Pointer Bounds
10155 Checker.  This option may be helpful if a program is linked with a library
10156 missing size information for some symbols.  Disabled by default.
10158 @item -fchkp-check-read
10159 @opindex fchkp-check-read
10160 @opindex fno-chkp-check-read
10161 Instructs Pointer Bounds Checker to generate checks for all read
10162 accesses to memory.  Enabled by default.
10164 @item -fchkp-check-write
10165 @opindex fchkp-check-write
10166 @opindex fno-chkp-check-write
10167 Instructs Pointer Bounds Checker to generate checks for all write
10168 accesses to memory.  Enabled by default.
10170 @item -fchkp-store-bounds
10171 @opindex fchkp-store-bounds
10172 @opindex fno-chkp-store-bounds
10173 Instructs Pointer Bounds Checker to generate bounds stores for
10174 pointer writes.  Enabled by default.
10176 @item -fchkp-instrument-calls
10177 @opindex fchkp-instrument-calls
10178 @opindex fno-chkp-instrument-calls
10179 Instructs Pointer Bounds Checker to pass pointer bounds to calls.
10180 Enabled by default.
10182 @item -fchkp-instrument-marked-only
10183 @opindex fchkp-instrument-marked-only
10184 @opindex fno-chkp-instrument-marked-only
10185 Instructs Pointer Bounds Checker to instrument only functions
10186 marked with the @code{bnd_instrument} attribute
10187 (@pxref{Function Attributes}).  Disabled by default.
10189 @item -fchkp-use-wrappers
10190 @opindex fchkp-use-wrappers
10191 @opindex fno-chkp-use-wrappers
10192 Allows Pointer Bounds Checker to replace calls to built-in functions
10193 with calls to wrapper functions.  When @option{-fchkp-use-wrappers}
10194 is used to link a program, the GCC driver automatically links
10195 against @file{libmpxwrappers}.  See also @option{-static-libmpxwrappers}.
10196 Enabled by default.
10198 @item -fstack-protector
10199 @opindex fstack-protector
10200 Emit extra code to check for buffer overflows, such as stack smashing
10201 attacks.  This is done by adding a guard variable to functions with
10202 vulnerable objects.  This includes functions that call @code{alloca}, and
10203 functions with buffers larger than 8 bytes.  The guards are initialized
10204 when a function is entered and then checked when the function exits.
10205 If a guard check fails, an error message is printed and the program exits.
10207 @item -fstack-protector-all
10208 @opindex fstack-protector-all
10209 Like @option{-fstack-protector} except that all functions are protected.
10211 @item -fstack-protector-strong
10212 @opindex fstack-protector-strong
10213 Like @option{-fstack-protector} but includes additional functions to
10214 be protected --- those that have local array definitions, or have
10215 references to local frame addresses.
10217 @item -fstack-protector-explicit
10218 @opindex fstack-protector-explicit
10219 Like @option{-fstack-protector} but only protects those functions which
10220 have the @code{stack_protect} attribute.
10222 @item -fstack-check
10223 @opindex fstack-check
10224 Generate code to verify that you do not go beyond the boundary of the
10225 stack.  You should specify this flag if you are running in an
10226 environment with multiple threads, but you only rarely need to specify it in
10227 a single-threaded environment since stack overflow is automatically
10228 detected on nearly all systems if there is only one stack.
10230 Note that this switch does not actually cause checking to be done; the
10231 operating system or the language runtime must do that.  The switch causes
10232 generation of code to ensure that they see the stack being extended.
10234 You can additionally specify a string parameter: @samp{no} means no
10235 checking, @samp{generic} means force the use of old-style checking,
10236 @samp{specific} means use the best checking method and is equivalent
10237 to bare @option{-fstack-check}.
10239 Old-style checking is a generic mechanism that requires no specific
10240 target support in the compiler but comes with the following drawbacks:
10242 @enumerate
10243 @item
10244 Modified allocation strategy for large objects: they are always
10245 allocated dynamically if their size exceeds a fixed threshold.
10247 @item
10248 Fixed limit on the size of the static frame of functions: when it is
10249 topped by a particular function, stack checking is not reliable and
10250 a warning is issued by the compiler.
10252 @item
10253 Inefficiency: because of both the modified allocation strategy and the
10254 generic implementation, code performance is hampered.
10255 @end enumerate
10257 Note that old-style stack checking is also the fallback method for
10258 @samp{specific} if no target support has been added in the compiler.
10260 @item -fstack-limit-register=@var{reg}
10261 @itemx -fstack-limit-symbol=@var{sym}
10262 @itemx -fno-stack-limit
10263 @opindex fstack-limit-register
10264 @opindex fstack-limit-symbol
10265 @opindex fno-stack-limit
10266 Generate code to ensure that the stack does not grow beyond a certain value,
10267 either the value of a register or the address of a symbol.  If a larger
10268 stack is required, a signal is raised at run time.  For most targets,
10269 the signal is raised before the stack overruns the boundary, so
10270 it is possible to catch the signal without taking special precautions.
10272 For instance, if the stack starts at absolute address @samp{0x80000000}
10273 and grows downwards, you can use the flags
10274 @option{-fstack-limit-symbol=__stack_limit} and
10275 @option{-Wl,--defsym,__stack_limit=0x7ffe0000} to enforce a stack limit
10276 of 128KB@.  Note that this may only work with the GNU linker.
10278 You can locally override stack limit checking by using the
10279 @code{no_stack_limit} function attribute (@pxref{Function Attributes}).
10281 @item -fsplit-stack
10282 @opindex fsplit-stack
10283 Generate code to automatically split the stack before it overflows.
10284 The resulting program has a discontiguous stack which can only
10285 overflow if the program is unable to allocate any more memory.  This
10286 is most useful when running threaded programs, as it is no longer
10287 necessary to calculate a good stack size to use for each thread.  This
10288 is currently only implemented for the x86 targets running
10289 GNU/Linux.
10291 When code compiled with @option{-fsplit-stack} calls code compiled
10292 without @option{-fsplit-stack}, there may not be much stack space
10293 available for the latter code to run.  If compiling all code,
10294 including library code, with @option{-fsplit-stack} is not an option,
10295 then the linker can fix up these calls so that the code compiled
10296 without @option{-fsplit-stack} always has a large stack.  Support for
10297 this is implemented in the gold linker in GNU binutils release 2.21
10298 and later.
10300 @item -fvtable-verify=@r{[}std@r{|}preinit@r{|}none@r{]}
10301 @opindex fvtable-verify
10302 This option is only available when compiling C++ code.
10303 It turns on (or off, if using @option{-fvtable-verify=none}) the security
10304 feature that verifies at run time, for every virtual call, that
10305 the vtable pointer through which the call is made is valid for the type of
10306 the object, and has not been corrupted or overwritten.  If an invalid vtable
10307 pointer is detected at run time, an error is reported and execution of the
10308 program is immediately halted.
10310 This option causes run-time data structures to be built at program startup,
10311 which are used for verifying the vtable pointers.  
10312 The options @samp{std} and @samp{preinit}
10313 control the timing of when these data structures are built.  In both cases the
10314 data structures are built before execution reaches @code{main}.  Using
10315 @option{-fvtable-verify=std} causes the data structures to be built after
10316 shared libraries have been loaded and initialized.
10317 @option{-fvtable-verify=preinit} causes them to be built before shared
10318 libraries have been loaded and initialized.
10320 If this option appears multiple times in the command line with different
10321 values specified, @samp{none} takes highest priority over both @samp{std} and
10322 @samp{preinit}; @samp{preinit} takes priority over @samp{std}.
10324 @item -fvtv-debug
10325 @opindex fvtv-debug
10326 When used in conjunction with @option{-fvtable-verify=std} or 
10327 @option{-fvtable-verify=preinit}, causes debug versions of the 
10328 runtime functions for the vtable verification feature to be called.  
10329 This flag also causes the compiler to log information about which 
10330 vtable pointers it finds for each class.
10331 This information is written to a file named @file{vtv_set_ptr_data.log} 
10332 in the directory named by the environment variable @env{VTV_LOGS_DIR} 
10333 if that is defined or the current working directory otherwise.
10335 Note:  This feature @emph{appends} data to the log file. If you want a fresh log
10336 file, be sure to delete any existing one.
10338 @item -fvtv-counts
10339 @opindex fvtv-counts
10340 This is a debugging flag.  When used in conjunction with
10341 @option{-fvtable-verify=std} or @option{-fvtable-verify=preinit}, this
10342 causes the compiler to keep track of the total number of virtual calls
10343 it encounters and the number of verifications it inserts.  It also
10344 counts the number of calls to certain run-time library functions
10345 that it inserts and logs this information for each compilation unit.
10346 The compiler writes this information to a file named
10347 @file{vtv_count_data.log} in the directory named by the environment
10348 variable @env{VTV_LOGS_DIR} if that is defined or the current working
10349 directory otherwise.  It also counts the size of the vtable pointer sets
10350 for each class, and writes this information to @file{vtv_class_set_sizes.log}
10351 in the same directory.
10353 Note:  This feature @emph{appends} data to the log files.  To get fresh log
10354 files, be sure to delete any existing ones.
10356 @item -finstrument-functions
10357 @opindex finstrument-functions
10358 Generate instrumentation calls for entry and exit to functions.  Just
10359 after function entry and just before function exit, the following
10360 profiling functions are called with the address of the current
10361 function and its call site.  (On some platforms,
10362 @code{__builtin_return_address} does not work beyond the current
10363 function, so the call site information may not be available to the
10364 profiling functions otherwise.)
10366 @smallexample
10367 void __cyg_profile_func_enter (void *this_fn,
10368                                void *call_site);
10369 void __cyg_profile_func_exit  (void *this_fn,
10370                                void *call_site);
10371 @end smallexample
10373 The first argument is the address of the start of the current function,
10374 which may be looked up exactly in the symbol table.
10376 This instrumentation is also done for functions expanded inline in other
10377 functions.  The profiling calls indicate where, conceptually, the
10378 inline function is entered and exited.  This means that addressable
10379 versions of such functions must be available.  If all your uses of a
10380 function are expanded inline, this may mean an additional expansion of
10381 code size.  If you use @code{extern inline} in your C code, an
10382 addressable version of such functions must be provided.  (This is
10383 normally the case anyway, but if you get lucky and the optimizer always
10384 expands the functions inline, you might have gotten away without
10385 providing static copies.)
10387 A function may be given the attribute @code{no_instrument_function}, in
10388 which case this instrumentation is not done.  This can be used, for
10389 example, for the profiling functions listed above, high-priority
10390 interrupt routines, and any functions from which the profiling functions
10391 cannot safely be called (perhaps signal handlers, if the profiling
10392 routines generate output or allocate memory).
10394 @item -finstrument-functions-exclude-file-list=@var{file},@var{file},@dots{}
10395 @opindex finstrument-functions-exclude-file-list
10397 Set the list of functions that are excluded from instrumentation (see
10398 the description of @option{-finstrument-functions}).  If the file that
10399 contains a function definition matches with one of @var{file}, then
10400 that function is not instrumented.  The match is done on substrings:
10401 if the @var{file} parameter is a substring of the file name, it is
10402 considered to be a match.
10404 For example:
10406 @smallexample
10407 -finstrument-functions-exclude-file-list=/bits/stl,include/sys
10408 @end smallexample
10410 @noindent
10411 excludes any inline function defined in files whose pathnames
10412 contain @file{/bits/stl} or @file{include/sys}.
10414 If, for some reason, you want to include letter @samp{,} in one of
10415 @var{sym}, write @samp{\,}. For example,
10416 @option{-finstrument-functions-exclude-file-list='\,\,tmp'}
10417 (note the single quote surrounding the option).
10419 @item -finstrument-functions-exclude-function-list=@var{sym},@var{sym},@dots{}
10420 @opindex finstrument-functions-exclude-function-list
10422 This is similar to @option{-finstrument-functions-exclude-file-list},
10423 but this option sets the list of function names to be excluded from
10424 instrumentation.  The function name to be matched is its user-visible
10425 name, such as @code{vector<int> blah(const vector<int> &)}, not the
10426 internal mangled name (e.g., @code{_Z4blahRSt6vectorIiSaIiEE}).  The
10427 match is done on substrings: if the @var{sym} parameter is a substring
10428 of the function name, it is considered to be a match.  For C99 and C++
10429 extended identifiers, the function name must be given in UTF-8, not
10430 using universal character names.
10432 @end table
10435 @node Preprocessor Options
10436 @section Options Controlling the Preprocessor
10437 @cindex preprocessor options
10438 @cindex options, preprocessor
10440 These options control the C preprocessor, which is run on each C source
10441 file before actual compilation.
10443 If you use the @option{-E} option, nothing is done except preprocessing.
10444 Some of these options make sense only together with @option{-E} because
10445 they cause the preprocessor output to be unsuitable for actual
10446 compilation.
10448 @table @gcctabopt
10449 @item -Wp,@var{option}
10450 @opindex Wp
10451 You can use @option{-Wp,@var{option}} to bypass the compiler driver
10452 and pass @var{option} directly through to the preprocessor.  If
10453 @var{option} contains commas, it is split into multiple options at the
10454 commas.  However, many options are modified, translated or interpreted
10455 by the compiler driver before being passed to the preprocessor, and
10456 @option{-Wp} forcibly bypasses this phase.  The preprocessor's direct
10457 interface is undocumented and subject to change, so whenever possible
10458 you should avoid using @option{-Wp} and let the driver handle the
10459 options instead.
10461 @item -Xpreprocessor @var{option}
10462 @opindex Xpreprocessor
10463 Pass @var{option} as an option to the preprocessor.  You can use this to
10464 supply system-specific preprocessor options that GCC does not 
10465 recognize.
10467 If you want to pass an option that takes an argument, you must use
10468 @option{-Xpreprocessor} twice, once for the option and once for the argument.
10470 @item -no-integrated-cpp
10471 @opindex no-integrated-cpp
10472 Perform preprocessing as a separate pass before compilation.
10473 By default, GCC performs preprocessing as an integrated part of
10474 input tokenization and parsing.
10475 If this option is provided, the appropriate language front end
10476 (@command{cc1}, @command{cc1plus}, or @command{cc1obj} for C, C++,
10477 and Objective-C, respectively) is instead invoked twice,
10478 once for preprocessing only and once for actual compilation
10479 of the preprocessed input.
10480 This option may be useful in conjunction with the @option{-B} or
10481 @option{-wrapper} options to specify an alternate preprocessor or
10482 perform additional processing of the program source between
10483 normal preprocessing and compilation.
10484 @end table
10486 @include cppopts.texi
10488 @node Assembler Options
10489 @section Passing Options to the Assembler
10491 @c prevent bad page break with this line
10492 You can pass options to the assembler.
10494 @table @gcctabopt
10495 @item -Wa,@var{option}
10496 @opindex Wa
10497 Pass @var{option} as an option to the assembler.  If @var{option}
10498 contains commas, it is split into multiple options at the commas.
10500 @item -Xassembler @var{option}
10501 @opindex Xassembler
10502 Pass @var{option} as an option to the assembler.  You can use this to
10503 supply system-specific assembler options that GCC does not
10504 recognize.
10506 If you want to pass an option that takes an argument, you must use
10507 @option{-Xassembler} twice, once for the option and once for the argument.
10509 @end table
10511 @node Link Options
10512 @section Options for Linking
10513 @cindex link options
10514 @cindex options, linking
10516 These options come into play when the compiler links object files into
10517 an executable output file.  They are meaningless if the compiler is
10518 not doing a link step.
10520 @table @gcctabopt
10521 @cindex file names
10522 @item @var{object-file-name}
10523 A file name that does not end in a special recognized suffix is
10524 considered to name an object file or library.  (Object files are
10525 distinguished from libraries by the linker according to the file
10526 contents.)  If linking is done, these object files are used as input
10527 to the linker.
10529 @item -c
10530 @itemx -S
10531 @itemx -E
10532 @opindex c
10533 @opindex S
10534 @opindex E
10535 If any of these options is used, then the linker is not run, and
10536 object file names should not be used as arguments.  @xref{Overall
10537 Options}.
10539 @item -fuse-ld=bfd
10540 @opindex fuse-ld=bfd
10541 Use the @command{bfd} linker instead of the default linker.
10543 @item -fuse-ld=gold
10544 @opindex fuse-ld=gold
10545 Use the @command{gold} linker instead of the default linker.
10547 @cindex Libraries
10548 @item -l@var{library}
10549 @itemx -l @var{library}
10550 @opindex l
10551 Search the library named @var{library} when linking.  (The second
10552 alternative with the library as a separate argument is only for
10553 POSIX compliance and is not recommended.)
10555 It makes a difference where in the command you write this option; the
10556 linker searches and processes libraries and object files in the order they
10557 are specified.  Thus, @samp{foo.o -lz bar.o} searches library @samp{z}
10558 after file @file{foo.o} but before @file{bar.o}.  If @file{bar.o} refers
10559 to functions in @samp{z}, those functions may not be loaded.
10561 The linker searches a standard list of directories for the library,
10562 which is actually a file named @file{lib@var{library}.a}.  The linker
10563 then uses this file as if it had been specified precisely by name.
10565 The directories searched include several standard system directories
10566 plus any that you specify with @option{-L}.
10568 Normally the files found this way are library files---archive files
10569 whose members are object files.  The linker handles an archive file by
10570 scanning through it for members which define symbols that have so far
10571 been referenced but not defined.  But if the file that is found is an
10572 ordinary object file, it is linked in the usual fashion.  The only
10573 difference between using an @option{-l} option and specifying a file name
10574 is that @option{-l} surrounds @var{library} with @samp{lib} and @samp{.a}
10575 and searches several directories.
10577 @item -lobjc
10578 @opindex lobjc
10579 You need this special case of the @option{-l} option in order to
10580 link an Objective-C or Objective-C++ program.
10582 @item -nostartfiles
10583 @opindex nostartfiles
10584 Do not use the standard system startup files when linking.
10585 The standard system libraries are used normally, unless @option{-nostdlib}
10586 or @option{-nodefaultlibs} is used.
10588 @item -nodefaultlibs
10589 @opindex nodefaultlibs
10590 Do not use the standard system libraries when linking.
10591 Only the libraries you specify are passed to the linker, and options
10592 specifying linkage of the system libraries, such as @option{-static-libgcc}
10593 or @option{-shared-libgcc}, are ignored.  
10594 The standard startup files are used normally, unless @option{-nostartfiles}
10595 is used.  
10597 The compiler may generate calls to @code{memcmp},
10598 @code{memset}, @code{memcpy} and @code{memmove}.
10599 These entries are usually resolved by entries in
10600 libc.  These entry points should be supplied through some other
10601 mechanism when this option is specified.
10603 @item -nostdlib
10604 @opindex nostdlib
10605 Do not use the standard system startup files or libraries when linking.
10606 No startup files and only the libraries you specify are passed to
10607 the linker, and options specifying linkage of the system libraries, such as
10608 @option{-static-libgcc} or @option{-shared-libgcc}, are ignored.
10610 The compiler may generate calls to @code{memcmp}, @code{memset},
10611 @code{memcpy} and @code{memmove}.
10612 These entries are usually resolved by entries in
10613 libc.  These entry points should be supplied through some other
10614 mechanism when this option is specified.
10616 @cindex @option{-lgcc}, use with @option{-nostdlib}
10617 @cindex @option{-nostdlib} and unresolved references
10618 @cindex unresolved references and @option{-nostdlib}
10619 @cindex @option{-lgcc}, use with @option{-nodefaultlibs}
10620 @cindex @option{-nodefaultlibs} and unresolved references
10621 @cindex unresolved references and @option{-nodefaultlibs}
10622 One of the standard libraries bypassed by @option{-nostdlib} and
10623 @option{-nodefaultlibs} is @file{libgcc.a}, a library of internal subroutines
10624 which GCC uses to overcome shortcomings of particular machines, or special
10625 needs for some languages.
10626 (@xref{Interface,,Interfacing to GCC Output,gccint,GNU Compiler
10627 Collection (GCC) Internals},
10628 for more discussion of @file{libgcc.a}.)
10629 In most cases, you need @file{libgcc.a} even when you want to avoid
10630 other standard libraries.  In other words, when you specify @option{-nostdlib}
10631 or @option{-nodefaultlibs} you should usually specify @option{-lgcc} as well.
10632 This ensures that you have no unresolved references to internal GCC
10633 library subroutines.
10634 (An example of such an internal subroutine is @code{__main}, used to ensure C++
10635 constructors are called; @pxref{Collect2,,@code{collect2}, gccint,
10636 GNU Compiler Collection (GCC) Internals}.)
10638 @item -pie
10639 @opindex pie
10640 Produce a position independent executable on targets that support it.
10641 For predictable results, you must also specify the same set of options
10642 used for compilation (@option{-fpie}, @option{-fPIE},
10643 or model suboptions) when you specify this linker option.
10645 @item -no-pie
10646 @opindex no-pie
10647 Don't produce a position independent executable.
10649 @item -rdynamic
10650 @opindex rdynamic
10651 Pass the flag @option{-export-dynamic} to the ELF linker, on targets
10652 that support it. This instructs the linker to add all symbols, not
10653 only used ones, to the dynamic symbol table. This option is needed
10654 for some uses of @code{dlopen} or to allow obtaining backtraces
10655 from within a program.
10657 @item -s
10658 @opindex s
10659 Remove all symbol table and relocation information from the executable.
10661 @item -static
10662 @opindex static
10663 On systems that support dynamic linking, this prevents linking with the shared
10664 libraries.  On other systems, this option has no effect.
10666 @item -shared
10667 @opindex shared
10668 Produce a shared object which can then be linked with other objects to
10669 form an executable.  Not all systems support this option.  For predictable
10670 results, you must also specify the same set of options used for compilation
10671 (@option{-fpic}, @option{-fPIC}, or model suboptions) when
10672 you specify this linker option.@footnote{On some systems, @samp{gcc -shared}
10673 needs to build supplementary stub code for constructors to work.  On
10674 multi-libbed systems, @samp{gcc -shared} must select the correct support
10675 libraries to link against.  Failing to supply the correct flags may lead
10676 to subtle defects.  Supplying them in cases where they are not necessary
10677 is innocuous.}
10679 @item -shared-libgcc
10680 @itemx -static-libgcc
10681 @opindex shared-libgcc
10682 @opindex static-libgcc
10683 On systems that provide @file{libgcc} as a shared library, these options
10684 force the use of either the shared or static version, respectively.
10685 If no shared version of @file{libgcc} was built when the compiler was
10686 configured, these options have no effect.
10688 There are several situations in which an application should use the
10689 shared @file{libgcc} instead of the static version.  The most common
10690 of these is when the application wishes to throw and catch exceptions
10691 across different shared libraries.  In that case, each of the libraries
10692 as well as the application itself should use the shared @file{libgcc}.
10694 Therefore, the G++ and GCJ drivers automatically add
10695 @option{-shared-libgcc} whenever you build a shared library or a main
10696 executable, because C++ and Java programs typically use exceptions, so
10697 this is the right thing to do.
10699 If, instead, you use the GCC driver to create shared libraries, you may
10700 find that they are not always linked with the shared @file{libgcc}.
10701 If GCC finds, at its configuration time, that you have a non-GNU linker
10702 or a GNU linker that does not support option @option{--eh-frame-hdr},
10703 it links the shared version of @file{libgcc} into shared libraries
10704 by default.  Otherwise, it takes advantage of the linker and optimizes
10705 away the linking with the shared version of @file{libgcc}, linking with
10706 the static version of libgcc by default.  This allows exceptions to
10707 propagate through such shared libraries, without incurring relocation
10708 costs at library load time.
10710 However, if a library or main executable is supposed to throw or catch
10711 exceptions, you must link it using the G++ or GCJ driver, as appropriate
10712 for the languages used in the program, or using the option
10713 @option{-shared-libgcc}, such that it is linked with the shared
10714 @file{libgcc}.
10716 @item -static-libasan
10717 @opindex static-libasan
10718 When the @option{-fsanitize=address} option is used to link a program,
10719 the GCC driver automatically links against @option{libasan}.  If
10720 @file{libasan} is available as a shared library, and the @option{-static}
10721 option is not used, then this links against the shared version of
10722 @file{libasan}.  The @option{-static-libasan} option directs the GCC
10723 driver to link @file{libasan} statically, without necessarily linking
10724 other libraries statically.
10726 @item -static-libtsan
10727 @opindex static-libtsan
10728 When the @option{-fsanitize=thread} option is used to link a program,
10729 the GCC driver automatically links against @option{libtsan}.  If
10730 @file{libtsan} is available as a shared library, and the @option{-static}
10731 option is not used, then this links against the shared version of
10732 @file{libtsan}.  The @option{-static-libtsan} option directs the GCC
10733 driver to link @file{libtsan} statically, without necessarily linking
10734 other libraries statically.
10736 @item -static-liblsan
10737 @opindex static-liblsan
10738 When the @option{-fsanitize=leak} option is used to link a program,
10739 the GCC driver automatically links against @option{liblsan}.  If
10740 @file{liblsan} is available as a shared library, and the @option{-static}
10741 option is not used, then this links against the shared version of
10742 @file{liblsan}.  The @option{-static-liblsan} option directs the GCC
10743 driver to link @file{liblsan} statically, without necessarily linking
10744 other libraries statically.
10746 @item -static-libubsan
10747 @opindex static-libubsan
10748 When the @option{-fsanitize=undefined} option is used to link a program,
10749 the GCC driver automatically links against @option{libubsan}.  If
10750 @file{libubsan} is available as a shared library, and the @option{-static}
10751 option is not used, then this links against the shared version of
10752 @file{libubsan}.  The @option{-static-libubsan} option directs the GCC
10753 driver to link @file{libubsan} statically, without necessarily linking
10754 other libraries statically.
10756 @item -static-libmpx
10757 @opindex static-libmpx
10758 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are
10759 used to link a program, the GCC driver automatically links against
10760 @file{libmpx}.  If @file{libmpx} is available as a shared library,
10761 and the @option{-static} option is not used, then this links against
10762 the shared version of @file{libmpx}.  The @option{-static-libmpx}
10763 option directs the GCC driver to link @file{libmpx} statically,
10764 without necessarily linking other libraries statically.
10766 @item -static-libmpxwrappers
10767 @opindex static-libmpxwrappers
10768 When the @option{-fcheck-pointer bounds} and @option{-mmpx} options are used
10769 to link a program without also using @option{-fno-chkp-use-wrappers}, the
10770 GCC driver automatically links against @file{libmpxwrappers}.  If
10771 @file{libmpxwrappers} is available as a shared library, and the
10772 @option{-static} option is not used, then this links against the shared
10773 version of @file{libmpxwrappers}.  The @option{-static-libmpxwrappers}
10774 option directs the GCC driver to link @file{libmpxwrappers} statically,
10775 without necessarily linking other libraries statically.
10777 @item -static-libstdc++
10778 @opindex static-libstdc++
10779 When the @command{g++} program is used to link a C++ program, it
10780 normally automatically links against @option{libstdc++}.  If
10781 @file{libstdc++} is available as a shared library, and the
10782 @option{-static} option is not used, then this links against the
10783 shared version of @file{libstdc++}.  That is normally fine.  However, it
10784 is sometimes useful to freeze the version of @file{libstdc++} used by
10785 the program without going all the way to a fully static link.  The
10786 @option{-static-libstdc++} option directs the @command{g++} driver to
10787 link @file{libstdc++} statically, without necessarily linking other
10788 libraries statically.
10790 @item -symbolic
10791 @opindex symbolic
10792 Bind references to global symbols when building a shared object.  Warn
10793 about any unresolved references (unless overridden by the link editor
10794 option @option{-Xlinker -z -Xlinker defs}).  Only a few systems support
10795 this option.
10797 @item -T @var{script}
10798 @opindex T
10799 @cindex linker script
10800 Use @var{script} as the linker script.  This option is supported by most
10801 systems using the GNU linker.  On some targets, such as bare-board
10802 targets without an operating system, the @option{-T} option may be required
10803 when linking to avoid references to undefined symbols.
10805 @item -Xlinker @var{option}
10806 @opindex Xlinker
10807 Pass @var{option} as an option to the linker.  You can use this to
10808 supply system-specific linker options that GCC does not recognize.
10810 If you want to pass an option that takes a separate argument, you must use
10811 @option{-Xlinker} twice, once for the option and once for the argument.
10812 For example, to pass @option{-assert definitions}, you must write
10813 @option{-Xlinker -assert -Xlinker definitions}.  It does not work to write
10814 @option{-Xlinker "-assert definitions"}, because this passes the entire
10815 string as a single argument, which is not what the linker expects.
10817 When using the GNU linker, it is usually more convenient to pass
10818 arguments to linker options using the @option{@var{option}=@var{value}}
10819 syntax than as separate arguments.  For example, you can specify
10820 @option{-Xlinker -Map=output.map} rather than
10821 @option{-Xlinker -Map -Xlinker output.map}.  Other linkers may not support
10822 this syntax for command-line options.
10824 @item -Wl,@var{option}
10825 @opindex Wl
10826 Pass @var{option} as an option to the linker.  If @var{option} contains
10827 commas, it is split into multiple options at the commas.  You can use this
10828 syntax to pass an argument to the option.
10829 For example, @option{-Wl,-Map,output.map} passes @option{-Map output.map} to the
10830 linker.  When using the GNU linker, you can also get the same effect with
10831 @option{-Wl,-Map=output.map}.
10833 @item -u @var{symbol}
10834 @opindex u
10835 Pretend the symbol @var{symbol} is undefined, to force linking of
10836 library modules to define it.  You can use @option{-u} multiple times with
10837 different symbols to force loading of additional library modules.
10839 @item -z @var{keyword}
10840 @opindex z
10841 @option{-z} is passed directly on to the linker along with the keyword
10842 @var{keyword}. See the section in the documentation of your linker for
10843 permitted values and their meanings.
10844 @end table
10846 @node Directory Options
10847 @section Options for Directory Search
10848 @cindex directory options
10849 @cindex options, directory search
10850 @cindex search path
10852 These options specify directories to search for header files, for
10853 libraries and for parts of the compiler:
10855 @table @gcctabopt
10856 @item -I@var{dir}
10857 @opindex I
10858 Add the directory @var{dir} to the head of the list of directories to be
10859 searched for header files.  This can be used to override a system header
10860 file, substituting your own version, since these directories are
10861 searched before the system header file directories.  However, you should
10862 not use this option to add directories that contain vendor-supplied
10863 system header files (use @option{-isystem} for that).  If you use more than
10864 one @option{-I} option, the directories are scanned in left-to-right
10865 order; the standard system directories come after.
10867 If a standard system include directory, or a directory specified with
10868 @option{-isystem}, is also specified with @option{-I}, the @option{-I}
10869 option is ignored.  The directory is still searched but as a
10870 system directory at its normal position in the system include chain.
10871 This is to ensure that GCC's procedure to fix buggy system headers and
10872 the ordering for the @code{include_next} directive are not inadvertently changed.
10873 If you really need to change the search order for system directories,
10874 use the @option{-nostdinc} and/or @option{-isystem} options.
10876 @item -iplugindir=@var{dir}
10877 @opindex iplugindir=
10878 Set the directory to search for plugins that are passed
10879 by @option{-fplugin=@var{name}} instead of
10880 @option{-fplugin=@var{path}/@var{name}.so}.  This option is not meant
10881 to be used by the user, but only passed by the driver.
10883 @item -iquote@var{dir}
10884 @opindex iquote
10885 Add the directory @var{dir} to the head of the list of directories to
10886 be searched for header files only for the case of @code{#include
10887 "@var{file}"}; they are not searched for @code{#include <@var{file}>},
10888 otherwise just like @option{-I}.
10890 @item -L@var{dir}
10891 @opindex L
10892 Add directory @var{dir} to the list of directories to be searched
10893 for @option{-l}.
10895 @item -B@var{prefix}
10896 @opindex B
10897 This option specifies where to find the executables, libraries,
10898 include files, and data files of the compiler itself.
10900 The compiler driver program runs one or more of the subprograms
10901 @command{cpp}, @command{cc1}, @command{as} and @command{ld}.  It tries
10902 @var{prefix} as a prefix for each program it tries to run, both with and
10903 without @samp{@var{machine}/@var{version}/} for the corresponding target
10904 machine and compiler version.
10906 For each subprogram to be run, the compiler driver first tries the
10907 @option{-B} prefix, if any.  If that name is not found, or if @option{-B}
10908 is not specified, the driver tries two standard prefixes, 
10909 @file{/usr/lib/gcc/} and @file{/usr/local/lib/gcc/}.  If neither of
10910 those results in a file name that is found, the unmodified program
10911 name is searched for using the directories specified in your
10912 @env{PATH} environment variable.
10914 The compiler checks to see if the path provided by @option{-B}
10915 refers to a directory, and if necessary it adds a directory
10916 separator character at the end of the path.
10918 @option{-B} prefixes that effectively specify directory names also apply
10919 to libraries in the linker, because the compiler translates these
10920 options into @option{-L} options for the linker.  They also apply to
10921 include files in the preprocessor, because the compiler translates these
10922 options into @option{-isystem} options for the preprocessor.  In this case,
10923 the compiler appends @samp{include} to the prefix.
10925 The runtime support file @file{libgcc.a} can also be searched for using
10926 the @option{-B} prefix, if needed.  If it is not found there, the two
10927 standard prefixes above are tried, and that is all.  The file is left
10928 out of the link if it is not found by those means.
10930 Another way to specify a prefix much like the @option{-B} prefix is to use
10931 the environment variable @env{GCC_EXEC_PREFIX}.  @xref{Environment
10932 Variables}.
10934 As a special kludge, if the path provided by @option{-B} is
10935 @file{[dir/]stage@var{N}/}, where @var{N} is a number in the range 0 to
10936 9, then it is replaced by @file{[dir/]include}.  This is to help
10937 with boot-strapping the compiler.
10939 @item -no-canonical-prefixes
10940 @opindex no-canonical-prefixes
10941 Do not expand any symbolic links, resolve references to @samp{/../}
10942 or @samp{/./}, or make the path absolute when generating a relative
10943 prefix.
10945 @item --sysroot=@var{dir}
10946 @opindex sysroot
10947 Use @var{dir} as the logical root directory for headers and libraries.
10948 For example, if the compiler normally searches for headers in
10949 @file{/usr/include} and libraries in @file{/usr/lib}, it instead
10950 searches @file{@var{dir}/usr/include} and @file{@var{dir}/usr/lib}.
10952 If you use both this option and the @option{-isysroot} option, then
10953 the @option{--sysroot} option applies to libraries, but the
10954 @option{-isysroot} option applies to header files.
10956 The GNU linker (beginning with version 2.16) has the necessary support
10957 for this option.  If your linker does not support this option, the
10958 header file aspect of @option{--sysroot} still works, but the
10959 library aspect does not.
10961 @item --no-sysroot-suffix
10962 @opindex no-sysroot-suffix
10963 For some targets, a suffix is added to the root directory specified
10964 with @option{--sysroot}, depending on the other options used, so that
10965 headers may for example be found in
10966 @file{@var{dir}/@var{suffix}/usr/include} instead of
10967 @file{@var{dir}/usr/include}.  This option disables the addition of
10968 such a suffix.
10970 @item -I-
10971 @opindex I-
10972 This option has been deprecated.  Please use @option{-iquote} instead for
10973 @option{-I} directories before the @option{-I-} and remove the @option{-I-}
10974 option.
10975 Any directories you specify with @option{-I} options before the @option{-I-}
10976 option are searched only for the case of @code{#include "@var{file}"};
10977 they are not searched for @code{#include <@var{file}>}.
10979 If additional directories are specified with @option{-I} options after
10980 the @option{-I-} option, these directories are searched for all @code{#include}
10981 directives.  (Ordinarily @emph{all} @option{-I} directories are used
10982 this way.)
10984 In addition, the @option{-I-} option inhibits the use of the current
10985 directory (where the current input file came from) as the first search
10986 directory for @code{#include "@var{file}"}.  There is no way to
10987 override this effect of @option{-I-}.  With @option{-I.} you can specify
10988 searching the directory that is current when the compiler is
10989 invoked.  That is not exactly the same as what the preprocessor does
10990 by default, but it is often satisfactory.
10992 @option{-I-} does not inhibit the use of the standard system directories
10993 for header files.  Thus, @option{-I-} and @option{-nostdinc} are
10994 independent.
10995 @end table
10997 @node Code Gen Options
10998 @section Options for Code Generation Conventions
10999 @cindex code generation conventions
11000 @cindex options, code generation
11001 @cindex run-time options
11003 These machine-independent options control the interface conventions
11004 used in code generation.
11006 Most of them have both positive and negative forms; the negative form
11007 of @option{-ffoo} is @option{-fno-foo}.  In the table below, only
11008 one of the forms is listed---the one that is not the default.  You
11009 can figure out the other form by either removing @samp{no-} or adding
11012 @table @gcctabopt
11013 @item -fstack-reuse=@var{reuse-level}
11014 @opindex fstack_reuse
11015 This option controls stack space reuse for user declared local/auto variables
11016 and compiler generated temporaries.  @var{reuse_level} can be @samp{all},
11017 @samp{named_vars}, or @samp{none}. @samp{all} enables stack reuse for all
11018 local variables and temporaries, @samp{named_vars} enables the reuse only for
11019 user defined local variables with names, and @samp{none} disables stack reuse
11020 completely. The default value is @samp{all}. The option is needed when the
11021 program extends the lifetime of a scoped local variable or a compiler generated
11022 temporary beyond the end point defined by the language.  When a lifetime of
11023 a variable ends, and if the variable lives in memory, the optimizing compiler
11024 has the freedom to reuse its stack space with other temporaries or scoped
11025 local variables whose live range does not overlap with it. Legacy code extending
11026 local lifetime is likely to break with the stack reuse optimization.
11028 For example,
11030 @smallexample
11031    int *p;
11032    @{
11033      int local1;
11035      p = &local1;
11036      local1 = 10;
11037      ....
11038    @}
11039    @{
11040       int local2;
11041       local2 = 20;
11042       ...
11043    @}
11045    if (*p == 10)  // out of scope use of local1
11046      @{
11048      @}
11049 @end smallexample
11051 Another example:
11052 @smallexample
11054    struct A
11055    @{
11056        A(int k) : i(k), j(k) @{ @}
11057        int i;
11058        int j;
11059    @};
11061    A *ap;
11063    void foo(const A& ar)
11064    @{
11065       ap = &ar;
11066    @}
11068    void bar()
11069    @{
11070       foo(A(10)); // temp object's lifetime ends when foo returns
11072       @{
11073         A a(20);
11074         ....
11075       @}
11076       ap->i+= 10;  // ap references out of scope temp whose space
11077                    // is reused with a. What is the value of ap->i?
11078    @}
11080 @end smallexample
11082 The lifetime of a compiler generated temporary is well defined by the C++
11083 standard. When a lifetime of a temporary ends, and if the temporary lives
11084 in memory, the optimizing compiler has the freedom to reuse its stack
11085 space with other temporaries or scoped local variables whose live range
11086 does not overlap with it. However some of the legacy code relies on
11087 the behavior of older compilers in which temporaries' stack space is
11088 not reused, the aggressive stack reuse can lead to runtime errors. This
11089 option is used to control the temporary stack reuse optimization.
11091 @item -ftrapv
11092 @opindex ftrapv
11093 This option generates traps for signed overflow on addition, subtraction,
11094 multiplication operations.
11095 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11096 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11097 @option{-fwrapv} being effective.  Note that only active options override, so
11098 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11099 results in @option{-ftrapv} being effective.
11101 @item -fwrapv
11102 @opindex fwrapv
11103 This option instructs the compiler to assume that signed arithmetic
11104 overflow of addition, subtraction and multiplication wraps around
11105 using twos-complement representation.  This flag enables some optimizations
11106 and disables others.  This option is enabled by default for the Java
11107 front end, as required by the Java language specification.
11108 The options @option{-ftrapv} and @option{-fwrapv} override each other, so using
11109 @option{-ftrapv} @option{-fwrapv} on the command-line results in
11110 @option{-fwrapv} being effective.  Note that only active options override, so
11111 using @option{-ftrapv} @option{-fwrapv} @option{-fno-wrapv} on the command-line
11112 results in @option{-ftrapv} being effective.
11114 @item -fexceptions
11115 @opindex fexceptions
11116 Enable exception handling.  Generates extra code needed to propagate
11117 exceptions.  For some targets, this implies GCC generates frame
11118 unwind information for all functions, which can produce significant data
11119 size overhead, although it does not affect execution.  If you do not
11120 specify this option, GCC enables it by default for languages like
11121 C++ that normally require exception handling, and disables it for
11122 languages like C that do not normally require it.  However, you may need
11123 to enable this option when compiling C code that needs to interoperate
11124 properly with exception handlers written in C++.  You may also wish to
11125 disable this option if you are compiling older C++ programs that don't
11126 use exception handling.
11128 @item -fnon-call-exceptions
11129 @opindex fnon-call-exceptions
11130 Generate code that allows trapping instructions to throw exceptions.
11131 Note that this requires platform-specific runtime support that does
11132 not exist everywhere.  Moreover, it only allows @emph{trapping}
11133 instructions to throw exceptions, i.e.@: memory references or floating-point
11134 instructions.  It does not allow exceptions to be thrown from
11135 arbitrary signal handlers such as @code{SIGALRM}.
11137 @item -fdelete-dead-exceptions
11138 @opindex fdelete-dead-exceptions
11139 Consider that instructions that may throw exceptions but don't otherwise
11140 contribute to the execution of the program can be optimized away.
11141 This option is enabled by default for the Ada front end, as permitted by
11142 the Ada language specification.
11143 Optimization passes that cause dead exceptions to be removed are enabled independently at different optimization levels.
11145 @item -funwind-tables
11146 @opindex funwind-tables
11147 Similar to @option{-fexceptions}, except that it just generates any needed
11148 static data, but does not affect the generated code in any other way.
11149 You normally do not need to enable this option; instead, a language processor
11150 that needs this handling enables it on your behalf.
11152 @item -fasynchronous-unwind-tables
11153 @opindex fasynchronous-unwind-tables
11154 Generate unwind table in DWARF format, if supported by target machine.  The
11155 table is exact at each instruction boundary, so it can be used for stack
11156 unwinding from asynchronous events (such as debugger or garbage collector).
11158 @item -fno-gnu-unique
11159 @opindex fno-gnu-unique
11160 On systems with recent GNU assembler and C library, the C++ compiler
11161 uses the @code{STB_GNU_UNIQUE} binding to make sure that definitions
11162 of template static data members and static local variables in inline
11163 functions are unique even in the presence of @code{RTLD_LOCAL}; this
11164 is necessary to avoid problems with a library used by two different
11165 @code{RTLD_LOCAL} plugins depending on a definition in one of them and
11166 therefore disagreeing with the other one about the binding of the
11167 symbol.  But this causes @code{dlclose} to be ignored for affected
11168 DSOs; if your program relies on reinitialization of a DSO via
11169 @code{dlclose} and @code{dlopen}, you can use
11170 @option{-fno-gnu-unique}.
11172 @item -fpcc-struct-return
11173 @opindex fpcc-struct-return
11174 Return ``short'' @code{struct} and @code{union} values in memory like
11175 longer ones, rather than in registers.  This convention is less
11176 efficient, but it has the advantage of allowing intercallability between
11177 GCC-compiled files and files compiled with other compilers, particularly
11178 the Portable C Compiler (pcc).
11180 The precise convention for returning structures in memory depends
11181 on the target configuration macros.
11183 Short structures and unions are those whose size and alignment match
11184 that of some integer type.
11186 @strong{Warning:} code compiled with the @option{-fpcc-struct-return}
11187 switch is not binary compatible with code compiled with the
11188 @option{-freg-struct-return} switch.
11189 Use it to conform to a non-default application binary interface.
11191 @item -freg-struct-return
11192 @opindex freg-struct-return
11193 Return @code{struct} and @code{union} values in registers when possible.
11194 This is more efficient for small structures than
11195 @option{-fpcc-struct-return}.
11197 If you specify neither @option{-fpcc-struct-return} nor
11198 @option{-freg-struct-return}, GCC defaults to whichever convention is
11199 standard for the target.  If there is no standard convention, GCC
11200 defaults to @option{-fpcc-struct-return}, except on targets where GCC is
11201 the principal compiler.  In those cases, we can choose the standard, and
11202 we chose the more efficient register return alternative.
11204 @strong{Warning:} code compiled with the @option{-freg-struct-return}
11205 switch is not binary compatible with code compiled with the
11206 @option{-fpcc-struct-return} switch.
11207 Use it to conform to a non-default application binary interface.
11209 @item -fshort-enums
11210 @opindex fshort-enums
11211 Allocate to an @code{enum} type only as many bytes as it needs for the
11212 declared range of possible values.  Specifically, the @code{enum} type
11213 is equivalent to the smallest integer type that has enough room.
11215 @strong{Warning:} the @option{-fshort-enums} switch causes GCC to generate
11216 code that is not binary compatible with code generated without that switch.
11217 Use it to conform to a non-default application binary interface.
11219 @item -fshort-wchar
11220 @opindex fshort-wchar
11221 Override the underlying type for @code{wchar_t} to be @code{short
11222 unsigned int} instead of the default for the target.  This option is
11223 useful for building programs to run under WINE@.
11225 @strong{Warning:} the @option{-fshort-wchar} switch causes GCC to generate
11226 code that is not binary compatible with code generated without that switch.
11227 Use it to conform to a non-default application binary interface.
11229 @item -fno-common
11230 @opindex fno-common
11231 In C code, controls the placement of uninitialized global variables.
11232 Unix C compilers have traditionally permitted multiple definitions of
11233 such variables in different compilation units by placing the variables
11234 in a common block.
11235 This is the behavior specified by @option{-fcommon}, and is the default
11236 for GCC on most targets.
11237 On the other hand, this behavior is not required by ISO C, and on some
11238 targets may carry a speed or code size penalty on variable references.
11239 The @option{-fno-common} option specifies that the compiler should place
11240 uninitialized global variables in the data section of the object file,
11241 rather than generating them as common blocks.
11242 This has the effect that if the same variable is declared
11243 (without @code{extern}) in two different compilations,
11244 you get a multiple-definition error when you link them.
11245 In this case, you must compile with @option{-fcommon} instead.
11246 Compiling with @option{-fno-common} is useful on targets for which
11247 it provides better performance, or if you wish to verify that the
11248 program will work on other systems that always treat uninitialized
11249 variable declarations this way.
11251 @item -fno-ident
11252 @opindex fno-ident
11253 Ignore the @code{#ident} directive.
11255 @item -finhibit-size-directive
11256 @opindex finhibit-size-directive
11257 Don't output a @code{.size} assembler directive, or anything else that
11258 would cause trouble if the function is split in the middle, and the
11259 two halves are placed at locations far apart in memory.  This option is
11260 used when compiling @file{crtstuff.c}; you should not need to use it
11261 for anything else.
11263 @item -fverbose-asm
11264 @opindex fverbose-asm
11265 Put extra commentary information in the generated assembly code to
11266 make it more readable.  This option is generally only of use to those
11267 who actually need to read the generated assembly code (perhaps while
11268 debugging the compiler itself).
11270 @option{-fno-verbose-asm}, the default, causes the
11271 extra information to be omitted and is useful when comparing two assembler
11272 files.
11274 @item -frecord-gcc-switches
11275 @opindex frecord-gcc-switches
11276 This switch causes the command line used to invoke the
11277 compiler to be recorded into the object file that is being created.
11278 This switch is only implemented on some targets and the exact format
11279 of the recording is target and binary file format dependent, but it
11280 usually takes the form of a section containing ASCII text.  This
11281 switch is related to the @option{-fverbose-asm} switch, but that
11282 switch only records information in the assembler output file as
11283 comments, so it never reaches the object file.
11284 See also @option{-grecord-gcc-switches} for another
11285 way of storing compiler options into the object file.
11287 @item -fpic
11288 @opindex fpic
11289 @cindex global offset table
11290 @cindex PIC
11291 Generate position-independent code (PIC) suitable for use in a shared
11292 library, if supported for the target machine.  Such code accesses all
11293 constant addresses through a global offset table (GOT)@.  The dynamic
11294 loader resolves the GOT entries when the program starts (the dynamic
11295 loader is not part of GCC; it is part of the operating system).  If
11296 the GOT size for the linked executable exceeds a machine-specific
11297 maximum size, you get an error message from the linker indicating that
11298 @option{-fpic} does not work; in that case, recompile with @option{-fPIC}
11299 instead.  (These maximums are 8k on the SPARC, 28k on AArch64 and 32k
11300 on the m68k and RS/6000.  The x86 has no such limit.)
11302 Position-independent code requires special support, and therefore works
11303 only on certain machines.  For the x86, GCC supports PIC for System V
11304 but not for the Sun 386i.  Code generated for the IBM RS/6000 is always
11305 position-independent.
11307 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
11308 are defined to 1.
11310 @item -fPIC
11311 @opindex fPIC
11312 If supported for the target machine, emit position-independent code,
11313 suitable for dynamic linking and avoiding any limit on the size of the
11314 global offset table.  This option makes a difference on AArch64, m68k,
11315 PowerPC and SPARC@.
11317 Position-independent code requires special support, and therefore works
11318 only on certain machines.
11320 When this flag is set, the macros @code{__pic__} and @code{__PIC__}
11321 are defined to 2.
11323 @item -fpie
11324 @itemx -fPIE
11325 @opindex fpie
11326 @opindex fPIE
11327 These options are similar to @option{-fpic} and @option{-fPIC}, but
11328 generated position independent code can be only linked into executables.
11329 Usually these options are used when @option{-pie} GCC option is
11330 used during linking.
11332 @option{-fpie} and @option{-fPIE} both define the macros
11333 @code{__pie__} and @code{__PIE__}.  The macros have the value 1
11334 for @option{-fpie} and 2 for @option{-fPIE}.
11336 @item -fno-plt
11337 @opindex fno-plt
11338 Do not use the PLT for external function calls in position-independent code.
11339 Instead, load the callee address at call sites from the GOT and branch to it.
11340 This leads to more efficient code by eliminating PLT stubs and exposing
11341 GOT loads to optimizations.  On architectures such as 32-bit x86 where
11342 PLT stubs expect the GOT pointer in a specific register, this gives more
11343 register allocation freedom to the compiler.
11344 Lazy binding requires use of the PLT; 
11345 with @option{-fno-plt} all external symbols are resolved at load time.
11347 Alternatively, the function attribute @code{noplt} can be used to avoid calls
11348 through the PLT for specific external functions.
11350 In position-dependent code, a few targets also convert calls to
11351 functions that are marked to not use the PLT to use the GOT instead.
11353 @item -fno-jump-tables
11354 @opindex fno-jump-tables
11355 Do not use jump tables for switch statements even where it would be
11356 more efficient than other code generation strategies.  This option is
11357 of use in conjunction with @option{-fpic} or @option{-fPIC} for
11358 building code that forms part of a dynamic linker and cannot
11359 reference the address of a jump table.  On some targets, jump tables
11360 do not require a GOT and this option is not needed.
11362 @item -ffixed-@var{reg}
11363 @opindex ffixed
11364 Treat the register named @var{reg} as a fixed register; generated code
11365 should never refer to it (except perhaps as a stack pointer, frame
11366 pointer or in some other fixed role).
11368 @var{reg} must be the name of a register.  The register names accepted
11369 are machine-specific and are defined in the @code{REGISTER_NAMES}
11370 macro in the machine description macro file.
11372 This flag does not have a negative form, because it specifies a
11373 three-way choice.
11375 @item -fcall-used-@var{reg}
11376 @opindex fcall-used
11377 Treat the register named @var{reg} as an allocable register that is
11378 clobbered by function calls.  It may be allocated for temporaries or
11379 variables that do not live across a call.  Functions compiled this way
11380 do not save and restore the register @var{reg}.
11382 It is an error to use this flag with the frame pointer or stack pointer.
11383 Use of this flag for other registers that have fixed pervasive roles in
11384 the machine's execution model produces disastrous results.
11386 This flag does not have a negative form, because it specifies a
11387 three-way choice.
11389 @item -fcall-saved-@var{reg}
11390 @opindex fcall-saved
11391 Treat the register named @var{reg} as an allocable register saved by
11392 functions.  It may be allocated even for temporaries or variables that
11393 live across a call.  Functions compiled this way save and restore
11394 the register @var{reg} if they use it.
11396 It is an error to use this flag with the frame pointer or stack pointer.
11397 Use of this flag for other registers that have fixed pervasive roles in
11398 the machine's execution model produces disastrous results.
11400 A different sort of disaster results from the use of this flag for
11401 a register in which function values may be returned.
11403 This flag does not have a negative form, because it specifies a
11404 three-way choice.
11406 @item -fpack-struct[=@var{n}]
11407 @opindex fpack-struct
11408 Without a value specified, pack all structure members together without
11409 holes.  When a value is specified (which must be a small power of two), pack
11410 structure members according to this value, representing the maximum
11411 alignment (that is, objects with default alignment requirements larger than
11412 this are output potentially unaligned at the next fitting location.
11414 @strong{Warning:} the @option{-fpack-struct} switch causes GCC to generate
11415 code that is not binary compatible with code generated without that switch.
11416 Additionally, it makes the code suboptimal.
11417 Use it to conform to a non-default application binary interface.
11419 @item -fleading-underscore
11420 @opindex fleading-underscore
11421 This option and its counterpart, @option{-fno-leading-underscore}, forcibly
11422 change the way C symbols are represented in the object file.  One use
11423 is to help link with legacy assembly code.
11425 @strong{Warning:} the @option{-fleading-underscore} switch causes GCC to
11426 generate code that is not binary compatible with code generated without that
11427 switch.  Use it to conform to a non-default application binary interface.
11428 Not all targets provide complete support for this switch.
11430 @item -ftls-model=@var{model}
11431 @opindex ftls-model
11432 Alter the thread-local storage model to be used (@pxref{Thread-Local}).
11433 The @var{model} argument should be one of @samp{global-dynamic},
11434 @samp{local-dynamic}, @samp{initial-exec} or @samp{local-exec}.
11435 Note that the choice is subject to optimization: the compiler may use
11436 a more efficient model for symbols not visible outside of the translation
11437 unit, or if @option{-fpic} is not given on the command line.
11439 The default without @option{-fpic} is @samp{initial-exec}; with
11440 @option{-fpic} the default is @samp{global-dynamic}.
11442 @item -fvisibility=@r{[}default@r{|}internal@r{|}hidden@r{|}protected@r{]}
11443 @opindex fvisibility
11444 Set the default ELF image symbol visibility to the specified option---all
11445 symbols are marked with this unless overridden within the code.
11446 Using this feature can very substantially improve linking and
11447 load times of shared object libraries, produce more optimized
11448 code, provide near-perfect API export and prevent symbol clashes.
11449 It is @strong{strongly} recommended that you use this in any shared objects
11450 you distribute.
11452 Despite the nomenclature, @samp{default} always means public; i.e.,
11453 available to be linked against from outside the shared object.
11454 @samp{protected} and @samp{internal} are pretty useless in real-world
11455 usage so the only other commonly used option is @samp{hidden}.
11456 The default if @option{-fvisibility} isn't specified is
11457 @samp{default}, i.e., make every symbol public.
11459 A good explanation of the benefits offered by ensuring ELF
11460 symbols have the correct visibility is given by ``How To Write
11461 Shared Libraries'' by Ulrich Drepper (which can be found at
11462 @w{@uref{http://www.akkadia.org/drepper/}})---however a superior
11463 solution made possible by this option to marking things hidden when
11464 the default is public is to make the default hidden and mark things
11465 public.  This is the norm with DLLs on Windows and with @option{-fvisibility=hidden}
11466 and @code{__attribute__ ((visibility("default")))} instead of
11467 @code{__declspec(dllexport)} you get almost identical semantics with
11468 identical syntax.  This is a great boon to those working with
11469 cross-platform projects.
11471 For those adding visibility support to existing code, you may find
11472 @code{#pragma GCC visibility} of use.  This works by you enclosing
11473 the declarations you wish to set visibility for with (for example)
11474 @code{#pragma GCC visibility push(hidden)} and
11475 @code{#pragma GCC visibility pop}.
11476 Bear in mind that symbol visibility should be viewed @strong{as
11477 part of the API interface contract} and thus all new code should
11478 always specify visibility when it is not the default; i.e., declarations
11479 only for use within the local DSO should @strong{always} be marked explicitly
11480 as hidden as so to avoid PLT indirection overheads---making this
11481 abundantly clear also aids readability and self-documentation of the code.
11482 Note that due to ISO C++ specification requirements, @code{operator new} and
11483 @code{operator delete} must always be of default visibility.
11485 Be aware that headers from outside your project, in particular system
11486 headers and headers from any other library you use, may not be
11487 expecting to be compiled with visibility other than the default.  You
11488 may need to explicitly say @code{#pragma GCC visibility push(default)}
11489 before including any such headers.
11491 @code{extern} declarations are not affected by @option{-fvisibility}, so
11492 a lot of code can be recompiled with @option{-fvisibility=hidden} with
11493 no modifications.  However, this means that calls to @code{extern}
11494 functions with no explicit visibility use the PLT, so it is more
11495 effective to use @code{__attribute ((visibility))} and/or
11496 @code{#pragma GCC visibility} to tell the compiler which @code{extern}
11497 declarations should be treated as hidden.
11499 Note that @option{-fvisibility} does affect C++ vague linkage
11500 entities. This means that, for instance, an exception class that is
11501 be thrown between DSOs must be explicitly marked with default
11502 visibility so that the @samp{type_info} nodes are unified between
11503 the DSOs.
11505 An overview of these techniques, their benefits and how to use them
11506 is at @uref{http://gcc.gnu.org/@/wiki/@/Visibility}.
11508 @item -fstrict-volatile-bitfields
11509 @opindex fstrict-volatile-bitfields
11510 This option should be used if accesses to volatile bit-fields (or other
11511 structure fields, although the compiler usually honors those types
11512 anyway) should use a single access of the width of the
11513 field's type, aligned to a natural alignment if possible.  For
11514 example, targets with memory-mapped peripheral registers might require
11515 all such accesses to be 16 bits wide; with this flag you can
11516 declare all peripheral bit-fields as @code{unsigned short} (assuming short
11517 is 16 bits on these targets) to force GCC to use 16-bit accesses
11518 instead of, perhaps, a more efficient 32-bit access.
11520 If this option is disabled, the compiler uses the most efficient
11521 instruction.  In the previous example, that might be a 32-bit load
11522 instruction, even though that accesses bytes that do not contain
11523 any portion of the bit-field, or memory-mapped registers unrelated to
11524 the one being updated.
11526 In some cases, such as when the @code{packed} attribute is applied to a 
11527 structure field, it may not be possible to access the field with a single
11528 read or write that is correctly aligned for the target machine.  In this
11529 case GCC falls back to generating multiple accesses rather than code that 
11530 will fault or truncate the result at run time.
11532 Note:  Due to restrictions of the C/C++11 memory model, write accesses are
11533 not allowed to touch non bit-field members.  It is therefore recommended
11534 to define all bits of the field's type as bit-field members.
11536 The default value of this option is determined by the application binary
11537 interface for the target processor.
11539 @item -fsync-libcalls
11540 @opindex fsync-libcalls
11541 This option controls whether any out-of-line instance of the @code{__sync}
11542 family of functions may be used to implement the C++11 @code{__atomic}
11543 family of functions.
11545 The default value of this option is enabled, thus the only useful form
11546 of the option is @option{-fno-sync-libcalls}.  This option is used in
11547 the implementation of the @file{libatomic} runtime library.
11549 @end table
11551 @node Developer Options
11552 @section GCC Developer Options
11553 @cindex developer options
11554 @cindex debugging GCC
11555 @cindex debug dump options
11556 @cindex dump options
11557 @cindex compilation statistics
11559 This section describes command-line options that are primarily of
11560 interest to GCC developers, including options to support compiler
11561 testing and investigation of compiler bugs and compile-time
11562 performance problems.  This includes options that produce debug dumps
11563 at various points in the compilation; that print statistics such as
11564 memory use and execution time; and that print information about GCC's
11565 configuration, such as where it searches for libraries.  You should
11566 rarely need to use any of these options for ordinary compilation and
11567 linking tasks.
11569 @table @gcctabopt
11571 @item -d@var{letters}
11572 @itemx -fdump-rtl-@var{pass}
11573 @itemx -fdump-rtl-@var{pass}=@var{filename}
11574 @opindex d
11575 @opindex fdump-rtl-@var{pass}
11576 Says to make debugging dumps during compilation at times specified by
11577 @var{letters}.  This is used for debugging the RTL-based passes of the
11578 compiler.  The file names for most of the dumps are made by appending
11579 a pass number and a word to the @var{dumpname}, and the files are
11580 created in the directory of the output file.  In case of
11581 @option{=@var{filename}} option, the dump is output on the given file
11582 instead of the pass numbered dump files.  Note that the pass number is
11583 assigned as passes are registered into the pass manager.  Most passes
11584 are registered in the order that they will execute and for these passes
11585 the number corresponds to the pass execution order.  However, passes
11586 registered by plugins, passes specific to compilation targets, or
11587 passes that are otherwise registered after all the other passes are
11588 numbered higher than a pass named "final", even if they are executed
11589 earlier.  @var{dumpname} is generated from the name of the output
11590 file if explicitly specified and not an executable, otherwise it is
11591 the basename of the source file.  These switches may have different
11592 effects when @option{-E} is used for preprocessing.
11594 Debug dumps can be enabled with a @option{-fdump-rtl} switch or some
11595 @option{-d} option @var{letters}.  Here are the possible
11596 letters for use in @var{pass} and @var{letters}, and their meanings:
11598 @table @gcctabopt
11600 @item -fdump-rtl-alignments
11601 @opindex fdump-rtl-alignments
11602 Dump after branch alignments have been computed.
11604 @item -fdump-rtl-asmcons
11605 @opindex fdump-rtl-asmcons
11606 Dump after fixing rtl statements that have unsatisfied in/out constraints.
11608 @item -fdump-rtl-auto_inc_dec
11609 @opindex fdump-rtl-auto_inc_dec
11610 Dump after auto-inc-dec discovery.  This pass is only run on
11611 architectures that have auto inc or auto dec instructions.
11613 @item -fdump-rtl-barriers
11614 @opindex fdump-rtl-barriers
11615 Dump after cleaning up the barrier instructions.
11617 @item -fdump-rtl-bbpart
11618 @opindex fdump-rtl-bbpart
11619 Dump after partitioning hot and cold basic blocks.
11621 @item -fdump-rtl-bbro
11622 @opindex fdump-rtl-bbro
11623 Dump after block reordering.
11625 @item -fdump-rtl-btl1
11626 @itemx -fdump-rtl-btl2
11627 @opindex fdump-rtl-btl2
11628 @opindex fdump-rtl-btl2
11629 @option{-fdump-rtl-btl1} and @option{-fdump-rtl-btl2} enable dumping
11630 after the two branch
11631 target load optimization passes.
11633 @item -fdump-rtl-bypass
11634 @opindex fdump-rtl-bypass
11635 Dump after jump bypassing and control flow optimizations.
11637 @item -fdump-rtl-combine
11638 @opindex fdump-rtl-combine
11639 Dump after the RTL instruction combination pass.
11641 @item -fdump-rtl-compgotos
11642 @opindex fdump-rtl-compgotos
11643 Dump after duplicating the computed gotos.
11645 @item -fdump-rtl-ce1
11646 @itemx -fdump-rtl-ce2
11647 @itemx -fdump-rtl-ce3
11648 @opindex fdump-rtl-ce1
11649 @opindex fdump-rtl-ce2
11650 @opindex fdump-rtl-ce3
11651 @option{-fdump-rtl-ce1}, @option{-fdump-rtl-ce2}, and
11652 @option{-fdump-rtl-ce3} enable dumping after the three
11653 if conversion passes.
11655 @item -fdump-rtl-cprop_hardreg
11656 @opindex fdump-rtl-cprop_hardreg
11657 Dump after hard register copy propagation.
11659 @item -fdump-rtl-csa
11660 @opindex fdump-rtl-csa
11661 Dump after combining stack adjustments.
11663 @item -fdump-rtl-cse1
11664 @itemx -fdump-rtl-cse2
11665 @opindex fdump-rtl-cse1
11666 @opindex fdump-rtl-cse2
11667 @option{-fdump-rtl-cse1} and @option{-fdump-rtl-cse2} enable dumping after
11668 the two common subexpression elimination passes.
11670 @item -fdump-rtl-dce
11671 @opindex fdump-rtl-dce
11672 Dump after the standalone dead code elimination passes.
11674 @item -fdump-rtl-dbr
11675 @opindex fdump-rtl-dbr
11676 Dump after delayed branch scheduling.
11678 @item -fdump-rtl-dce1
11679 @itemx -fdump-rtl-dce2
11680 @opindex fdump-rtl-dce1
11681 @opindex fdump-rtl-dce2
11682 @option{-fdump-rtl-dce1} and @option{-fdump-rtl-dce2} enable dumping after
11683 the two dead store elimination passes.
11685 @item -fdump-rtl-eh
11686 @opindex fdump-rtl-eh
11687 Dump after finalization of EH handling code.
11689 @item -fdump-rtl-eh_ranges
11690 @opindex fdump-rtl-eh_ranges
11691 Dump after conversion of EH handling range regions.
11693 @item -fdump-rtl-expand
11694 @opindex fdump-rtl-expand
11695 Dump after RTL generation.
11697 @item -fdump-rtl-fwprop1
11698 @itemx -fdump-rtl-fwprop2
11699 @opindex fdump-rtl-fwprop1
11700 @opindex fdump-rtl-fwprop2
11701 @option{-fdump-rtl-fwprop1} and @option{-fdump-rtl-fwprop2} enable
11702 dumping after the two forward propagation passes.
11704 @item -fdump-rtl-gcse1
11705 @itemx -fdump-rtl-gcse2
11706 @opindex fdump-rtl-gcse1
11707 @opindex fdump-rtl-gcse2
11708 @option{-fdump-rtl-gcse1} and @option{-fdump-rtl-gcse2} enable dumping
11709 after global common subexpression elimination.
11711 @item -fdump-rtl-init-regs
11712 @opindex fdump-rtl-init-regs
11713 Dump after the initialization of the registers.
11715 @item -fdump-rtl-initvals
11716 @opindex fdump-rtl-initvals
11717 Dump after the computation of the initial value sets.
11719 @item -fdump-rtl-into_cfglayout
11720 @opindex fdump-rtl-into_cfglayout
11721 Dump after converting to cfglayout mode.
11723 @item -fdump-rtl-ira
11724 @opindex fdump-rtl-ira
11725 Dump after iterated register allocation.
11727 @item -fdump-rtl-jump
11728 @opindex fdump-rtl-jump
11729 Dump after the second jump optimization.
11731 @item -fdump-rtl-loop2
11732 @opindex fdump-rtl-loop2
11733 @option{-fdump-rtl-loop2} enables dumping after the rtl
11734 loop optimization passes.
11736 @item -fdump-rtl-mach
11737 @opindex fdump-rtl-mach
11738 Dump after performing the machine dependent reorganization pass, if that
11739 pass exists.
11741 @item -fdump-rtl-mode_sw
11742 @opindex fdump-rtl-mode_sw
11743 Dump after removing redundant mode switches.
11745 @item -fdump-rtl-rnreg
11746 @opindex fdump-rtl-rnreg
11747 Dump after register renumbering.
11749 @item -fdump-rtl-outof_cfglayout
11750 @opindex fdump-rtl-outof_cfglayout
11751 Dump after converting from cfglayout mode.
11753 @item -fdump-rtl-peephole2
11754 @opindex fdump-rtl-peephole2
11755 Dump after the peephole pass.
11757 @item -fdump-rtl-postreload
11758 @opindex fdump-rtl-postreload
11759 Dump after post-reload optimizations.
11761 @item -fdump-rtl-pro_and_epilogue
11762 @opindex fdump-rtl-pro_and_epilogue
11763 Dump after generating the function prologues and epilogues.
11765 @item -fdump-rtl-sched1
11766 @itemx -fdump-rtl-sched2
11767 @opindex fdump-rtl-sched1
11768 @opindex fdump-rtl-sched2
11769 @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2} enable dumping
11770 after the basic block scheduling passes.
11772 @item -fdump-rtl-ree
11773 @opindex fdump-rtl-ree
11774 Dump after sign/zero extension elimination.
11776 @item -fdump-rtl-seqabstr
11777 @opindex fdump-rtl-seqabstr
11778 Dump after common sequence discovery.
11780 @item -fdump-rtl-shorten
11781 @opindex fdump-rtl-shorten
11782 Dump after shortening branches.
11784 @item -fdump-rtl-sibling
11785 @opindex fdump-rtl-sibling
11786 Dump after sibling call optimizations.
11788 @item -fdump-rtl-split1
11789 @itemx -fdump-rtl-split2
11790 @itemx -fdump-rtl-split3
11791 @itemx -fdump-rtl-split4
11792 @itemx -fdump-rtl-split5
11793 @opindex fdump-rtl-split1
11794 @opindex fdump-rtl-split2
11795 @opindex fdump-rtl-split3
11796 @opindex fdump-rtl-split4
11797 @opindex fdump-rtl-split5
11798 These options enable dumping after five rounds of
11799 instruction splitting.
11801 @item -fdump-rtl-sms
11802 @opindex fdump-rtl-sms
11803 Dump after modulo scheduling.  This pass is only run on some
11804 architectures.
11806 @item -fdump-rtl-stack
11807 @opindex fdump-rtl-stack
11808 Dump after conversion from GCC's ``flat register file'' registers to the
11809 x87's stack-like registers.  This pass is only run on x86 variants.
11811 @item -fdump-rtl-subreg1
11812 @itemx -fdump-rtl-subreg2
11813 @opindex fdump-rtl-subreg1
11814 @opindex fdump-rtl-subreg2
11815 @option{-fdump-rtl-subreg1} and @option{-fdump-rtl-subreg2} enable dumping after
11816 the two subreg expansion passes.
11818 @item -fdump-rtl-unshare
11819 @opindex fdump-rtl-unshare
11820 Dump after all rtl has been unshared.
11822 @item -fdump-rtl-vartrack
11823 @opindex fdump-rtl-vartrack
11824 Dump after variable tracking.
11826 @item -fdump-rtl-vregs
11827 @opindex fdump-rtl-vregs
11828 Dump after converting virtual registers to hard registers.
11830 @item -fdump-rtl-web
11831 @opindex fdump-rtl-web
11832 Dump after live range splitting.
11834 @item -fdump-rtl-regclass
11835 @itemx -fdump-rtl-subregs_of_mode_init
11836 @itemx -fdump-rtl-subregs_of_mode_finish
11837 @itemx -fdump-rtl-dfinit
11838 @itemx -fdump-rtl-dfinish
11839 @opindex fdump-rtl-regclass
11840 @opindex fdump-rtl-subregs_of_mode_init
11841 @opindex fdump-rtl-subregs_of_mode_finish
11842 @opindex fdump-rtl-dfinit
11843 @opindex fdump-rtl-dfinish
11844 These dumps are defined but always produce empty files.
11846 @item -da
11847 @itemx -fdump-rtl-all
11848 @opindex da
11849 @opindex fdump-rtl-all
11850 Produce all the dumps listed above.
11852 @item -dA
11853 @opindex dA
11854 Annotate the assembler output with miscellaneous debugging information.
11856 @item -dD
11857 @opindex dD
11858 Dump all macro definitions, at the end of preprocessing, in addition to
11859 normal output.
11861 @item -dH
11862 @opindex dH
11863 Produce a core dump whenever an error occurs.
11865 @item -dp
11866 @opindex dp
11867 Annotate the assembler output with a comment indicating which
11868 pattern and alternative is used.  The length of each instruction is
11869 also printed.
11871 @item -dP
11872 @opindex dP
11873 Dump the RTL in the assembler output as a comment before each instruction.
11874 Also turns on @option{-dp} annotation.
11876 @item -dx
11877 @opindex dx
11878 Just generate RTL for a function instead of compiling it.  Usually used
11879 with @option{-fdump-rtl-expand}.
11880 @end table
11882 @item -fdump-noaddr
11883 @opindex fdump-noaddr
11884 When doing debugging dumps, suppress address output.  This makes it more
11885 feasible to use diff on debugging dumps for compiler invocations with
11886 different compiler binaries and/or different
11887 text / bss / data / heap / stack / dso start locations.
11889 @item -freport-bug
11890 @opindex freport-bug
11891 Collect and dump debug information into a temporary file if an
11892 internal compiler error (ICE) occurs.
11894 @item -fdump-unnumbered
11895 @opindex fdump-unnumbered
11896 When doing debugging dumps, suppress instruction numbers and address output.
11897 This makes it more feasible to use diff on debugging dumps for compiler
11898 invocations with different options, in particular with and without
11899 @option{-g}.
11901 @item -fdump-unnumbered-links
11902 @opindex fdump-unnumbered-links
11903 When doing debugging dumps (see @option{-d} option above), suppress
11904 instruction numbers for the links to the previous and next instructions
11905 in a sequence.
11907 @item -fdump-translation-unit @r{(C++ only)}
11908 @itemx -fdump-translation-unit-@var{options} @r{(C++ only)}
11909 @opindex fdump-translation-unit
11910 Dump a representation of the tree structure for the entire translation
11911 unit to a file.  The file name is made by appending @file{.tu} to the
11912 source file name, and the file is created in the same directory as the
11913 output file.  If the @samp{-@var{options}} form is used, @var{options}
11914 controls the details of the dump as described for the
11915 @option{-fdump-tree} options.
11917 @item -fdump-class-hierarchy @r{(C++ only)}
11918 @itemx -fdump-class-hierarchy-@var{options} @r{(C++ only)}
11919 @opindex fdump-class-hierarchy
11920 Dump a representation of each class's hierarchy and virtual function
11921 table layout to a file.  The file name is made by appending
11922 @file{.class} to the source file name, and the file is created in the
11923 same directory as the output file.  If the @samp{-@var{options}} form
11924 is used, @var{options} controls the details of the dump as described
11925 for the @option{-fdump-tree} options.
11927 @item -fdump-ipa-@var{switch}
11928 @opindex fdump-ipa
11929 Control the dumping at various stages of inter-procedural analysis
11930 language tree to a file.  The file name is generated by appending a
11931 switch specific suffix to the source file name, and the file is created
11932 in the same directory as the output file.  The following dumps are
11933 possible:
11935 @table @samp
11936 @item all
11937 Enables all inter-procedural analysis dumps.
11939 @item cgraph
11940 Dumps information about call-graph optimization, unused function removal,
11941 and inlining decisions.
11943 @item inline
11944 Dump after function inlining.
11946 @end table
11948 @item -fdump-passes
11949 @opindex fdump-passes
11950 Dump the list of optimization passes that are turned on and off by
11951 the current command-line options.
11953 @item -fdump-statistics-@var{option}
11954 @opindex fdump-statistics
11955 Enable and control dumping of pass statistics in a separate file.  The
11956 file name is generated by appending a suffix ending in
11957 @samp{.statistics} to the source file name, and the file is created in
11958 the same directory as the output file.  If the @samp{-@var{option}}
11959 form is used, @samp{-stats} causes counters to be summed over the
11960 whole compilation unit while @samp{-details} dumps every event as
11961 the passes generate them.  The default with no option is to sum
11962 counters for each function compiled.
11964 @item -fdump-tree-@var{switch}
11965 @itemx -fdump-tree-@var{switch}-@var{options}
11966 @itemx -fdump-tree-@var{switch}-@var{options}=@var{filename}
11967 @opindex fdump-tree
11968 Control the dumping at various stages of processing the intermediate
11969 language tree to a file.  The file name is generated by appending a
11970 switch-specific suffix to the source file name, and the file is
11971 created in the same directory as the output file. In case of
11972 @option{=@var{filename}} option, the dump is output on the given file
11973 instead of the auto named dump files.  If the @samp{-@var{options}}
11974 form is used, @var{options} is a list of @samp{-} separated options
11975 which control the details of the dump.  Not all options are applicable
11976 to all dumps; those that are not meaningful are ignored.  The
11977 following options are available
11979 @table @samp
11980 @item address
11981 Print the address of each node.  Usually this is not meaningful as it
11982 changes according to the environment and source file.  Its primary use
11983 is for tying up a dump file with a debug environment.
11984 @item asmname
11985 If @code{DECL_ASSEMBLER_NAME} has been set for a given decl, use that
11986 in the dump instead of @code{DECL_NAME}.  Its primary use is ease of
11987 use working backward from mangled names in the assembly file.
11988 @item slim
11989 When dumping front-end intermediate representations, inhibit dumping
11990 of members of a scope or body of a function merely because that scope
11991 has been reached.  Only dump such items when they are directly reachable
11992 by some other path.
11994 When dumping pretty-printed trees, this option inhibits dumping the
11995 bodies of control structures.
11997 When dumping RTL, print the RTL in slim (condensed) form instead of
11998 the default LISP-like representation.
11999 @item raw
12000 Print a raw representation of the tree.  By default, trees are
12001 pretty-printed into a C-like representation.
12002 @item details
12003 Enable more detailed dumps (not honored by every dump option). Also
12004 include information from the optimization passes.
12005 @item stats
12006 Enable dumping various statistics about the pass (not honored by every dump
12007 option).
12008 @item blocks
12009 Enable showing basic block boundaries (disabled in raw dumps).
12010 @item graph
12011 For each of the other indicated dump files (@option{-fdump-rtl-@var{pass}}),
12012 dump a representation of the control flow graph suitable for viewing with
12013 GraphViz to @file{@var{file}.@var{passid}.@var{pass}.dot}.  Each function in
12014 the file is pretty-printed as a subgraph, so that GraphViz can render them
12015 all in a single plot.
12017 This option currently only works for RTL dumps, and the RTL is always
12018 dumped in slim form.
12019 @item vops
12020 Enable showing virtual operands for every statement.
12021 @item lineno
12022 Enable showing line numbers for statements.
12023 @item uid
12024 Enable showing the unique ID (@code{DECL_UID}) for each variable.
12025 @item verbose
12026 Enable showing the tree dump for each statement.
12027 @item eh
12028 Enable showing the EH region number holding each statement.
12029 @item scev
12030 Enable showing scalar evolution analysis details.
12031 @item optimized
12032 Enable showing optimization information (only available in certain
12033 passes).
12034 @item missed
12035 Enable showing missed optimization information (only available in certain
12036 passes).
12037 @item note
12038 Enable other detailed optimization information (only available in
12039 certain passes).
12040 @item =@var{filename}
12041 Instead of an auto named dump file, output into the given file
12042 name. The file names @file{stdout} and @file{stderr} are treated
12043 specially and are considered already open standard streams. For
12044 example,
12046 @smallexample
12047 gcc -O2 -ftree-vectorize -fdump-tree-vect-blocks=foo.dump
12048      -fdump-tree-pre=stderr file.c
12049 @end smallexample
12051 outputs vectorizer dump into @file{foo.dump}, while the PRE dump is
12052 output on to @file{stderr}. If two conflicting dump filenames are
12053 given for the same pass, then the latter option overrides the earlier
12054 one.
12056 @item split-paths
12057 @opindex fdump-tree-split-paths
12058 Dump each function after splitting paths to loop backedges.  The file
12059 name is made by appending @file{.split-paths} to the source file name.
12061 @item all
12062 Turn on all options, except @option{raw}, @option{slim}, @option{verbose}
12063 and @option{lineno}.
12065 @item optall
12066 Turn on all optimization options, i.e., @option{optimized},
12067 @option{missed}, and @option{note}.
12068 @end table
12070 The following tree dumps are possible:
12071 @table @samp
12073 @item original
12074 @opindex fdump-tree-original
12075 Dump before any tree based optimization, to @file{@var{file}.original}.
12077 @item optimized
12078 @opindex fdump-tree-optimized
12079 Dump after all tree based optimization, to @file{@var{file}.optimized}.
12081 @item gimple
12082 @opindex fdump-tree-gimple
12083 Dump each function before and after the gimplification pass to a file.  The
12084 file name is made by appending @file{.gimple} to the source file name.
12086 @item cfg
12087 @opindex fdump-tree-cfg
12088 Dump the control flow graph of each function to a file.  The file name is
12089 made by appending @file{.cfg} to the source file name.
12091 @item ch
12092 @opindex fdump-tree-ch
12093 Dump each function after copying loop headers.  The file name is made by
12094 appending @file{.ch} to the source file name.
12096 @item ssa
12097 @opindex fdump-tree-ssa
12098 Dump SSA related information to a file.  The file name is made by appending
12099 @file{.ssa} to the source file name.
12101 @item alias
12102 @opindex fdump-tree-alias
12103 Dump aliasing information for each function.  The file name is made by
12104 appending @file{.alias} to the source file name.
12106 @item ccp
12107 @opindex fdump-tree-ccp
12108 Dump each function after CCP@.  The file name is made by appending
12109 @file{.ccp} to the source file name.
12111 @item storeccp
12112 @opindex fdump-tree-storeccp
12113 Dump each function after STORE-CCP@.  The file name is made by appending
12114 @file{.storeccp} to the source file name.
12116 @item pre
12117 @opindex fdump-tree-pre
12118 Dump trees after partial redundancy elimination.  The file name is made
12119 by appending @file{.pre} to the source file name.
12121 @item fre
12122 @opindex fdump-tree-fre
12123 Dump trees after full redundancy elimination.  The file name is made
12124 by appending @file{.fre} to the source file name.
12126 @item copyprop
12127 @opindex fdump-tree-copyprop
12128 Dump trees after copy propagation.  The file name is made
12129 by appending @file{.copyprop} to the source file name.
12131 @item store_copyprop
12132 @opindex fdump-tree-store_copyprop
12133 Dump trees after store copy-propagation.  The file name is made
12134 by appending @file{.store_copyprop} to the source file name.
12136 @item dce
12137 @opindex fdump-tree-dce
12138 Dump each function after dead code elimination.  The file name is made by
12139 appending @file{.dce} to the source file name.
12141 @item sra
12142 @opindex fdump-tree-sra
12143 Dump each function after performing scalar replacement of aggregates.  The
12144 file name is made by appending @file{.sra} to the source file name.
12146 @item sink
12147 @opindex fdump-tree-sink
12148 Dump each function after performing code sinking.  The file name is made
12149 by appending @file{.sink} to the source file name.
12151 @item dom
12152 @opindex fdump-tree-dom
12153 Dump each function after applying dominator tree optimizations.  The file
12154 name is made by appending @file{.dom} to the source file name.
12156 @item dse
12157 @opindex fdump-tree-dse
12158 Dump each function after applying dead store elimination.  The file
12159 name is made by appending @file{.dse} to the source file name.
12161 @item phiopt
12162 @opindex fdump-tree-phiopt
12163 Dump each function after optimizing PHI nodes into straightline code.  The file
12164 name is made by appending @file{.phiopt} to the source file name.
12166 @item backprop
12167 @opindex fdump-tree-backprop
12168 Dump each function after back-propagating use information up the definition
12169 chain.  The file name is made by appending @file{.backprop} to the
12170 source file name.
12172 @item forwprop
12173 @opindex fdump-tree-forwprop
12174 Dump each function after forward propagating single use variables.  The file
12175 name is made by appending @file{.forwprop} to the source file name.
12177 @item nrv
12178 @opindex fdump-tree-nrv
12179 Dump each function after applying the named return value optimization on
12180 generic trees.  The file name is made by appending @file{.nrv} to the source
12181 file name.
12183 @item vect
12184 @opindex fdump-tree-vect
12185 Dump each function after applying vectorization of loops.  The file name is
12186 made by appending @file{.vect} to the source file name.
12188 @item slp
12189 @opindex fdump-tree-slp
12190 Dump each function after applying vectorization of basic blocks.  The file name
12191 is made by appending @file{.slp} to the source file name.
12193 @item vrp
12194 @opindex fdump-tree-vrp
12195 Dump each function after Value Range Propagation (VRP).  The file name
12196 is made by appending @file{.vrp} to the source file name.
12198 @item oaccdevlow
12199 @opindex fdump-tree-oaccdevlow
12200 Dump each function after applying device-specific OpenACC transformations.
12201 The file name is made by appending @file{.oaccdevlow} to the source file name.
12203 @item all
12204 @opindex fdump-tree-all
12205 Enable all the available tree dumps with the flags provided in this option.
12206 @end table
12208 @item -fopt-info
12209 @itemx -fopt-info-@var{options}
12210 @itemx -fopt-info-@var{options}=@var{filename}
12211 @opindex fopt-info
12212 Controls optimization dumps from various optimization passes. If the
12213 @samp{-@var{options}} form is used, @var{options} is a list of
12214 @samp{-} separated option keywords to select the dump details and
12215 optimizations.  
12217 The @var{options} can be divided into two groups: options describing the
12218 verbosity of the dump, and options describing which optimizations
12219 should be included. The options from both the groups can be freely
12220 mixed as they are non-overlapping. However, in case of any conflicts,
12221 the later options override the earlier options on the command
12222 line. 
12224 The following options control the dump verbosity:
12226 @table @samp
12227 @item optimized
12228 Print information when an optimization is successfully applied. It is
12229 up to a pass to decide which information is relevant. For example, the
12230 vectorizer passes print the source location of loops which are
12231 successfully vectorized.
12232 @item missed
12233 Print information about missed optimizations. Individual passes
12234 control which information to include in the output. 
12235 @item note
12236 Print verbose information about optimizations, such as certain
12237 transformations, more detailed messages about decisions etc.
12238 @item all
12239 Print detailed optimization information. This includes
12240 @samp{optimized}, @samp{missed}, and @samp{note}.
12241 @end table
12243 One or more of the following option keywords can be used to describe a
12244 group of optimizations:
12246 @table @samp
12247 @item ipa
12248 Enable dumps from all interprocedural optimizations.
12249 @item loop
12250 Enable dumps from all loop optimizations.
12251 @item inline
12252 Enable dumps from all inlining optimizations.
12253 @item vec
12254 Enable dumps from all vectorization optimizations.
12255 @item optall
12256 Enable dumps from all optimizations. This is a superset of
12257 the optimization groups listed above.
12258 @end table
12260 If @var{options} is
12261 omitted, it defaults to @samp{optimized-optall}, which means to dump all
12262 info about successful optimizations from all the passes.  
12264 If the @var{filename} is provided, then the dumps from all the
12265 applicable optimizations are concatenated into the @var{filename}.
12266 Otherwise the dump is output onto @file{stderr}. Though multiple
12267 @option{-fopt-info} options are accepted, only one of them can include
12268 a @var{filename}. If other filenames are provided then all but the
12269 first such option are ignored.
12271 Note that the output @var{filename} is overwritten
12272 in case of multiple translation units. If a combined output from
12273 multiple translation units is desired, @file{stderr} should be used
12274 instead.
12276 In the following example, the optimization info is output to
12277 @file{stderr}:
12279 @smallexample
12280 gcc -O3 -fopt-info
12281 @end smallexample
12283 This example:
12284 @smallexample
12285 gcc -O3 -fopt-info-missed=missed.all
12286 @end smallexample
12288 @noindent
12289 outputs missed optimization report from all the passes into
12290 @file{missed.all}, and this one:
12292 @smallexample
12293 gcc -O2 -ftree-vectorize -fopt-info-vec-missed
12294 @end smallexample
12296 @noindent
12297 prints information about missed optimization opportunities from
12298 vectorization passes on @file{stderr}.  
12299 Note that @option{-fopt-info-vec-missed} is equivalent to 
12300 @option{-fopt-info-missed-vec}.
12302 As another example,
12303 @smallexample
12304 gcc -O3 -fopt-info-inline-optimized-missed=inline.txt
12305 @end smallexample
12307 @noindent
12308 outputs information about missed optimizations as well as
12309 optimized locations from all the inlining passes into
12310 @file{inline.txt}.
12312 Finally, consider:
12314 @smallexample
12315 gcc -fopt-info-vec-missed=vec.miss -fopt-info-loop-optimized=loop.opt
12316 @end smallexample
12318 @noindent
12319 Here the two output filenames @file{vec.miss} and @file{loop.opt} are
12320 in conflict since only one output file is allowed. In this case, only
12321 the first option takes effect and the subsequent options are
12322 ignored. Thus only @file{vec.miss} is produced which contains
12323 dumps from the vectorizer about missed opportunities.
12325 @item -fsched-verbose=@var{n}
12326 @opindex fsched-verbose
12327 On targets that use instruction scheduling, this option controls the
12328 amount of debugging output the scheduler prints to the dump files.
12330 For @var{n} greater than zero, @option{-fsched-verbose} outputs the
12331 same information as @option{-fdump-rtl-sched1} and @option{-fdump-rtl-sched2}.
12332 For @var{n} greater than one, it also output basic block probabilities,
12333 detailed ready list information and unit/insn info.  For @var{n} greater
12334 than two, it includes RTL at abort point, control-flow and regions info.
12335 And for @var{n} over four, @option{-fsched-verbose} also includes
12336 dependence info.
12340 @item -fenable-@var{kind}-@var{pass}
12341 @itemx -fdisable-@var{kind}-@var{pass}=@var{range-list}
12342 @opindex fdisable-
12343 @opindex fenable-
12345 This is a set of options that are used to explicitly disable/enable
12346 optimization passes.  These options are intended for use for debugging GCC.
12347 Compiler users should use regular options for enabling/disabling
12348 passes instead.
12350 @table @gcctabopt
12352 @item -fdisable-ipa-@var{pass}
12353 Disable IPA pass @var{pass}. @var{pass} is the pass name.  If the same pass is
12354 statically invoked in the compiler multiple times, the pass name should be
12355 appended with a sequential number starting from 1.
12357 @item -fdisable-rtl-@var{pass}
12358 @itemx -fdisable-rtl-@var{pass}=@var{range-list}
12359 Disable RTL pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
12360 statically invoked in the compiler multiple times, the pass name should be
12361 appended with a sequential number starting from 1.  @var{range-list} is a 
12362 comma-separated list of function ranges or assembler names.  Each range is a number
12363 pair separated by a colon.  The range is inclusive in both ends.  If the range
12364 is trivial, the number pair can be simplified as a single number.  If the
12365 function's call graph node's @var{uid} falls within one of the specified ranges,
12366 the @var{pass} is disabled for that function.  The @var{uid} is shown in the
12367 function header of a dump file, and the pass names can be dumped by using
12368 option @option{-fdump-passes}.
12370 @item -fdisable-tree-@var{pass}
12371 @itemx -fdisable-tree-@var{pass}=@var{range-list}
12372 Disable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description of
12373 option arguments.
12375 @item -fenable-ipa-@var{pass}
12376 Enable IPA pass @var{pass}.  @var{pass} is the pass name.  If the same pass is
12377 statically invoked in the compiler multiple times, the pass name should be
12378 appended with a sequential number starting from 1.
12380 @item -fenable-rtl-@var{pass}
12381 @itemx -fenable-rtl-@var{pass}=@var{range-list}
12382 Enable RTL pass @var{pass}.  See @option{-fdisable-rtl} for option argument
12383 description and examples.
12385 @item -fenable-tree-@var{pass}
12386 @itemx -fenable-tree-@var{pass}=@var{range-list}
12387 Enable tree pass @var{pass}.  See @option{-fdisable-rtl} for the description
12388 of option arguments.
12390 @end table
12392 Here are some examples showing uses of these options.
12394 @smallexample
12396 # disable ccp1 for all functions
12397    -fdisable-tree-ccp1
12398 # disable complete unroll for function whose cgraph node uid is 1
12399    -fenable-tree-cunroll=1
12400 # disable gcse2 for functions at the following ranges [1,1],
12401 # [300,400], and [400,1000]
12402 # disable gcse2 for functions foo and foo2
12403    -fdisable-rtl-gcse2=foo,foo2
12404 # disable early inlining
12405    -fdisable-tree-einline
12406 # disable ipa inlining
12407    -fdisable-ipa-inline
12408 # enable tree full unroll
12409    -fenable-tree-unroll
12411 @end smallexample
12413 @item -fchecking
12414 @itemx -fchecking=@var{n}
12415 @opindex fchecking
12416 @opindex fno-checking
12417 Enable internal consistency checking.  The default depends on
12418 the compiler configuration.  @option{-fchecking=2} enables further
12419 internal consistency checking that might affect code generation.
12421 @item -frandom-seed=@var{string}
12422 @opindex frandom-seed
12423 This option provides a seed that GCC uses in place of
12424 random numbers in generating certain symbol names
12425 that have to be different in every compiled file.  It is also used to
12426 place unique stamps in coverage data files and the object files that
12427 produce them.  You can use the @option{-frandom-seed} option to produce
12428 reproducibly identical object files.
12430 The @var{string} can either be a number (decimal, octal or hex) or an
12431 arbitrary string (in which case it's converted to a number by
12432 computing CRC32).
12434 The @var{string} should be different for every file you compile.
12436 @item -save-temps
12437 @itemx -save-temps=cwd
12438 @opindex save-temps
12439 Store the usual ``temporary'' intermediate files permanently; place them
12440 in the current directory and name them based on the source file.  Thus,
12441 compiling @file{foo.c} with @option{-c -save-temps} produces files
12442 @file{foo.i} and @file{foo.s}, as well as @file{foo.o}.  This creates a
12443 preprocessed @file{foo.i} output file even though the compiler now
12444 normally uses an integrated preprocessor.
12446 When used in combination with the @option{-x} command-line option,
12447 @option{-save-temps} is sensible enough to avoid over writing an
12448 input source file with the same extension as an intermediate file.
12449 The corresponding intermediate file may be obtained by renaming the
12450 source file before using @option{-save-temps}.
12452 If you invoke GCC in parallel, compiling several different source
12453 files that share a common base name in different subdirectories or the
12454 same source file compiled for multiple output destinations, it is
12455 likely that the different parallel compilers will interfere with each
12456 other, and overwrite the temporary files.  For instance:
12458 @smallexample
12459 gcc -save-temps -o outdir1/foo.o indir1/foo.c&
12460 gcc -save-temps -o outdir2/foo.o indir2/foo.c&
12461 @end smallexample
12463 may result in @file{foo.i} and @file{foo.o} being written to
12464 simultaneously by both compilers.
12466 @item -save-temps=obj
12467 @opindex save-temps=obj
12468 Store the usual ``temporary'' intermediate files permanently.  If the
12469 @option{-o} option is used, the temporary files are based on the
12470 object file.  If the @option{-o} option is not used, the
12471 @option{-save-temps=obj} switch behaves like @option{-save-temps}.
12473 For example:
12475 @smallexample
12476 gcc -save-temps=obj -c foo.c
12477 gcc -save-temps=obj -c bar.c -o dir/xbar.o
12478 gcc -save-temps=obj foobar.c -o dir2/yfoobar
12479 @end smallexample
12481 @noindent
12482 creates @file{foo.i}, @file{foo.s}, @file{dir/xbar.i},
12483 @file{dir/xbar.s}, @file{dir2/yfoobar.i}, @file{dir2/yfoobar.s}, and
12484 @file{dir2/yfoobar.o}.
12486 @item -time@r{[}=@var{file}@r{]}
12487 @opindex time
12488 Report the CPU time taken by each subprocess in the compilation
12489 sequence.  For C source files, this is the compiler proper and assembler
12490 (plus the linker if linking is done).
12492 Without the specification of an output file, the output looks like this:
12494 @smallexample
12495 # cc1 0.12 0.01
12496 # as 0.00 0.01
12497 @end smallexample
12499 The first number on each line is the ``user time'', that is time spent
12500 executing the program itself.  The second number is ``system time'',
12501 time spent executing operating system routines on behalf of the program.
12502 Both numbers are in seconds.
12504 With the specification of an output file, the output is appended to the
12505 named file, and it looks like this:
12507 @smallexample
12508 0.12 0.01 cc1 @var{options}
12509 0.00 0.01 as @var{options}
12510 @end smallexample
12512 The ``user time'' and the ``system time'' are moved before the program
12513 name, and the options passed to the program are displayed, so that one
12514 can later tell what file was being compiled, and with which options.
12516 @item -fdump-final-insns@r{[}=@var{file}@r{]}
12517 @opindex fdump-final-insns
12518 Dump the final internal representation (RTL) to @var{file}.  If the
12519 optional argument is omitted (or if @var{file} is @code{.}), the name
12520 of the dump file is determined by appending @code{.gkd} to the
12521 compilation output file name.
12523 @item -fcompare-debug@r{[}=@var{opts}@r{]}
12524 @opindex fcompare-debug
12525 @opindex fno-compare-debug
12526 If no error occurs during compilation, run the compiler a second time,
12527 adding @var{opts} and @option{-fcompare-debug-second} to the arguments
12528 passed to the second compilation.  Dump the final internal
12529 representation in both compilations, and print an error if they differ.
12531 If the equal sign is omitted, the default @option{-gtoggle} is used.
12533 The environment variable @env{GCC_COMPARE_DEBUG}, if defined, non-empty
12534 and nonzero, implicitly enables @option{-fcompare-debug}.  If
12535 @env{GCC_COMPARE_DEBUG} is defined to a string starting with a dash,
12536 then it is used for @var{opts}, otherwise the default @option{-gtoggle}
12537 is used.
12539 @option{-fcompare-debug=}, with the equal sign but without @var{opts},
12540 is equivalent to @option{-fno-compare-debug}, which disables the dumping
12541 of the final representation and the second compilation, preventing even
12542 @env{GCC_COMPARE_DEBUG} from taking effect.
12544 To verify full coverage during @option{-fcompare-debug} testing, set
12545 @env{GCC_COMPARE_DEBUG} to say @option{-fcompare-debug-not-overridden},
12546 which GCC rejects as an invalid option in any actual compilation
12547 (rather than preprocessing, assembly or linking).  To get just a
12548 warning, setting @env{GCC_COMPARE_DEBUG} to @samp{-w%n-fcompare-debug
12549 not overridden} will do.
12551 @item -fcompare-debug-second
12552 @opindex fcompare-debug-second
12553 This option is implicitly passed to the compiler for the second
12554 compilation requested by @option{-fcompare-debug}, along with options to
12555 silence warnings, and omitting other options that would cause
12556 side-effect compiler outputs to files or to the standard output.  Dump
12557 files and preserved temporary files are renamed so as to contain the
12558 @code{.gk} additional extension during the second compilation, to avoid
12559 overwriting those generated by the first.
12561 When this option is passed to the compiler driver, it causes the
12562 @emph{first} compilation to be skipped, which makes it useful for little
12563 other than debugging the compiler proper.
12565 @item -gtoggle
12566 @opindex gtoggle
12567 Turn off generation of debug info, if leaving out this option
12568 generates it, or turn it on at level 2 otherwise.  The position of this
12569 argument in the command line does not matter; it takes effect after all
12570 other options are processed, and it does so only once, no matter how
12571 many times it is given.  This is mainly intended to be used with
12572 @option{-fcompare-debug}.
12574 @item -fvar-tracking-assignments-toggle
12575 @opindex fvar-tracking-assignments-toggle
12576 @opindex fno-var-tracking-assignments-toggle
12577 Toggle @option{-fvar-tracking-assignments}, in the same way that
12578 @option{-gtoggle} toggles @option{-g}.
12580 @item -Q
12581 @opindex Q
12582 Makes the compiler print out each function name as it is compiled, and
12583 print some statistics about each pass when it finishes.
12585 @item -ftime-report
12586 @opindex ftime-report
12587 Makes the compiler print some statistics about the time consumed by each
12588 pass when it finishes.
12590 @item -fira-verbose=@var{n}
12591 @opindex fira-verbose
12592 Control the verbosity of the dump file for the integrated register allocator.
12593 The default value is 5.  If the value @var{n} is greater or equal to 10,
12594 the dump output is sent to stderr using the same format as @var{n} minus 10.
12596 @item -flto-report
12597 @opindex flto-report
12598 Prints a report with internal details on the workings of the link-time
12599 optimizer.  The contents of this report vary from version to version.
12600 It is meant to be useful to GCC developers when processing object
12601 files in LTO mode (via @option{-flto}).
12603 Disabled by default.
12605 @item -flto-report-wpa
12606 @opindex flto-report-wpa
12607 Like @option{-flto-report}, but only print for the WPA phase of Link
12608 Time Optimization.
12610 @item -fmem-report
12611 @opindex fmem-report
12612 Makes the compiler print some statistics about permanent memory
12613 allocation when it finishes.
12615 @item -fmem-report-wpa
12616 @opindex fmem-report-wpa
12617 Makes the compiler print some statistics about permanent memory
12618 allocation for the WPA phase only.
12620 @item -fpre-ipa-mem-report
12621 @opindex fpre-ipa-mem-report
12622 @item -fpost-ipa-mem-report
12623 @opindex fpost-ipa-mem-report
12624 Makes the compiler print some statistics about permanent memory
12625 allocation before or after interprocedural optimization.
12627 @item -fprofile-report
12628 @opindex fprofile-report
12629 Makes the compiler print some statistics about consistency of the
12630 (estimated) profile and effect of individual passes.
12632 @item -fstack-usage
12633 @opindex fstack-usage
12634 Makes the compiler output stack usage information for the program, on a
12635 per-function basis.  The filename for the dump is made by appending
12636 @file{.su} to the @var{auxname}.  @var{auxname} is generated from the name of
12637 the output file, if explicitly specified and it is not an executable,
12638 otherwise it is the basename of the source file.  An entry is made up
12639 of three fields:
12641 @itemize
12642 @item
12643 The name of the function.
12644 @item
12645 A number of bytes.
12646 @item
12647 One or more qualifiers: @code{static}, @code{dynamic}, @code{bounded}.
12648 @end itemize
12650 The qualifier @code{static} means that the function manipulates the stack
12651 statically: a fixed number of bytes are allocated for the frame on function
12652 entry and released on function exit; no stack adjustments are otherwise made
12653 in the function.  The second field is this fixed number of bytes.
12655 The qualifier @code{dynamic} means that the function manipulates the stack
12656 dynamically: in addition to the static allocation described above, stack
12657 adjustments are made in the body of the function, for example to push/pop
12658 arguments around function calls.  If the qualifier @code{bounded} is also
12659 present, the amount of these adjustments is bounded at compile time and
12660 the second field is an upper bound of the total amount of stack used by
12661 the function.  If it is not present, the amount of these adjustments is
12662 not bounded at compile time and the second field only represents the
12663 bounded part.
12665 @item -fstats
12666 @opindex fstats
12667 Emit statistics about front-end processing at the end of the compilation.
12668 This option is supported only by the C++ front end, and
12669 the information is generally only useful to the G++ development team.
12671 @item -fdbg-cnt-list
12672 @opindex fdbg-cnt-list
12673 Print the name and the counter upper bound for all debug counters.
12676 @item -fdbg-cnt=@var{counter-value-list}
12677 @opindex fdbg-cnt
12678 Set the internal debug counter upper bound.  @var{counter-value-list}
12679 is a comma-separated list of @var{name}:@var{value} pairs
12680 which sets the upper bound of each debug counter @var{name} to @var{value}.
12681 All debug counters have the initial upper bound of @code{UINT_MAX};
12682 thus @code{dbg_cnt} returns true always unless the upper bound
12683 is set by this option.
12684 For example, with @option{-fdbg-cnt=dce:10,tail_call:0},
12685 @code{dbg_cnt(dce)} returns true only for first 10 invocations.
12687 @item -print-file-name=@var{library}
12688 @opindex print-file-name
12689 Print the full absolute name of the library file @var{library} that
12690 would be used when linking---and don't do anything else.  With this
12691 option, GCC does not compile or link anything; it just prints the
12692 file name.
12694 @item -print-multi-directory
12695 @opindex print-multi-directory
12696 Print the directory name corresponding to the multilib selected by any
12697 other switches present in the command line.  This directory is supposed
12698 to exist in @env{GCC_EXEC_PREFIX}.
12700 @item -print-multi-lib
12701 @opindex print-multi-lib
12702 Print the mapping from multilib directory names to compiler switches
12703 that enable them.  The directory name is separated from the switches by
12704 @samp{;}, and each switch starts with an @samp{@@} instead of the
12705 @samp{-}, without spaces between multiple switches.  This is supposed to
12706 ease shell processing.
12708 @item -print-multi-os-directory
12709 @opindex print-multi-os-directory
12710 Print the path to OS libraries for the selected
12711 multilib, relative to some @file{lib} subdirectory.  If OS libraries are
12712 present in the @file{lib} subdirectory and no multilibs are used, this is
12713 usually just @file{.}, if OS libraries are present in @file{lib@var{suffix}}
12714 sibling directories this prints e.g.@: @file{../lib64}, @file{../lib} or
12715 @file{../lib32}, or if OS libraries are present in @file{lib/@var{subdir}}
12716 subdirectories it prints e.g.@: @file{amd64}, @file{sparcv9} or @file{ev6}.
12718 @item -print-multiarch
12719 @opindex print-multiarch
12720 Print the path to OS libraries for the selected multiarch,
12721 relative to some @file{lib} subdirectory.
12723 @item -print-prog-name=@var{program}
12724 @opindex print-prog-name
12725 Like @option{-print-file-name}, but searches for a program such as @command{cpp}.
12727 @item -print-libgcc-file-name
12728 @opindex print-libgcc-file-name
12729 Same as @option{-print-file-name=libgcc.a}.
12731 This is useful when you use @option{-nostdlib} or @option{-nodefaultlibs}
12732 but you do want to link with @file{libgcc.a}.  You can do:
12734 @smallexample
12735 gcc -nostdlib @var{files}@dots{} `gcc -print-libgcc-file-name`
12736 @end smallexample
12738 @item -print-search-dirs
12739 @opindex print-search-dirs
12740 Print the name of the configured installation directory and a list of
12741 program and library directories @command{gcc} searches---and don't do anything else.
12743 This is useful when @command{gcc} prints the error message
12744 @samp{installation problem, cannot exec cpp0: No such file or directory}.
12745 To resolve this you either need to put @file{cpp0} and the other compiler
12746 components where @command{gcc} expects to find them, or you can set the environment
12747 variable @env{GCC_EXEC_PREFIX} to the directory where you installed them.
12748 Don't forget the trailing @samp{/}.
12749 @xref{Environment Variables}.
12751 @item -print-sysroot
12752 @opindex print-sysroot
12753 Print the target sysroot directory that is used during
12754 compilation.  This is the target sysroot specified either at configure
12755 time or using the @option{--sysroot} option, possibly with an extra
12756 suffix that depends on compilation options.  If no target sysroot is
12757 specified, the option prints nothing.
12759 @item -print-sysroot-headers-suffix
12760 @opindex print-sysroot-headers-suffix
12761 Print the suffix added to the target sysroot when searching for
12762 headers, or give an error if the compiler is not configured with such
12763 a suffix---and don't do anything else.
12765 @item -dumpmachine
12766 @opindex dumpmachine
12767 Print the compiler's target machine (for example,
12768 @samp{i686-pc-linux-gnu})---and don't do anything else.
12770 @item -dumpversion
12771 @opindex dumpversion
12772 Print the compiler version (for example, @code{3.0})---and don't do
12773 anything else.
12775 @item -dumpspecs
12776 @opindex dumpspecs
12777 Print the compiler's built-in specs---and don't do anything else.  (This
12778 is used when GCC itself is being built.)  @xref{Spec Files}.
12779 @end table
12781 @node Submodel Options
12782 @section Machine-Dependent Options
12783 @cindex submodel options
12784 @cindex specifying hardware config
12785 @cindex hardware models and configurations, specifying
12786 @cindex target-dependent options
12787 @cindex machine-dependent options
12789 Each target machine supported by GCC can have its own options---for
12790 example, to allow you to compile for a particular processor variant or
12791 ABI, or to control optimizations specific to that machine.  By
12792 convention, the names of machine-specific options start with
12793 @samp{-m}.
12795 Some configurations of the compiler also support additional target-specific
12796 options, usually for compatibility with other compilers on the same
12797 platform.
12799 @c This list is ordered alphanumerically by subsection name.
12800 @c It should be the same order and spelling as these options are listed
12801 @c in Machine Dependent Options
12803 @menu
12804 * AArch64 Options::
12805 * Adapteva Epiphany Options::
12806 * ARC Options::
12807 * ARM Options::
12808 * AVR Options::
12809 * Blackfin Options::
12810 * C6X Options::
12811 * CRIS Options::
12812 * CR16 Options::
12813 * Darwin Options::
12814 * DEC Alpha Options::
12815 * FR30 Options::
12816 * FT32 Options::
12817 * FRV Options::
12818 * GNU/Linux Options::
12819 * H8/300 Options::
12820 * HPPA Options::
12821 * IA-64 Options::
12822 * LM32 Options::
12823 * M32C Options::
12824 * M32R/D Options::
12825 * M680x0 Options::
12826 * MCore Options::
12827 * MeP Options::
12828 * MicroBlaze Options::
12829 * MIPS Options::
12830 * MMIX Options::
12831 * MN10300 Options::
12832 * Moxie Options::
12833 * MSP430 Options::
12834 * NDS32 Options::
12835 * Nios II Options::
12836 * Nvidia PTX Options::
12837 * PDP-11 Options::
12838 * picoChip Options::
12839 * PowerPC Options::
12840 * RL78 Options::
12841 * RS/6000 and PowerPC Options::
12842 * RX Options::
12843 * S/390 and zSeries Options::
12844 * Score Options::
12845 * SH Options::
12846 * Solaris 2 Options::
12847 * SPARC Options::
12848 * SPU Options::
12849 * System V Options::
12850 * TILE-Gx Options::
12851 * TILEPro Options::
12852 * V850 Options::
12853 * VAX Options::
12854 * Visium Options::
12855 * VMS Options::
12856 * VxWorks Options::
12857 * x86 Options::
12858 * x86 Windows Options::
12859 * Xstormy16 Options::
12860 * Xtensa Options::
12861 * zSeries Options::
12862 @end menu
12864 @node AArch64 Options
12865 @subsection AArch64 Options
12866 @cindex AArch64 Options
12868 These options are defined for AArch64 implementations:
12870 @table @gcctabopt
12872 @item -mabi=@var{name}
12873 @opindex mabi
12874 Generate code for the specified data model.  Permissible values
12875 are @samp{ilp32} for SysV-like data model where int, long int and pointers
12876 are 32 bits, and @samp{lp64} for SysV-like data model where int is 32 bits,
12877 but long int and pointers are 64 bits.
12879 The default depends on the specific target configuration.  Note that
12880 the LP64 and ILP32 ABIs are not link-compatible; you must compile your
12881 entire program with the same ABI, and link with a compatible set of libraries.
12883 @item -mbig-endian
12884 @opindex mbig-endian
12885 Generate big-endian code.  This is the default when GCC is configured for an
12886 @samp{aarch64_be-*-*} target.
12888 @item -mgeneral-regs-only
12889 @opindex mgeneral-regs-only
12890 Generate code which uses only the general-purpose registers.  This will prevent
12891 the compiler from using floating-point and Advanced SIMD registers but will not
12892 impose any restrictions on the assembler.
12894 @item -mlittle-endian
12895 @opindex mlittle-endian
12896 Generate little-endian code.  This is the default when GCC is configured for an
12897 @samp{aarch64-*-*} but not an @samp{aarch64_be-*-*} target.
12899 @item -mcmodel=tiny
12900 @opindex mcmodel=tiny
12901 Generate code for the tiny code model.  The program and its statically defined
12902 symbols must be within 1MB of each other.  Programs can be statically or
12903 dynamically linked.
12905 @item -mcmodel=small
12906 @opindex mcmodel=small
12907 Generate code for the small code model.  The program and its statically defined
12908 symbols must be within 4GB of each other.  Programs can be statically or
12909 dynamically linked.  This is the default code model.
12911 @item -mcmodel=large
12912 @opindex mcmodel=large
12913 Generate code for the large code model.  This makes no assumptions about
12914 addresses and sizes of sections.  Programs can be statically linked only.
12916 @item -mstrict-align
12917 @opindex mstrict-align
12918 Avoid generating memory accesses that may not be aligned on a natural object
12919 boundary as described in the architecture specification.
12921 @item -momit-leaf-frame-pointer
12922 @itemx -mno-omit-leaf-frame-pointer
12923 @opindex momit-leaf-frame-pointer
12924 @opindex mno-omit-leaf-frame-pointer
12925 Omit or keep the frame pointer in leaf functions.  The former behavior is the
12926 default.
12928 @item -mtls-dialect=desc
12929 @opindex mtls-dialect=desc
12930 Use TLS descriptors as the thread-local storage mechanism for dynamic accesses
12931 of TLS variables.  This is the default.
12933 @item -mtls-dialect=traditional
12934 @opindex mtls-dialect=traditional
12935 Use traditional TLS as the thread-local storage mechanism for dynamic accesses
12936 of TLS variables.
12938 @item -mtls-size=@var{size}
12939 @opindex mtls-size
12940 Specify bit size of immediate TLS offsets.  Valid values are 12, 24, 32, 48.
12941 This option requires binutils 2.26 or newer.
12943 @item -mfix-cortex-a53-835769
12944 @itemx -mno-fix-cortex-a53-835769
12945 @opindex mfix-cortex-a53-835769
12946 @opindex mno-fix-cortex-a53-835769
12947 Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769.
12948 This involves inserting a NOP instruction between memory instructions and
12949 64-bit integer multiply-accumulate instructions.
12951 @item -mfix-cortex-a53-843419
12952 @itemx -mno-fix-cortex-a53-843419
12953 @opindex mfix-cortex-a53-843419
12954 @opindex mno-fix-cortex-a53-843419
12955 Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419.
12956 This erratum workaround is made at link time and this will only pass the
12957 corresponding flag to the linker.
12959 @item -mlow-precision-recip-sqrt
12960 @item -mno-low-precision-recip-sqrt
12961 @opindex mlow-precision-recip-sqrt
12962 @opindex mno-low-precision-recip-sqrt
12963 Enable or disable reciprocal square root approximation.
12964 This option only has an effect if @option{-ffast-math} or
12965 @option{-funsafe-math-optimizations} is used as well.  Enabling this reduces
12966 precision of reciprocal square root results to about 16 bits for
12967 single precision and to 32 bits for double precision.
12969 @item -march=@var{name}
12970 @opindex march
12971 Specify the name of the target architecture and, optionally, one or
12972 more feature modifiers.  This option has the form
12973 @option{-march=@var{arch}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}.
12975 The permissible values for @var{arch} are @samp{armv8-a},
12976 @samp{armv8.1-a} or @var{native}.
12978 The value @samp{armv8.1-a} implies @samp{armv8-a} and enables compiler
12979 support for the ARMv8.1 architecture extension.  In particular, it
12980 enables the @samp{+crc} and @samp{+lse} features.
12982 The value @samp{native} is available on native AArch64 GNU/Linux and
12983 causes the compiler to pick the architecture of the host system.  This
12984 option has no effect if the compiler is unable to recognize the
12985 architecture of the host system,
12987 The permissible values for @var{feature} are listed in the sub-section
12988 on @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
12989 Feature Modifiers}.  Where conflicting feature modifiers are
12990 specified, the right-most feature is used.
12992 GCC uses @var{name} to determine what kind of instructions it can emit
12993 when generating assembly code.  If @option{-march} is specified
12994 without either of @option{-mtune} or @option{-mcpu} also being
12995 specified, the code is tuned to perform well across a range of target
12996 processors implementing the target architecture.
12998 @item -mtune=@var{name}
12999 @opindex mtune
13000 Specify the name of the target processor for which GCC should tune the
13001 performance of the code.  Permissible values for this option are:
13002 @samp{generic}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
13003 @samp{cortex-a72}, @samp{exynos-m1}, @samp{qdf24xx}, @samp{thunderx},
13004 @samp{xgene1}, @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53},
13005 @samp{native}.
13007 The values @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}
13008 specify that GCC should tune for a big.LITTLE system.
13010 Additionally on native AArch64 GNU/Linux systems the value
13011 @samp{native} tunes performance to the host system.  This option has no effect
13012 if the compiler is unable to recognize the processor of the host system.
13014 Where none of @option{-mtune=}, @option{-mcpu=} or @option{-march=}
13015 are specified, the code is tuned to perform well across a range
13016 of target processors.
13018 This option cannot be suffixed by feature modifiers.
13020 @item -mcpu=@var{name}
13021 @opindex mcpu
13022 Specify the name of the target processor, optionally suffixed by one
13023 or more feature modifiers.  This option has the form
13024 @option{-mcpu=@var{cpu}@r{@{}+@r{[}no@r{]}@var{feature}@r{@}*}}, where
13025 the permissible values for @var{cpu} are the same as those available
13026 for @option{-mtune}.  The permissible values for @var{feature} are
13027 documented in the sub-section on
13028 @ref{aarch64-feature-modifiers,,@option{-march} and @option{-mcpu}
13029 Feature Modifiers}.  Where conflicting feature modifiers are
13030 specified, the right-most feature is used.
13032 GCC uses @var{name} to determine what kind of instructions it can emit when
13033 generating assembly code (as if by @option{-march}) and to determine
13034 the target processor for which to tune for performance (as if
13035 by @option{-mtune}).  Where this option is used in conjunction
13036 with @option{-march} or @option{-mtune}, those options take precedence
13037 over the appropriate part of this option.
13039 @item -moverride=@var{string}
13040 @opindex moverride
13041 Override tuning decisions made by the back-end in response to a
13042 @option{-mtune=} switch.  The syntax, semantics, and accepted values
13043 for @var{string} in this option are not guaranteed to be consistent
13044 across releases.
13046 This option is only intended to be useful when developing GCC.
13048 @item -mpc-relative-literal-loads
13049 @opindex mpc-relative-literal-loads
13050 Enable PC-relative literal loads.  With this option literal pools are
13051 accessed using a single instruction and emitted after each function.  This
13052 limits the maximum size of functions to 1MB.  This is enabled by default for
13053 @option{-mcmodel=tiny}.
13055 @end table
13057 @subsubsection @option{-march} and @option{-mcpu} Feature Modifiers
13058 @anchor{aarch64-feature-modifiers}
13059 @cindex @option{-march} feature modifiers
13060 @cindex @option{-mcpu} feature modifiers
13061 Feature modifiers used with @option{-march} and @option{-mcpu} can be any of
13062 the following and their inverses @option{no@var{feature}}:
13064 @table @samp
13065 @item crc
13066 Enable CRC extension.  This is on by default for
13067 @option{-march=armv8.1-a}.
13068 @item crypto
13069 Enable Crypto extension.  This also enables Advanced SIMD and floating-point
13070 instructions.
13071 @item fp
13072 Enable floating-point instructions.  This is on by default for all possible
13073 values for options @option{-march} and @option{-mcpu}.
13074 @item simd
13075 Enable Advanced SIMD instructions.  This also enables floating-point
13076 instructions.  This is on by default for all possible values for options
13077 @option{-march} and @option{-mcpu}.
13078 @item lse
13079 Enable Large System Extension instructions.  This is on by default for
13080 @option{-march=armv8.1-a}.
13082 @end table
13084 Feature @option{crypto} implies @option{simd}, which implies @option{fp}.
13085 Conversely, @option{nofp} implies @option{nosimd}, which implies
13086 @option{nocrypto}.
13088 @node Adapteva Epiphany Options
13089 @subsection Adapteva Epiphany Options
13091 These @samp{-m} options are defined for Adapteva Epiphany:
13093 @table @gcctabopt
13094 @item -mhalf-reg-file
13095 @opindex mhalf-reg-file
13096 Don't allocate any register in the range @code{r32}@dots{}@code{r63}.
13097 That allows code to run on hardware variants that lack these registers.
13099 @item -mprefer-short-insn-regs
13100 @opindex mprefer-short-insn-regs
13101 Preferentially allocate registers that allow short instruction generation.
13102 This can result in increased instruction count, so this may either reduce or
13103 increase overall code size.
13105 @item -mbranch-cost=@var{num}
13106 @opindex mbranch-cost
13107 Set the cost of branches to roughly @var{num} ``simple'' instructions.
13108 This cost is only a heuristic and is not guaranteed to produce
13109 consistent results across releases.
13111 @item -mcmove
13112 @opindex mcmove
13113 Enable the generation of conditional moves.
13115 @item -mnops=@var{num}
13116 @opindex mnops
13117 Emit @var{num} NOPs before every other generated instruction.
13119 @item -mno-soft-cmpsf
13120 @opindex mno-soft-cmpsf
13121 For single-precision floating-point comparisons, emit an @code{fsub} instruction
13122 and test the flags.  This is faster than a software comparison, but can
13123 get incorrect results in the presence of NaNs, or when two different small
13124 numbers are compared such that their difference is calculated as zero.
13125 The default is @option{-msoft-cmpsf}, which uses slower, but IEEE-compliant,
13126 software comparisons.
13128 @item -mstack-offset=@var{num}
13129 @opindex mstack-offset
13130 Set the offset between the top of the stack and the stack pointer.
13131 E.g., a value of 8 means that the eight bytes in the range @code{sp+0@dots{}sp+7}
13132 can be used by leaf functions without stack allocation.
13133 Values other than @samp{8} or @samp{16} are untested and unlikely to work.
13134 Note also that this option changes the ABI; compiling a program with a
13135 different stack offset than the libraries have been compiled with
13136 generally does not work.
13137 This option can be useful if you want to evaluate if a different stack
13138 offset would give you better code, but to actually use a different stack
13139 offset to build working programs, it is recommended to configure the
13140 toolchain with the appropriate @option{--with-stack-offset=@var{num}} option.
13142 @item -mno-round-nearest
13143 @opindex mno-round-nearest
13144 Make the scheduler assume that the rounding mode has been set to
13145 truncating.  The default is @option{-mround-nearest}.
13147 @item -mlong-calls
13148 @opindex mlong-calls
13149 If not otherwise specified by an attribute, assume all calls might be beyond
13150 the offset range of the @code{b} / @code{bl} instructions, and therefore load the
13151 function address into a register before performing a (otherwise direct) call.
13152 This is the default.
13154 @item -mshort-calls
13155 @opindex short-calls
13156 If not otherwise specified by an attribute, assume all direct calls are
13157 in the range of the @code{b} / @code{bl} instructions, so use these instructions
13158 for direct calls.  The default is @option{-mlong-calls}.
13160 @item -msmall16
13161 @opindex msmall16
13162 Assume addresses can be loaded as 16-bit unsigned values.  This does not
13163 apply to function addresses for which @option{-mlong-calls} semantics
13164 are in effect.
13166 @item -mfp-mode=@var{mode}
13167 @opindex mfp-mode
13168 Set the prevailing mode of the floating-point unit.
13169 This determines the floating-point mode that is provided and expected
13170 at function call and return time.  Making this mode match the mode you
13171 predominantly need at function start can make your programs smaller and
13172 faster by avoiding unnecessary mode switches.
13174 @var{mode} can be set to one the following values:
13176 @table @samp
13177 @item caller
13178 Any mode at function entry is valid, and retained or restored when
13179 the function returns, and when it calls other functions.
13180 This mode is useful for compiling libraries or other compilation units
13181 you might want to incorporate into different programs with different
13182 prevailing FPU modes, and the convenience of being able to use a single
13183 object file outweighs the size and speed overhead for any extra
13184 mode switching that might be needed, compared with what would be needed
13185 with a more specific choice of prevailing FPU mode.
13187 @item truncate
13188 This is the mode used for floating-point calculations with
13189 truncating (i.e.@: round towards zero) rounding mode.  That includes
13190 conversion from floating point to integer.
13192 @item round-nearest
13193 This is the mode used for floating-point calculations with
13194 round-to-nearest-or-even rounding mode.
13196 @item int
13197 This is the mode used to perform integer calculations in the FPU, e.g.@:
13198 integer multiply, or integer multiply-and-accumulate.
13199 @end table
13201 The default is @option{-mfp-mode=caller}
13203 @item -mnosplit-lohi
13204 @itemx -mno-postinc
13205 @itemx -mno-postmodify
13206 @opindex mnosplit-lohi
13207 @opindex mno-postinc
13208 @opindex mno-postmodify
13209 Code generation tweaks that disable, respectively, splitting of 32-bit
13210 loads, generation of post-increment addresses, and generation of
13211 post-modify addresses.  The defaults are @option{msplit-lohi},
13212 @option{-mpost-inc}, and @option{-mpost-modify}.
13214 @item -mnovect-double
13215 @opindex mno-vect-double
13216 Change the preferred SIMD mode to SImode.  The default is
13217 @option{-mvect-double}, which uses DImode as preferred SIMD mode.
13219 @item -max-vect-align=@var{num}
13220 @opindex max-vect-align
13221 The maximum alignment for SIMD vector mode types.
13222 @var{num} may be 4 or 8.  The default is 8.
13223 Note that this is an ABI change, even though many library function
13224 interfaces are unaffected if they don't use SIMD vector modes
13225 in places that affect size and/or alignment of relevant types.
13227 @item -msplit-vecmove-early
13228 @opindex msplit-vecmove-early
13229 Split vector moves into single word moves before reload.  In theory this
13230 can give better register allocation, but so far the reverse seems to be
13231 generally the case.
13233 @item -m1reg-@var{reg}
13234 @opindex m1reg-
13235 Specify a register to hold the constant @minus{}1, which makes loading small negative
13236 constants and certain bitmasks faster.
13237 Allowable values for @var{reg} are @samp{r43} and @samp{r63},
13238 which specify use of that register as a fixed register,
13239 and @samp{none}, which means that no register is used for this
13240 purpose.  The default is @option{-m1reg-none}.
13242 @end table
13244 @node ARC Options
13245 @subsection ARC Options
13246 @cindex ARC options
13248 The following options control the architecture variant for which code
13249 is being compiled:
13251 @c architecture variants
13252 @table @gcctabopt
13254 @item -mbarrel-shifter
13255 @opindex mbarrel-shifter
13256 Generate instructions supported by barrel shifter.  This is the default
13257 unless @option{-mcpu=ARC601} or @samp{-mcpu=ARCEM} is in effect.
13259 @item -mcpu=@var{cpu}
13260 @opindex mcpu
13261 Set architecture type, register usage, and instruction scheduling
13262 parameters for @var{cpu}.  There are also shortcut alias options
13263 available for backward compatibility and convenience.  Supported
13264 values for @var{cpu} are
13266 @table @samp
13267 @opindex mA6
13268 @opindex mARC600
13269 @item ARC600
13270 @item arc600
13271 Compile for ARC600.  Aliases: @option{-mA6}, @option{-mARC600}.
13273 @item ARC601
13274 @item arc601
13275 @opindex mARC601
13276 Compile for ARC601.  Alias: @option{-mARC601}.
13278 @item ARC700
13279 @item arc700
13280 @opindex mA7
13281 @opindex mARC700
13282 Compile for ARC700.  Aliases: @option{-mA7}, @option{-mARC700}.
13283 This is the default when configured with @option{--with-cpu=arc700}@.
13285 @item ARCEM
13286 @item arcem
13287 Compile for ARC EM.
13289 @item ARCHS
13290 @item archs
13291 Compile for ARC HS.
13292 @end table
13294 @item -mdpfp
13295 @opindex mdpfp
13296 @itemx -mdpfp-compact
13297 @opindex mdpfp-compact
13298 FPX: Generate Double Precision FPX instructions, tuned for the compact
13299 implementation.
13301 @item -mdpfp-fast
13302 @opindex mdpfp-fast
13303 FPX: Generate Double Precision FPX instructions, tuned for the fast
13304 implementation.
13306 @item -mno-dpfp-lrsr
13307 @opindex mno-dpfp-lrsr
13308 Disable LR and SR instructions from using FPX extension aux registers.
13310 @item -mea
13311 @opindex mea
13312 Generate Extended arithmetic instructions.  Currently only
13313 @code{divaw}, @code{adds}, @code{subs}, and @code{sat16} are
13314 supported.  This is always enabled for @option{-mcpu=ARC700}.
13316 @item -mno-mpy
13317 @opindex mno-mpy
13318 Do not generate mpy instructions for ARC700.
13320 @item -mmul32x16
13321 @opindex mmul32x16
13322 Generate 32x16 bit multiply and mac instructions.
13324 @item -mmul64
13325 @opindex mmul64
13326 Generate mul64 and mulu64 instructions.  Only valid for @option{-mcpu=ARC600}.
13328 @item -mnorm
13329 @opindex mnorm
13330 Generate norm instruction.  This is the default if @option{-mcpu=ARC700}
13331 is in effect.
13333 @item -mspfp
13334 @opindex mspfp
13335 @itemx -mspfp-compact
13336 @opindex mspfp-compact
13337 FPX: Generate Single Precision FPX instructions, tuned for the compact
13338 implementation.
13340 @item -mspfp-fast
13341 @opindex mspfp-fast
13342 FPX: Generate Single Precision FPX instructions, tuned for the fast
13343 implementation.
13345 @item -msimd
13346 @opindex msimd
13347 Enable generation of ARC SIMD instructions via target-specific
13348 builtins.  Only valid for @option{-mcpu=ARC700}.
13350 @item -msoft-float
13351 @opindex msoft-float
13352 This option ignored; it is provided for compatibility purposes only.
13353 Software floating point code is emitted by default, and this default
13354 can overridden by FPX options; @samp{mspfp}, @samp{mspfp-compact}, or
13355 @samp{mspfp-fast} for single precision, and @samp{mdpfp},
13356 @samp{mdpfp-compact}, or @samp{mdpfp-fast} for double precision.
13358 @item -mswap
13359 @opindex mswap
13360 Generate swap instructions.
13362 @item -matomic
13363 @opindex matomic
13364 This enables Locked Load/Store Conditional extension to implement
13365 atomic memopry built-in functions.  Not available for ARC 6xx or ARC
13366 EM cores.
13368 @item -mdiv-rem
13369 @opindex mdiv-rem
13370 Enable DIV/REM instructions for ARCv2 cores.
13372 @item -mcode-density
13373 @opindex mcode-density
13374 Enable code density instructions for ARC EM, default on for ARC HS.
13376 @item -mll64
13377 @opindex mll64
13378 Enable double load/store operations for ARC HS cores.
13380 @item -mtp-regno=@var{regno}
13381 @opindex mtp-regno
13382 Specify thread pointer register number.
13384 @item -mmpy-option=@var{multo}
13385 @opindex mmpy-option
13386 Compile ARCv2 code with a multiplier design option.  @samp{wlh1} is
13387 the default value.  The recognized values for @var{multo} are:
13389 @table @samp
13390 @item 0
13391 No multiplier available.
13393 @item 1
13394 @opindex w
13395 The multiply option is set to w: 16x16 multiplier, fully pipelined.
13396 The following instructions are enabled: MPYW, and MPYUW.
13398 @item 2
13399 @opindex wlh1
13400 The multiply option is set to wlh1: 32x32 multiplier, fully
13401 pipelined (1 stage).  The following instructions are additionally
13402 enabled: MPY, MPYU, MPYM, MPYMU, and MPY_S.
13404 @item 3
13405 @opindex wlh2
13406 The multiply option is set to wlh2: 32x32 multiplier, fully pipelined
13407 (2 stages).  The following instructions are additionally enabled: MPY,
13408 MPYU, MPYM, MPYMU, and MPY_S.
13410 @item 4
13411 @opindex wlh3
13412 The multiply option is set to wlh3: Two 16x16 multiplier, blocking,
13413 sequential.  The following instructions are additionally enabled: MPY,
13414 MPYU, MPYM, MPYMU, and MPY_S.
13416 @item 5
13417 @opindex wlh4
13418 The multiply option is set to wlh4: One 16x16 multiplier, blocking,
13419 sequential.  The following instructions are additionally enabled: MPY,
13420 MPYU, MPYM, MPYMU, and MPY_S.
13422 @item 6
13423 @opindex wlh5
13424 The multiply option is set to wlh5: One 32x4 multiplier, blocking,
13425 sequential.  The following instructions are additionally enabled: MPY,
13426 MPYU, MPYM, MPYMU, and MPY_S.
13428 @end table
13430 This option is only available for ARCv2 cores@.
13432 @item -mfpu=@var{fpu}
13433 @opindex mfpu
13434 Enables specific floating-point hardware extension for ARCv2
13435 core.  Supported values for @var{fpu} are:
13437 @table @samp
13439 @item fpus
13440 @opindex fpus
13441 Enables support for single precision floating point hardware
13442 extensions@.
13444 @item fpud
13445 @opindex fpud
13446 Enables support for double precision floating point hardware
13447 extensions.  The single precision floating point extension is also
13448 enabled.  Not available for ARC EM@.
13450 @item fpuda
13451 @opindex fpuda
13452 Enables support for double precision floating point hardware
13453 extensions using double precision assist instructions.  The single
13454 precision floating point extension is also enabled.  This option is
13455 only available for ARC EM@.
13457 @item fpuda_div
13458 @opindex fpuda_div
13459 Enables support for double precision floating point hardware
13460 extensions using double precision assist instructions, and simple
13461 precision square-root and divide hardware extensions.  The single
13462 precision floating point extension is also enabled.  This option is
13463 only available for ARC EM@.
13465 @item fpuda_fma
13466 @opindex fpuda_fma
13467 Enables support for double precision floating point hardware
13468 extensions using double precision assist instructions, and simple
13469 precision fused multiple and add hardware extension.  The single
13470 precision floating point extension is also enabled.  This option is
13471 only available for ARC EM@.
13473 @item fpuda_all
13474 @opindex fpuda_all
13475 Enables support for double precision floating point hardware
13476 extensions using double precision assist instructions, and all simple
13477 precision hardware extensions.  The single precision floating point
13478 extension is also enabled.  This option is only available for ARC EM@.
13480 @item fpus_div
13481 @opindex fpus_div
13482 Enables support for single precision floating point, and single
13483 precision square-root and divide hardware extensions@.
13485 @item fpud_div
13486 @opindex fpud_div
13487 Enables support for double precision floating point, and double
13488 precision square-root and divide hardware extensions.  This option
13489 includes option @samp{fpus_div}. Not available for ARC EM@.
13491 @item fpus_fma
13492 @opindex fpus_fma
13493 Enables support for single precision floating point, and single
13494 precision fused multiple and add hardware extensions@.
13496 @item fpud_fma
13497 @opindex fpud_fma
13498 Enables support for double precision floating point, and double
13499 precision fused multiple and add hardware extensions.  This option
13500 includes option @samp{fpus_fma}.  Not available for ARC EM@.
13502 @item fpus_all
13503 @opindex fpus_all
13504 Enables support for all single precision floating point hardware
13505 extensions@.
13507 @item fpud_all
13508 @opindex fpud_all
13509 Enables support for all single and double precision floating point
13510 hardware extensions.  Not available for ARC EM@.
13512 @end table
13514 @end table
13516 The following options are passed through to the assembler, and also
13517 define preprocessor macro symbols.
13519 @c Flags used by the assembler, but for which we define preprocessor
13520 @c macro symbols as well.
13521 @table @gcctabopt
13522 @item -mdsp-packa
13523 @opindex mdsp-packa
13524 Passed down to the assembler to enable the DSP Pack A extensions.
13525 Also sets the preprocessor symbol @code{__Xdsp_packa}.
13527 @item -mdvbf
13528 @opindex mdvbf
13529 Passed down to the assembler to enable the dual viterbi butterfly
13530 extension.  Also sets the preprocessor symbol @code{__Xdvbf}.
13532 @c ARC700 4.10 extension instruction
13533 @item -mlock
13534 @opindex mlock
13535 Passed down to the assembler to enable the Locked Load/Store
13536 Conditional extension.  Also sets the preprocessor symbol
13537 @code{__Xlock}.
13539 @item -mmac-d16
13540 @opindex mmac-d16
13541 Passed down to the assembler.  Also sets the preprocessor symbol
13542 @code{__Xxmac_d16}.
13544 @item -mmac-24
13545 @opindex mmac-24
13546 Passed down to the assembler.  Also sets the preprocessor symbol
13547 @code{__Xxmac_24}.
13549 @c ARC700 4.10 extension instruction
13550 @item -mrtsc
13551 @opindex mrtsc
13552 Passed down to the assembler to enable the 64-bit Time-Stamp Counter
13553 extension instruction.  Also sets the preprocessor symbol
13554 @code{__Xrtsc}.
13556 @c ARC700 4.10 extension instruction
13557 @item -mswape
13558 @opindex mswape
13559 Passed down to the assembler to enable the swap byte ordering
13560 extension instruction.  Also sets the preprocessor symbol
13561 @code{__Xswape}.
13563 @item -mtelephony
13564 @opindex mtelephony
13565 Passed down to the assembler to enable dual and single operand
13566 instructions for telephony.  Also sets the preprocessor symbol
13567 @code{__Xtelephony}.
13569 @item -mxy
13570 @opindex mxy
13571 Passed down to the assembler to enable the XY Memory extension.  Also
13572 sets the preprocessor symbol @code{__Xxy}.
13574 @end table
13576 The following options control how the assembly code is annotated:
13578 @c Assembly annotation options
13579 @table @gcctabopt
13580 @item -misize
13581 @opindex misize
13582 Annotate assembler instructions with estimated addresses.
13584 @item -mannotate-align
13585 @opindex mannotate-align
13586 Explain what alignment considerations lead to the decision to make an
13587 instruction short or long.
13589 @end table
13591 The following options are passed through to the linker:
13593 @c options passed through to the linker
13594 @table @gcctabopt
13595 @item -marclinux
13596 @opindex marclinux
13597 Passed through to the linker, to specify use of the @code{arclinux} emulation.
13598 This option is enabled by default in tool chains built for
13599 @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets
13600 when profiling is not requested.
13602 @item -marclinux_prof
13603 @opindex marclinux_prof
13604 Passed through to the linker, to specify use of the
13605 @code{arclinux_prof} emulation.  This option is enabled by default in
13606 tool chains built for @w{@code{arc-linux-uclibc}} and
13607 @w{@code{arceb-linux-uclibc}} targets when profiling is requested.
13609 @end table
13611 The following options control the semantics of generated code:
13613 @c semantically relevant code generation options
13614 @table @gcctabopt
13615 @item -mlong-calls
13616 @opindex mlong-calls
13617 Generate call insns as register indirect calls, thus providing access
13618 to the full 32-bit address range.
13620 @item -mmedium-calls
13621 @opindex mmedium-calls
13622 Don't use less than 25 bit addressing range for calls, which is the
13623 offset available for an unconditional branch-and-link
13624 instruction.  Conditional execution of function calls is suppressed, to
13625 allow use of the 25-bit range, rather than the 21-bit range with
13626 conditional branch-and-link.  This is the default for tool chains built
13627 for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}} targets.
13629 @item -mno-sdata
13630 @opindex mno-sdata
13631 Do not generate sdata references.  This is the default for tool chains
13632 built for @w{@code{arc-linux-uclibc}} and @w{@code{arceb-linux-uclibc}}
13633 targets.
13635 @item -mucb-mcount
13636 @opindex mucb-mcount
13637 Instrument with mcount calls as used in UCB code.  I.e. do the
13638 counting in the callee, not the caller.  By default ARC instrumentation
13639 counts in the caller.
13641 @item -mvolatile-cache
13642 @opindex mvolatile-cache
13643 Use ordinarily cached memory accesses for volatile references.  This is the
13644 default.
13646 @item -mno-volatile-cache
13647 @opindex mno-volatile-cache
13648 Enable cache bypass for volatile references.
13650 @end table
13652 The following options fine tune code generation:
13653 @c code generation tuning options
13654 @table @gcctabopt
13655 @item -malign-call
13656 @opindex malign-call
13657 Do alignment optimizations for call instructions.
13659 @item -mauto-modify-reg
13660 @opindex mauto-modify-reg
13661 Enable the use of pre/post modify with register displacement.
13663 @item -mbbit-peephole
13664 @opindex mbbit-peephole
13665 Enable bbit peephole2.
13667 @item -mno-brcc
13668 @opindex mno-brcc
13669 This option disables a target-specific pass in @file{arc_reorg} to
13670 generate @code{BRcc} instructions.  It has no effect on @code{BRcc}
13671 generation driven by the combiner pass.
13673 @item -mcase-vector-pcrel
13674 @opindex mcase-vector-pcrel
13675 Use pc-relative switch case tables - this enables case table shortening.
13676 This is the default for @option{-Os}.
13678 @item -mcompact-casesi
13679 @opindex mcompact-casesi
13680 Enable compact casesi pattern.
13681 This is the default for @option{-Os}.
13683 @item -mno-cond-exec
13684 @opindex mno-cond-exec
13685 Disable ARCompact specific pass to generate conditional execution instructions.
13686 Due to delay slot scheduling and interactions between operand numbers,
13687 literal sizes, instruction lengths, and the support for conditional execution,
13688 the target-independent pass to generate conditional execution is often lacking,
13689 so the ARC port has kept a special pass around that tries to find more
13690 conditional execution generating opportunities after register allocation,
13691 branch shortening, and delay slot scheduling have been done.  This pass
13692 generally, but not always, improves performance and code size, at the cost of
13693 extra compilation time, which is why there is an option to switch it off.
13694 If you have a problem with call instructions exceeding their allowable
13695 offset range because they are conditionalized, you should consider using
13696 @option{-mmedium-calls} instead.
13698 @item -mearly-cbranchsi
13699 @opindex mearly-cbranchsi
13700 Enable pre-reload use of the cbranchsi pattern.
13702 @item -mexpand-adddi
13703 @opindex mexpand-adddi
13704 Expand @code{adddi3} and @code{subdi3} at rtl generation time into
13705 @code{add.f}, @code{adc} etc.
13707 @item -mindexed-loads
13708 @opindex mindexed-loads
13709 Enable the use of indexed loads.  This can be problematic because some
13710 optimizers then assume that indexed stores exist, which is not
13711 the case.
13713 @opindex mlra
13714 Enable Local Register Allocation.  This is still experimental for ARC,
13715 so by default the compiler uses standard reload
13716 (i.e. @option{-mno-lra}).
13718 @item -mlra-priority-none
13719 @opindex mlra-priority-none
13720 Don't indicate any priority for target registers.
13722 @item -mlra-priority-compact
13723 @opindex mlra-priority-compact
13724 Indicate target register priority for r0..r3 / r12..r15.
13726 @item -mlra-priority-noncompact
13727 @opindex mlra-priority-noncompact
13728 Reduce target register priority for r0..r3 / r12..r15.
13730 @item -mno-millicode
13731 @opindex mno-millicode
13732 When optimizing for size (using @option{-Os}), prologues and epilogues
13733 that have to save or restore a large number of registers are often
13734 shortened by using call to a special function in libgcc; this is
13735 referred to as a @emph{millicode} call.  As these calls can pose
13736 performance issues, and/or cause linking issues when linking in a
13737 nonstandard way, this option is provided to turn off millicode call
13738 generation.
13740 @item -mmixed-code
13741 @opindex mmixed-code
13742 Tweak register allocation to help 16-bit instruction generation.
13743 This generally has the effect of decreasing the average instruction size
13744 while increasing the instruction count.
13746 @item -mq-class
13747 @opindex mq-class
13748 Enable 'q' instruction alternatives.
13749 This is the default for @option{-Os}.
13751 @item -mRcq
13752 @opindex mRcq
13753 Enable Rcq constraint handling - most short code generation depends on this.
13754 This is the default.
13756 @item -mRcw
13757 @opindex mRcw
13758 Enable Rcw constraint handling - ccfsm condexec mostly depends on this.
13759 This is the default.
13761 @item -msize-level=@var{level}
13762 @opindex msize-level
13763 Fine-tune size optimization with regards to instruction lengths and alignment.
13764 The recognized values for @var{level} are:
13765 @table @samp
13766 @item 0
13767 No size optimization.  This level is deprecated and treated like @samp{1}.
13769 @item 1
13770 Short instructions are used opportunistically.
13772 @item 2
13773 In addition, alignment of loops and of code after barriers are dropped.
13775 @item 3
13776 In addition, optional data alignment is dropped, and the option @option{Os} is enabled.
13778 @end table
13780 This defaults to @samp{3} when @option{-Os} is in effect.  Otherwise,
13781 the behavior when this is not set is equivalent to level @samp{1}.
13783 @item -mtune=@var{cpu}
13784 @opindex mtune
13785 Set instruction scheduling parameters for @var{cpu}, overriding any implied
13786 by @option{-mcpu=}.
13788 Supported values for @var{cpu} are
13790 @table @samp
13791 @item ARC600
13792 Tune for ARC600 cpu.
13794 @item ARC601
13795 Tune for ARC601 cpu.
13797 @item ARC700
13798 Tune for ARC700 cpu with standard multiplier block.
13800 @item ARC700-xmac
13801 Tune for ARC700 cpu with XMAC block.
13803 @item ARC725D
13804 Tune for ARC725D cpu.
13806 @item ARC750D
13807 Tune for ARC750D cpu.
13809 @end table
13811 @item -mmultcost=@var{num}
13812 @opindex mmultcost
13813 Cost to assume for a multiply instruction, with @samp{4} being equal to a
13814 normal instruction.
13816 @item -munalign-prob-threshold=@var{probability}
13817 @opindex munalign-prob-threshold
13818 Set probability threshold for unaligning branches.
13819 When tuning for @samp{ARC700} and optimizing for speed, branches without
13820 filled delay slot are preferably emitted unaligned and long, unless
13821 profiling indicates that the probability for the branch to be taken
13822 is below @var{probability}.  @xref{Cross-profiling}.
13823 The default is (REG_BR_PROB_BASE/2), i.e.@: 5000.
13825 @end table
13827 The following options are maintained for backward compatibility, but
13828 are now deprecated and will be removed in a future release:
13830 @c Deprecated options
13831 @table @gcctabopt
13833 @item -margonaut
13834 @opindex margonaut
13835 Obsolete FPX.
13837 @item -mbig-endian
13838 @opindex mbig-endian
13839 @itemx -EB
13840 @opindex EB
13841 Compile code for big endian targets.  Use of these options is now
13842 deprecated.  Users wanting big-endian code, should use the
13843 @w{@code{arceb-elf32}} and @w{@code{arceb-linux-uclibc}} targets when
13844 building the tool chain, for which big-endian is the default.
13846 @item -mlittle-endian
13847 @opindex mlittle-endian
13848 @itemx -EL
13849 @opindex EL
13850 Compile code for little endian targets.  Use of these options is now
13851 deprecated.  Users wanting little-endian code should use the
13852 @w{@code{arc-elf32}} and @w{@code{arc-linux-uclibc}} targets when
13853 building the tool chain, for which little-endian is the default.
13855 @item -mbarrel_shifter
13856 @opindex mbarrel_shifter
13857 Replaced by @option{-mbarrel-shifter}.
13859 @item -mdpfp_compact
13860 @opindex mdpfp_compact
13861 Replaced by @option{-mdpfp-compact}.
13863 @item -mdpfp_fast
13864 @opindex mdpfp_fast
13865 Replaced by @option{-mdpfp-fast}.
13867 @item -mdsp_packa
13868 @opindex mdsp_packa
13869 Replaced by @option{-mdsp-packa}.
13871 @item -mEA
13872 @opindex mEA
13873 Replaced by @option{-mea}.
13875 @item -mmac_24
13876 @opindex mmac_24
13877 Replaced by @option{-mmac-24}.
13879 @item -mmac_d16
13880 @opindex mmac_d16
13881 Replaced by @option{-mmac-d16}.
13883 @item -mspfp_compact
13884 @opindex mspfp_compact
13885 Replaced by @option{-mspfp-compact}.
13887 @item -mspfp_fast
13888 @opindex mspfp_fast
13889 Replaced by @option{-mspfp-fast}.
13891 @item -mtune=@var{cpu}
13892 @opindex mtune
13893 Values @samp{arc600}, @samp{arc601}, @samp{arc700} and
13894 @samp{arc700-xmac} for @var{cpu} are replaced by @samp{ARC600},
13895 @samp{ARC601}, @samp{ARC700} and @samp{ARC700-xmac} respectively
13897 @item -multcost=@var{num}
13898 @opindex multcost
13899 Replaced by @option{-mmultcost}.
13901 @end table
13903 @node ARM Options
13904 @subsection ARM Options
13905 @cindex ARM options
13907 These @samp{-m} options are defined for the ARM port:
13909 @table @gcctabopt
13910 @item -mabi=@var{name}
13911 @opindex mabi
13912 Generate code for the specified ABI@.  Permissible values are: @samp{apcs-gnu},
13913 @samp{atpcs}, @samp{aapcs}, @samp{aapcs-linux} and @samp{iwmmxt}.
13915 @item -mapcs-frame
13916 @opindex mapcs-frame
13917 Generate a stack frame that is compliant with the ARM Procedure Call
13918 Standard for all functions, even if this is not strictly necessary for
13919 correct execution of the code.  Specifying @option{-fomit-frame-pointer}
13920 with this option causes the stack frames not to be generated for
13921 leaf functions.  The default is @option{-mno-apcs-frame}.
13922 This option is deprecated.
13924 @item -mapcs
13925 @opindex mapcs
13926 This is a synonym for @option{-mapcs-frame} and is deprecated.
13928 @ignore
13929 @c not currently implemented
13930 @item -mapcs-stack-check
13931 @opindex mapcs-stack-check
13932 Generate code to check the amount of stack space available upon entry to
13933 every function (that actually uses some stack space).  If there is
13934 insufficient space available then either the function
13935 @code{__rt_stkovf_split_small} or @code{__rt_stkovf_split_big} is
13936 called, depending upon the amount of stack space required.  The runtime
13937 system is required to provide these functions.  The default is
13938 @option{-mno-apcs-stack-check}, since this produces smaller code.
13940 @c not currently implemented
13941 @item -mapcs-float
13942 @opindex mapcs-float
13943 Pass floating-point arguments using the floating-point registers.  This is
13944 one of the variants of the APCS@.  This option is recommended if the
13945 target hardware has a floating-point unit or if a lot of floating-point
13946 arithmetic is going to be performed by the code.  The default is
13947 @option{-mno-apcs-float}, since the size of integer-only code is 
13948 slightly increased if @option{-mapcs-float} is used.
13950 @c not currently implemented
13951 @item -mapcs-reentrant
13952 @opindex mapcs-reentrant
13953 Generate reentrant, position-independent code.  The default is
13954 @option{-mno-apcs-reentrant}.
13955 @end ignore
13957 @item -mthumb-interwork
13958 @opindex mthumb-interwork
13959 Generate code that supports calling between the ARM and Thumb
13960 instruction sets.  Without this option, on pre-v5 architectures, the
13961 two instruction sets cannot be reliably used inside one program.  The
13962 default is @option{-mno-thumb-interwork}, since slightly larger code
13963 is generated when @option{-mthumb-interwork} is specified.  In AAPCS
13964 configurations this option is meaningless.
13966 @item -mno-sched-prolog
13967 @opindex mno-sched-prolog
13968 Prevent the reordering of instructions in the function prologue, or the
13969 merging of those instruction with the instructions in the function's
13970 body.  This means that all functions start with a recognizable set
13971 of instructions (or in fact one of a choice from a small set of
13972 different function prologues), and this information can be used to
13973 locate the start of functions inside an executable piece of code.  The
13974 default is @option{-msched-prolog}.
13976 @item -mfloat-abi=@var{name}
13977 @opindex mfloat-abi
13978 Specifies which floating-point ABI to use.  Permissible values
13979 are: @samp{soft}, @samp{softfp} and @samp{hard}.
13981 Specifying @samp{soft} causes GCC to generate output containing
13982 library calls for floating-point operations.
13983 @samp{softfp} allows the generation of code using hardware floating-point
13984 instructions, but still uses the soft-float calling conventions.
13985 @samp{hard} allows generation of floating-point instructions
13986 and uses FPU-specific calling conventions.
13988 The default depends on the specific target configuration.  Note that
13989 the hard-float and soft-float ABIs are not link-compatible; you must
13990 compile your entire program with the same ABI, and link with a
13991 compatible set of libraries.
13993 @item -mlittle-endian
13994 @opindex mlittle-endian
13995 Generate code for a processor running in little-endian mode.  This is
13996 the default for all standard configurations.
13998 @item -mbig-endian
13999 @opindex mbig-endian
14000 Generate code for a processor running in big-endian mode; the default is
14001 to compile code for a little-endian processor.
14003 @item -march=@var{name}
14004 @opindex march
14005 This specifies the name of the target ARM architecture.  GCC uses this
14006 name to determine what kind of instructions it can emit when generating
14007 assembly code.  This option can be used in conjunction with or instead
14008 of the @option{-mcpu=} option.  Permissible names are: @samp{armv2},
14009 @samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
14010 @samp{armv5}, @samp{armv5t}, @samp{armv5e}, @samp{armv5te},
14011 @samp{armv6}, @samp{armv6j},
14012 @samp{armv6t2}, @samp{armv6z}, @samp{armv6kz}, @samp{armv6-m},
14013 @samp{armv7}, @samp{armv7-a}, @samp{armv7-r}, @samp{armv7-m}, @samp{armv7e-m},
14014 @samp{armv7ve}, @samp{armv8-a}, @samp{armv8-a+crc}, @samp{armv8.1-a},
14015 @samp{armv8.1-a+crc}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312}.
14017 Architecture revisions older than @option{armv4t} are deprecated.
14019 @option{-march=armv7ve} is the armv7-a architecture with virtualization
14020 extensions.
14022 @option{-march=armv8-a+crc} enables code generation for the ARMv8-A
14023 architecture together with the optional CRC32 extensions.
14025 @option{-march=native} causes the compiler to auto-detect the architecture
14026 of the build computer.  At present, this feature is only supported on
14027 GNU/Linux, and not all architectures are recognized.  If the auto-detect
14028 is unsuccessful the option has no effect.
14030 @item -mtune=@var{name}
14031 @opindex mtune
14032 This option specifies the name of the target ARM processor for
14033 which GCC should tune the performance of the code.
14034 For some ARM implementations better performance can be obtained by using
14035 this option.
14036 Permissible names are: @samp{arm2}, @samp{arm250},
14037 @samp{arm3}, @samp{arm6}, @samp{arm60}, @samp{arm600}, @samp{arm610},
14038 @samp{arm620}, @samp{arm7}, @samp{arm7m}, @samp{arm7d}, @samp{arm7dm},
14039 @samp{arm7di}, @samp{arm7dmi}, @samp{arm70}, @samp{arm700},
14040 @samp{arm700i}, @samp{arm710}, @samp{arm710c}, @samp{arm7100},
14041 @samp{arm720},
14042 @samp{arm7500}, @samp{arm7500fe}, @samp{arm7tdmi}, @samp{arm7tdmi-s},
14043 @samp{arm710t}, @samp{arm720t}, @samp{arm740t},
14044 @samp{strongarm}, @samp{strongarm110}, @samp{strongarm1100},
14045 @samp{strongarm1110},
14046 @samp{arm8}, @samp{arm810}, @samp{arm9}, @samp{arm9e}, @samp{arm920},
14047 @samp{arm920t}, @samp{arm922t}, @samp{arm946e-s}, @samp{arm966e-s},
14048 @samp{arm968e-s}, @samp{arm926ej-s}, @samp{arm940t}, @samp{arm9tdmi},
14049 @samp{arm10tdmi}, @samp{arm1020t}, @samp{arm1026ej-s},
14050 @samp{arm10e}, @samp{arm1020e}, @samp{arm1022e},
14051 @samp{arm1136j-s}, @samp{arm1136jf-s}, @samp{mpcore}, @samp{mpcorenovfp},
14052 @samp{arm1156t2-s}, @samp{arm1156t2f-s}, @samp{arm1176jz-s}, @samp{arm1176jzf-s},
14053 @samp{generic-armv7-a}, @samp{cortex-a5}, @samp{cortex-a7}, @samp{cortex-a8},
14054 @samp{cortex-a9}, @samp{cortex-a12}, @samp{cortex-a15}, @samp{cortex-a17},
14055 @samp{cortex-a32}, @samp{cortex-a35}, @samp{cortex-a53}, @samp{cortex-a57},
14056 @samp{cortex-a72}, @samp{cortex-r4},
14057 @samp{cortex-r4f}, @samp{cortex-r5}, @samp{cortex-r7}, @samp{cortex-r8},
14058 @samp{cortex-m7},
14059 @samp{cortex-m4},
14060 @samp{cortex-m3},
14061 @samp{cortex-m1},
14062 @samp{cortex-m0},
14063 @samp{cortex-m0plus},
14064 @samp{cortex-m1.small-multiply},
14065 @samp{cortex-m0.small-multiply},
14066 @samp{cortex-m0plus.small-multiply},
14067 @samp{exynos-m1},
14068 @samp{qdf24xx},
14069 @samp{marvell-pj4},
14070 @samp{xscale}, @samp{iwmmxt}, @samp{iwmmxt2}, @samp{ep9312},
14071 @samp{fa526}, @samp{fa626},
14072 @samp{fa606te}, @samp{fa626te}, @samp{fmp626}, @samp{fa726te},
14073 @samp{xgene1}.
14075 Additionally, this option can specify that GCC should tune the performance
14076 of the code for a big.LITTLE system.  Permissible names are:
14077 @samp{cortex-a15.cortex-a7}, @samp{cortex-a17.cortex-a7},
14078 @samp{cortex-a57.cortex-a53}, @samp{cortex-a72.cortex-a53}.
14080 @option{-mtune=generic-@var{arch}} specifies that GCC should tune the
14081 performance for a blend of processors within architecture @var{arch}.
14082 The aim is to generate code that run well on the current most popular
14083 processors, balancing between optimizations that benefit some CPUs in the
14084 range, and avoiding performance pitfalls of other CPUs.  The effects of
14085 this option may change in future GCC versions as CPU models come and go.
14087 @option{-mtune=native} causes the compiler to auto-detect the CPU
14088 of the build computer.  At present, this feature is only supported on
14089 GNU/Linux, and not all architectures are recognized.  If the auto-detect is
14090 unsuccessful the option has no effect.
14092 @item -mcpu=@var{name}
14093 @opindex mcpu
14094 This specifies the name of the target ARM processor.  GCC uses this name
14095 to derive the name of the target ARM architecture (as if specified
14096 by @option{-march}) and the ARM processor type for which to tune for
14097 performance (as if specified by @option{-mtune}).  Where this option
14098 is used in conjunction with @option{-march} or @option{-mtune},
14099 those options take precedence over the appropriate part of this option.
14101 Permissible names for this option are the same as those for
14102 @option{-mtune}.
14104 @option{-mcpu=generic-@var{arch}} is also permissible, and is
14105 equivalent to @option{-march=@var{arch} -mtune=generic-@var{arch}}.
14106 See @option{-mtune} for more information.
14108 @option{-mcpu=native} causes the compiler to auto-detect the CPU
14109 of the build computer.  At present, this feature is only supported on
14110 GNU/Linux, and not all architectures are recognized.  If the auto-detect
14111 is unsuccessful the option has no effect.
14113 @item -mfpu=@var{name}
14114 @opindex mfpu
14115 This specifies what floating-point hardware (or hardware emulation) is
14116 available on the target.  Permissible names are: @samp{vfp}, @samp{vfpv3},
14117 @samp{vfpv3-fp16}, @samp{vfpv3-d16}, @samp{vfpv3-d16-fp16}, @samp{vfpv3xd},
14118 @samp{vfpv3xd-fp16}, @samp{neon}, @samp{neon-fp16}, @samp{vfpv4},
14119 @samp{vfpv4-d16}, @samp{fpv4-sp-d16}, @samp{neon-vfpv4},
14120 @samp{fpv5-d16}, @samp{fpv5-sp-d16},
14121 @samp{fp-armv8}, @samp{neon-fp-armv8} and @samp{crypto-neon-fp-armv8}.
14123 If @option{-msoft-float} is specified this specifies the format of
14124 floating-point values.
14126 If the selected floating-point hardware includes the NEON extension
14127 (e.g. @option{-mfpu}=@samp{neon}), note that floating-point
14128 operations are not generated by GCC's auto-vectorization pass unless
14129 @option{-funsafe-math-optimizations} is also specified.  This is
14130 because NEON hardware does not fully implement the IEEE 754 standard for
14131 floating-point arithmetic (in particular denormal values are treated as
14132 zero), so the use of NEON instructions may lead to a loss of precision.
14134 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}).
14136 @item -mfp16-format=@var{name}
14137 @opindex mfp16-format
14138 Specify the format of the @code{__fp16} half-precision floating-point type.
14139 Permissible names are @samp{none}, @samp{ieee}, and @samp{alternative};
14140 the default is @samp{none}, in which case the @code{__fp16} type is not
14141 defined.  @xref{Half-Precision}, for more information.
14143 @item -mstructure-size-boundary=@var{n}
14144 @opindex mstructure-size-boundary
14145 The sizes of all structures and unions are rounded up to a multiple
14146 of the number of bits set by this option.  Permissible values are 8, 32
14147 and 64.  The default value varies for different toolchains.  For the COFF
14148 targeted toolchain the default value is 8.  A value of 64 is only allowed
14149 if the underlying ABI supports it.
14151 Specifying a larger number can produce faster, more efficient code, but
14152 can also increase the size of the program.  Different values are potentially
14153 incompatible.  Code compiled with one value cannot necessarily expect to
14154 work with code or libraries compiled with another value, if they exchange
14155 information using structures or unions.
14157 @item -mabort-on-noreturn
14158 @opindex mabort-on-noreturn
14159 Generate a call to the function @code{abort} at the end of a
14160 @code{noreturn} function.  It is executed if the function tries to
14161 return.
14163 @item -mlong-calls
14164 @itemx -mno-long-calls
14165 @opindex mlong-calls
14166 @opindex mno-long-calls
14167 Tells the compiler to perform function calls by first loading the
14168 address of the function into a register and then performing a subroutine
14169 call on this register.  This switch is needed if the target function
14170 lies outside of the 64-megabyte addressing range of the offset-based
14171 version of subroutine call instruction.
14173 Even if this switch is enabled, not all function calls are turned
14174 into long calls.  The heuristic is that static functions, functions
14175 that have the @code{short_call} attribute, functions that are inside
14176 the scope of a @code{#pragma no_long_calls} directive, and functions whose
14177 definitions have already been compiled within the current compilation
14178 unit are not turned into long calls.  The exceptions to this rule are
14179 that weak function definitions, functions with the @code{long_call}
14180 attribute or the @code{section} attribute, and functions that are within
14181 the scope of a @code{#pragma long_calls} directive are always
14182 turned into long calls.
14184 This feature is not enabled by default.  Specifying
14185 @option{-mno-long-calls} restores the default behavior, as does
14186 placing the function calls within the scope of a @code{#pragma
14187 long_calls_off} directive.  Note these switches have no effect on how
14188 the compiler generates code to handle function calls via function
14189 pointers.
14191 @item -msingle-pic-base
14192 @opindex msingle-pic-base
14193 Treat the register used for PIC addressing as read-only, rather than
14194 loading it in the prologue for each function.  The runtime system is
14195 responsible for initializing this register with an appropriate value
14196 before execution begins.
14198 @item -mpic-register=@var{reg}
14199 @opindex mpic-register
14200 Specify the register to be used for PIC addressing.
14201 For standard PIC base case, the default is any suitable register
14202 determined by compiler.  For single PIC base case, the default is
14203 @samp{R9} if target is EABI based or stack-checking is enabled,
14204 otherwise the default is @samp{R10}.
14206 @item -mpic-data-is-text-relative
14207 @opindex mpic-data-is-text-relative
14208 Assume that each data segments are relative to text segment at load time.
14209 Therefore, it permits addressing data using PC-relative operations.
14210 This option is on by default for targets other than VxWorks RTP.
14212 @item -mpoke-function-name
14213 @opindex mpoke-function-name
14214 Write the name of each function into the text section, directly
14215 preceding the function prologue.  The generated code is similar to this:
14217 @smallexample
14218      t0
14219          .ascii "arm_poke_function_name", 0
14220          .align
14221      t1
14222          .word 0xff000000 + (t1 - t0)
14223      arm_poke_function_name
14224          mov     ip, sp
14225          stmfd   sp!, @{fp, ip, lr, pc@}
14226          sub     fp, ip, #4
14227 @end smallexample
14229 When performing a stack backtrace, code can inspect the value of
14230 @code{pc} stored at @code{fp + 0}.  If the trace function then looks at
14231 location @code{pc - 12} and the top 8 bits are set, then we know that
14232 there is a function name embedded immediately preceding this location
14233 and has length @code{((pc[-3]) & 0xff000000)}.
14235 @item -mthumb
14236 @itemx -marm
14237 @opindex marm
14238 @opindex mthumb
14240 Select between generating code that executes in ARM and Thumb
14241 states.  The default for most configurations is to generate code
14242 that executes in ARM state, but the default can be changed by
14243 configuring GCC with the @option{--with-mode=}@var{state}
14244 configure option.
14246 You can also override the ARM and Thumb mode for each function
14247 by using the @code{target("thumb")} and @code{target("arm")} function attributes
14248 (@pxref{ARM Function Attributes}) or pragmas (@pxref{Function Specific Option Pragmas}).
14250 @item -mtpcs-frame
14251 @opindex mtpcs-frame
14252 Generate a stack frame that is compliant with the Thumb Procedure Call
14253 Standard for all non-leaf functions.  (A leaf function is one that does
14254 not call any other functions.)  The default is @option{-mno-tpcs-frame}.
14256 @item -mtpcs-leaf-frame
14257 @opindex mtpcs-leaf-frame
14258 Generate a stack frame that is compliant with the Thumb Procedure Call
14259 Standard for all leaf functions.  (A leaf function is one that does
14260 not call any other functions.)  The default is @option{-mno-apcs-leaf-frame}.
14262 @item -mcallee-super-interworking
14263 @opindex mcallee-super-interworking
14264 Gives all externally visible functions in the file being compiled an ARM
14265 instruction set header which switches to Thumb mode before executing the
14266 rest of the function.  This allows these functions to be called from
14267 non-interworking code.  This option is not valid in AAPCS configurations
14268 because interworking is enabled by default.
14270 @item -mcaller-super-interworking
14271 @opindex mcaller-super-interworking
14272 Allows calls via function pointers (including virtual functions) to
14273 execute correctly regardless of whether the target code has been
14274 compiled for interworking or not.  There is a small overhead in the cost
14275 of executing a function pointer if this option is enabled.  This option
14276 is not valid in AAPCS configurations because interworking is enabled
14277 by default.
14279 @item -mtp=@var{name}
14280 @opindex mtp
14281 Specify the access model for the thread local storage pointer.  The valid
14282 models are @samp{soft}, which generates calls to @code{__aeabi_read_tp},
14283 @samp{cp15}, which fetches the thread pointer from @code{cp15} directly
14284 (supported in the arm6k architecture), and @samp{auto}, which uses the
14285 best available method for the selected processor.  The default setting is
14286 @samp{auto}.
14288 @item -mtls-dialect=@var{dialect}
14289 @opindex mtls-dialect
14290 Specify the dialect to use for accessing thread local storage.  Two
14291 @var{dialect}s are supported---@samp{gnu} and @samp{gnu2}.  The
14292 @samp{gnu} dialect selects the original GNU scheme for supporting
14293 local and global dynamic TLS models.  The @samp{gnu2} dialect
14294 selects the GNU descriptor scheme, which provides better performance
14295 for shared libraries.  The GNU descriptor scheme is compatible with
14296 the original scheme, but does require new assembler, linker and
14297 library support.  Initial and local exec TLS models are unaffected by
14298 this option and always use the original scheme.
14300 @item -mword-relocations
14301 @opindex mword-relocations
14302 Only generate absolute relocations on word-sized values (i.e. R_ARM_ABS32).
14303 This is enabled by default on targets (uClinux, SymbianOS) where the runtime
14304 loader imposes this restriction, and when @option{-fpic} or @option{-fPIC}
14305 is specified.
14307 @item -mfix-cortex-m3-ldrd
14308 @opindex mfix-cortex-m3-ldrd
14309 Some Cortex-M3 cores can cause data corruption when @code{ldrd} instructions
14310 with overlapping destination and base registers are used.  This option avoids
14311 generating these instructions.  This option is enabled by default when
14312 @option{-mcpu=cortex-m3} is specified.
14314 @item -munaligned-access
14315 @itemx -mno-unaligned-access
14316 @opindex munaligned-access
14317 @opindex mno-unaligned-access
14318 Enables (or disables) reading and writing of 16- and 32- bit values
14319 from addresses that are not 16- or 32- bit aligned.  By default
14320 unaligned access is disabled for all pre-ARMv6 and all ARMv6-M
14321 architectures, and enabled for all other architectures.  If unaligned
14322 access is not enabled then words in packed data structures are
14323 accessed a byte at a time.
14325 The ARM attribute @code{Tag_CPU_unaligned_access} is set in the
14326 generated object file to either true or false, depending upon the
14327 setting of this option.  If unaligned access is enabled then the
14328 preprocessor symbol @code{__ARM_FEATURE_UNALIGNED} is also
14329 defined.
14331 @item -mneon-for-64bits
14332 @opindex mneon-for-64bits
14333 Enables using Neon to handle scalar 64-bits operations. This is
14334 disabled by default since the cost of moving data from core registers
14335 to Neon is high.
14337 @item -mslow-flash-data
14338 @opindex mslow-flash-data
14339 Assume loading data from flash is slower than fetching instruction.
14340 Therefore literal load is minimized for better performance.
14341 This option is only supported when compiling for ARMv7 M-profile and
14342 off by default.
14344 @item -masm-syntax-unified
14345 @opindex masm-syntax-unified
14346 Assume inline assembler is using unified asm syntax.  The default is
14347 currently off which implies divided syntax.  This option has no impact
14348 on Thumb2. However, this may change in future releases of GCC.
14349 Divided syntax should be considered deprecated.
14351 @item -mrestrict-it
14352 @opindex mrestrict-it
14353 Restricts generation of IT blocks to conform to the rules of ARMv8.
14354 IT blocks can only contain a single 16-bit instruction from a select
14355 set of instructions. This option is on by default for ARMv8 Thumb mode.
14357 @item -mprint-tune-info
14358 @opindex mprint-tune-info
14359 Print CPU tuning information as comment in assembler file.  This is
14360 an option used only for regression testing of the compiler and not
14361 intended for ordinary use in compiling code.  This option is disabled
14362 by default.
14363 @end table
14365 @node AVR Options
14366 @subsection AVR Options
14367 @cindex AVR Options
14369 These options are defined for AVR implementations:
14371 @table @gcctabopt
14372 @item -mmcu=@var{mcu}
14373 @opindex mmcu
14374 Specify Atmel AVR instruction set architectures (ISA) or MCU type.
14376 The default for this option is@tie{}@samp{avr2}.
14378 GCC supports the following AVR devices and ISAs:
14380 @include avr-mmcu.texi
14382 @item -maccumulate-args
14383 @opindex maccumulate-args
14384 Accumulate outgoing function arguments and acquire/release the needed
14385 stack space for outgoing function arguments once in function
14386 prologue/epilogue.  Without this option, outgoing arguments are pushed
14387 before calling a function and popped afterwards.
14389 Popping the arguments after the function call can be expensive on
14390 AVR so that accumulating the stack space might lead to smaller
14391 executables because arguments need not to be removed from the
14392 stack after such a function call.
14394 This option can lead to reduced code size for functions that perform
14395 several calls to functions that get their arguments on the stack like
14396 calls to printf-like functions.
14398 @item -mbranch-cost=@var{cost}
14399 @opindex mbranch-cost
14400 Set the branch costs for conditional branch instructions to
14401 @var{cost}.  Reasonable values for @var{cost} are small, non-negative
14402 integers. The default branch cost is 0.
14404 @item -mcall-prologues
14405 @opindex mcall-prologues
14406 Functions prologues/epilogues are expanded as calls to appropriate
14407 subroutines.  Code size is smaller.
14409 @item -mint8
14410 @opindex mint8
14411 Assume @code{int} to be 8-bit integer.  This affects the sizes of all types: a
14412 @code{char} is 1 byte, an @code{int} is 1 byte, a @code{long} is 2 bytes,
14413 and @code{long long} is 4 bytes.  Please note that this option does not
14414 conform to the C standards, but it results in smaller code
14415 size.
14417 @item -mn-flash=@var{num}
14418 @opindex mn-flash
14419 Assume that the flash memory has a size of 
14420 @var{num} times 64@tie{}KiB.
14422 @item -mno-interrupts
14423 @opindex mno-interrupts
14424 Generated code is not compatible with hardware interrupts.
14425 Code size is smaller.
14427 @item -mrelax
14428 @opindex mrelax
14429 Try to replace @code{CALL} resp.@: @code{JMP} instruction by the shorter
14430 @code{RCALL} resp.@: @code{RJMP} instruction if applicable.
14431 Setting @option{-mrelax} just adds the @option{--mlink-relax} option to
14432 the assembler's command line and the @option{--relax} option to the
14433 linker's command line.
14435 Jump relaxing is performed by the linker because jump offsets are not
14436 known before code is located. Therefore, the assembler code generated by the
14437 compiler is the same, but the instructions in the executable may
14438 differ from instructions in the assembler code.
14440 Relaxing must be turned on if linker stubs are needed, see the
14441 section on @code{EIND} and linker stubs below.
14443 @item -mrmw
14444 @opindex mrmw
14445 Assume that the device supports the Read-Modify-Write
14446 instructions @code{XCH}, @code{LAC}, @code{LAS} and @code{LAT}.
14448 @item -msp8
14449 @opindex msp8
14450 Treat the stack pointer register as an 8-bit register,
14451 i.e.@: assume the high byte of the stack pointer is zero.
14452 In general, you don't need to set this option by hand.
14454 This option is used internally by the compiler to select and
14455 build multilibs for architectures @code{avr2} and @code{avr25}.
14456 These architectures mix devices with and without @code{SPH}.
14457 For any setting other than @option{-mmcu=avr2} or @option{-mmcu=avr25}
14458 the compiler driver adds or removes this option from the compiler
14459 proper's command line, because the compiler then knows if the device
14460 or architecture has an 8-bit stack pointer and thus no @code{SPH}
14461 register or not.
14463 @item -mstrict-X
14464 @opindex mstrict-X
14465 Use address register @code{X} in a way proposed by the hardware.  This means
14466 that @code{X} is only used in indirect, post-increment or
14467 pre-decrement addressing.
14469 Without this option, the @code{X} register may be used in the same way
14470 as @code{Y} or @code{Z} which then is emulated by additional
14471 instructions.  
14472 For example, loading a value with @code{X+const} addressing with a
14473 small non-negative @code{const < 64} to a register @var{Rn} is
14474 performed as
14476 @example
14477 adiw r26, const   ; X += const
14478 ld   @var{Rn}, X        ; @var{Rn} = *X
14479 sbiw r26, const   ; X -= const
14480 @end example
14482 @item -mtiny-stack
14483 @opindex mtiny-stack
14484 Only change the lower 8@tie{}bits of the stack pointer.
14486 @item -nodevicelib
14487 @opindex nodevicelib
14488 Don't link against AVR-LibC's device specific library @code{libdev.a}.
14490 @item -Waddr-space-convert
14491 @opindex Waddr-space-convert
14492 Warn about conversions between address spaces in the case where the
14493 resulting address space is not contained in the incoming address space.
14494 @end table
14496 @subsubsection @code{EIND} and Devices with More Than 128 Ki Bytes of Flash
14497 @cindex @code{EIND}
14498 Pointers in the implementation are 16@tie{}bits wide.
14499 The address of a function or label is represented as word address so
14500 that indirect jumps and calls can target any code address in the
14501 range of 64@tie{}Ki words.
14503 In order to facilitate indirect jump on devices with more than 128@tie{}Ki
14504 bytes of program memory space, there is a special function register called
14505 @code{EIND} that serves as most significant part of the target address
14506 when @code{EICALL} or @code{EIJMP} instructions are used.
14508 Indirect jumps and calls on these devices are handled as follows by
14509 the compiler and are subject to some limitations:
14511 @itemize @bullet
14513 @item
14514 The compiler never sets @code{EIND}.
14516 @item
14517 The compiler uses @code{EIND} implicitly in @code{EICALL}/@code{EIJMP}
14518 instructions or might read @code{EIND} directly in order to emulate an
14519 indirect call/jump by means of a @code{RET} instruction.
14521 @item
14522 The compiler assumes that @code{EIND} never changes during the startup
14523 code or during the application. In particular, @code{EIND} is not
14524 saved/restored in function or interrupt service routine
14525 prologue/epilogue.
14527 @item
14528 For indirect calls to functions and computed goto, the linker
14529 generates @emph{stubs}. Stubs are jump pads sometimes also called
14530 @emph{trampolines}. Thus, the indirect call/jump jumps to such a stub.
14531 The stub contains a direct jump to the desired address.
14533 @item
14534 Linker relaxation must be turned on so that the linker generates
14535 the stubs correctly in all situations. See the compiler option
14536 @option{-mrelax} and the linker option @option{--relax}.
14537 There are corner cases where the linker is supposed to generate stubs
14538 but aborts without relaxation and without a helpful error message.
14540 @item
14541 The default linker script is arranged for code with @code{EIND = 0}.
14542 If code is supposed to work for a setup with @code{EIND != 0}, a custom
14543 linker script has to be used in order to place the sections whose
14544 name start with @code{.trampolines} into the segment where @code{EIND}
14545 points to.
14547 @item
14548 The startup code from libgcc never sets @code{EIND}.
14549 Notice that startup code is a blend of code from libgcc and AVR-LibC.
14550 For the impact of AVR-LibC on @code{EIND}, see the
14551 @w{@uref{http://nongnu.org/avr-libc/user-manual/,AVR-LibC user manual}}.
14553 @item
14554 It is legitimate for user-specific startup code to set up @code{EIND}
14555 early, for example by means of initialization code located in
14556 section @code{.init3}. Such code runs prior to general startup code
14557 that initializes RAM and calls constructors, but after the bit
14558 of startup code from AVR-LibC that sets @code{EIND} to the segment
14559 where the vector table is located.
14560 @example
14561 #include <avr/io.h>
14563 static void
14564 __attribute__((section(".init3"),naked,used,no_instrument_function))
14565 init3_set_eind (void)
14567   __asm volatile ("ldi r24,pm_hh8(__trampolines_start)\n\t"
14568                   "out %i0,r24" :: "n" (&EIND) : "r24","memory");
14570 @end example
14572 @noindent
14573 The @code{__trampolines_start} symbol is defined in the linker script.
14575 @item
14576 Stubs are generated automatically by the linker if
14577 the following two conditions are met:
14578 @itemize @minus
14580 @item The address of a label is taken by means of the @code{gs} modifier
14581 (short for @emph{generate stubs}) like so:
14582 @example
14583 LDI r24, lo8(gs(@var{func}))
14584 LDI r25, hi8(gs(@var{func}))
14585 @end example
14586 @item The final location of that label is in a code segment
14587 @emph{outside} the segment where the stubs are located.
14588 @end itemize
14590 @item
14591 The compiler emits such @code{gs} modifiers for code labels in the
14592 following situations:
14593 @itemize @minus
14594 @item Taking address of a function or code label.
14595 @item Computed goto.
14596 @item If prologue-save function is used, see @option{-mcall-prologues}
14597 command-line option.
14598 @item Switch/case dispatch tables. If you do not want such dispatch
14599 tables you can specify the @option{-fno-jump-tables} command-line option.
14600 @item C and C++ constructors/destructors called during startup/shutdown.
14601 @item If the tools hit a @code{gs()} modifier explained above.
14602 @end itemize
14604 @item
14605 Jumping to non-symbolic addresses like so is @emph{not} supported:
14607 @example
14608 int main (void)
14610     /* Call function at word address 0x2 */
14611     return ((int(*)(void)) 0x2)();
14613 @end example
14615 Instead, a stub has to be set up, i.e.@: the function has to be called
14616 through a symbol (@code{func_4} in the example):
14618 @example
14619 int main (void)
14621     extern int func_4 (void);
14623     /* Call function at byte address 0x4 */
14624     return func_4();
14626 @end example
14628 and the application be linked with @option{-Wl,--defsym,func_4=0x4}.
14629 Alternatively, @code{func_4} can be defined in the linker script.
14630 @end itemize
14632 @subsubsection Handling of the @code{RAMPD}, @code{RAMPX}, @code{RAMPY} and @code{RAMPZ} Special Function Registers
14633 @cindex @code{RAMPD}
14634 @cindex @code{RAMPX}
14635 @cindex @code{RAMPY}
14636 @cindex @code{RAMPZ}
14637 Some AVR devices support memories larger than the 64@tie{}KiB range
14638 that can be accessed with 16-bit pointers.  To access memory locations
14639 outside this 64@tie{}KiB range, the contentent of a @code{RAMP}
14640 register is used as high part of the address:
14641 The @code{X}, @code{Y}, @code{Z} address register is concatenated
14642 with the @code{RAMPX}, @code{RAMPY}, @code{RAMPZ} special function
14643 register, respectively, to get a wide address. Similarly,
14644 @code{RAMPD} is used together with direct addressing.
14646 @itemize
14647 @item
14648 The startup code initializes the @code{RAMP} special function
14649 registers with zero.
14651 @item
14652 If a @ref{AVR Named Address Spaces,named address space} other than
14653 generic or @code{__flash} is used, then @code{RAMPZ} is set
14654 as needed before the operation.
14656 @item
14657 If the device supports RAM larger than 64@tie{}KiB and the compiler
14658 needs to change @code{RAMPZ} to accomplish an operation, @code{RAMPZ}
14659 is reset to zero after the operation.
14661 @item
14662 If the device comes with a specific @code{RAMP} register, the ISR
14663 prologue/epilogue saves/restores that SFR and initializes it with
14664 zero in case the ISR code might (implicitly) use it.
14666 @item
14667 RAM larger than 64@tie{}KiB is not supported by GCC for AVR targets.
14668 If you use inline assembler to read from locations outside the
14669 16-bit address range and change one of the @code{RAMP} registers,
14670 you must reset it to zero after the access.
14672 @end itemize
14674 @subsubsection AVR Built-in Macros
14676 GCC defines several built-in macros so that the user code can test
14677 for the presence or absence of features.  Almost any of the following
14678 built-in macros are deduced from device capabilities and thus
14679 triggered by the @option{-mmcu=} command-line option.
14681 For even more AVR-specific built-in macros see
14682 @ref{AVR Named Address Spaces} and @ref{AVR Built-in Functions}.
14684 @table @code
14686 @item __AVR_ARCH__
14687 Build-in macro that resolves to a decimal number that identifies the
14688 architecture and depends on the @option{-mmcu=@var{mcu}} option.
14689 Possible values are:
14691 @code{2}, @code{25}, @code{3}, @code{31}, @code{35},
14692 @code{4}, @code{5}, @code{51}, @code{6}
14694 for @var{mcu}=@code{avr2}, @code{avr25}, @code{avr3}, @code{avr31},
14695 @code{avr35}, @code{avr4}, @code{avr5}, @code{avr51}, @code{avr6},
14697 respectively and
14699 @code{100}, @code{102}, @code{104},
14700 @code{105}, @code{106}, @code{107}
14702 for @var{mcu}=@code{avrtiny}, @code{avrxmega2}, @code{avrxmega4},
14703 @code{avrxmega5}, @code{avrxmega6}, @code{avrxmega7}, respectively.
14704 If @var{mcu} specifies a device, this built-in macro is set
14705 accordingly. For example, with @option{-mmcu=atmega8} the macro is
14706 defined to @code{4}.
14708 @item __AVR_@var{Device}__
14709 Setting @option{-mmcu=@var{device}} defines this built-in macro which reflects
14710 the device's name. For example, @option{-mmcu=atmega8} defines the
14711 built-in macro @code{__AVR_ATmega8__}, @option{-mmcu=attiny261a} defines
14712 @code{__AVR_ATtiny261A__}, etc.
14714 The built-in macros' names follow
14715 the scheme @code{__AVR_@var{Device}__} where @var{Device} is
14716 the device name as from the AVR user manual. The difference between
14717 @var{Device} in the built-in macro and @var{device} in
14718 @option{-mmcu=@var{device}} is that the latter is always lowercase.
14720 If @var{device} is not a device but only a core architecture like
14721 @samp{avr51}, this macro is not defined.
14723 @item __AVR_DEVICE_NAME__
14724 Setting @option{-mmcu=@var{device}} defines this built-in macro to
14725 the device's name. For example, with @option{-mmcu=atmega8} the macro
14726 is defined to @code{atmega8}.
14728 If @var{device} is not a device but only a core architecture like
14729 @samp{avr51}, this macro is not defined.
14731 @item __AVR_XMEGA__
14732 The device / architecture belongs to the XMEGA family of devices.
14734 @item __AVR_HAVE_ELPM__
14735 The device has the @code{ELPM} instruction.
14737 @item __AVR_HAVE_ELPMX__
14738 The device has the @code{ELPM R@var{n},Z} and @code{ELPM
14739 R@var{n},Z+} instructions.
14741 @item __AVR_HAVE_MOVW__
14742 The device has the @code{MOVW} instruction to perform 16-bit
14743 register-register moves.
14745 @item __AVR_HAVE_LPMX__
14746 The device has the @code{LPM R@var{n},Z} and
14747 @code{LPM R@var{n},Z+} instructions.
14749 @item __AVR_HAVE_MUL__
14750 The device has a hardware multiplier. 
14752 @item __AVR_HAVE_JMP_CALL__
14753 The device has the @code{JMP} and @code{CALL} instructions.
14754 This is the case for devices with at least 16@tie{}KiB of program
14755 memory.
14757 @item __AVR_HAVE_EIJMP_EICALL__
14758 @itemx __AVR_3_BYTE_PC__
14759 The device has the @code{EIJMP} and @code{EICALL} instructions.
14760 This is the case for devices with more than 128@tie{}KiB of program memory.
14761 This also means that the program counter
14762 (PC) is 3@tie{}bytes wide.
14764 @item __AVR_2_BYTE_PC__
14765 The program counter (PC) is 2@tie{}bytes wide. This is the case for devices
14766 with up to 128@tie{}KiB of program memory.
14768 @item __AVR_HAVE_8BIT_SP__
14769 @itemx __AVR_HAVE_16BIT_SP__
14770 The stack pointer (SP) register is treated as 8-bit respectively
14771 16-bit register by the compiler.
14772 The definition of these macros is affected by @option{-mtiny-stack}.
14774 @item __AVR_HAVE_SPH__
14775 @itemx __AVR_SP8__
14776 The device has the SPH (high part of stack pointer) special function
14777 register or has an 8-bit stack pointer, respectively.
14778 The definition of these macros is affected by @option{-mmcu=} and
14779 in the cases of @option{-mmcu=avr2} and @option{-mmcu=avr25} also
14780 by @option{-msp8}.
14782 @item __AVR_HAVE_RAMPD__
14783 @itemx __AVR_HAVE_RAMPX__
14784 @itemx __AVR_HAVE_RAMPY__
14785 @itemx __AVR_HAVE_RAMPZ__
14786 The device has the @code{RAMPD}, @code{RAMPX}, @code{RAMPY},
14787 @code{RAMPZ} special function register, respectively.
14789 @item __NO_INTERRUPTS__
14790 This macro reflects the @option{-mno-interrupts} command-line option.
14792 @item __AVR_ERRATA_SKIP__
14793 @itemx __AVR_ERRATA_SKIP_JMP_CALL__
14794 Some AVR devices (AT90S8515, ATmega103) must not skip 32-bit
14795 instructions because of a hardware erratum.  Skip instructions are
14796 @code{SBRS}, @code{SBRC}, @code{SBIS}, @code{SBIC} and @code{CPSE}.
14797 The second macro is only defined if @code{__AVR_HAVE_JMP_CALL__} is also
14798 set.
14800 @item __AVR_ISA_RMW__
14801 The device has Read-Modify-Write instructions (XCH, LAC, LAS and LAT).
14803 @item __AVR_SFR_OFFSET__=@var{offset}
14804 Instructions that can address I/O special function registers directly
14805 like @code{IN}, @code{OUT}, @code{SBI}, etc.@: may use a different
14806 address as if addressed by an instruction to access RAM like @code{LD}
14807 or @code{STS}. This offset depends on the device architecture and has
14808 to be subtracted from the RAM address in order to get the
14809 respective I/O@tie{}address.
14811 @item __WITH_AVRLIBC__
14812 The compiler is configured to be used together with AVR-Libc.
14813 See the @option{--with-avrlibc} configure option.
14815 @end table
14817 @node Blackfin Options
14818 @subsection Blackfin Options
14819 @cindex Blackfin Options
14821 @table @gcctabopt
14822 @item -mcpu=@var{cpu}@r{[}-@var{sirevision}@r{]}
14823 @opindex mcpu=
14824 Specifies the name of the target Blackfin processor.  Currently, @var{cpu}
14825 can be one of @samp{bf512}, @samp{bf514}, @samp{bf516}, @samp{bf518},
14826 @samp{bf522}, @samp{bf523}, @samp{bf524}, @samp{bf525}, @samp{bf526},
14827 @samp{bf527}, @samp{bf531}, @samp{bf532}, @samp{bf533},
14828 @samp{bf534}, @samp{bf536}, @samp{bf537}, @samp{bf538}, @samp{bf539},
14829 @samp{bf542}, @samp{bf544}, @samp{bf547}, @samp{bf548}, @samp{bf549},
14830 @samp{bf542m}, @samp{bf544m}, @samp{bf547m}, @samp{bf548m}, @samp{bf549m},
14831 @samp{bf561}, @samp{bf592}.
14833 The optional @var{sirevision} specifies the silicon revision of the target
14834 Blackfin processor.  Any workarounds available for the targeted silicon revision
14835 are enabled.  If @var{sirevision} is @samp{none}, no workarounds are enabled.
14836 If @var{sirevision} is @samp{any}, all workarounds for the targeted processor
14837 are enabled.  The @code{__SILICON_REVISION__} macro is defined to two
14838 hexadecimal digits representing the major and minor numbers in the silicon
14839 revision.  If @var{sirevision} is @samp{none}, the @code{__SILICON_REVISION__}
14840 is not defined.  If @var{sirevision} is @samp{any}, the
14841 @code{__SILICON_REVISION__} is defined to be @code{0xffff}.
14842 If this optional @var{sirevision} is not used, GCC assumes the latest known
14843 silicon revision of the targeted Blackfin processor.
14845 GCC defines a preprocessor macro for the specified @var{cpu}.
14846 For the @samp{bfin-elf} toolchain, this option causes the hardware BSP
14847 provided by libgloss to be linked in if @option{-msim} is not given.
14849 Without this option, @samp{bf532} is used as the processor by default.
14851 Note that support for @samp{bf561} is incomplete.  For @samp{bf561},
14852 only the preprocessor macro is defined.
14854 @item -msim
14855 @opindex msim
14856 Specifies that the program will be run on the simulator.  This causes
14857 the simulator BSP provided by libgloss to be linked in.  This option
14858 has effect only for @samp{bfin-elf} toolchain.
14859 Certain other options, such as @option{-mid-shared-library} and
14860 @option{-mfdpic}, imply @option{-msim}.
14862 @item -momit-leaf-frame-pointer
14863 @opindex momit-leaf-frame-pointer
14864 Don't keep the frame pointer in a register for leaf functions.  This
14865 avoids the instructions to save, set up and restore frame pointers and
14866 makes an extra register available in leaf functions.  The option
14867 @option{-fomit-frame-pointer} removes the frame pointer for all functions,
14868 which might make debugging harder.
14870 @item -mspecld-anomaly
14871 @opindex mspecld-anomaly
14872 When enabled, the compiler ensures that the generated code does not
14873 contain speculative loads after jump instructions. If this option is used,
14874 @code{__WORKAROUND_SPECULATIVE_LOADS} is defined.
14876 @item -mno-specld-anomaly
14877 @opindex mno-specld-anomaly
14878 Don't generate extra code to prevent speculative loads from occurring.
14880 @item -mcsync-anomaly
14881 @opindex mcsync-anomaly
14882 When enabled, the compiler ensures that the generated code does not
14883 contain CSYNC or SSYNC instructions too soon after conditional branches.
14884 If this option is used, @code{__WORKAROUND_SPECULATIVE_SYNCS} is defined.
14886 @item -mno-csync-anomaly
14887 @opindex mno-csync-anomaly
14888 Don't generate extra code to prevent CSYNC or SSYNC instructions from
14889 occurring too soon after a conditional branch.
14891 @item -mlow-64k
14892 @opindex mlow-64k
14893 When enabled, the compiler is free to take advantage of the knowledge that
14894 the entire program fits into the low 64k of memory.
14896 @item -mno-low-64k
14897 @opindex mno-low-64k
14898 Assume that the program is arbitrarily large.  This is the default.
14900 @item -mstack-check-l1
14901 @opindex mstack-check-l1
14902 Do stack checking using information placed into L1 scratchpad memory by the
14903 uClinux kernel.
14905 @item -mid-shared-library
14906 @opindex mid-shared-library
14907 Generate code that supports shared libraries via the library ID method.
14908 This allows for execute in place and shared libraries in an environment
14909 without virtual memory management.  This option implies @option{-fPIC}.
14910 With a @samp{bfin-elf} target, this option implies @option{-msim}.
14912 @item -mno-id-shared-library
14913 @opindex mno-id-shared-library
14914 Generate code that doesn't assume ID-based shared libraries are being used.
14915 This is the default.
14917 @item -mleaf-id-shared-library
14918 @opindex mleaf-id-shared-library
14919 Generate code that supports shared libraries via the library ID method,
14920 but assumes that this library or executable won't link against any other
14921 ID shared libraries.  That allows the compiler to use faster code for jumps
14922 and calls.
14924 @item -mno-leaf-id-shared-library
14925 @opindex mno-leaf-id-shared-library
14926 Do not assume that the code being compiled won't link against any ID shared
14927 libraries.  Slower code is generated for jump and call insns.
14929 @item -mshared-library-id=n
14930 @opindex mshared-library-id
14931 Specifies the identification number of the ID-based shared library being
14932 compiled.  Specifying a value of 0 generates more compact code; specifying
14933 other values forces the allocation of that number to the current
14934 library but is no more space- or time-efficient than omitting this option.
14936 @item -msep-data
14937 @opindex msep-data
14938 Generate code that allows the data segment to be located in a different
14939 area of memory from the text segment.  This allows for execute in place in
14940 an environment without virtual memory management by eliminating relocations
14941 against the text section.
14943 @item -mno-sep-data
14944 @opindex mno-sep-data
14945 Generate code that assumes that the data segment follows the text segment.
14946 This is the default.
14948 @item -mlong-calls
14949 @itemx -mno-long-calls
14950 @opindex mlong-calls
14951 @opindex mno-long-calls
14952 Tells the compiler to perform function calls by first loading the
14953 address of the function into a register and then performing a subroutine
14954 call on this register.  This switch is needed if the target function
14955 lies outside of the 24-bit addressing range of the offset-based
14956 version of subroutine call instruction.
14958 This feature is not enabled by default.  Specifying
14959 @option{-mno-long-calls} restores the default behavior.  Note these
14960 switches have no effect on how the compiler generates code to handle
14961 function calls via function pointers.
14963 @item -mfast-fp
14964 @opindex mfast-fp
14965 Link with the fast floating-point library. This library relaxes some of
14966 the IEEE floating-point standard's rules for checking inputs against
14967 Not-a-Number (NAN), in the interest of performance.
14969 @item -minline-plt
14970 @opindex minline-plt
14971 Enable inlining of PLT entries in function calls to functions that are
14972 not known to bind locally.  It has no effect without @option{-mfdpic}.
14974 @item -mmulticore
14975 @opindex mmulticore
14976 Build a standalone application for multicore Blackfin processors. 
14977 This option causes proper start files and link scripts supporting 
14978 multicore to be used, and defines the macro @code{__BFIN_MULTICORE}. 
14979 It can only be used with @option{-mcpu=bf561@r{[}-@var{sirevision}@r{]}}. 
14981 This option can be used with @option{-mcorea} or @option{-mcoreb}, which
14982 selects the one-application-per-core programming model.  Without
14983 @option{-mcorea} or @option{-mcoreb}, the single-application/dual-core
14984 programming model is used. In this model, the main function of Core B
14985 should be named as @code{coreb_main}.
14987 If this option is not used, the single-core application programming
14988 model is used.
14990 @item -mcorea
14991 @opindex mcorea
14992 Build a standalone application for Core A of BF561 when using
14993 the one-application-per-core programming model. Proper start files
14994 and link scripts are used to support Core A, and the macro
14995 @code{__BFIN_COREA} is defined.
14996 This option can only be used in conjunction with @option{-mmulticore}.
14998 @item -mcoreb
14999 @opindex mcoreb
15000 Build a standalone application for Core B of BF561 when using
15001 the one-application-per-core programming model. Proper start files
15002 and link scripts are used to support Core B, and the macro
15003 @code{__BFIN_COREB} is defined. When this option is used, @code{coreb_main}
15004 should be used instead of @code{main}. 
15005 This option can only be used in conjunction with @option{-mmulticore}.
15007 @item -msdram
15008 @opindex msdram
15009 Build a standalone application for SDRAM. Proper start files and
15010 link scripts are used to put the application into SDRAM, and the macro
15011 @code{__BFIN_SDRAM} is defined.
15012 The loader should initialize SDRAM before loading the application.
15014 @item -micplb
15015 @opindex micplb
15016 Assume that ICPLBs are enabled at run time.  This has an effect on certain
15017 anomaly workarounds.  For Linux targets, the default is to assume ICPLBs
15018 are enabled; for standalone applications the default is off.
15019 @end table
15021 @node C6X Options
15022 @subsection C6X Options
15023 @cindex C6X Options
15025 @table @gcctabopt
15026 @item -march=@var{name}
15027 @opindex march
15028 This specifies the name of the target architecture.  GCC uses this
15029 name to determine what kind of instructions it can emit when generating
15030 assembly code.  Permissible names are: @samp{c62x},
15031 @samp{c64x}, @samp{c64x+}, @samp{c67x}, @samp{c67x+}, @samp{c674x}.
15033 @item -mbig-endian
15034 @opindex mbig-endian
15035 Generate code for a big-endian target.
15037 @item -mlittle-endian
15038 @opindex mlittle-endian
15039 Generate code for a little-endian target.  This is the default.
15041 @item -msim
15042 @opindex msim
15043 Choose startup files and linker script suitable for the simulator.
15045 @item -msdata=default
15046 @opindex msdata=default
15047 Put small global and static data in the @code{.neardata} section,
15048 which is pointed to by register @code{B14}.  Put small uninitialized
15049 global and static data in the @code{.bss} section, which is adjacent
15050 to the @code{.neardata} section.  Put small read-only data into the
15051 @code{.rodata} section.  The corresponding sections used for large
15052 pieces of data are @code{.fardata}, @code{.far} and @code{.const}.
15054 @item -msdata=all
15055 @opindex msdata=all
15056 Put all data, not just small objects, into the sections reserved for
15057 small data, and use addressing relative to the @code{B14} register to
15058 access them.
15060 @item -msdata=none
15061 @opindex msdata=none
15062 Make no use of the sections reserved for small data, and use absolute
15063 addresses to access all data.  Put all initialized global and static
15064 data in the @code{.fardata} section, and all uninitialized data in the
15065 @code{.far} section.  Put all constant data into the @code{.const}
15066 section.
15067 @end table
15069 @node CRIS Options
15070 @subsection CRIS Options
15071 @cindex CRIS Options
15073 These options are defined specifically for the CRIS ports.
15075 @table @gcctabopt
15076 @item -march=@var{architecture-type}
15077 @itemx -mcpu=@var{architecture-type}
15078 @opindex march
15079 @opindex mcpu
15080 Generate code for the specified architecture.  The choices for
15081 @var{architecture-type} are @samp{v3}, @samp{v8} and @samp{v10} for
15082 respectively ETRAX@w{ }4, ETRAX@w{ }100, and ETRAX@w{ }100@w{ }LX@.
15083 Default is @samp{v0} except for cris-axis-linux-gnu, where the default is
15084 @samp{v10}.
15086 @item -mtune=@var{architecture-type}
15087 @opindex mtune
15088 Tune to @var{architecture-type} everything applicable about the generated
15089 code, except for the ABI and the set of available instructions.  The
15090 choices for @var{architecture-type} are the same as for
15091 @option{-march=@var{architecture-type}}.
15093 @item -mmax-stack-frame=@var{n}
15094 @opindex mmax-stack-frame
15095 Warn when the stack frame of a function exceeds @var{n} bytes.
15097 @item -metrax4
15098 @itemx -metrax100
15099 @opindex metrax4
15100 @opindex metrax100
15101 The options @option{-metrax4} and @option{-metrax100} are synonyms for
15102 @option{-march=v3} and @option{-march=v8} respectively.
15104 @item -mmul-bug-workaround
15105 @itemx -mno-mul-bug-workaround
15106 @opindex mmul-bug-workaround
15107 @opindex mno-mul-bug-workaround
15108 Work around a bug in the @code{muls} and @code{mulu} instructions for CPU
15109 models where it applies.  This option is active by default.
15111 @item -mpdebug
15112 @opindex mpdebug
15113 Enable CRIS-specific verbose debug-related information in the assembly
15114 code.  This option also has the effect of turning off the @samp{#NO_APP}
15115 formatted-code indicator to the assembler at the beginning of the
15116 assembly file.
15118 @item -mcc-init
15119 @opindex mcc-init
15120 Do not use condition-code results from previous instruction; always emit
15121 compare and test instructions before use of condition codes.
15123 @item -mno-side-effects
15124 @opindex mno-side-effects
15125 Do not emit instructions with side effects in addressing modes other than
15126 post-increment.
15128 @item -mstack-align
15129 @itemx -mno-stack-align
15130 @itemx -mdata-align
15131 @itemx -mno-data-align
15132 @itemx -mconst-align
15133 @itemx -mno-const-align
15134 @opindex mstack-align
15135 @opindex mno-stack-align
15136 @opindex mdata-align
15137 @opindex mno-data-align
15138 @opindex mconst-align
15139 @opindex mno-const-align
15140 These options (@samp{no-} options) arrange (eliminate arrangements) for the
15141 stack frame, individual data and constants to be aligned for the maximum
15142 single data access size for the chosen CPU model.  The default is to
15143 arrange for 32-bit alignment.  ABI details such as structure layout are
15144 not affected by these options.
15146 @item -m32-bit
15147 @itemx -m16-bit
15148 @itemx -m8-bit
15149 @opindex m32-bit
15150 @opindex m16-bit
15151 @opindex m8-bit
15152 Similar to the stack- data- and const-align options above, these options
15153 arrange for stack frame, writable data and constants to all be 32-bit,
15154 16-bit or 8-bit aligned.  The default is 32-bit alignment.
15156 @item -mno-prologue-epilogue
15157 @itemx -mprologue-epilogue
15158 @opindex mno-prologue-epilogue
15159 @opindex mprologue-epilogue
15160 With @option{-mno-prologue-epilogue}, the normal function prologue and
15161 epilogue which set up the stack frame are omitted and no return
15162 instructions or return sequences are generated in the code.  Use this
15163 option only together with visual inspection of the compiled code: no
15164 warnings or errors are generated when call-saved registers must be saved,
15165 or storage for local variables needs to be allocated.
15167 @item -mno-gotplt
15168 @itemx -mgotplt
15169 @opindex mno-gotplt
15170 @opindex mgotplt
15171 With @option{-fpic} and @option{-fPIC}, don't generate (do generate)
15172 instruction sequences that load addresses for functions from the PLT part
15173 of the GOT rather than (traditional on other architectures) calls to the
15174 PLT@.  The default is @option{-mgotplt}.
15176 @item -melf
15177 @opindex melf
15178 Legacy no-op option only recognized with the cris-axis-elf and
15179 cris-axis-linux-gnu targets.
15181 @item -mlinux
15182 @opindex mlinux
15183 Legacy no-op option only recognized with the cris-axis-linux-gnu target.
15185 @item -sim
15186 @opindex sim
15187 This option, recognized for the cris-axis-elf, arranges
15188 to link with input-output functions from a simulator library.  Code,
15189 initialized data and zero-initialized data are allocated consecutively.
15191 @item -sim2
15192 @opindex sim2
15193 Like @option{-sim}, but pass linker options to locate initialized data at
15194 0x40000000 and zero-initialized data at 0x80000000.
15195 @end table
15197 @node CR16 Options
15198 @subsection CR16 Options
15199 @cindex CR16 Options
15201 These options are defined specifically for the CR16 ports.
15203 @table @gcctabopt
15205 @item -mmac
15206 @opindex mmac
15207 Enable the use of multiply-accumulate instructions. Disabled by default.
15209 @item -mcr16cplus
15210 @itemx -mcr16c
15211 @opindex mcr16cplus
15212 @opindex mcr16c
15213 Generate code for CR16C or CR16C+ architecture. CR16C+ architecture 
15214 is default.
15216 @item -msim
15217 @opindex msim
15218 Links the library libsim.a which is in compatible with simulator. Applicable
15219 to ELF compiler only.
15221 @item -mint32
15222 @opindex mint32
15223 Choose integer type as 32-bit wide.
15225 @item -mbit-ops
15226 @opindex mbit-ops
15227 Generates @code{sbit}/@code{cbit} instructions for bit manipulations.
15229 @item -mdata-model=@var{model}
15230 @opindex mdata-model
15231 Choose a data model. The choices for @var{model} are @samp{near},
15232 @samp{far} or @samp{medium}. @samp{medium} is default.
15233 However, @samp{far} is not valid with @option{-mcr16c}, as the
15234 CR16C architecture does not support the far data model.
15235 @end table
15237 @node Darwin Options
15238 @subsection Darwin Options
15239 @cindex Darwin options
15241 These options are defined for all architectures running the Darwin operating
15242 system.
15244 FSF GCC on Darwin does not create ``fat'' object files; it creates
15245 an object file for the single architecture that GCC was built to
15246 target.  Apple's GCC on Darwin does create ``fat'' files if multiple
15247 @option{-arch} options are used; it does so by running the compiler or
15248 linker multiple times and joining the results together with
15249 @file{lipo}.
15251 The subtype of the file created (like @samp{ppc7400} or @samp{ppc970} or
15252 @samp{i686}) is determined by the flags that specify the ISA
15253 that GCC is targeting, like @option{-mcpu} or @option{-march}.  The
15254 @option{-force_cpusubtype_ALL} option can be used to override this.
15256 The Darwin tools vary in their behavior when presented with an ISA
15257 mismatch.  The assembler, @file{as}, only permits instructions to
15258 be used that are valid for the subtype of the file it is generating,
15259 so you cannot put 64-bit instructions in a @samp{ppc750} object file.
15260 The linker for shared libraries, @file{/usr/bin/libtool}, fails
15261 and prints an error if asked to create a shared library with a less
15262 restrictive subtype than its input files (for instance, trying to put
15263 a @samp{ppc970} object file in a @samp{ppc7400} library).  The linker
15264 for executables, @command{ld}, quietly gives the executable the most
15265 restrictive subtype of any of its input files.
15267 @table @gcctabopt
15268 @item -F@var{dir}
15269 @opindex F
15270 Add the framework directory @var{dir} to the head of the list of
15271 directories to be searched for header files.  These directories are
15272 interleaved with those specified by @option{-I} options and are
15273 scanned in a left-to-right order.
15275 A framework directory is a directory with frameworks in it.  A
15276 framework is a directory with a @file{Headers} and/or
15277 @file{PrivateHeaders} directory contained directly in it that ends
15278 in @file{.framework}.  The name of a framework is the name of this
15279 directory excluding the @file{.framework}.  Headers associated with
15280 the framework are found in one of those two directories, with
15281 @file{Headers} being searched first.  A subframework is a framework
15282 directory that is in a framework's @file{Frameworks} directory.
15283 Includes of subframework headers can only appear in a header of a
15284 framework that contains the subframework, or in a sibling subframework
15285 header.  Two subframeworks are siblings if they occur in the same
15286 framework.  A subframework should not have the same name as a
15287 framework; a warning is issued if this is violated.  Currently a
15288 subframework cannot have subframeworks; in the future, the mechanism
15289 may be extended to support this.  The standard frameworks can be found
15290 in @file{/System/Library/Frameworks} and
15291 @file{/Library/Frameworks}.  An example include looks like
15292 @code{#include <Framework/header.h>}, where @file{Framework} denotes
15293 the name of the framework and @file{header.h} is found in the
15294 @file{PrivateHeaders} or @file{Headers} directory.
15296 @item -iframework@var{dir}
15297 @opindex iframework
15298 Like @option{-F} except the directory is a treated as a system
15299 directory.  The main difference between this @option{-iframework} and
15300 @option{-F} is that with @option{-iframework} the compiler does not
15301 warn about constructs contained within header files found via
15302 @var{dir}.  This option is valid only for the C family of languages.
15304 @item -gused
15305 @opindex gused
15306 Emit debugging information for symbols that are used.  For stabs
15307 debugging format, this enables @option{-feliminate-unused-debug-symbols}.
15308 This is by default ON@.
15310 @item -gfull
15311 @opindex gfull
15312 Emit debugging information for all symbols and types.
15314 @item -mmacosx-version-min=@var{version}
15315 The earliest version of MacOS X that this executable will run on
15316 is @var{version}.  Typical values of @var{version} include @code{10.1},
15317 @code{10.2}, and @code{10.3.9}.
15319 If the compiler was built to use the system's headers by default,
15320 then the default for this option is the system version on which the
15321 compiler is running, otherwise the default is to make choices that
15322 are compatible with as many systems and code bases as possible.
15324 @item -mkernel
15325 @opindex mkernel
15326 Enable kernel development mode.  The @option{-mkernel} option sets
15327 @option{-static}, @option{-fno-common}, @option{-fno-use-cxa-atexit},
15328 @option{-fno-exceptions}, @option{-fno-non-call-exceptions},
15329 @option{-fapple-kext}, @option{-fno-weak} and @option{-fno-rtti} where
15330 applicable.  This mode also sets @option{-mno-altivec},
15331 @option{-msoft-float}, @option{-fno-builtin} and
15332 @option{-mlong-branch} for PowerPC targets.
15334 @item -mone-byte-bool
15335 @opindex mone-byte-bool
15336 Override the defaults for @code{bool} so that @code{sizeof(bool)==1}.
15337 By default @code{sizeof(bool)} is @code{4} when compiling for
15338 Darwin/PowerPC and @code{1} when compiling for Darwin/x86, so this
15339 option has no effect on x86.
15341 @strong{Warning:} The @option{-mone-byte-bool} switch causes GCC
15342 to generate code that is not binary compatible with code generated
15343 without that switch.  Using this switch may require recompiling all
15344 other modules in a program, including system libraries.  Use this
15345 switch to conform to a non-default data model.
15347 @item -mfix-and-continue
15348 @itemx -ffix-and-continue
15349 @itemx -findirect-data
15350 @opindex mfix-and-continue
15351 @opindex ffix-and-continue
15352 @opindex findirect-data
15353 Generate code suitable for fast turnaround development, such as to
15354 allow GDB to dynamically load @file{.o} files into already-running
15355 programs.  @option{-findirect-data} and @option{-ffix-and-continue}
15356 are provided for backwards compatibility.
15358 @item -all_load
15359 @opindex all_load
15360 Loads all members of static archive libraries.
15361 See man ld(1) for more information.
15363 @item -arch_errors_fatal
15364 @opindex arch_errors_fatal
15365 Cause the errors having to do with files that have the wrong architecture
15366 to be fatal.
15368 @item -bind_at_load
15369 @opindex bind_at_load
15370 Causes the output file to be marked such that the dynamic linker will
15371 bind all undefined references when the file is loaded or launched.
15373 @item -bundle
15374 @opindex bundle
15375 Produce a Mach-o bundle format file.
15376 See man ld(1) for more information.
15378 @item -bundle_loader @var{executable}
15379 @opindex bundle_loader
15380 This option specifies the @var{executable} that will load the build
15381 output file being linked.  See man ld(1) for more information.
15383 @item -dynamiclib
15384 @opindex dynamiclib
15385 When passed this option, GCC produces a dynamic library instead of
15386 an executable when linking, using the Darwin @file{libtool} command.
15388 @item -force_cpusubtype_ALL
15389 @opindex force_cpusubtype_ALL
15390 This causes GCC's output file to have the @samp{ALL} subtype, instead of
15391 one controlled by the @option{-mcpu} or @option{-march} option.
15393 @item -allowable_client  @var{client_name}
15394 @itemx -client_name
15395 @itemx -compatibility_version
15396 @itemx -current_version
15397 @itemx -dead_strip
15398 @itemx -dependency-file
15399 @itemx -dylib_file
15400 @itemx -dylinker_install_name
15401 @itemx -dynamic
15402 @itemx -exported_symbols_list
15403 @itemx -filelist
15404 @need 800
15405 @itemx -flat_namespace
15406 @itemx -force_flat_namespace
15407 @itemx -headerpad_max_install_names
15408 @itemx -image_base
15409 @itemx -init
15410 @itemx -install_name
15411 @itemx -keep_private_externs
15412 @itemx -multi_module
15413 @itemx -multiply_defined
15414 @itemx -multiply_defined_unused
15415 @need 800
15416 @itemx -noall_load
15417 @itemx -no_dead_strip_inits_and_terms
15418 @itemx -nofixprebinding
15419 @itemx -nomultidefs
15420 @itemx -noprebind
15421 @itemx -noseglinkedit
15422 @itemx -pagezero_size
15423 @itemx -prebind
15424 @itemx -prebind_all_twolevel_modules
15425 @itemx -private_bundle
15426 @need 800
15427 @itemx -read_only_relocs
15428 @itemx -sectalign
15429 @itemx -sectobjectsymbols
15430 @itemx -whyload
15431 @itemx -seg1addr
15432 @itemx -sectcreate
15433 @itemx -sectobjectsymbols
15434 @itemx -sectorder
15435 @itemx -segaddr
15436 @itemx -segs_read_only_addr
15437 @need 800
15438 @itemx -segs_read_write_addr
15439 @itemx -seg_addr_table
15440 @itemx -seg_addr_table_filename
15441 @itemx -seglinkedit
15442 @itemx -segprot
15443 @itemx -segs_read_only_addr
15444 @itemx -segs_read_write_addr
15445 @itemx -single_module
15446 @itemx -static
15447 @itemx -sub_library
15448 @need 800
15449 @itemx -sub_umbrella
15450 @itemx -twolevel_namespace
15451 @itemx -umbrella
15452 @itemx -undefined
15453 @itemx -unexported_symbols_list
15454 @itemx -weak_reference_mismatches
15455 @itemx -whatsloaded
15456 @opindex allowable_client
15457 @opindex client_name
15458 @opindex compatibility_version
15459 @opindex current_version
15460 @opindex dead_strip
15461 @opindex dependency-file
15462 @opindex dylib_file
15463 @opindex dylinker_install_name
15464 @opindex dynamic
15465 @opindex exported_symbols_list
15466 @opindex filelist
15467 @opindex flat_namespace
15468 @opindex force_flat_namespace
15469 @opindex headerpad_max_install_names
15470 @opindex image_base
15471 @opindex init
15472 @opindex install_name
15473 @opindex keep_private_externs
15474 @opindex multi_module
15475 @opindex multiply_defined
15476 @opindex multiply_defined_unused
15477 @opindex noall_load
15478 @opindex no_dead_strip_inits_and_terms
15479 @opindex nofixprebinding
15480 @opindex nomultidefs
15481 @opindex noprebind
15482 @opindex noseglinkedit
15483 @opindex pagezero_size
15484 @opindex prebind
15485 @opindex prebind_all_twolevel_modules
15486 @opindex private_bundle
15487 @opindex read_only_relocs
15488 @opindex sectalign
15489 @opindex sectobjectsymbols
15490 @opindex whyload
15491 @opindex seg1addr
15492 @opindex sectcreate
15493 @opindex sectobjectsymbols
15494 @opindex sectorder
15495 @opindex segaddr
15496 @opindex segs_read_only_addr
15497 @opindex segs_read_write_addr
15498 @opindex seg_addr_table
15499 @opindex seg_addr_table_filename
15500 @opindex seglinkedit
15501 @opindex segprot
15502 @opindex segs_read_only_addr
15503 @opindex segs_read_write_addr
15504 @opindex single_module
15505 @opindex static
15506 @opindex sub_library
15507 @opindex sub_umbrella
15508 @opindex twolevel_namespace
15509 @opindex umbrella
15510 @opindex undefined
15511 @opindex unexported_symbols_list
15512 @opindex weak_reference_mismatches
15513 @opindex whatsloaded
15514 These options are passed to the Darwin linker.  The Darwin linker man page
15515 describes them in detail.
15516 @end table
15518 @node DEC Alpha Options
15519 @subsection DEC Alpha Options
15521 These @samp{-m} options are defined for the DEC Alpha implementations:
15523 @table @gcctabopt
15524 @item -mno-soft-float
15525 @itemx -msoft-float
15526 @opindex mno-soft-float
15527 @opindex msoft-float
15528 Use (do not use) the hardware floating-point instructions for
15529 floating-point operations.  When @option{-msoft-float} is specified,
15530 functions in @file{libgcc.a} are used to perform floating-point
15531 operations.  Unless they are replaced by routines that emulate the
15532 floating-point operations, or compiled in such a way as to call such
15533 emulations routines, these routines issue floating-point
15534 operations.   If you are compiling for an Alpha without floating-point
15535 operations, you must ensure that the library is built so as not to call
15536 them.
15538 Note that Alpha implementations without floating-point operations are
15539 required to have floating-point registers.
15541 @item -mfp-reg
15542 @itemx -mno-fp-regs
15543 @opindex mfp-reg
15544 @opindex mno-fp-regs
15545 Generate code that uses (does not use) the floating-point register set.
15546 @option{-mno-fp-regs} implies @option{-msoft-float}.  If the floating-point
15547 register set is not used, floating-point operands are passed in integer
15548 registers as if they were integers and floating-point results are passed
15549 in @code{$0} instead of @code{$f0}.  This is a non-standard calling sequence,
15550 so any function with a floating-point argument or return value called by code
15551 compiled with @option{-mno-fp-regs} must also be compiled with that
15552 option.
15554 A typical use of this option is building a kernel that does not use,
15555 and hence need not save and restore, any floating-point registers.
15557 @item -mieee
15558 @opindex mieee
15559 The Alpha architecture implements floating-point hardware optimized for
15560 maximum performance.  It is mostly compliant with the IEEE floating-point
15561 standard.  However, for full compliance, software assistance is
15562 required.  This option generates code fully IEEE-compliant code
15563 @emph{except} that the @var{inexact-flag} is not maintained (see below).
15564 If this option is turned on, the preprocessor macro @code{_IEEE_FP} is
15565 defined during compilation.  The resulting code is less efficient but is
15566 able to correctly support denormalized numbers and exceptional IEEE
15567 values such as not-a-number and plus/minus infinity.  Other Alpha
15568 compilers call this option @option{-ieee_with_no_inexact}.
15570 @item -mieee-with-inexact
15571 @opindex mieee-with-inexact
15572 This is like @option{-mieee} except the generated code also maintains
15573 the IEEE @var{inexact-flag}.  Turning on this option causes the
15574 generated code to implement fully-compliant IEEE math.  In addition to
15575 @code{_IEEE_FP}, @code{_IEEE_FP_EXACT} is defined as a preprocessor
15576 macro.  On some Alpha implementations the resulting code may execute
15577 significantly slower than the code generated by default.  Since there is
15578 very little code that depends on the @var{inexact-flag}, you should
15579 normally not specify this option.  Other Alpha compilers call this
15580 option @option{-ieee_with_inexact}.
15582 @item -mfp-trap-mode=@var{trap-mode}
15583 @opindex mfp-trap-mode
15584 This option controls what floating-point related traps are enabled.
15585 Other Alpha compilers call this option @option{-fptm @var{trap-mode}}.
15586 The trap mode can be set to one of four values:
15588 @table @samp
15589 @item n
15590 This is the default (normal) setting.  The only traps that are enabled
15591 are the ones that cannot be disabled in software (e.g., division by zero
15592 trap).
15594 @item u
15595 In addition to the traps enabled by @samp{n}, underflow traps are enabled
15596 as well.
15598 @item su
15599 Like @samp{u}, but the instructions are marked to be safe for software
15600 completion (see Alpha architecture manual for details).
15602 @item sui
15603 Like @samp{su}, but inexact traps are enabled as well.
15604 @end table
15606 @item -mfp-rounding-mode=@var{rounding-mode}
15607 @opindex mfp-rounding-mode
15608 Selects the IEEE rounding mode.  Other Alpha compilers call this option
15609 @option{-fprm @var{rounding-mode}}.  The @var{rounding-mode} can be one
15612 @table @samp
15613 @item n
15614 Normal IEEE rounding mode.  Floating-point numbers are rounded towards
15615 the nearest machine number or towards the even machine number in case
15616 of a tie.
15618 @item m
15619 Round towards minus infinity.
15621 @item c
15622 Chopped rounding mode.  Floating-point numbers are rounded towards zero.
15624 @item d
15625 Dynamic rounding mode.  A field in the floating-point control register
15626 (@var{fpcr}, see Alpha architecture reference manual) controls the
15627 rounding mode in effect.  The C library initializes this register for
15628 rounding towards plus infinity.  Thus, unless your program modifies the
15629 @var{fpcr}, @samp{d} corresponds to round towards plus infinity.
15630 @end table
15632 @item -mtrap-precision=@var{trap-precision}
15633 @opindex mtrap-precision
15634 In the Alpha architecture, floating-point traps are imprecise.  This
15635 means without software assistance it is impossible to recover from a
15636 floating trap and program execution normally needs to be terminated.
15637 GCC can generate code that can assist operating system trap handlers
15638 in determining the exact location that caused a floating-point trap.
15639 Depending on the requirements of an application, different levels of
15640 precisions can be selected:
15642 @table @samp
15643 @item p
15644 Program precision.  This option is the default and means a trap handler
15645 can only identify which program caused a floating-point exception.
15647 @item f
15648 Function precision.  The trap handler can determine the function that
15649 caused a floating-point exception.
15651 @item i
15652 Instruction precision.  The trap handler can determine the exact
15653 instruction that caused a floating-point exception.
15654 @end table
15656 Other Alpha compilers provide the equivalent options called
15657 @option{-scope_safe} and @option{-resumption_safe}.
15659 @item -mieee-conformant
15660 @opindex mieee-conformant
15661 This option marks the generated code as IEEE conformant.  You must not
15662 use this option unless you also specify @option{-mtrap-precision=i} and either
15663 @option{-mfp-trap-mode=su} or @option{-mfp-trap-mode=sui}.  Its only effect
15664 is to emit the line @samp{.eflag 48} in the function prologue of the
15665 generated assembly file.
15667 @item -mbuild-constants
15668 @opindex mbuild-constants
15669 Normally GCC examines a 32- or 64-bit integer constant to
15670 see if it can construct it from smaller constants in two or three
15671 instructions.  If it cannot, it outputs the constant as a literal and
15672 generates code to load it from the data segment at run time.
15674 Use this option to require GCC to construct @emph{all} integer constants
15675 using code, even if it takes more instructions (the maximum is six).
15677 You typically use this option to build a shared library dynamic
15678 loader.  Itself a shared library, it must relocate itself in memory
15679 before it can find the variables and constants in its own data segment.
15681 @item -mbwx
15682 @itemx -mno-bwx
15683 @itemx -mcix
15684 @itemx -mno-cix
15685 @itemx -mfix
15686 @itemx -mno-fix
15687 @itemx -mmax
15688 @itemx -mno-max
15689 @opindex mbwx
15690 @opindex mno-bwx
15691 @opindex mcix
15692 @opindex mno-cix
15693 @opindex mfix
15694 @opindex mno-fix
15695 @opindex mmax
15696 @opindex mno-max
15697 Indicate whether GCC should generate code to use the optional BWX,
15698 CIX, FIX and MAX instruction sets.  The default is to use the instruction
15699 sets supported by the CPU type specified via @option{-mcpu=} option or that
15700 of the CPU on which GCC was built if none is specified.
15702 @item -mfloat-vax
15703 @itemx -mfloat-ieee
15704 @opindex mfloat-vax
15705 @opindex mfloat-ieee
15706 Generate code that uses (does not use) VAX F and G floating-point
15707 arithmetic instead of IEEE single and double precision.
15709 @item -mexplicit-relocs
15710 @itemx -mno-explicit-relocs
15711 @opindex mexplicit-relocs
15712 @opindex mno-explicit-relocs
15713 Older Alpha assemblers provided no way to generate symbol relocations
15714 except via assembler macros.  Use of these macros does not allow
15715 optimal instruction scheduling.  GNU binutils as of version 2.12
15716 supports a new syntax that allows the compiler to explicitly mark
15717 which relocations should apply to which instructions.  This option
15718 is mostly useful for debugging, as GCC detects the capabilities of
15719 the assembler when it is built and sets the default accordingly.
15721 @item -msmall-data
15722 @itemx -mlarge-data
15723 @opindex msmall-data
15724 @opindex mlarge-data
15725 When @option{-mexplicit-relocs} is in effect, static data is
15726 accessed via @dfn{gp-relative} relocations.  When @option{-msmall-data}
15727 is used, objects 8 bytes long or smaller are placed in a @dfn{small data area}
15728 (the @code{.sdata} and @code{.sbss} sections) and are accessed via
15729 16-bit relocations off of the @code{$gp} register.  This limits the
15730 size of the small data area to 64KB, but allows the variables to be
15731 directly accessed via a single instruction.
15733 The default is @option{-mlarge-data}.  With this option the data area
15734 is limited to just below 2GB@.  Programs that require more than 2GB of
15735 data must use @code{malloc} or @code{mmap} to allocate the data in the
15736 heap instead of in the program's data segment.
15738 When generating code for shared libraries, @option{-fpic} implies
15739 @option{-msmall-data} and @option{-fPIC} implies @option{-mlarge-data}.
15741 @item -msmall-text
15742 @itemx -mlarge-text
15743 @opindex msmall-text
15744 @opindex mlarge-text
15745 When @option{-msmall-text} is used, the compiler assumes that the
15746 code of the entire program (or shared library) fits in 4MB, and is
15747 thus reachable with a branch instruction.  When @option{-msmall-data}
15748 is used, the compiler can assume that all local symbols share the
15749 same @code{$gp} value, and thus reduce the number of instructions
15750 required for a function call from 4 to 1.
15752 The default is @option{-mlarge-text}.
15754 @item -mcpu=@var{cpu_type}
15755 @opindex mcpu
15756 Set the instruction set and instruction scheduling parameters for
15757 machine type @var{cpu_type}.  You can specify either the @samp{EV}
15758 style name or the corresponding chip number.  GCC supports scheduling
15759 parameters for the EV4, EV5 and EV6 family of processors and
15760 chooses the default values for the instruction set from the processor
15761 you specify.  If you do not specify a processor type, GCC defaults
15762 to the processor on which the compiler was built.
15764 Supported values for @var{cpu_type} are
15766 @table @samp
15767 @item ev4
15768 @itemx ev45
15769 @itemx 21064
15770 Schedules as an EV4 and has no instruction set extensions.
15772 @item ev5
15773 @itemx 21164
15774 Schedules as an EV5 and has no instruction set extensions.
15776 @item ev56
15777 @itemx 21164a
15778 Schedules as an EV5 and supports the BWX extension.
15780 @item pca56
15781 @itemx 21164pc
15782 @itemx 21164PC
15783 Schedules as an EV5 and supports the BWX and MAX extensions.
15785 @item ev6
15786 @itemx 21264
15787 Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
15789 @item ev67
15790 @itemx 21264a
15791 Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
15792 @end table
15794 Native toolchains also support the value @samp{native},
15795 which selects the best architecture option for the host processor.
15796 @option{-mcpu=native} has no effect if GCC does not recognize
15797 the processor.
15799 @item -mtune=@var{cpu_type}
15800 @opindex mtune
15801 Set only the instruction scheduling parameters for machine type
15802 @var{cpu_type}.  The instruction set is not changed.
15804 Native toolchains also support the value @samp{native},
15805 which selects the best architecture option for the host processor.
15806 @option{-mtune=native} has no effect if GCC does not recognize
15807 the processor.
15809 @item -mmemory-latency=@var{time}
15810 @opindex mmemory-latency
15811 Sets the latency the scheduler should assume for typical memory
15812 references as seen by the application.  This number is highly
15813 dependent on the memory access patterns used by the application
15814 and the size of the external cache on the machine.
15816 Valid options for @var{time} are
15818 @table @samp
15819 @item @var{number}
15820 A decimal number representing clock cycles.
15822 @item L1
15823 @itemx L2
15824 @itemx L3
15825 @itemx main
15826 The compiler contains estimates of the number of clock cycles for
15827 ``typical'' EV4 & EV5 hardware for the Level 1, 2 & 3 caches
15828 (also called Dcache, Scache, and Bcache), as well as to main memory.
15829 Note that L3 is only valid for EV5.
15831 @end table
15832 @end table
15834 @node FR30 Options
15835 @subsection FR30 Options
15836 @cindex FR30 Options
15838 These options are defined specifically for the FR30 port.
15840 @table @gcctabopt
15842 @item -msmall-model
15843 @opindex msmall-model
15844 Use the small address space model.  This can produce smaller code, but
15845 it does assume that all symbolic values and addresses fit into a
15846 20-bit range.
15848 @item -mno-lsim
15849 @opindex mno-lsim
15850 Assume that runtime support has been provided and so there is no need
15851 to include the simulator library (@file{libsim.a}) on the linker
15852 command line.
15854 @end table
15856 @node FT32 Options
15857 @subsection FT32 Options
15858 @cindex FT32 Options
15860 These options are defined specifically for the FT32 port.
15862 @table @gcctabopt
15864 @item -msim
15865 @opindex msim
15866 Specifies that the program will be run on the simulator.  This causes
15867 an alternate runtime startup and library to be linked.
15868 You must not use this option when generating programs that will run on
15869 real hardware; you must provide your own runtime library for whatever
15870 I/O functions are needed.
15872 @item -mlra
15873 @opindex mlra
15874 Enable Local Register Allocation.  This is still experimental for FT32,
15875 so by default the compiler uses standard reload.
15877 @item -mnodiv
15878 @opindex mnodiv
15879 Do not use div and mod instructions.
15881 @end table
15883 @node FRV Options
15884 @subsection FRV Options
15885 @cindex FRV Options
15887 @table @gcctabopt
15888 @item -mgpr-32
15889 @opindex mgpr-32
15891 Only use the first 32 general-purpose registers.
15893 @item -mgpr-64
15894 @opindex mgpr-64
15896 Use all 64 general-purpose registers.
15898 @item -mfpr-32
15899 @opindex mfpr-32
15901 Use only the first 32 floating-point registers.
15903 @item -mfpr-64
15904 @opindex mfpr-64
15906 Use all 64 floating-point registers.
15908 @item -mhard-float
15909 @opindex mhard-float
15911 Use hardware instructions for floating-point operations.
15913 @item -msoft-float
15914 @opindex msoft-float
15916 Use library routines for floating-point operations.
15918 @item -malloc-cc
15919 @opindex malloc-cc
15921 Dynamically allocate condition code registers.
15923 @item -mfixed-cc
15924 @opindex mfixed-cc
15926 Do not try to dynamically allocate condition code registers, only
15927 use @code{icc0} and @code{fcc0}.
15929 @item -mdword
15930 @opindex mdword
15932 Change ABI to use double word insns.
15934 @item -mno-dword
15935 @opindex mno-dword
15937 Do not use double word instructions.
15939 @item -mdouble
15940 @opindex mdouble
15942 Use floating-point double instructions.
15944 @item -mno-double
15945 @opindex mno-double
15947 Do not use floating-point double instructions.
15949 @item -mmedia
15950 @opindex mmedia
15952 Use media instructions.
15954 @item -mno-media
15955 @opindex mno-media
15957 Do not use media instructions.
15959 @item -mmuladd
15960 @opindex mmuladd
15962 Use multiply and add/subtract instructions.
15964 @item -mno-muladd
15965 @opindex mno-muladd
15967 Do not use multiply and add/subtract instructions.
15969 @item -mfdpic
15970 @opindex mfdpic
15972 Select the FDPIC ABI, which uses function descriptors to represent
15973 pointers to functions.  Without any PIC/PIE-related options, it
15974 implies @option{-fPIE}.  With @option{-fpic} or @option{-fpie}, it
15975 assumes GOT entries and small data are within a 12-bit range from the
15976 GOT base address; with @option{-fPIC} or @option{-fPIE}, GOT offsets
15977 are computed with 32 bits.
15978 With a @samp{bfin-elf} target, this option implies @option{-msim}.
15980 @item -minline-plt
15981 @opindex minline-plt
15983 Enable inlining of PLT entries in function calls to functions that are
15984 not known to bind locally.  It has no effect without @option{-mfdpic}.
15985 It's enabled by default if optimizing for speed and compiling for
15986 shared libraries (i.e., @option{-fPIC} or @option{-fpic}), or when an
15987 optimization option such as @option{-O3} or above is present in the
15988 command line.
15990 @item -mTLS
15991 @opindex mTLS
15993 Assume a large TLS segment when generating thread-local code.
15995 @item -mtls
15996 @opindex mtls
15998 Do not assume a large TLS segment when generating thread-local code.
16000 @item -mgprel-ro
16001 @opindex mgprel-ro
16003 Enable the use of @code{GPREL} relocations in the FDPIC ABI for data
16004 that is known to be in read-only sections.  It's enabled by default,
16005 except for @option{-fpic} or @option{-fpie}: even though it may help
16006 make the global offset table smaller, it trades 1 instruction for 4.
16007 With @option{-fPIC} or @option{-fPIE}, it trades 3 instructions for 4,
16008 one of which may be shared by multiple symbols, and it avoids the need
16009 for a GOT entry for the referenced symbol, so it's more likely to be a
16010 win.  If it is not, @option{-mno-gprel-ro} can be used to disable it.
16012 @item -multilib-library-pic
16013 @opindex multilib-library-pic
16015 Link with the (library, not FD) pic libraries.  It's implied by
16016 @option{-mlibrary-pic}, as well as by @option{-fPIC} and
16017 @option{-fpic} without @option{-mfdpic}.  You should never have to use
16018 it explicitly.
16020 @item -mlinked-fp
16021 @opindex mlinked-fp
16023 Follow the EABI requirement of always creating a frame pointer whenever
16024 a stack frame is allocated.  This option is enabled by default and can
16025 be disabled with @option{-mno-linked-fp}.
16027 @item -mlong-calls
16028 @opindex mlong-calls
16030 Use indirect addressing to call functions outside the current
16031 compilation unit.  This allows the functions to be placed anywhere
16032 within the 32-bit address space.
16034 @item -malign-labels
16035 @opindex malign-labels
16037 Try to align labels to an 8-byte boundary by inserting NOPs into the
16038 previous packet.  This option only has an effect when VLIW packing
16039 is enabled.  It doesn't create new packets; it merely adds NOPs to
16040 existing ones.
16042 @item -mlibrary-pic
16043 @opindex mlibrary-pic
16045 Generate position-independent EABI code.
16047 @item -macc-4
16048 @opindex macc-4
16050 Use only the first four media accumulator registers.
16052 @item -macc-8
16053 @opindex macc-8
16055 Use all eight media accumulator registers.
16057 @item -mpack
16058 @opindex mpack
16060 Pack VLIW instructions.
16062 @item -mno-pack
16063 @opindex mno-pack
16065 Do not pack VLIW instructions.
16067 @item -mno-eflags
16068 @opindex mno-eflags
16070 Do not mark ABI switches in e_flags.
16072 @item -mcond-move
16073 @opindex mcond-move
16075 Enable the use of conditional-move instructions (default).
16077 This switch is mainly for debugging the compiler and will likely be removed
16078 in a future version.
16080 @item -mno-cond-move
16081 @opindex mno-cond-move
16083 Disable the use of conditional-move instructions.
16085 This switch is mainly for debugging the compiler and will likely be removed
16086 in a future version.
16088 @item -mscc
16089 @opindex mscc
16091 Enable the use of conditional set instructions (default).
16093 This switch is mainly for debugging the compiler and will likely be removed
16094 in a future version.
16096 @item -mno-scc
16097 @opindex mno-scc
16099 Disable the use of conditional set instructions.
16101 This switch is mainly for debugging the compiler and will likely be removed
16102 in a future version.
16104 @item -mcond-exec
16105 @opindex mcond-exec
16107 Enable the use of conditional execution (default).
16109 This switch is mainly for debugging the compiler and will likely be removed
16110 in a future version.
16112 @item -mno-cond-exec
16113 @opindex mno-cond-exec
16115 Disable the use of conditional execution.
16117 This switch is mainly for debugging the compiler and will likely be removed
16118 in a future version.
16120 @item -mvliw-branch
16121 @opindex mvliw-branch
16123 Run a pass to pack branches into VLIW instructions (default).
16125 This switch is mainly for debugging the compiler and will likely be removed
16126 in a future version.
16128 @item -mno-vliw-branch
16129 @opindex mno-vliw-branch
16131 Do not run a pass to pack branches into VLIW instructions.
16133 This switch is mainly for debugging the compiler and will likely be removed
16134 in a future version.
16136 @item -mmulti-cond-exec
16137 @opindex mmulti-cond-exec
16139 Enable optimization of @code{&&} and @code{||} in conditional execution
16140 (default).
16142 This switch is mainly for debugging the compiler and will likely be removed
16143 in a future version.
16145 @item -mno-multi-cond-exec
16146 @opindex mno-multi-cond-exec
16148 Disable optimization of @code{&&} and @code{||} in conditional execution.
16150 This switch is mainly for debugging the compiler and will likely be removed
16151 in a future version.
16153 @item -mnested-cond-exec
16154 @opindex mnested-cond-exec
16156 Enable nested conditional execution optimizations (default).
16158 This switch is mainly for debugging the compiler and will likely be removed
16159 in a future version.
16161 @item -mno-nested-cond-exec
16162 @opindex mno-nested-cond-exec
16164 Disable nested conditional execution optimizations.
16166 This switch is mainly for debugging the compiler and will likely be removed
16167 in a future version.
16169 @item -moptimize-membar
16170 @opindex moptimize-membar
16172 This switch removes redundant @code{membar} instructions from the
16173 compiler-generated code.  It is enabled by default.
16175 @item -mno-optimize-membar
16176 @opindex mno-optimize-membar
16178 This switch disables the automatic removal of redundant @code{membar}
16179 instructions from the generated code.
16181 @item -mtomcat-stats
16182 @opindex mtomcat-stats
16184 Cause gas to print out tomcat statistics.
16186 @item -mcpu=@var{cpu}
16187 @opindex mcpu
16189 Select the processor type for which to generate code.  Possible values are
16190 @samp{frv}, @samp{fr550}, @samp{tomcat}, @samp{fr500}, @samp{fr450},
16191 @samp{fr405}, @samp{fr400}, @samp{fr300} and @samp{simple}.
16193 @end table
16195 @node GNU/Linux Options
16196 @subsection GNU/Linux Options
16198 These @samp{-m} options are defined for GNU/Linux targets:
16200 @table @gcctabopt
16201 @item -mglibc
16202 @opindex mglibc
16203 Use the GNU C library.  This is the default except
16204 on @samp{*-*-linux-*uclibc*}, @samp{*-*-linux-*musl*} and
16205 @samp{*-*-linux-*android*} targets.
16207 @item -muclibc
16208 @opindex muclibc
16209 Use uClibc C library.  This is the default on
16210 @samp{*-*-linux-*uclibc*} targets.
16212 @item -mmusl
16213 @opindex mmusl
16214 Use the musl C library.  This is the default on
16215 @samp{*-*-linux-*musl*} targets.
16217 @item -mbionic
16218 @opindex mbionic
16219 Use Bionic C library.  This is the default on
16220 @samp{*-*-linux-*android*} targets.
16222 @item -mandroid
16223 @opindex mandroid
16224 Compile code compatible with Android platform.  This is the default on
16225 @samp{*-*-linux-*android*} targets.
16227 When compiling, this option enables @option{-mbionic}, @option{-fPIC},
16228 @option{-fno-exceptions} and @option{-fno-rtti} by default.  When linking,
16229 this option makes the GCC driver pass Android-specific options to the linker.
16230 Finally, this option causes the preprocessor macro @code{__ANDROID__}
16231 to be defined.
16233 @item -tno-android-cc
16234 @opindex tno-android-cc
16235 Disable compilation effects of @option{-mandroid}, i.e., do not enable
16236 @option{-mbionic}, @option{-fPIC}, @option{-fno-exceptions} and
16237 @option{-fno-rtti} by default.
16239 @item -tno-android-ld
16240 @opindex tno-android-ld
16241 Disable linking effects of @option{-mandroid}, i.e., pass standard Linux
16242 linking options to the linker.
16244 @end table
16246 @node H8/300 Options
16247 @subsection H8/300 Options
16249 These @samp{-m} options are defined for the H8/300 implementations:
16251 @table @gcctabopt
16252 @item -mrelax
16253 @opindex mrelax
16254 Shorten some address references at link time, when possible; uses the
16255 linker option @option{-relax}.  @xref{H8/300,, @code{ld} and the H8/300,
16256 ld, Using ld}, for a fuller description.
16258 @item -mh
16259 @opindex mh
16260 Generate code for the H8/300H@.
16262 @item -ms
16263 @opindex ms
16264 Generate code for the H8S@.
16266 @item -mn
16267 @opindex mn
16268 Generate code for the H8S and H8/300H in the normal mode.  This switch
16269 must be used either with @option{-mh} or @option{-ms}.
16271 @item -ms2600
16272 @opindex ms2600
16273 Generate code for the H8S/2600.  This switch must be used with @option{-ms}.
16275 @item -mexr
16276 @opindex mexr
16277 Extended registers are stored on stack before execution of function
16278 with monitor attribute. Default option is @option{-mexr}.
16279 This option is valid only for H8S targets.
16281 @item -mno-exr
16282 @opindex mno-exr
16283 Extended registers are not stored on stack before execution of function 
16284 with monitor attribute. Default option is @option{-mno-exr}. 
16285 This option is valid only for H8S targets.
16287 @item -mint32
16288 @opindex mint32
16289 Make @code{int} data 32 bits by default.
16291 @item -malign-300
16292 @opindex malign-300
16293 On the H8/300H and H8S, use the same alignment rules as for the H8/300.
16294 The default for the H8/300H and H8S is to align longs and floats on
16295 4-byte boundaries.
16296 @option{-malign-300} causes them to be aligned on 2-byte boundaries.
16297 This option has no effect on the H8/300.
16298 @end table
16300 @node HPPA Options
16301 @subsection HPPA Options
16302 @cindex HPPA Options
16304 These @samp{-m} options are defined for the HPPA family of computers:
16306 @table @gcctabopt
16307 @item -march=@var{architecture-type}
16308 @opindex march
16309 Generate code for the specified architecture.  The choices for
16310 @var{architecture-type} are @samp{1.0} for PA 1.0, @samp{1.1} for PA
16311 1.1, and @samp{2.0} for PA 2.0 processors.  Refer to
16312 @file{/usr/lib/sched.models} on an HP-UX system to determine the proper
16313 architecture option for your machine.  Code compiled for lower numbered
16314 architectures runs on higher numbered architectures, but not the
16315 other way around.
16317 @item -mpa-risc-1-0
16318 @itemx -mpa-risc-1-1
16319 @itemx -mpa-risc-2-0
16320 @opindex mpa-risc-1-0
16321 @opindex mpa-risc-1-1
16322 @opindex mpa-risc-2-0
16323 Synonyms for @option{-march=1.0}, @option{-march=1.1}, and @option{-march=2.0} respectively.
16325 @item -mjump-in-delay
16326 @opindex mjump-in-delay
16327 This option is ignored and provided for compatibility purposes only.
16329 @item -mdisable-fpregs
16330 @opindex mdisable-fpregs
16331 Prevent floating-point registers from being used in any manner.  This is
16332 necessary for compiling kernels that perform lazy context switching of
16333 floating-point registers.  If you use this option and attempt to perform
16334 floating-point operations, the compiler aborts.
16336 @item -mdisable-indexing
16337 @opindex mdisable-indexing
16338 Prevent the compiler from using indexing address modes.  This avoids some
16339 rather obscure problems when compiling MIG generated code under MACH@.
16341 @item -mno-space-regs
16342 @opindex mno-space-regs
16343 Generate code that assumes the target has no space registers.  This allows
16344 GCC to generate faster indirect calls and use unscaled index address modes.
16346 Such code is suitable for level 0 PA systems and kernels.
16348 @item -mfast-indirect-calls
16349 @opindex mfast-indirect-calls
16350 Generate code that assumes calls never cross space boundaries.  This
16351 allows GCC to emit code that performs faster indirect calls.
16353 This option does not work in the presence of shared libraries or nested
16354 functions.
16356 @item -mfixed-range=@var{register-range}
16357 @opindex mfixed-range
16358 Generate code treating the given register range as fixed registers.
16359 A fixed register is one that the register allocator cannot use.  This is
16360 useful when compiling kernel code.  A register range is specified as
16361 two registers separated by a dash.  Multiple register ranges can be
16362 specified separated by a comma.
16364 @item -mlong-load-store
16365 @opindex mlong-load-store
16366 Generate 3-instruction load and store sequences as sometimes required by
16367 the HP-UX 10 linker.  This is equivalent to the @samp{+k} option to
16368 the HP compilers.
16370 @item -mportable-runtime
16371 @opindex mportable-runtime
16372 Use the portable calling conventions proposed by HP for ELF systems.
16374 @item -mgas
16375 @opindex mgas
16376 Enable the use of assembler directives only GAS understands.
16378 @item -mschedule=@var{cpu-type}
16379 @opindex mschedule
16380 Schedule code according to the constraints for the machine type
16381 @var{cpu-type}.  The choices for @var{cpu-type} are @samp{700}
16382 @samp{7100}, @samp{7100LC}, @samp{7200}, @samp{7300} and @samp{8000}.  Refer
16383 to @file{/usr/lib/sched.models} on an HP-UX system to determine the
16384 proper scheduling option for your machine.  The default scheduling is
16385 @samp{8000}.
16387 @item -mlinker-opt
16388 @opindex mlinker-opt
16389 Enable the optimization pass in the HP-UX linker.  Note this makes symbolic
16390 debugging impossible.  It also triggers a bug in the HP-UX 8 and HP-UX 9
16391 linkers in which they give bogus error messages when linking some programs.
16393 @item -msoft-float
16394 @opindex msoft-float
16395 Generate output containing library calls for floating point.
16396 @strong{Warning:} the requisite libraries are not available for all HPPA
16397 targets.  Normally the facilities of the machine's usual C compiler are
16398 used, but this cannot be done directly in cross-compilation.  You must make
16399 your own arrangements to provide suitable library functions for
16400 cross-compilation.
16402 @option{-msoft-float} changes the calling convention in the output file;
16403 therefore, it is only useful if you compile @emph{all} of a program with
16404 this option.  In particular, you need to compile @file{libgcc.a}, the
16405 library that comes with GCC, with @option{-msoft-float} in order for
16406 this to work.
16408 @item -msio
16409 @opindex msio
16410 Generate the predefine, @code{_SIO}, for server IO@.  The default is
16411 @option{-mwsio}.  This generates the predefines, @code{__hp9000s700},
16412 @code{__hp9000s700__} and @code{_WSIO}, for workstation IO@.  These
16413 options are available under HP-UX and HI-UX@.
16415 @item -mgnu-ld
16416 @opindex mgnu-ld
16417 Use options specific to GNU @command{ld}.
16418 This passes @option{-shared} to @command{ld} when
16419 building a shared library.  It is the default when GCC is configured,
16420 explicitly or implicitly, with the GNU linker.  This option does not
16421 affect which @command{ld} is called; it only changes what parameters
16422 are passed to that @command{ld}.
16423 The @command{ld} that is called is determined by the
16424 @option{--with-ld} configure option, GCC's program search path, and
16425 finally by the user's @env{PATH}.  The linker used by GCC can be printed
16426 using @samp{which `gcc -print-prog-name=ld`}.  This option is only available
16427 on the 64-bit HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
16429 @item -mhp-ld
16430 @opindex mhp-ld
16431 Use options specific to HP @command{ld}.
16432 This passes @option{-b} to @command{ld} when building
16433 a shared library and passes @option{+Accept TypeMismatch} to @command{ld} on all
16434 links.  It is the default when GCC is configured, explicitly or
16435 implicitly, with the HP linker.  This option does not affect
16436 which @command{ld} is called; it only changes what parameters are passed to that
16437 @command{ld}.
16438 The @command{ld} that is called is determined by the @option{--with-ld}
16439 configure option, GCC's program search path, and finally by the user's
16440 @env{PATH}.  The linker used by GCC can be printed using @samp{which
16441 `gcc -print-prog-name=ld`}.  This option is only available on the 64-bit
16442 HP-UX GCC, i.e.@: configured with @samp{hppa*64*-*-hpux*}.
16444 @item -mlong-calls
16445 @opindex mno-long-calls
16446 Generate code that uses long call sequences.  This ensures that a call
16447 is always able to reach linker generated stubs.  The default is to generate
16448 long calls only when the distance from the call site to the beginning
16449 of the function or translation unit, as the case may be, exceeds a
16450 predefined limit set by the branch type being used.  The limits for
16451 normal calls are 7,600,000 and 240,000 bytes, respectively for the
16452 PA 2.0 and PA 1.X architectures.  Sibcalls are always limited at
16453 240,000 bytes.
16455 Distances are measured from the beginning of functions when using the
16456 @option{-ffunction-sections} option, or when using the @option{-mgas}
16457 and @option{-mno-portable-runtime} options together under HP-UX with
16458 the SOM linker.
16460 It is normally not desirable to use this option as it degrades
16461 performance.  However, it may be useful in large applications,
16462 particularly when partial linking is used to build the application.
16464 The types of long calls used depends on the capabilities of the
16465 assembler and linker, and the type of code being generated.  The
16466 impact on systems that support long absolute calls, and long pic
16467 symbol-difference or pc-relative calls should be relatively small.
16468 However, an indirect call is used on 32-bit ELF systems in pic code
16469 and it is quite long.
16471 @item -munix=@var{unix-std}
16472 @opindex march
16473 Generate compiler predefines and select a startfile for the specified
16474 UNIX standard.  The choices for @var{unix-std} are @samp{93}, @samp{95}
16475 and @samp{98}.  @samp{93} is supported on all HP-UX versions.  @samp{95}
16476 is available on HP-UX 10.10 and later.  @samp{98} is available on HP-UX
16477 11.11 and later.  The default values are @samp{93} for HP-UX 10.00,
16478 @samp{95} for HP-UX 10.10 though to 11.00, and @samp{98} for HP-UX 11.11
16479 and later.
16481 @option{-munix=93} provides the same predefines as GCC 3.3 and 3.4.
16482 @option{-munix=95} provides additional predefines for @code{XOPEN_UNIX}
16483 and @code{_XOPEN_SOURCE_EXTENDED}, and the startfile @file{unix95.o}.
16484 @option{-munix=98} provides additional predefines for @code{_XOPEN_UNIX},
16485 @code{_XOPEN_SOURCE_EXTENDED}, @code{_INCLUDE__STDC_A1_SOURCE} and
16486 @code{_INCLUDE_XOPEN_SOURCE_500}, and the startfile @file{unix98.o}.
16488 It is @emph{important} to note that this option changes the interfaces
16489 for various library routines.  It also affects the operational behavior
16490 of the C library.  Thus, @emph{extreme} care is needed in using this
16491 option.
16493 Library code that is intended to operate with more than one UNIX
16494 standard must test, set and restore the variable @code{__xpg4_extended_mask}
16495 as appropriate.  Most GNU software doesn't provide this capability.
16497 @item -nolibdld
16498 @opindex nolibdld
16499 Suppress the generation of link options to search libdld.sl when the
16500 @option{-static} option is specified on HP-UX 10 and later.
16502 @item -static
16503 @opindex static
16504 The HP-UX implementation of setlocale in libc has a dependency on
16505 libdld.sl.  There isn't an archive version of libdld.sl.  Thus,
16506 when the @option{-static} option is specified, special link options
16507 are needed to resolve this dependency.
16509 On HP-UX 10 and later, the GCC driver adds the necessary options to
16510 link with libdld.sl when the @option{-static} option is specified.
16511 This causes the resulting binary to be dynamic.  On the 64-bit port,
16512 the linkers generate dynamic binaries by default in any case.  The
16513 @option{-nolibdld} option can be used to prevent the GCC driver from
16514 adding these link options.
16516 @item -threads
16517 @opindex threads
16518 Add support for multithreading with the @dfn{dce thread} library
16519 under HP-UX@.  This option sets flags for both the preprocessor and
16520 linker.
16521 @end table
16523 @node IA-64 Options
16524 @subsection IA-64 Options
16525 @cindex IA-64 Options
16527 These are the @samp{-m} options defined for the Intel IA-64 architecture.
16529 @table @gcctabopt
16530 @item -mbig-endian
16531 @opindex mbig-endian
16532 Generate code for a big-endian target.  This is the default for HP-UX@.
16534 @item -mlittle-endian
16535 @opindex mlittle-endian
16536 Generate code for a little-endian target.  This is the default for AIX5
16537 and GNU/Linux.
16539 @item -mgnu-as
16540 @itemx -mno-gnu-as
16541 @opindex mgnu-as
16542 @opindex mno-gnu-as
16543 Generate (or don't) code for the GNU assembler.  This is the default.
16544 @c Also, this is the default if the configure option @option{--with-gnu-as}
16545 @c is used.
16547 @item -mgnu-ld
16548 @itemx -mno-gnu-ld
16549 @opindex mgnu-ld
16550 @opindex mno-gnu-ld
16551 Generate (or don't) code for the GNU linker.  This is the default.
16552 @c Also, this is the default if the configure option @option{--with-gnu-ld}
16553 @c is used.
16555 @item -mno-pic
16556 @opindex mno-pic
16557 Generate code that does not use a global pointer register.  The result
16558 is not position independent code, and violates the IA-64 ABI@.
16560 @item -mvolatile-asm-stop
16561 @itemx -mno-volatile-asm-stop
16562 @opindex mvolatile-asm-stop
16563 @opindex mno-volatile-asm-stop
16564 Generate (or don't) a stop bit immediately before and after volatile asm
16565 statements.
16567 @item -mregister-names
16568 @itemx -mno-register-names
16569 @opindex mregister-names
16570 @opindex mno-register-names
16571 Generate (or don't) @samp{in}, @samp{loc}, and @samp{out} register names for
16572 the stacked registers.  This may make assembler output more readable.
16574 @item -mno-sdata
16575 @itemx -msdata
16576 @opindex mno-sdata
16577 @opindex msdata
16578 Disable (or enable) optimizations that use the small data section.  This may
16579 be useful for working around optimizer bugs.
16581 @item -mconstant-gp
16582 @opindex mconstant-gp
16583 Generate code that uses a single constant global pointer value.  This is
16584 useful when compiling kernel code.
16586 @item -mauto-pic
16587 @opindex mauto-pic
16588 Generate code that is self-relocatable.  This implies @option{-mconstant-gp}.
16589 This is useful when compiling firmware code.
16591 @item -minline-float-divide-min-latency
16592 @opindex minline-float-divide-min-latency
16593 Generate code for inline divides of floating-point values
16594 using the minimum latency algorithm.
16596 @item -minline-float-divide-max-throughput
16597 @opindex minline-float-divide-max-throughput
16598 Generate code for inline divides of floating-point values
16599 using the maximum throughput algorithm.
16601 @item -mno-inline-float-divide
16602 @opindex mno-inline-float-divide
16603 Do not generate inline code for divides of floating-point values.
16605 @item -minline-int-divide-min-latency
16606 @opindex minline-int-divide-min-latency
16607 Generate code for inline divides of integer values
16608 using the minimum latency algorithm.
16610 @item -minline-int-divide-max-throughput
16611 @opindex minline-int-divide-max-throughput
16612 Generate code for inline divides of integer values
16613 using the maximum throughput algorithm.
16615 @item -mno-inline-int-divide
16616 @opindex mno-inline-int-divide
16617 Do not generate inline code for divides of integer values.
16619 @item -minline-sqrt-min-latency
16620 @opindex minline-sqrt-min-latency
16621 Generate code for inline square roots
16622 using the minimum latency algorithm.
16624 @item -minline-sqrt-max-throughput
16625 @opindex minline-sqrt-max-throughput
16626 Generate code for inline square roots
16627 using the maximum throughput algorithm.
16629 @item -mno-inline-sqrt
16630 @opindex mno-inline-sqrt
16631 Do not generate inline code for @code{sqrt}.
16633 @item -mfused-madd
16634 @itemx -mno-fused-madd
16635 @opindex mfused-madd
16636 @opindex mno-fused-madd
16637 Do (don't) generate code that uses the fused multiply/add or multiply/subtract
16638 instructions.  The default is to use these instructions.
16640 @item -mno-dwarf2-asm
16641 @itemx -mdwarf2-asm
16642 @opindex mno-dwarf2-asm
16643 @opindex mdwarf2-asm
16644 Don't (or do) generate assembler code for the DWARF line number debugging
16645 info.  This may be useful when not using the GNU assembler.
16647 @item -mearly-stop-bits
16648 @itemx -mno-early-stop-bits
16649 @opindex mearly-stop-bits
16650 @opindex mno-early-stop-bits
16651 Allow stop bits to be placed earlier than immediately preceding the
16652 instruction that triggered the stop bit.  This can improve instruction
16653 scheduling, but does not always do so.
16655 @item -mfixed-range=@var{register-range}
16656 @opindex mfixed-range
16657 Generate code treating the given register range as fixed registers.
16658 A fixed register is one that the register allocator cannot use.  This is
16659 useful when compiling kernel code.  A register range is specified as
16660 two registers separated by a dash.  Multiple register ranges can be
16661 specified separated by a comma.
16663 @item -mtls-size=@var{tls-size}
16664 @opindex mtls-size
16665 Specify bit size of immediate TLS offsets.  Valid values are 14, 22, and
16668 @item -mtune=@var{cpu-type}
16669 @opindex mtune
16670 Tune the instruction scheduling for a particular CPU, Valid values are
16671 @samp{itanium}, @samp{itanium1}, @samp{merced}, @samp{itanium2},
16672 and @samp{mckinley}.
16674 @item -milp32
16675 @itemx -mlp64
16676 @opindex milp32
16677 @opindex mlp64
16678 Generate code for a 32-bit or 64-bit environment.
16679 The 32-bit environment sets int, long and pointer to 32 bits.
16680 The 64-bit environment sets int to 32 bits and long and pointer
16681 to 64 bits.  These are HP-UX specific flags.
16683 @item -mno-sched-br-data-spec
16684 @itemx -msched-br-data-spec
16685 @opindex mno-sched-br-data-spec
16686 @opindex msched-br-data-spec
16687 (Dis/En)able data speculative scheduling before reload.
16688 This results in generation of @code{ld.a} instructions and
16689 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16690 The default setting is disabled.
16692 @item -msched-ar-data-spec
16693 @itemx -mno-sched-ar-data-spec
16694 @opindex msched-ar-data-spec
16695 @opindex mno-sched-ar-data-spec
16696 (En/Dis)able data speculative scheduling after reload.
16697 This results in generation of @code{ld.a} instructions and
16698 the corresponding check instructions (@code{ld.c} / @code{chk.a}).
16699 The default setting is enabled.
16701 @item -mno-sched-control-spec
16702 @itemx -msched-control-spec
16703 @opindex mno-sched-control-spec
16704 @opindex msched-control-spec
16705 (Dis/En)able control speculative scheduling.  This feature is
16706 available only during region scheduling (i.e.@: before reload).
16707 This results in generation of the @code{ld.s} instructions and
16708 the corresponding check instructions @code{chk.s}.
16709 The default setting is disabled.
16711 @item -msched-br-in-data-spec
16712 @itemx -mno-sched-br-in-data-spec
16713 @opindex msched-br-in-data-spec
16714 @opindex mno-sched-br-in-data-spec
16715 (En/Dis)able speculative scheduling of the instructions that
16716 are dependent on the data speculative loads before reload.
16717 This is effective only with @option{-msched-br-data-spec} enabled.
16718 The default setting is enabled.
16720 @item -msched-ar-in-data-spec
16721 @itemx -mno-sched-ar-in-data-spec
16722 @opindex msched-ar-in-data-spec
16723 @opindex mno-sched-ar-in-data-spec
16724 (En/Dis)able speculative scheduling of the instructions that
16725 are dependent on the data speculative loads after reload.
16726 This is effective only with @option{-msched-ar-data-spec} enabled.
16727 The default setting is enabled.
16729 @item -msched-in-control-spec
16730 @itemx -mno-sched-in-control-spec
16731 @opindex msched-in-control-spec
16732 @opindex mno-sched-in-control-spec
16733 (En/Dis)able speculative scheduling of the instructions that
16734 are dependent on the control speculative loads.
16735 This is effective only with @option{-msched-control-spec} enabled.
16736 The default setting is enabled.
16738 @item -mno-sched-prefer-non-data-spec-insns
16739 @itemx -msched-prefer-non-data-spec-insns
16740 @opindex mno-sched-prefer-non-data-spec-insns
16741 @opindex msched-prefer-non-data-spec-insns
16742 If enabled, data-speculative instructions are chosen for schedule
16743 only if there are no other choices at the moment.  This makes
16744 the use of the data speculation much more conservative.
16745 The default setting is disabled.
16747 @item -mno-sched-prefer-non-control-spec-insns
16748 @itemx -msched-prefer-non-control-spec-insns
16749 @opindex mno-sched-prefer-non-control-spec-insns
16750 @opindex msched-prefer-non-control-spec-insns
16751 If enabled, control-speculative instructions are chosen for schedule
16752 only if there are no other choices at the moment.  This makes
16753 the use of the control speculation much more conservative.
16754 The default setting is disabled.
16756 @item -mno-sched-count-spec-in-critical-path
16757 @itemx -msched-count-spec-in-critical-path
16758 @opindex mno-sched-count-spec-in-critical-path
16759 @opindex msched-count-spec-in-critical-path
16760 If enabled, speculative dependencies are considered during
16761 computation of the instructions priorities.  This makes the use of the
16762 speculation a bit more conservative.
16763 The default setting is disabled.
16765 @item -msched-spec-ldc
16766 @opindex msched-spec-ldc
16767 Use a simple data speculation check.  This option is on by default.
16769 @item -msched-control-spec-ldc
16770 @opindex msched-spec-ldc
16771 Use a simple check for control speculation.  This option is on by default.
16773 @item -msched-stop-bits-after-every-cycle
16774 @opindex msched-stop-bits-after-every-cycle
16775 Place a stop bit after every cycle when scheduling.  This option is on
16776 by default.
16778 @item -msched-fp-mem-deps-zero-cost
16779 @opindex msched-fp-mem-deps-zero-cost
16780 Assume that floating-point stores and loads are not likely to cause a conflict
16781 when placed into the same instruction group.  This option is disabled by
16782 default.
16784 @item -msel-sched-dont-check-control-spec
16785 @opindex msel-sched-dont-check-control-spec
16786 Generate checks for control speculation in selective scheduling.
16787 This flag is disabled by default.
16789 @item -msched-max-memory-insns=@var{max-insns}
16790 @opindex msched-max-memory-insns
16791 Limit on the number of memory insns per instruction group, giving lower
16792 priority to subsequent memory insns attempting to schedule in the same
16793 instruction group. Frequently useful to prevent cache bank conflicts.
16794 The default value is 1.
16796 @item -msched-max-memory-insns-hard-limit
16797 @opindex msched-max-memory-insns-hard-limit
16798 Makes the limit specified by @option{msched-max-memory-insns} a hard limit,
16799 disallowing more than that number in an instruction group.
16800 Otherwise, the limit is ``soft'', meaning that non-memory operations
16801 are preferred when the limit is reached, but memory operations may still
16802 be scheduled.
16804 @end table
16806 @node LM32 Options
16807 @subsection LM32 Options
16808 @cindex LM32 options
16810 These @option{-m} options are defined for the LatticeMico32 architecture:
16812 @table @gcctabopt
16813 @item -mbarrel-shift-enabled
16814 @opindex mbarrel-shift-enabled
16815 Enable barrel-shift instructions.
16817 @item -mdivide-enabled
16818 @opindex mdivide-enabled
16819 Enable divide and modulus instructions.
16821 @item -mmultiply-enabled
16822 @opindex multiply-enabled
16823 Enable multiply instructions.
16825 @item -msign-extend-enabled
16826 @opindex msign-extend-enabled
16827 Enable sign extend instructions.
16829 @item -muser-enabled
16830 @opindex muser-enabled
16831 Enable user-defined instructions.
16833 @end table
16835 @node M32C Options
16836 @subsection M32C Options
16837 @cindex M32C options
16839 @table @gcctabopt
16840 @item -mcpu=@var{name}
16841 @opindex mcpu=
16842 Select the CPU for which code is generated.  @var{name} may be one of
16843 @samp{r8c} for the R8C/Tiny series, @samp{m16c} for the M16C (up to
16844 /60) series, @samp{m32cm} for the M16C/80 series, or @samp{m32c} for
16845 the M32C/80 series.
16847 @item -msim
16848 @opindex msim
16849 Specifies that the program will be run on the simulator.  This causes
16850 an alternate runtime library to be linked in which supports, for
16851 example, file I/O@.  You must not use this option when generating
16852 programs that will run on real hardware; you must provide your own
16853 runtime library for whatever I/O functions are needed.
16855 @item -memregs=@var{number}
16856 @opindex memregs=
16857 Specifies the number of memory-based pseudo-registers GCC uses
16858 during code generation.  These pseudo-registers are used like real
16859 registers, so there is a tradeoff between GCC's ability to fit the
16860 code into available registers, and the performance penalty of using
16861 memory instead of registers.  Note that all modules in a program must
16862 be compiled with the same value for this option.  Because of that, you
16863 must not use this option with GCC's default runtime libraries.
16865 @end table
16867 @node M32R/D Options
16868 @subsection M32R/D Options
16869 @cindex M32R/D options
16871 These @option{-m} options are defined for Renesas M32R/D architectures:
16873 @table @gcctabopt
16874 @item -m32r2
16875 @opindex m32r2
16876 Generate code for the M32R/2@.
16878 @item -m32rx
16879 @opindex m32rx
16880 Generate code for the M32R/X@.
16882 @item -m32r
16883 @opindex m32r
16884 Generate code for the M32R@.  This is the default.
16886 @item -mmodel=small
16887 @opindex mmodel=small
16888 Assume all objects live in the lower 16MB of memory (so that their addresses
16889 can be loaded with the @code{ld24} instruction), and assume all subroutines
16890 are reachable with the @code{bl} instruction.
16891 This is the default.
16893 The addressability of a particular object can be set with the
16894 @code{model} attribute.
16896 @item -mmodel=medium
16897 @opindex mmodel=medium
16898 Assume objects may be anywhere in the 32-bit address space (the compiler
16899 generates @code{seth/add3} instructions to load their addresses), and
16900 assume all subroutines are reachable with the @code{bl} instruction.
16902 @item -mmodel=large
16903 @opindex mmodel=large
16904 Assume objects may be anywhere in the 32-bit address space (the compiler
16905 generates @code{seth/add3} instructions to load their addresses), and
16906 assume subroutines may not be reachable with the @code{bl} instruction
16907 (the compiler generates the much slower @code{seth/add3/jl}
16908 instruction sequence).
16910 @item -msdata=none
16911 @opindex msdata=none
16912 Disable use of the small data area.  Variables are put into
16913 one of @code{.data}, @code{.bss}, or @code{.rodata} (unless the
16914 @code{section} attribute has been specified).
16915 This is the default.
16917 The small data area consists of sections @code{.sdata} and @code{.sbss}.
16918 Objects may be explicitly put in the small data area with the
16919 @code{section} attribute using one of these sections.
16921 @item -msdata=sdata
16922 @opindex msdata=sdata
16923 Put small global and static data in the small data area, but do not
16924 generate special code to reference them.
16926 @item -msdata=use
16927 @opindex msdata=use
16928 Put small global and static data in the small data area, and generate
16929 special instructions to reference them.
16931 @item -G @var{num}
16932 @opindex G
16933 @cindex smaller data references
16934 Put global and static objects less than or equal to @var{num} bytes
16935 into the small data or BSS sections instead of the normal data or BSS
16936 sections.  The default value of @var{num} is 8.
16937 The @option{-msdata} option must be set to one of @samp{sdata} or @samp{use}
16938 for this option to have any effect.
16940 All modules should be compiled with the same @option{-G @var{num}} value.
16941 Compiling with different values of @var{num} may or may not work; if it
16942 doesn't the linker gives an error message---incorrect code is not
16943 generated.
16945 @item -mdebug
16946 @opindex mdebug
16947 Makes the M32R-specific code in the compiler display some statistics
16948 that might help in debugging programs.
16950 @item -malign-loops
16951 @opindex malign-loops
16952 Align all loops to a 32-byte boundary.
16954 @item -mno-align-loops
16955 @opindex mno-align-loops
16956 Do not enforce a 32-byte alignment for loops.  This is the default.
16958 @item -missue-rate=@var{number}
16959 @opindex missue-rate=@var{number}
16960 Issue @var{number} instructions per cycle.  @var{number} can only be 1
16961 or 2.
16963 @item -mbranch-cost=@var{number}
16964 @opindex mbranch-cost=@var{number}
16965 @var{number} can only be 1 or 2.  If it is 1 then branches are
16966 preferred over conditional code, if it is 2, then the opposite applies.
16968 @item -mflush-trap=@var{number}
16969 @opindex mflush-trap=@var{number}
16970 Specifies the trap number to use to flush the cache.  The default is
16971 12.  Valid numbers are between 0 and 15 inclusive.
16973 @item -mno-flush-trap
16974 @opindex mno-flush-trap
16975 Specifies that the cache cannot be flushed by using a trap.
16977 @item -mflush-func=@var{name}
16978 @opindex mflush-func=@var{name}
16979 Specifies the name of the operating system function to call to flush
16980 the cache.  The default is @samp{_flush_cache}, but a function call
16981 is only used if a trap is not available.
16983 @item -mno-flush-func
16984 @opindex mno-flush-func
16985 Indicates that there is no OS function for flushing the cache.
16987 @end table
16989 @node M680x0 Options
16990 @subsection M680x0 Options
16991 @cindex M680x0 options
16993 These are the @samp{-m} options defined for M680x0 and ColdFire processors.
16994 The default settings depend on which architecture was selected when
16995 the compiler was configured; the defaults for the most common choices
16996 are given below.
16998 @table @gcctabopt
16999 @item -march=@var{arch}
17000 @opindex march
17001 Generate code for a specific M680x0 or ColdFire instruction set
17002 architecture.  Permissible values of @var{arch} for M680x0
17003 architectures are: @samp{68000}, @samp{68010}, @samp{68020},
17004 @samp{68030}, @samp{68040}, @samp{68060} and @samp{cpu32}.  ColdFire
17005 architectures are selected according to Freescale's ISA classification
17006 and the permissible values are: @samp{isaa}, @samp{isaaplus},
17007 @samp{isab} and @samp{isac}.
17009 GCC defines a macro @code{__mcf@var{arch}__} whenever it is generating
17010 code for a ColdFire target.  The @var{arch} in this macro is one of the
17011 @option{-march} arguments given above.
17013 When used together, @option{-march} and @option{-mtune} select code
17014 that runs on a family of similar processors but that is optimized
17015 for a particular microarchitecture.
17017 @item -mcpu=@var{cpu}
17018 @opindex mcpu
17019 Generate code for a specific M680x0 or ColdFire processor.
17020 The M680x0 @var{cpu}s are: @samp{68000}, @samp{68010}, @samp{68020},
17021 @samp{68030}, @samp{68040}, @samp{68060}, @samp{68302}, @samp{68332}
17022 and @samp{cpu32}.  The ColdFire @var{cpu}s are given by the table
17023 below, which also classifies the CPUs into families:
17025 @multitable @columnfractions 0.20 0.80
17026 @item @strong{Family} @tab @strong{@samp{-mcpu} arguments}
17027 @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}
17028 @item @samp{5206} @tab @samp{5202} @samp{5204} @samp{5206}
17029 @item @samp{5206e} @tab @samp{5206e}
17030 @item @samp{5208} @tab @samp{5207} @samp{5208}
17031 @item @samp{5211a} @tab @samp{5210a} @samp{5211a}
17032 @item @samp{5213} @tab @samp{5211} @samp{5212} @samp{5213}
17033 @item @samp{5216} @tab @samp{5214} @samp{5216}
17034 @item @samp{52235} @tab @samp{52230} @samp{52231} @samp{52232} @samp{52233} @samp{52234} @samp{52235}
17035 @item @samp{5225} @tab @samp{5224} @samp{5225}
17036 @item @samp{52259} @tab @samp{52252} @samp{52254} @samp{52255} @samp{52256} @samp{52258} @samp{52259}
17037 @item @samp{5235} @tab @samp{5232} @samp{5233} @samp{5234} @samp{5235} @samp{523x}
17038 @item @samp{5249} @tab @samp{5249}
17039 @item @samp{5250} @tab @samp{5250}
17040 @item @samp{5271} @tab @samp{5270} @samp{5271}
17041 @item @samp{5272} @tab @samp{5272}
17042 @item @samp{5275} @tab @samp{5274} @samp{5275}
17043 @item @samp{5282} @tab @samp{5280} @samp{5281} @samp{5282} @samp{528x}
17044 @item @samp{53017} @tab @samp{53011} @samp{53012} @samp{53013} @samp{53014} @samp{53015} @samp{53016} @samp{53017}
17045 @item @samp{5307} @tab @samp{5307}
17046 @item @samp{5329} @tab @samp{5327} @samp{5328} @samp{5329} @samp{532x}
17047 @item @samp{5373} @tab @samp{5372} @samp{5373} @samp{537x}
17048 @item @samp{5407} @tab @samp{5407}
17049 @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}
17050 @end multitable
17052 @option{-mcpu=@var{cpu}} overrides @option{-march=@var{arch}} if
17053 @var{arch} is compatible with @var{cpu}.  Other combinations of
17054 @option{-mcpu} and @option{-march} are rejected.
17056 GCC defines the macro @code{__mcf_cpu_@var{cpu}} when ColdFire target
17057 @var{cpu} is selected.  It also defines @code{__mcf_family_@var{family}},
17058 where the value of @var{family} is given by the table above.
17060 @item -mtune=@var{tune}
17061 @opindex mtune
17062 Tune the code for a particular microarchitecture within the
17063 constraints set by @option{-march} and @option{-mcpu}.
17064 The M680x0 microarchitectures are: @samp{68000}, @samp{68010},
17065 @samp{68020}, @samp{68030}, @samp{68040}, @samp{68060}
17066 and @samp{cpu32}.  The ColdFire microarchitectures
17067 are: @samp{cfv1}, @samp{cfv2}, @samp{cfv3}, @samp{cfv4} and @samp{cfv4e}.
17069 You can also use @option{-mtune=68020-40} for code that needs
17070 to run relatively well on 68020, 68030 and 68040 targets.
17071 @option{-mtune=68020-60} is similar but includes 68060 targets
17072 as well.  These two options select the same tuning decisions as
17073 @option{-m68020-40} and @option{-m68020-60} respectively.
17075 GCC defines the macros @code{__mc@var{arch}} and @code{__mc@var{arch}__}
17076 when tuning for 680x0 architecture @var{arch}.  It also defines
17077 @code{mc@var{arch}} unless either @option{-ansi} or a non-GNU @option{-std}
17078 option is used.  If GCC is tuning for a range of architectures,
17079 as selected by @option{-mtune=68020-40} or @option{-mtune=68020-60},
17080 it defines the macros for every architecture in the range.
17082 GCC also defines the macro @code{__m@var{uarch}__} when tuning for
17083 ColdFire microarchitecture @var{uarch}, where @var{uarch} is one
17084 of the arguments given above.
17086 @item -m68000
17087 @itemx -mc68000
17088 @opindex m68000
17089 @opindex mc68000
17090 Generate output for a 68000.  This is the default
17091 when the compiler is configured for 68000-based systems.
17092 It is equivalent to @option{-march=68000}.
17094 Use this option for microcontrollers with a 68000 or EC000 core,
17095 including the 68008, 68302, 68306, 68307, 68322, 68328 and 68356.
17097 @item -m68010
17098 @opindex m68010
17099 Generate output for a 68010.  This is the default
17100 when the compiler is configured for 68010-based systems.
17101 It is equivalent to @option{-march=68010}.
17103 @item -m68020
17104 @itemx -mc68020
17105 @opindex m68020
17106 @opindex mc68020
17107 Generate output for a 68020.  This is the default
17108 when the compiler is configured for 68020-based systems.
17109 It is equivalent to @option{-march=68020}.
17111 @item -m68030
17112 @opindex m68030
17113 Generate output for a 68030.  This is the default when the compiler is
17114 configured for 68030-based systems.  It is equivalent to
17115 @option{-march=68030}.
17117 @item -m68040
17118 @opindex m68040
17119 Generate output for a 68040.  This is the default when the compiler is
17120 configured for 68040-based systems.  It is equivalent to
17121 @option{-march=68040}.
17123 This option inhibits the use of 68881/68882 instructions that have to be
17124 emulated by software on the 68040.  Use this option if your 68040 does not
17125 have code to emulate those instructions.
17127 @item -m68060
17128 @opindex m68060
17129 Generate output for a 68060.  This is the default when the compiler is
17130 configured for 68060-based systems.  It is equivalent to
17131 @option{-march=68060}.
17133 This option inhibits the use of 68020 and 68881/68882 instructions that
17134 have to be emulated by software on the 68060.  Use this option if your 68060
17135 does not have code to emulate those instructions.
17137 @item -mcpu32
17138 @opindex mcpu32
17139 Generate output for a CPU32.  This is the default
17140 when the compiler is configured for CPU32-based systems.
17141 It is equivalent to @option{-march=cpu32}.
17143 Use this option for microcontrollers with a
17144 CPU32 or CPU32+ core, including the 68330, 68331, 68332, 68333, 68334,
17145 68336, 68340, 68341, 68349 and 68360.
17147 @item -m5200
17148 @opindex m5200
17149 Generate output for a 520X ColdFire CPU@.  This is the default
17150 when the compiler is configured for 520X-based systems.
17151 It is equivalent to @option{-mcpu=5206}, and is now deprecated
17152 in favor of that option.
17154 Use this option for microcontroller with a 5200 core, including
17155 the MCF5202, MCF5203, MCF5204 and MCF5206.
17157 @item -m5206e
17158 @opindex m5206e
17159 Generate output for a 5206e ColdFire CPU@.  The option is now
17160 deprecated in favor of the equivalent @option{-mcpu=5206e}.
17162 @item -m528x
17163 @opindex m528x
17164 Generate output for a member of the ColdFire 528X family.
17165 The option is now deprecated in favor of the equivalent
17166 @option{-mcpu=528x}.
17168 @item -m5307
17169 @opindex m5307
17170 Generate output for a ColdFire 5307 CPU@.  The option is now deprecated
17171 in favor of the equivalent @option{-mcpu=5307}.
17173 @item -m5407
17174 @opindex m5407
17175 Generate output for a ColdFire 5407 CPU@.  The option is now deprecated
17176 in favor of the equivalent @option{-mcpu=5407}.
17178 @item -mcfv4e
17179 @opindex mcfv4e
17180 Generate output for a ColdFire V4e family CPU (e.g.@: 547x/548x).
17181 This includes use of hardware floating-point instructions.
17182 The option is equivalent to @option{-mcpu=547x}, and is now
17183 deprecated in favor of that option.
17185 @item -m68020-40
17186 @opindex m68020-40
17187 Generate output for a 68040, without using any of the new instructions.
17188 This results in code that can run relatively efficiently on either a
17189 68020/68881 or a 68030 or a 68040.  The generated code does use the
17190 68881 instructions that are emulated on the 68040.
17192 The option is equivalent to @option{-march=68020} @option{-mtune=68020-40}.
17194 @item -m68020-60
17195 @opindex m68020-60
17196 Generate output for a 68060, without using any of the new instructions.
17197 This results in code that can run relatively efficiently on either a
17198 68020/68881 or a 68030 or a 68040.  The generated code does use the
17199 68881 instructions that are emulated on the 68060.
17201 The option is equivalent to @option{-march=68020} @option{-mtune=68020-60}.
17203 @item -mhard-float
17204 @itemx -m68881
17205 @opindex mhard-float
17206 @opindex m68881
17207 Generate floating-point instructions.  This is the default for 68020
17208 and above, and for ColdFire devices that have an FPU@.  It defines the
17209 macro @code{__HAVE_68881__} on M680x0 targets and @code{__mcffpu__}
17210 on ColdFire targets.
17212 @item -msoft-float
17213 @opindex msoft-float
17214 Do not generate floating-point instructions; use library calls instead.
17215 This is the default for 68000, 68010, and 68832 targets.  It is also
17216 the default for ColdFire devices that have no FPU.
17218 @item -mdiv
17219 @itemx -mno-div
17220 @opindex mdiv
17221 @opindex mno-div
17222 Generate (do not generate) ColdFire hardware divide and remainder
17223 instructions.  If @option{-march} is used without @option{-mcpu},
17224 the default is ``on'' for ColdFire architectures and ``off'' for M680x0
17225 architectures.  Otherwise, the default is taken from the target CPU
17226 (either the default CPU, or the one specified by @option{-mcpu}).  For
17227 example, the default is ``off'' for @option{-mcpu=5206} and ``on'' for
17228 @option{-mcpu=5206e}.
17230 GCC defines the macro @code{__mcfhwdiv__} when this option is enabled.
17232 @item -mshort
17233 @opindex mshort
17234 Consider type @code{int} to be 16 bits wide, like @code{short int}.
17235 Additionally, parameters passed on the stack are also aligned to a
17236 16-bit boundary even on targets whose API mandates promotion to 32-bit.
17238 @item -mno-short
17239 @opindex mno-short
17240 Do not consider type @code{int} to be 16 bits wide.  This is the default.
17242 @item -mnobitfield
17243 @itemx -mno-bitfield
17244 @opindex mnobitfield
17245 @opindex mno-bitfield
17246 Do not use the bit-field instructions.  The @option{-m68000}, @option{-mcpu32}
17247 and @option{-m5200} options imply @w{@option{-mnobitfield}}.
17249 @item -mbitfield
17250 @opindex mbitfield
17251 Do use the bit-field instructions.  The @option{-m68020} option implies
17252 @option{-mbitfield}.  This is the default if you use a configuration
17253 designed for a 68020.
17255 @item -mrtd
17256 @opindex mrtd
17257 Use a different function-calling convention, in which functions
17258 that take a fixed number of arguments return with the @code{rtd}
17259 instruction, which pops their arguments while returning.  This
17260 saves one instruction in the caller since there is no need to pop
17261 the arguments there.
17263 This calling convention is incompatible with the one normally
17264 used on Unix, so you cannot use it if you need to call libraries
17265 compiled with the Unix compiler.
17267 Also, you must provide function prototypes for all functions that
17268 take variable numbers of arguments (including @code{printf});
17269 otherwise incorrect code is generated for calls to those
17270 functions.
17272 In addition, seriously incorrect code results if you call a
17273 function with too many arguments.  (Normally, extra arguments are
17274 harmlessly ignored.)
17276 The @code{rtd} instruction is supported by the 68010, 68020, 68030,
17277 68040, 68060 and CPU32 processors, but not by the 68000 or 5200.
17279 @item -mno-rtd
17280 @opindex mno-rtd
17281 Do not use the calling conventions selected by @option{-mrtd}.
17282 This is the default.
17284 @item -malign-int
17285 @itemx -mno-align-int
17286 @opindex malign-int
17287 @opindex mno-align-int
17288 Control whether GCC aligns @code{int}, @code{long}, @code{long long},
17289 @code{float}, @code{double}, and @code{long double} variables on a 32-bit
17290 boundary (@option{-malign-int}) or a 16-bit boundary (@option{-mno-align-int}).
17291 Aligning variables on 32-bit boundaries produces code that runs somewhat
17292 faster on processors with 32-bit busses at the expense of more memory.
17294 @strong{Warning:} if you use the @option{-malign-int} switch, GCC
17295 aligns structures containing the above types differently than
17296 most published application binary interface specifications for the m68k.
17298 @item -mpcrel
17299 @opindex mpcrel
17300 Use the pc-relative addressing mode of the 68000 directly, instead of
17301 using a global offset table.  At present, this option implies @option{-fpic},
17302 allowing at most a 16-bit offset for pc-relative addressing.  @option{-fPIC} is
17303 not presently supported with @option{-mpcrel}, though this could be supported for
17304 68020 and higher processors.
17306 @item -mno-strict-align
17307 @itemx -mstrict-align
17308 @opindex mno-strict-align
17309 @opindex mstrict-align
17310 Do not (do) assume that unaligned memory references are handled by
17311 the system.
17313 @item -msep-data
17314 Generate code that allows the data segment to be located in a different
17315 area of memory from the text segment.  This allows for execute-in-place in
17316 an environment without virtual memory management.  This option implies
17317 @option{-fPIC}.
17319 @item -mno-sep-data
17320 Generate code that assumes that the data segment follows the text segment.
17321 This is the default.
17323 @item -mid-shared-library
17324 Generate code that supports shared libraries via the library ID method.
17325 This allows for execute-in-place and shared libraries in an environment
17326 without virtual memory management.  This option implies @option{-fPIC}.
17328 @item -mno-id-shared-library
17329 Generate code that doesn't assume ID-based shared libraries are being used.
17330 This is the default.
17332 @item -mshared-library-id=n
17333 Specifies the identification number of the ID-based shared library being
17334 compiled.  Specifying a value of 0 generates more compact code; specifying
17335 other values forces the allocation of that number to the current
17336 library, but is no more space- or time-efficient than omitting this option.
17338 @item -mxgot
17339 @itemx -mno-xgot
17340 @opindex mxgot
17341 @opindex mno-xgot
17342 When generating position-independent code for ColdFire, generate code
17343 that works if the GOT has more than 8192 entries.  This code is
17344 larger and slower than code generated without this option.  On M680x0
17345 processors, this option is not needed; @option{-fPIC} suffices.
17347 GCC normally uses a single instruction to load values from the GOT@.
17348 While this is relatively efficient, it only works if the GOT
17349 is smaller than about 64k.  Anything larger causes the linker
17350 to report an error such as:
17352 @cindex relocation truncated to fit (ColdFire)
17353 @smallexample
17354 relocation truncated to fit: R_68K_GOT16O foobar
17355 @end smallexample
17357 If this happens, you should recompile your code with @option{-mxgot}.
17358 It should then work with very large GOTs.  However, code generated with
17359 @option{-mxgot} is less efficient, since it takes 4 instructions to fetch
17360 the value of a global symbol.
17362 Note that some linkers, including newer versions of the GNU linker,
17363 can create multiple GOTs and sort GOT entries.  If you have such a linker,
17364 you should only need to use @option{-mxgot} when compiling a single
17365 object file that accesses more than 8192 GOT entries.  Very few do.
17367 These options have no effect unless GCC is generating
17368 position-independent code.
17370 @end table
17372 @node MCore Options
17373 @subsection MCore Options
17374 @cindex MCore options
17376 These are the @samp{-m} options defined for the Motorola M*Core
17377 processors.
17379 @table @gcctabopt
17381 @item -mhardlit
17382 @itemx -mno-hardlit
17383 @opindex mhardlit
17384 @opindex mno-hardlit
17385 Inline constants into the code stream if it can be done in two
17386 instructions or less.
17388 @item -mdiv
17389 @itemx -mno-div
17390 @opindex mdiv
17391 @opindex mno-div
17392 Use the divide instruction.  (Enabled by default).
17394 @item -mrelax-immediate
17395 @itemx -mno-relax-immediate
17396 @opindex mrelax-immediate
17397 @opindex mno-relax-immediate
17398 Allow arbitrary-sized immediates in bit operations.
17400 @item -mwide-bitfields
17401 @itemx -mno-wide-bitfields
17402 @opindex mwide-bitfields
17403 @opindex mno-wide-bitfields
17404 Always treat bit-fields as @code{int}-sized.
17406 @item -m4byte-functions
17407 @itemx -mno-4byte-functions
17408 @opindex m4byte-functions
17409 @opindex mno-4byte-functions
17410 Force all functions to be aligned to a 4-byte boundary.
17412 @item -mcallgraph-data
17413 @itemx -mno-callgraph-data
17414 @opindex mcallgraph-data
17415 @opindex mno-callgraph-data
17416 Emit callgraph information.
17418 @item -mslow-bytes
17419 @itemx -mno-slow-bytes
17420 @opindex mslow-bytes
17421 @opindex mno-slow-bytes
17422 Prefer word access when reading byte quantities.
17424 @item -mlittle-endian
17425 @itemx -mbig-endian
17426 @opindex mlittle-endian
17427 @opindex mbig-endian
17428 Generate code for a little-endian target.
17430 @item -m210
17431 @itemx -m340
17432 @opindex m210
17433 @opindex m340
17434 Generate code for the 210 processor.
17436 @item -mno-lsim
17437 @opindex mno-lsim
17438 Assume that runtime support has been provided and so omit the
17439 simulator library (@file{libsim.a)} from the linker command line.
17441 @item -mstack-increment=@var{size}
17442 @opindex mstack-increment
17443 Set the maximum amount for a single stack increment operation.  Large
17444 values can increase the speed of programs that contain functions
17445 that need a large amount of stack space, but they can also trigger a
17446 segmentation fault if the stack is extended too much.  The default
17447 value is 0x1000.
17449 @end table
17451 @node MeP Options
17452 @subsection MeP Options
17453 @cindex MeP options
17455 @table @gcctabopt
17457 @item -mabsdiff
17458 @opindex mabsdiff
17459 Enables the @code{abs} instruction, which is the absolute difference
17460 between two registers.
17462 @item -mall-opts
17463 @opindex mall-opts
17464 Enables all the optional instructions---average, multiply, divide, bit
17465 operations, leading zero, absolute difference, min/max, clip, and
17466 saturation.
17469 @item -maverage
17470 @opindex maverage
17471 Enables the @code{ave} instruction, which computes the average of two
17472 registers.
17474 @item -mbased=@var{n}
17475 @opindex mbased=
17476 Variables of size @var{n} bytes or smaller are placed in the
17477 @code{.based} section by default.  Based variables use the @code{$tp}
17478 register as a base register, and there is a 128-byte limit to the
17479 @code{.based} section.
17481 @item -mbitops
17482 @opindex mbitops
17483 Enables the bit operation instructions---bit test (@code{btstm}), set
17484 (@code{bsetm}), clear (@code{bclrm}), invert (@code{bnotm}), and
17485 test-and-set (@code{tas}).
17487 @item -mc=@var{name}
17488 @opindex mc=
17489 Selects which section constant data is placed in.  @var{name} may
17490 be @samp{tiny}, @samp{near}, or @samp{far}.
17492 @item -mclip
17493 @opindex mclip
17494 Enables the @code{clip} instruction.  Note that @option{-mclip} is not
17495 useful unless you also provide @option{-mminmax}.
17497 @item -mconfig=@var{name}
17498 @opindex mconfig=
17499 Selects one of the built-in core configurations.  Each MeP chip has
17500 one or more modules in it; each module has a core CPU and a variety of
17501 coprocessors, optional instructions, and peripherals.  The
17502 @code{MeP-Integrator} tool, not part of GCC, provides these
17503 configurations through this option; using this option is the same as
17504 using all the corresponding command-line options.  The default
17505 configuration is @samp{default}.
17507 @item -mcop
17508 @opindex mcop
17509 Enables the coprocessor instructions.  By default, this is a 32-bit
17510 coprocessor.  Note that the coprocessor is normally enabled via the
17511 @option{-mconfig=} option.
17513 @item -mcop32
17514 @opindex mcop32
17515 Enables the 32-bit coprocessor's instructions.
17517 @item -mcop64
17518 @opindex mcop64
17519 Enables the 64-bit coprocessor's instructions.
17521 @item -mivc2
17522 @opindex mivc2
17523 Enables IVC2 scheduling.  IVC2 is a 64-bit VLIW coprocessor.
17525 @item -mdc
17526 @opindex mdc
17527 Causes constant variables to be placed in the @code{.near} section.
17529 @item -mdiv
17530 @opindex mdiv
17531 Enables the @code{div} and @code{divu} instructions.
17533 @item -meb
17534 @opindex meb
17535 Generate big-endian code.
17537 @item -mel
17538 @opindex mel
17539 Generate little-endian code.
17541 @item -mio-volatile
17542 @opindex mio-volatile
17543 Tells the compiler that any variable marked with the @code{io}
17544 attribute is to be considered volatile.
17546 @item -ml
17547 @opindex ml
17548 Causes variables to be assigned to the @code{.far} section by default.
17550 @item -mleadz
17551 @opindex mleadz
17552 Enables the @code{leadz} (leading zero) instruction.
17554 @item -mm
17555 @opindex mm
17556 Causes variables to be assigned to the @code{.near} section by default.
17558 @item -mminmax
17559 @opindex mminmax
17560 Enables the @code{min} and @code{max} instructions.
17562 @item -mmult
17563 @opindex mmult
17564 Enables the multiplication and multiply-accumulate instructions.
17566 @item -mno-opts
17567 @opindex mno-opts
17568 Disables all the optional instructions enabled by @option{-mall-opts}.
17570 @item -mrepeat
17571 @opindex mrepeat
17572 Enables the @code{repeat} and @code{erepeat} instructions, used for
17573 low-overhead looping.
17575 @item -ms
17576 @opindex ms
17577 Causes all variables to default to the @code{.tiny} section.  Note
17578 that there is a 65536-byte limit to this section.  Accesses to these
17579 variables use the @code{%gp} base register.
17581 @item -msatur
17582 @opindex msatur
17583 Enables the saturation instructions.  Note that the compiler does not
17584 currently generate these itself, but this option is included for
17585 compatibility with other tools, like @code{as}.
17587 @item -msdram
17588 @opindex msdram
17589 Link the SDRAM-based runtime instead of the default ROM-based runtime.
17591 @item -msim
17592 @opindex msim
17593 Link the simulator run-time libraries.
17595 @item -msimnovec
17596 @opindex msimnovec
17597 Link the simulator runtime libraries, excluding built-in support
17598 for reset and exception vectors and tables.
17600 @item -mtf
17601 @opindex mtf
17602 Causes all functions to default to the @code{.far} section.  Without
17603 this option, functions default to the @code{.near} section.
17605 @item -mtiny=@var{n}
17606 @opindex mtiny=
17607 Variables that are @var{n} bytes or smaller are allocated to the
17608 @code{.tiny} section.  These variables use the @code{$gp} base
17609 register.  The default for this option is 4, but note that there's a
17610 65536-byte limit to the @code{.tiny} section.
17612 @end table
17614 @node MicroBlaze Options
17615 @subsection MicroBlaze Options
17616 @cindex MicroBlaze Options
17618 @table @gcctabopt
17620 @item -msoft-float
17621 @opindex msoft-float
17622 Use software emulation for floating point (default).
17624 @item -mhard-float
17625 @opindex mhard-float
17626 Use hardware floating-point instructions.
17628 @item -mmemcpy
17629 @opindex mmemcpy
17630 Do not optimize block moves, use @code{memcpy}.
17632 @item -mno-clearbss
17633 @opindex mno-clearbss
17634 This option is deprecated.  Use @option{-fno-zero-initialized-in-bss} instead.
17636 @item -mcpu=@var{cpu-type}
17637 @opindex mcpu=
17638 Use features of, and schedule code for, the given CPU.
17639 Supported values are in the format @samp{v@var{X}.@var{YY}.@var{Z}},
17640 where @var{X} is a major version, @var{YY} is the minor version, and
17641 @var{Z} is compatibility code.  Example values are @samp{v3.00.a},
17642 @samp{v4.00.b}, @samp{v5.00.a}, @samp{v5.00.b}, @samp{v5.00.b}, @samp{v6.00.a}.
17644 @item -mxl-soft-mul
17645 @opindex mxl-soft-mul
17646 Use software multiply emulation (default).
17648 @item -mxl-soft-div
17649 @opindex mxl-soft-div
17650 Use software emulation for divides (default).
17652 @item -mxl-barrel-shift
17653 @opindex mxl-barrel-shift
17654 Use the hardware barrel shifter.
17656 @item -mxl-pattern-compare
17657 @opindex mxl-pattern-compare
17658 Use pattern compare instructions.
17660 @item -msmall-divides
17661 @opindex msmall-divides
17662 Use table lookup optimization for small signed integer divisions.
17664 @item -mxl-stack-check
17665 @opindex mxl-stack-check
17666 This option is deprecated.  Use @option{-fstack-check} instead.
17668 @item -mxl-gp-opt
17669 @opindex mxl-gp-opt
17670 Use GP-relative @code{.sdata}/@code{.sbss} sections.
17672 @item -mxl-multiply-high
17673 @opindex mxl-multiply-high
17674 Use multiply high instructions for high part of 32x32 multiply.
17676 @item -mxl-float-convert
17677 @opindex mxl-float-convert
17678 Use hardware floating-point conversion instructions.
17680 @item -mxl-float-sqrt
17681 @opindex mxl-float-sqrt
17682 Use hardware floating-point square root instruction.
17684 @item -mbig-endian
17685 @opindex mbig-endian
17686 Generate code for a big-endian target.
17688 @item -mlittle-endian
17689 @opindex mlittle-endian
17690 Generate code for a little-endian target.
17692 @item -mxl-reorder
17693 @opindex mxl-reorder
17694 Use reorder instructions (swap and byte reversed load/store).
17696 @item -mxl-mode-@var{app-model}
17697 Select application model @var{app-model}.  Valid models are
17698 @table @samp
17699 @item executable
17700 normal executable (default), uses startup code @file{crt0.o}.
17702 @item xmdstub
17703 for use with Xilinx Microprocessor Debugger (XMD) based
17704 software intrusive debug agent called xmdstub. This uses startup file
17705 @file{crt1.o} and sets the start address of the program to 0x800.
17707 @item bootstrap
17708 for applications that are loaded using a bootloader.
17709 This model uses startup file @file{crt2.o} which does not contain a processor
17710 reset vector handler. This is suitable for transferring control on a
17711 processor reset to the bootloader rather than the application.
17713 @item novectors
17714 for applications that do not require any of the
17715 MicroBlaze vectors. This option may be useful for applications running
17716 within a monitoring application. This model uses @file{crt3.o} as a startup file.
17717 @end table
17719 Option @option{-xl-mode-@var{app-model}} is a deprecated alias for
17720 @option{-mxl-mode-@var{app-model}}.
17722 @end table
17724 @node MIPS Options
17725 @subsection MIPS Options
17726 @cindex MIPS options
17728 @table @gcctabopt
17730 @item -EB
17731 @opindex EB
17732 Generate big-endian code.
17734 @item -EL
17735 @opindex EL
17736 Generate little-endian code.  This is the default for @samp{mips*el-*-*}
17737 configurations.
17739 @item -march=@var{arch}
17740 @opindex march
17741 Generate code that runs on @var{arch}, which can be the name of a
17742 generic MIPS ISA, or the name of a particular processor.
17743 The ISA names are:
17744 @samp{mips1}, @samp{mips2}, @samp{mips3}, @samp{mips4},
17745 @samp{mips32}, @samp{mips32r2}, @samp{mips32r3}, @samp{mips32r5},
17746 @samp{mips32r6}, @samp{mips64}, @samp{mips64r2}, @samp{mips64r3},
17747 @samp{mips64r5} and @samp{mips64r6}.
17748 The processor names are:
17749 @samp{4kc}, @samp{4km}, @samp{4kp}, @samp{4ksc},
17750 @samp{4kec}, @samp{4kem}, @samp{4kep}, @samp{4ksd},
17751 @samp{5kc}, @samp{5kf},
17752 @samp{20kc},
17753 @samp{24kc}, @samp{24kf2_1}, @samp{24kf1_1},
17754 @samp{24kec}, @samp{24kef2_1}, @samp{24kef1_1},
17755 @samp{34kc}, @samp{34kf2_1}, @samp{34kf1_1}, @samp{34kn},
17756 @samp{74kc}, @samp{74kf2_1}, @samp{74kf1_1}, @samp{74kf3_2},
17757 @samp{1004kc}, @samp{1004kf2_1}, @samp{1004kf1_1},
17758 @samp{i6400},
17759 @samp{interaptiv},
17760 @samp{loongson2e}, @samp{loongson2f}, @samp{loongson3a},
17761 @samp{m4k},
17762 @samp{m14k}, @samp{m14kc}, @samp{m14ke}, @samp{m14kec},
17763 @samp{m5100}, @samp{m5101},
17764 @samp{octeon}, @samp{octeon+}, @samp{octeon2}, @samp{octeon3},
17765 @samp{orion},
17766 @samp{p5600},
17767 @samp{r2000}, @samp{r3000}, @samp{r3900}, @samp{r4000}, @samp{r4400},
17768 @samp{r4600}, @samp{r4650}, @samp{r4700}, @samp{r6000}, @samp{r8000},
17769 @samp{rm7000}, @samp{rm9000},
17770 @samp{r10000}, @samp{r12000}, @samp{r14000}, @samp{r16000},
17771 @samp{sb1},
17772 @samp{sr71000},
17773 @samp{vr4100}, @samp{vr4111}, @samp{vr4120}, @samp{vr4130}, @samp{vr4300},
17774 @samp{vr5000}, @samp{vr5400}, @samp{vr5500},
17775 @samp{xlr} and @samp{xlp}.
17776 The special value @samp{from-abi} selects the
17777 most compatible architecture for the selected ABI (that is,
17778 @samp{mips1} for 32-bit ABIs and @samp{mips3} for 64-bit ABIs)@.
17780 The native Linux/GNU toolchain also supports the value @samp{native},
17781 which selects the best architecture option for the host processor.
17782 @option{-march=native} has no effect if GCC does not recognize
17783 the processor.
17785 In processor names, a final @samp{000} can be abbreviated as @samp{k}
17786 (for example, @option{-march=r2k}).  Prefixes are optional, and
17787 @samp{vr} may be written @samp{r}.
17789 Names of the form @samp{@var{n}f2_1} refer to processors with
17790 FPUs clocked at half the rate of the core, names of the form
17791 @samp{@var{n}f1_1} refer to processors with FPUs clocked at the same
17792 rate as the core, and names of the form @samp{@var{n}f3_2} refer to
17793 processors with FPUs clocked a ratio of 3:2 with respect to the core.
17794 For compatibility reasons, @samp{@var{n}f} is accepted as a synonym
17795 for @samp{@var{n}f2_1} while @samp{@var{n}x} and @samp{@var{b}fx} are
17796 accepted as synonyms for @samp{@var{n}f1_1}.
17798 GCC defines two macros based on the value of this option.  The first
17799 is @code{_MIPS_ARCH}, which gives the name of target architecture, as
17800 a string.  The second has the form @code{_MIPS_ARCH_@var{foo}},
17801 where @var{foo} is the capitalized value of @code{_MIPS_ARCH}@.
17802 For example, @option{-march=r2000} sets @code{_MIPS_ARCH}
17803 to @code{"r2000"} and defines the macro @code{_MIPS_ARCH_R2000}.
17805 Note that the @code{_MIPS_ARCH} macro uses the processor names given
17806 above.  In other words, it has the full prefix and does not
17807 abbreviate @samp{000} as @samp{k}.  In the case of @samp{from-abi},
17808 the macro names the resolved architecture (either @code{"mips1"} or
17809 @code{"mips3"}).  It names the default architecture when no
17810 @option{-march} option is given.
17812 @item -mtune=@var{arch}
17813 @opindex mtune
17814 Optimize for @var{arch}.  Among other things, this option controls
17815 the way instructions are scheduled, and the perceived cost of arithmetic
17816 operations.  The list of @var{arch} values is the same as for
17817 @option{-march}.
17819 When this option is not used, GCC optimizes for the processor
17820 specified by @option{-march}.  By using @option{-march} and
17821 @option{-mtune} together, it is possible to generate code that
17822 runs on a family of processors, but optimize the code for one
17823 particular member of that family.
17825 @option{-mtune} defines the macros @code{_MIPS_TUNE} and
17826 @code{_MIPS_TUNE_@var{foo}}, which work in the same way as the
17827 @option{-march} ones described above.
17829 @item -mips1
17830 @opindex mips1
17831 Equivalent to @option{-march=mips1}.
17833 @item -mips2
17834 @opindex mips2
17835 Equivalent to @option{-march=mips2}.
17837 @item -mips3
17838 @opindex mips3
17839 Equivalent to @option{-march=mips3}.
17841 @item -mips4
17842 @opindex mips4
17843 Equivalent to @option{-march=mips4}.
17845 @item -mips32
17846 @opindex mips32
17847 Equivalent to @option{-march=mips32}.
17849 @item -mips32r3
17850 @opindex mips32r3
17851 Equivalent to @option{-march=mips32r3}.
17853 @item -mips32r5
17854 @opindex mips32r5
17855 Equivalent to @option{-march=mips32r5}.
17857 @item -mips32r6
17858 @opindex mips32r6
17859 Equivalent to @option{-march=mips32r6}.
17861 @item -mips64
17862 @opindex mips64
17863 Equivalent to @option{-march=mips64}.
17865 @item -mips64r2
17866 @opindex mips64r2
17867 Equivalent to @option{-march=mips64r2}.
17869 @item -mips64r3
17870 @opindex mips64r3
17871 Equivalent to @option{-march=mips64r3}.
17873 @item -mips64r5
17874 @opindex mips64r5
17875 Equivalent to @option{-march=mips64r5}.
17877 @item -mips64r6
17878 @opindex mips64r6
17879 Equivalent to @option{-march=mips64r6}.
17881 @item -mips16
17882 @itemx -mno-mips16
17883 @opindex mips16
17884 @opindex mno-mips16
17885 Generate (do not generate) MIPS16 code.  If GCC is targeting a
17886 MIPS32 or MIPS64 architecture, it makes use of the MIPS16e ASE@.
17888 MIPS16 code generation can also be controlled on a per-function basis
17889 by means of @code{mips16} and @code{nomips16} attributes.
17890 @xref{Function Attributes}, for more information.
17892 @item -mflip-mips16
17893 @opindex mflip-mips16
17894 Generate MIPS16 code on alternating functions.  This option is provided
17895 for regression testing of mixed MIPS16/non-MIPS16 code generation, and is
17896 not intended for ordinary use in compiling user code.
17898 @item -minterlink-compressed
17899 @item -mno-interlink-compressed
17900 @opindex minterlink-compressed
17901 @opindex mno-interlink-compressed
17902 Require (do not require) that code using the standard (uncompressed) MIPS ISA
17903 be link-compatible with MIPS16 and microMIPS code, and vice versa.
17905 For example, code using the standard ISA encoding cannot jump directly
17906 to MIPS16 or microMIPS code; it must either use a call or an indirect jump.
17907 @option{-minterlink-compressed} therefore disables direct jumps unless GCC
17908 knows that the target of the jump is not compressed.
17910 @item -minterlink-mips16
17911 @itemx -mno-interlink-mips16
17912 @opindex minterlink-mips16
17913 @opindex mno-interlink-mips16
17914 Aliases of @option{-minterlink-compressed} and
17915 @option{-mno-interlink-compressed}.  These options predate the microMIPS ASE
17916 and are retained for backwards compatibility.
17918 @item -mabi=32
17919 @itemx -mabi=o64
17920 @itemx -mabi=n32
17921 @itemx -mabi=64
17922 @itemx -mabi=eabi
17923 @opindex mabi=32
17924 @opindex mabi=o64
17925 @opindex mabi=n32
17926 @opindex mabi=64
17927 @opindex mabi=eabi
17928 Generate code for the given ABI@.
17930 Note that the EABI has a 32-bit and a 64-bit variant.  GCC normally
17931 generates 64-bit code when you select a 64-bit architecture, but you
17932 can use @option{-mgp32} to get 32-bit code instead.
17934 For information about the O64 ABI, see
17935 @uref{http://gcc.gnu.org/@/projects/@/mipso64-abi.html}.
17937 GCC supports a variant of the o32 ABI in which floating-point registers
17938 are 64 rather than 32 bits wide.  You can select this combination with
17939 @option{-mabi=32} @option{-mfp64}.  This ABI relies on the @code{mthc1}
17940 and @code{mfhc1} instructions and is therefore only supported for
17941 MIPS32R2, MIPS32R3 and MIPS32R5 processors.
17943 The register assignments for arguments and return values remain the
17944 same, but each scalar value is passed in a single 64-bit register
17945 rather than a pair of 32-bit registers.  For example, scalar
17946 floating-point values are returned in @samp{$f0} only, not a
17947 @samp{$f0}/@samp{$f1} pair.  The set of call-saved registers also
17948 remains the same in that the even-numbered double-precision registers
17949 are saved.
17951 Two additional variants of the o32 ABI are supported to enable
17952 a transition from 32-bit to 64-bit registers.  These are FPXX
17953 (@option{-mfpxx}) and FP64A (@option{-mfp64} @option{-mno-odd-spreg}).
17954 The FPXX extension mandates that all code must execute correctly
17955 when run using 32-bit or 64-bit registers.  The code can be interlinked
17956 with either FP32 or FP64, but not both.
17957 The FP64A extension is similar to the FP64 extension but forbids the
17958 use of odd-numbered single-precision registers.  This can be used
17959 in conjunction with the @code{FRE} mode of FPUs in MIPS32R5
17960 processors and allows both FP32 and FP64A code to interlink and
17961 run in the same process without changing FPU modes.
17963 @item -mabicalls
17964 @itemx -mno-abicalls
17965 @opindex mabicalls
17966 @opindex mno-abicalls
17967 Generate (do not generate) code that is suitable for SVR4-style
17968 dynamic objects.  @option{-mabicalls} is the default for SVR4-based
17969 systems.
17971 @item -mshared
17972 @itemx -mno-shared
17973 Generate (do not generate) code that is fully position-independent,
17974 and that can therefore be linked into shared libraries.  This option
17975 only affects @option{-mabicalls}.
17977 All @option{-mabicalls} code has traditionally been position-independent,
17978 regardless of options like @option{-fPIC} and @option{-fpic}.  However,
17979 as an extension, the GNU toolchain allows executables to use absolute
17980 accesses for locally-binding symbols.  It can also use shorter GP
17981 initialization sequences and generate direct calls to locally-defined
17982 functions.  This mode is selected by @option{-mno-shared}.
17984 @option{-mno-shared} depends on binutils 2.16 or higher and generates
17985 objects that can only be linked by the GNU linker.  However, the option
17986 does not affect the ABI of the final executable; it only affects the ABI
17987 of relocatable objects.  Using @option{-mno-shared} generally makes
17988 executables both smaller and quicker.
17990 @option{-mshared} is the default.
17992 @item -mplt
17993 @itemx -mno-plt
17994 @opindex mplt
17995 @opindex mno-plt
17996 Assume (do not assume) that the static and dynamic linkers
17997 support PLTs and copy relocations.  This option only affects
17998 @option{-mno-shared -mabicalls}.  For the n64 ABI, this option
17999 has no effect without @option{-msym32}.
18001 You can make @option{-mplt} the default by configuring
18002 GCC with @option{--with-mips-plt}.  The default is
18003 @option{-mno-plt} otherwise.
18005 @item -mxgot
18006 @itemx -mno-xgot
18007 @opindex mxgot
18008 @opindex mno-xgot
18009 Lift (do not lift) the usual restrictions on the size of the global
18010 offset table.
18012 GCC normally uses a single instruction to load values from the GOT@.
18013 While this is relatively efficient, it only works if the GOT
18014 is smaller than about 64k.  Anything larger causes the linker
18015 to report an error such as:
18017 @cindex relocation truncated to fit (MIPS)
18018 @smallexample
18019 relocation truncated to fit: R_MIPS_GOT16 foobar
18020 @end smallexample
18022 If this happens, you should recompile your code with @option{-mxgot}.
18023 This works with very large GOTs, although the code is also
18024 less efficient, since it takes three instructions to fetch the
18025 value of a global symbol.
18027 Note that some linkers can create multiple GOTs.  If you have such a
18028 linker, you should only need to use @option{-mxgot} when a single object
18029 file accesses more than 64k's worth of GOT entries.  Very few do.
18031 These options have no effect unless GCC is generating position
18032 independent code.
18034 @item -mgp32
18035 @opindex mgp32
18036 Assume that general-purpose registers are 32 bits wide.
18038 @item -mgp64
18039 @opindex mgp64
18040 Assume that general-purpose registers are 64 bits wide.
18042 @item -mfp32
18043 @opindex mfp32
18044 Assume that floating-point registers are 32 bits wide.
18046 @item -mfp64
18047 @opindex mfp64
18048 Assume that floating-point registers are 64 bits wide.
18050 @item -mfpxx
18051 @opindex mfpxx
18052 Do not assume the width of floating-point registers.
18054 @item -mhard-float
18055 @opindex mhard-float
18056 Use floating-point coprocessor instructions.
18058 @item -msoft-float
18059 @opindex msoft-float
18060 Do not use floating-point coprocessor instructions.  Implement
18061 floating-point calculations using library calls instead.
18063 @item -mno-float
18064 @opindex mno-float
18065 Equivalent to @option{-msoft-float}, but additionally asserts that the
18066 program being compiled does not perform any floating-point operations.
18067 This option is presently supported only by some bare-metal MIPS
18068 configurations, where it may select a special set of libraries
18069 that lack all floating-point support (including, for example, the
18070 floating-point @code{printf} formats).  
18071 If code compiled with @option{-mno-float} accidentally contains
18072 floating-point operations, it is likely to suffer a link-time
18073 or run-time failure.
18075 @item -msingle-float
18076 @opindex msingle-float
18077 Assume that the floating-point coprocessor only supports single-precision
18078 operations.
18080 @item -mdouble-float
18081 @opindex mdouble-float
18082 Assume that the floating-point coprocessor supports double-precision
18083 operations.  This is the default.
18085 @item -modd-spreg
18086 @itemx -mno-odd-spreg
18087 @opindex modd-spreg
18088 @opindex mno-odd-spreg
18089 Enable the use of odd-numbered single-precision floating-point registers
18090 for the o32 ABI.  This is the default for processors that are known to
18091 support these registers.  When using the o32 FPXX ABI, @option{-mno-odd-spreg}
18092 is set by default.
18094 @item -mabs=2008
18095 @itemx -mabs=legacy
18096 @opindex mabs=2008
18097 @opindex mabs=legacy
18098 These options control the treatment of the special not-a-number (NaN)
18099 IEEE 754 floating-point data with the @code{abs.@i{fmt}} and
18100 @code{neg.@i{fmt}} machine instructions.
18102 By default or when @option{-mabs=legacy} is used the legacy
18103 treatment is selected.  In this case these instructions are considered
18104 arithmetic and avoided where correct operation is required and the
18105 input operand might be a NaN.  A longer sequence of instructions that
18106 manipulate the sign bit of floating-point datum manually is used
18107 instead unless the @option{-ffinite-math-only} option has also been
18108 specified.
18110 The @option{-mabs=2008} option selects the IEEE 754-2008 treatment.  In
18111 this case these instructions are considered non-arithmetic and therefore
18112 operating correctly in all cases, including in particular where the
18113 input operand is a NaN.  These instructions are therefore always used
18114 for the respective operations.
18116 @item -mnan=2008
18117 @itemx -mnan=legacy
18118 @opindex mnan=2008
18119 @opindex mnan=legacy
18120 These options control the encoding of the special not-a-number (NaN)
18121 IEEE 754 floating-point data.
18123 The @option{-mnan=legacy} option selects the legacy encoding.  In this
18124 case quiet NaNs (qNaNs) are denoted by the first bit of their trailing
18125 significand field being 0, whereas signaling NaNs (sNaNs) are denoted
18126 by the first bit of their trailing significand field being 1.
18128 The @option{-mnan=2008} option selects the IEEE 754-2008 encoding.  In
18129 this case qNaNs are denoted by the first bit of their trailing
18130 significand field being 1, whereas sNaNs are denoted by the first bit of
18131 their trailing significand field being 0.
18133 The default is @option{-mnan=legacy} unless GCC has been configured with
18134 @option{--with-nan=2008}.
18136 @item -mllsc
18137 @itemx -mno-llsc
18138 @opindex mllsc
18139 @opindex mno-llsc
18140 Use (do not use) @samp{ll}, @samp{sc}, and @samp{sync} instructions to
18141 implement atomic memory built-in functions.  When neither option is
18142 specified, GCC uses the instructions if the target architecture
18143 supports them.
18145 @option{-mllsc} is useful if the runtime environment can emulate the
18146 instructions and @option{-mno-llsc} can be useful when compiling for
18147 nonstandard ISAs.  You can make either option the default by
18148 configuring GCC with @option{--with-llsc} and @option{--without-llsc}
18149 respectively.  @option{--with-llsc} is the default for some
18150 configurations; see the installation documentation for details.
18152 @item -mdsp
18153 @itemx -mno-dsp
18154 @opindex mdsp
18155 @opindex mno-dsp
18156 Use (do not use) revision 1 of the MIPS DSP ASE@.
18157 @xref{MIPS DSP Built-in Functions}.  This option defines the
18158 preprocessor macro @code{__mips_dsp}.  It also defines
18159 @code{__mips_dsp_rev} to 1.
18161 @item -mdspr2
18162 @itemx -mno-dspr2
18163 @opindex mdspr2
18164 @opindex mno-dspr2
18165 Use (do not use) revision 2 of the MIPS DSP ASE@.
18166 @xref{MIPS DSP Built-in Functions}.  This option defines the
18167 preprocessor macros @code{__mips_dsp} and @code{__mips_dspr2}.
18168 It also defines @code{__mips_dsp_rev} to 2.
18170 @item -msmartmips
18171 @itemx -mno-smartmips
18172 @opindex msmartmips
18173 @opindex mno-smartmips
18174 Use (do not use) the MIPS SmartMIPS ASE.
18176 @item -mpaired-single
18177 @itemx -mno-paired-single
18178 @opindex mpaired-single
18179 @opindex mno-paired-single
18180 Use (do not use) paired-single floating-point instructions.
18181 @xref{MIPS Paired-Single Support}.  This option requires
18182 hardware floating-point support to be enabled.
18184 @item -mdmx
18185 @itemx -mno-mdmx
18186 @opindex mdmx
18187 @opindex mno-mdmx
18188 Use (do not use) MIPS Digital Media Extension instructions.
18189 This option can only be used when generating 64-bit code and requires
18190 hardware floating-point support to be enabled.
18192 @item -mips3d
18193 @itemx -mno-mips3d
18194 @opindex mips3d
18195 @opindex mno-mips3d
18196 Use (do not use) the MIPS-3D ASE@.  @xref{MIPS-3D Built-in Functions}.
18197 The option @option{-mips3d} implies @option{-mpaired-single}.
18199 @item -mmicromips
18200 @itemx -mno-micromips
18201 @opindex mmicromips
18202 @opindex mno-mmicromips
18203 Generate (do not generate) microMIPS code.
18205 MicroMIPS code generation can also be controlled on a per-function basis
18206 by means of @code{micromips} and @code{nomicromips} attributes.
18207 @xref{Function Attributes}, for more information.
18209 @item -mmt
18210 @itemx -mno-mt
18211 @opindex mmt
18212 @opindex mno-mt
18213 Use (do not use) MT Multithreading instructions.
18215 @item -mmcu
18216 @itemx -mno-mcu
18217 @opindex mmcu
18218 @opindex mno-mcu
18219 Use (do not use) the MIPS MCU ASE instructions.
18221 @item -meva
18222 @itemx -mno-eva
18223 @opindex meva
18224 @opindex mno-eva
18225 Use (do not use) the MIPS Enhanced Virtual Addressing instructions.
18227 @item -mvirt
18228 @itemx -mno-virt
18229 @opindex mvirt
18230 @opindex mno-virt
18231 Use (do not use) the MIPS Virtualization Application Specific instructions.
18233 @item -mxpa
18234 @itemx -mno-xpa
18235 @opindex mxpa
18236 @opindex mno-xpa
18237 Use (do not use) the MIPS eXtended Physical Address (XPA) instructions.
18239 @item -mlong64
18240 @opindex mlong64
18241 Force @code{long} types to be 64 bits wide.  See @option{-mlong32} for
18242 an explanation of the default and the way that the pointer size is
18243 determined.
18245 @item -mlong32
18246 @opindex mlong32
18247 Force @code{long}, @code{int}, and pointer types to be 32 bits wide.
18249 The default size of @code{int}s, @code{long}s and pointers depends on
18250 the ABI@.  All the supported ABIs use 32-bit @code{int}s.  The n64 ABI
18251 uses 64-bit @code{long}s, as does the 64-bit EABI; the others use
18252 32-bit @code{long}s.  Pointers are the same size as @code{long}s,
18253 or the same size as integer registers, whichever is smaller.
18255 @item -msym32
18256 @itemx -mno-sym32
18257 @opindex msym32
18258 @opindex mno-sym32
18259 Assume (do not assume) that all symbols have 32-bit values, regardless
18260 of the selected ABI@.  This option is useful in combination with
18261 @option{-mabi=64} and @option{-mno-abicalls} because it allows GCC
18262 to generate shorter and faster references to symbolic addresses.
18264 @item -G @var{num}
18265 @opindex G
18266 Put definitions of externally-visible data in a small data section
18267 if that data is no bigger than @var{num} bytes.  GCC can then generate
18268 more efficient accesses to the data; see @option{-mgpopt} for details.
18270 The default @option{-G} option depends on the configuration.
18272 @item -mlocal-sdata
18273 @itemx -mno-local-sdata
18274 @opindex mlocal-sdata
18275 @opindex mno-local-sdata
18276 Extend (do not extend) the @option{-G} behavior to local data too,
18277 such as to static variables in C@.  @option{-mlocal-sdata} is the
18278 default for all configurations.
18280 If the linker complains that an application is using too much small data,
18281 you might want to try rebuilding the less performance-critical parts with
18282 @option{-mno-local-sdata}.  You might also want to build large
18283 libraries with @option{-mno-local-sdata}, so that the libraries leave
18284 more room for the main program.
18286 @item -mextern-sdata
18287 @itemx -mno-extern-sdata
18288 @opindex mextern-sdata
18289 @opindex mno-extern-sdata
18290 Assume (do not assume) that externally-defined data is in
18291 a small data section if the size of that data is within the @option{-G} limit.
18292 @option{-mextern-sdata} is the default for all configurations.
18294 If you compile a module @var{Mod} with @option{-mextern-sdata} @option{-G
18295 @var{num}} @option{-mgpopt}, and @var{Mod} references a variable @var{Var}
18296 that is no bigger than @var{num} bytes, you must make sure that @var{Var}
18297 is placed in a small data section.  If @var{Var} is defined by another
18298 module, you must either compile that module with a high-enough
18299 @option{-G} setting or attach a @code{section} attribute to @var{Var}'s
18300 definition.  If @var{Var} is common, you must link the application
18301 with a high-enough @option{-G} setting.
18303 The easiest way of satisfying these restrictions is to compile
18304 and link every module with the same @option{-G} option.  However,
18305 you may wish to build a library that supports several different
18306 small data limits.  You can do this by compiling the library with
18307 the highest supported @option{-G} setting and additionally using
18308 @option{-mno-extern-sdata} to stop the library from making assumptions
18309 about externally-defined data.
18311 @item -mgpopt
18312 @itemx -mno-gpopt
18313 @opindex mgpopt
18314 @opindex mno-gpopt
18315 Use (do not use) GP-relative accesses for symbols that are known to be
18316 in a small data section; see @option{-G}, @option{-mlocal-sdata} and
18317 @option{-mextern-sdata}.  @option{-mgpopt} is the default for all
18318 configurations.
18320 @option{-mno-gpopt} is useful for cases where the @code{$gp} register
18321 might not hold the value of @code{_gp}.  For example, if the code is
18322 part of a library that might be used in a boot monitor, programs that
18323 call boot monitor routines pass an unknown value in @code{$gp}.
18324 (In such situations, the boot monitor itself is usually compiled
18325 with @option{-G0}.)
18327 @option{-mno-gpopt} implies @option{-mno-local-sdata} and
18328 @option{-mno-extern-sdata}.
18330 @item -membedded-data
18331 @itemx -mno-embedded-data
18332 @opindex membedded-data
18333 @opindex mno-embedded-data
18334 Allocate variables to the read-only data section first if possible, then
18335 next in the small data section if possible, otherwise in data.  This gives
18336 slightly slower code than the default, but reduces the amount of RAM required
18337 when executing, and thus may be preferred for some embedded systems.
18339 @item -muninit-const-in-rodata
18340 @itemx -mno-uninit-const-in-rodata
18341 @opindex muninit-const-in-rodata
18342 @opindex mno-uninit-const-in-rodata
18343 Put uninitialized @code{const} variables in the read-only data section.
18344 This option is only meaningful in conjunction with @option{-membedded-data}.
18346 @item -mcode-readable=@var{setting}
18347 @opindex mcode-readable
18348 Specify whether GCC may generate code that reads from executable sections.
18349 There are three possible settings:
18351 @table @gcctabopt
18352 @item -mcode-readable=yes
18353 Instructions may freely access executable sections.  This is the
18354 default setting.
18356 @item -mcode-readable=pcrel
18357 MIPS16 PC-relative load instructions can access executable sections,
18358 but other instructions must not do so.  This option is useful on 4KSc
18359 and 4KSd processors when the code TLBs have the Read Inhibit bit set.
18360 It is also useful on processors that can be configured to have a dual
18361 instruction/data SRAM interface and that, like the M4K, automatically
18362 redirect PC-relative loads to the instruction RAM.
18364 @item -mcode-readable=no
18365 Instructions must not access executable sections.  This option can be
18366 useful on targets that are configured to have a dual instruction/data
18367 SRAM interface but that (unlike the M4K) do not automatically redirect
18368 PC-relative loads to the instruction RAM.
18369 @end table
18371 @item -msplit-addresses
18372 @itemx -mno-split-addresses
18373 @opindex msplit-addresses
18374 @opindex mno-split-addresses
18375 Enable (disable) use of the @code{%hi()} and @code{%lo()} assembler
18376 relocation operators.  This option has been superseded by
18377 @option{-mexplicit-relocs} but is retained for backwards compatibility.
18379 @item -mexplicit-relocs
18380 @itemx -mno-explicit-relocs
18381 @opindex mexplicit-relocs
18382 @opindex mno-explicit-relocs
18383 Use (do not use) assembler relocation operators when dealing with symbolic
18384 addresses.  The alternative, selected by @option{-mno-explicit-relocs},
18385 is to use assembler macros instead.
18387 @option{-mexplicit-relocs} is the default if GCC was configured
18388 to use an assembler that supports relocation operators.
18390 @item -mcheck-zero-division
18391 @itemx -mno-check-zero-division
18392 @opindex mcheck-zero-division
18393 @opindex mno-check-zero-division
18394 Trap (do not trap) on integer division by zero.
18396 The default is @option{-mcheck-zero-division}.
18398 @item -mdivide-traps
18399 @itemx -mdivide-breaks
18400 @opindex mdivide-traps
18401 @opindex mdivide-breaks
18402 MIPS systems check for division by zero by generating either a
18403 conditional trap or a break instruction.  Using traps results in
18404 smaller code, but is only supported on MIPS II and later.  Also, some
18405 versions of the Linux kernel have a bug that prevents trap from
18406 generating the proper signal (@code{SIGFPE}).  Use @option{-mdivide-traps} to
18407 allow conditional traps on architectures that support them and
18408 @option{-mdivide-breaks} to force the use of breaks.
18410 The default is usually @option{-mdivide-traps}, but this can be
18411 overridden at configure time using @option{--with-divide=breaks}.
18412 Divide-by-zero checks can be completely disabled using
18413 @option{-mno-check-zero-division}.
18415 @item -mmemcpy
18416 @itemx -mno-memcpy
18417 @opindex mmemcpy
18418 @opindex mno-memcpy
18419 Force (do not force) the use of @code{memcpy} for non-trivial block
18420 moves.  The default is @option{-mno-memcpy}, which allows GCC to inline
18421 most constant-sized copies.
18423 @item -mlong-calls
18424 @itemx -mno-long-calls
18425 @opindex mlong-calls
18426 @opindex mno-long-calls
18427 Disable (do not disable) use of the @code{jal} instruction.  Calling
18428 functions using @code{jal} is more efficient but requires the caller
18429 and callee to be in the same 256 megabyte segment.
18431 This option has no effect on abicalls code.  The default is
18432 @option{-mno-long-calls}.
18434 @item -mmad
18435 @itemx -mno-mad
18436 @opindex mmad
18437 @opindex mno-mad
18438 Enable (disable) use of the @code{mad}, @code{madu} and @code{mul}
18439 instructions, as provided by the R4650 ISA@.
18441 @item -mimadd
18442 @itemx -mno-imadd
18443 @opindex mimadd
18444 @opindex mno-imadd
18445 Enable (disable) use of the @code{madd} and @code{msub} integer
18446 instructions.  The default is @option{-mimadd} on architectures
18447 that support @code{madd} and @code{msub} except for the 74k 
18448 architecture where it was found to generate slower code.
18450 @item -mfused-madd
18451 @itemx -mno-fused-madd
18452 @opindex mfused-madd
18453 @opindex mno-fused-madd
18454 Enable (disable) use of the floating-point multiply-accumulate
18455 instructions, when they are available.  The default is
18456 @option{-mfused-madd}.
18458 On the R8000 CPU when multiply-accumulate instructions are used,
18459 the intermediate product is calculated to infinite precision
18460 and is not subject to the FCSR Flush to Zero bit.  This may be
18461 undesirable in some circumstances.  On other processors the result
18462 is numerically identical to the equivalent computation using
18463 separate multiply, add, subtract and negate instructions.
18465 @item -nocpp
18466 @opindex nocpp
18467 Tell the MIPS assembler to not run its preprocessor over user
18468 assembler files (with a @samp{.s} suffix) when assembling them.
18470 @item -mfix-24k
18471 @item -mno-fix-24k
18472 @opindex mfix-24k
18473 @opindex mno-fix-24k
18474 Work around the 24K E48 (lost data on stores during refill) errata.
18475 The workarounds are implemented by the assembler rather than by GCC@.
18477 @item -mfix-r4000
18478 @itemx -mno-fix-r4000
18479 @opindex mfix-r4000
18480 @opindex mno-fix-r4000
18481 Work around certain R4000 CPU errata:
18482 @itemize @minus
18483 @item
18484 A double-word or a variable shift may give an incorrect result if executed
18485 immediately after starting an integer division.
18486 @item
18487 A double-word or a variable shift may give an incorrect result if executed
18488 while an integer multiplication is in progress.
18489 @item
18490 An integer division may give an incorrect result if started in a delay slot
18491 of a taken branch or a jump.
18492 @end itemize
18494 @item -mfix-r4400
18495 @itemx -mno-fix-r4400
18496 @opindex mfix-r4400
18497 @opindex mno-fix-r4400
18498 Work around certain R4400 CPU errata:
18499 @itemize @minus
18500 @item
18501 A double-word or a variable shift may give an incorrect result if executed
18502 immediately after starting an integer division.
18503 @end itemize
18505 @item -mfix-r10000
18506 @itemx -mno-fix-r10000
18507 @opindex mfix-r10000
18508 @opindex mno-fix-r10000
18509 Work around certain R10000 errata:
18510 @itemize @minus
18511 @item
18512 @code{ll}/@code{sc} sequences may not behave atomically on revisions
18513 prior to 3.0.  They may deadlock on revisions 2.6 and earlier.
18514 @end itemize
18516 This option can only be used if the target architecture supports
18517 branch-likely instructions.  @option{-mfix-r10000} is the default when
18518 @option{-march=r10000} is used; @option{-mno-fix-r10000} is the default
18519 otherwise.
18521 @item -mfix-rm7000
18522 @itemx -mno-fix-rm7000
18523 @opindex mfix-rm7000
18524 Work around the RM7000 @code{dmult}/@code{dmultu} errata.  The
18525 workarounds are implemented by the assembler rather than by GCC@.
18527 @item -mfix-vr4120
18528 @itemx -mno-fix-vr4120
18529 @opindex mfix-vr4120
18530 Work around certain VR4120 errata:
18531 @itemize @minus
18532 @item
18533 @code{dmultu} does not always produce the correct result.
18534 @item
18535 @code{div} and @code{ddiv} do not always produce the correct result if one
18536 of the operands is negative.
18537 @end itemize
18538 The workarounds for the division errata rely on special functions in
18539 @file{libgcc.a}.  At present, these functions are only provided by
18540 the @code{mips64vr*-elf} configurations.
18542 Other VR4120 errata require a NOP to be inserted between certain pairs of
18543 instructions.  These errata are handled by the assembler, not by GCC itself.
18545 @item -mfix-vr4130
18546 @opindex mfix-vr4130
18547 Work around the VR4130 @code{mflo}/@code{mfhi} errata.  The
18548 workarounds are implemented by the assembler rather than by GCC,
18549 although GCC avoids using @code{mflo} and @code{mfhi} if the
18550 VR4130 @code{macc}, @code{macchi}, @code{dmacc} and @code{dmacchi}
18551 instructions are available instead.
18553 @item -mfix-sb1
18554 @itemx -mno-fix-sb1
18555 @opindex mfix-sb1
18556 Work around certain SB-1 CPU core errata.
18557 (This flag currently works around the SB-1 revision 2
18558 ``F1'' and ``F2'' floating-point errata.)
18560 @item -mr10k-cache-barrier=@var{setting}
18561 @opindex mr10k-cache-barrier
18562 Specify whether GCC should insert cache barriers to avoid the
18563 side-effects of speculation on R10K processors.
18565 In common with many processors, the R10K tries to predict the outcome
18566 of a conditional branch and speculatively executes instructions from
18567 the ``taken'' branch.  It later aborts these instructions if the
18568 predicted outcome is wrong.  However, on the R10K, even aborted
18569 instructions can have side effects.
18571 This problem only affects kernel stores and, depending on the system,
18572 kernel loads.  As an example, a speculatively-executed store may load
18573 the target memory into cache and mark the cache line as dirty, even if
18574 the store itself is later aborted.  If a DMA operation writes to the
18575 same area of memory before the ``dirty'' line is flushed, the cached
18576 data overwrites the DMA-ed data.  See the R10K processor manual
18577 for a full description, including other potential problems.
18579 One workaround is to insert cache barrier instructions before every memory
18580 access that might be speculatively executed and that might have side
18581 effects even if aborted.  @option{-mr10k-cache-barrier=@var{setting}}
18582 controls GCC's implementation of this workaround.  It assumes that
18583 aborted accesses to any byte in the following regions does not have
18584 side effects:
18586 @enumerate
18587 @item
18588 the memory occupied by the current function's stack frame;
18590 @item
18591 the memory occupied by an incoming stack argument;
18593 @item
18594 the memory occupied by an object with a link-time-constant address.
18595 @end enumerate
18597 It is the kernel's responsibility to ensure that speculative
18598 accesses to these regions are indeed safe.
18600 If the input program contains a function declaration such as:
18602 @smallexample
18603 void foo (void);
18604 @end smallexample
18606 then the implementation of @code{foo} must allow @code{j foo} and
18607 @code{jal foo} to be executed speculatively.  GCC honors this
18608 restriction for functions it compiles itself.  It expects non-GCC
18609 functions (such as hand-written assembly code) to do the same.
18611 The option has three forms:
18613 @table @gcctabopt
18614 @item -mr10k-cache-barrier=load-store
18615 Insert a cache barrier before a load or store that might be
18616 speculatively executed and that might have side effects even
18617 if aborted.
18619 @item -mr10k-cache-barrier=store
18620 Insert a cache barrier before a store that might be speculatively
18621 executed and that might have side effects even if aborted.
18623 @item -mr10k-cache-barrier=none
18624 Disable the insertion of cache barriers.  This is the default setting.
18625 @end table
18627 @item -mflush-func=@var{func}
18628 @itemx -mno-flush-func
18629 @opindex mflush-func
18630 Specifies the function to call to flush the I and D caches, or to not
18631 call any such function.  If called, the function must take the same
18632 arguments as the common @code{_flush_func}, that is, the address of the
18633 memory range for which the cache is being flushed, the size of the
18634 memory range, and the number 3 (to flush both caches).  The default
18635 depends on the target GCC was configured for, but commonly is either
18636 @code{_flush_func} or @code{__cpu_flush}.
18638 @item mbranch-cost=@var{num}
18639 @opindex mbranch-cost
18640 Set the cost of branches to roughly @var{num} ``simple'' instructions.
18641 This cost is only a heuristic and is not guaranteed to produce
18642 consistent results across releases.  A zero cost redundantly selects
18643 the default, which is based on the @option{-mtune} setting.
18645 @item -mbranch-likely
18646 @itemx -mno-branch-likely
18647 @opindex mbranch-likely
18648 @opindex mno-branch-likely
18649 Enable or disable use of Branch Likely instructions, regardless of the
18650 default for the selected architecture.  By default, Branch Likely
18651 instructions may be generated if they are supported by the selected
18652 architecture.  An exception is for the MIPS32 and MIPS64 architectures
18653 and processors that implement those architectures; for those, Branch
18654 Likely instructions are not be generated by default because the MIPS32
18655 and MIPS64 architectures specifically deprecate their use.
18657 @item -mcompact-branches=never
18658 @itemx -mcompact-branches=optimal
18659 @itemx -mcompact-branches=always
18660 @opindex mcompact-branches=never
18661 @opindex mcompact-branches=optimal
18662 @opindex mcompact-branches=always
18663 These options control which form of branches will be generated.  The
18664 default is @option{-mcompact-branches=optimal}.
18666 The @option{-mcompact-branches=never} option ensures that compact branch
18667 instructions will never be generated.
18669 The @option{-mcompact-branches=always} option ensures that a compact
18670 branch instruction will be generated if available.  If a compact branch
18671 instruction is not available, a delay slot form of the branch will be
18672 used instead.
18674 This option is supported from MIPS Release 6 onwards.
18676 The @option{-mcompact-branches=optimal} option will cause a delay slot
18677 branch to be used if one is available in the current ISA and the delay
18678 slot is successfully filled.  If the delay slot is not filled, a compact
18679 branch will be chosen if one is available.
18681 @item -mfp-exceptions
18682 @itemx -mno-fp-exceptions
18683 @opindex mfp-exceptions
18684 Specifies whether FP exceptions are enabled.  This affects how
18685 FP instructions are scheduled for some processors.
18686 The default is that FP exceptions are
18687 enabled.
18689 For instance, on the SB-1, if FP exceptions are disabled, and we are emitting
18690 64-bit code, then we can use both FP pipes.  Otherwise, we can only use one
18691 FP pipe.
18693 @item -mvr4130-align
18694 @itemx -mno-vr4130-align
18695 @opindex mvr4130-align
18696 The VR4130 pipeline is two-way superscalar, but can only issue two
18697 instructions together if the first one is 8-byte aligned.  When this
18698 option is enabled, GCC aligns pairs of instructions that it
18699 thinks should execute in parallel.
18701 This option only has an effect when optimizing for the VR4130.
18702 It normally makes code faster, but at the expense of making it bigger.
18703 It is enabled by default at optimization level @option{-O3}.
18705 @item -msynci
18706 @itemx -mno-synci
18707 @opindex msynci
18708 Enable (disable) generation of @code{synci} instructions on
18709 architectures that support it.  The @code{synci} instructions (if
18710 enabled) are generated when @code{__builtin___clear_cache} is
18711 compiled.
18713 This option defaults to @option{-mno-synci}, but the default can be
18714 overridden by configuring GCC with @option{--with-synci}.
18716 When compiling code for single processor systems, it is generally safe
18717 to use @code{synci}.  However, on many multi-core (SMP) systems, it
18718 does not invalidate the instruction caches on all cores and may lead
18719 to undefined behavior.
18721 @item -mrelax-pic-calls
18722 @itemx -mno-relax-pic-calls
18723 @opindex mrelax-pic-calls
18724 Try to turn PIC calls that are normally dispatched via register
18725 @code{$25} into direct calls.  This is only possible if the linker can
18726 resolve the destination at link time and if the destination is within
18727 range for a direct call.
18729 @option{-mrelax-pic-calls} is the default if GCC was configured to use
18730 an assembler and a linker that support the @code{.reloc} assembly
18731 directive and @option{-mexplicit-relocs} is in effect.  With
18732 @option{-mno-explicit-relocs}, this optimization can be performed by the
18733 assembler and the linker alone without help from the compiler.
18735 @item -mmcount-ra-address
18736 @itemx -mno-mcount-ra-address
18737 @opindex mmcount-ra-address
18738 @opindex mno-mcount-ra-address
18739 Emit (do not emit) code that allows @code{_mcount} to modify the
18740 calling function's return address.  When enabled, this option extends
18741 the usual @code{_mcount} interface with a new @var{ra-address}
18742 parameter, which has type @code{intptr_t *} and is passed in register
18743 @code{$12}.  @code{_mcount} can then modify the return address by
18744 doing both of the following:
18745 @itemize
18746 @item
18747 Returning the new address in register @code{$31}.
18748 @item
18749 Storing the new address in @code{*@var{ra-address}},
18750 if @var{ra-address} is nonnull.
18751 @end itemize
18753 The default is @option{-mno-mcount-ra-address}.
18755 @item -mframe-header-opt
18756 @itemx -mno-frame-header-opt
18757 @opindex mframe-header-opt
18758 Enable (disable) frame header optimization in the o32 ABI.  When using the
18759 o32 ABI, calling functions will allocate 16 bytes on the stack for the called
18760 function to write out register arguments.  When enabled, this optimization
18761 will suppress the allocation of the frame header if it can be determined that
18762 it is unused.
18764 This optimization is off by default at all optimization levels.
18766 @end table
18768 @node MMIX Options
18769 @subsection MMIX Options
18770 @cindex MMIX Options
18772 These options are defined for the MMIX:
18774 @table @gcctabopt
18775 @item -mlibfuncs
18776 @itemx -mno-libfuncs
18777 @opindex mlibfuncs
18778 @opindex mno-libfuncs
18779 Specify that intrinsic library functions are being compiled, passing all
18780 values in registers, no matter the size.
18782 @item -mepsilon
18783 @itemx -mno-epsilon
18784 @opindex mepsilon
18785 @opindex mno-epsilon
18786 Generate floating-point comparison instructions that compare with respect
18787 to the @code{rE} epsilon register.
18789 @item -mabi=mmixware
18790 @itemx -mabi=gnu
18791 @opindex mabi=mmixware
18792 @opindex mabi=gnu
18793 Generate code that passes function parameters and return values that (in
18794 the called function) are seen as registers @code{$0} and up, as opposed to
18795 the GNU ABI which uses global registers @code{$231} and up.
18797 @item -mzero-extend
18798 @itemx -mno-zero-extend
18799 @opindex mzero-extend
18800 @opindex mno-zero-extend
18801 When reading data from memory in sizes shorter than 64 bits, use (do not
18802 use) zero-extending load instructions by default, rather than
18803 sign-extending ones.
18805 @item -mknuthdiv
18806 @itemx -mno-knuthdiv
18807 @opindex mknuthdiv
18808 @opindex mno-knuthdiv
18809 Make the result of a division yielding a remainder have the same sign as
18810 the divisor.  With the default, @option{-mno-knuthdiv}, the sign of the
18811 remainder follows the sign of the dividend.  Both methods are
18812 arithmetically valid, the latter being almost exclusively used.
18814 @item -mtoplevel-symbols
18815 @itemx -mno-toplevel-symbols
18816 @opindex mtoplevel-symbols
18817 @opindex mno-toplevel-symbols
18818 Prepend (do not prepend) a @samp{:} to all global symbols, so the assembly
18819 code can be used with the @code{PREFIX} assembly directive.
18821 @item -melf
18822 @opindex melf
18823 Generate an executable in the ELF format, rather than the default
18824 @samp{mmo} format used by the @command{mmix} simulator.
18826 @item -mbranch-predict
18827 @itemx -mno-branch-predict
18828 @opindex mbranch-predict
18829 @opindex mno-branch-predict
18830 Use (do not use) the probable-branch instructions, when static branch
18831 prediction indicates a probable branch.
18833 @item -mbase-addresses
18834 @itemx -mno-base-addresses
18835 @opindex mbase-addresses
18836 @opindex mno-base-addresses
18837 Generate (do not generate) code that uses @emph{base addresses}.  Using a
18838 base address automatically generates a request (handled by the assembler
18839 and the linker) for a constant to be set up in a global register.  The
18840 register is used for one or more base address requests within the range 0
18841 to 255 from the value held in the register.  The generally leads to short
18842 and fast code, but the number of different data items that can be
18843 addressed is limited.  This means that a program that uses lots of static
18844 data may require @option{-mno-base-addresses}.
18846 @item -msingle-exit
18847 @itemx -mno-single-exit
18848 @opindex msingle-exit
18849 @opindex mno-single-exit
18850 Force (do not force) generated code to have a single exit point in each
18851 function.
18852 @end table
18854 @node MN10300 Options
18855 @subsection MN10300 Options
18856 @cindex MN10300 options
18858 These @option{-m} options are defined for Matsushita MN10300 architectures:
18860 @table @gcctabopt
18861 @item -mmult-bug
18862 @opindex mmult-bug
18863 Generate code to avoid bugs in the multiply instructions for the MN10300
18864 processors.  This is the default.
18866 @item -mno-mult-bug
18867 @opindex mno-mult-bug
18868 Do not generate code to avoid bugs in the multiply instructions for the
18869 MN10300 processors.
18871 @item -mam33
18872 @opindex mam33
18873 Generate code using features specific to the AM33 processor.
18875 @item -mno-am33
18876 @opindex mno-am33
18877 Do not generate code using features specific to the AM33 processor.  This
18878 is the default.
18880 @item -mam33-2
18881 @opindex mam33-2
18882 Generate code using features specific to the AM33/2.0 processor.
18884 @item -mam34
18885 @opindex mam34
18886 Generate code using features specific to the AM34 processor.
18888 @item -mtune=@var{cpu-type}
18889 @opindex mtune
18890 Use the timing characteristics of the indicated CPU type when
18891 scheduling instructions.  This does not change the targeted processor
18892 type.  The CPU type must be one of @samp{mn10300}, @samp{am33},
18893 @samp{am33-2} or @samp{am34}.
18895 @item -mreturn-pointer-on-d0
18896 @opindex mreturn-pointer-on-d0
18897 When generating a function that returns a pointer, return the pointer
18898 in both @code{a0} and @code{d0}.  Otherwise, the pointer is returned
18899 only in @code{a0}, and attempts to call such functions without a prototype
18900 result in errors.  Note that this option is on by default; use
18901 @option{-mno-return-pointer-on-d0} to disable it.
18903 @item -mno-crt0
18904 @opindex mno-crt0
18905 Do not link in the C run-time initialization object file.
18907 @item -mrelax
18908 @opindex mrelax
18909 Indicate to the linker that it should perform a relaxation optimization pass
18910 to shorten branches, calls and absolute memory addresses.  This option only
18911 has an effect when used on the command line for the final link step.
18913 This option makes symbolic debugging impossible.
18915 @item -mliw
18916 @opindex mliw
18917 Allow the compiler to generate @emph{Long Instruction Word}
18918 instructions if the target is the @samp{AM33} or later.  This is the
18919 default.  This option defines the preprocessor macro @code{__LIW__}.
18921 @item -mnoliw
18922 @opindex mnoliw
18923 Do not allow the compiler to generate @emph{Long Instruction Word}
18924 instructions.  This option defines the preprocessor macro
18925 @code{__NO_LIW__}.
18927 @item -msetlb
18928 @opindex msetlb
18929 Allow the compiler to generate the @emph{SETLB} and @emph{Lcc}
18930 instructions if the target is the @samp{AM33} or later.  This is the
18931 default.  This option defines the preprocessor macro @code{__SETLB__}.
18933 @item -mnosetlb
18934 @opindex mnosetlb
18935 Do not allow the compiler to generate @emph{SETLB} or @emph{Lcc}
18936 instructions.  This option defines the preprocessor macro
18937 @code{__NO_SETLB__}.
18939 @end table
18941 @node Moxie Options
18942 @subsection Moxie Options
18943 @cindex Moxie Options
18945 @table @gcctabopt
18947 @item -meb
18948 @opindex meb
18949 Generate big-endian code.  This is the default for @samp{moxie-*-*}
18950 configurations.
18952 @item -mel
18953 @opindex mel
18954 Generate little-endian code.
18956 @item -mmul.x
18957 @opindex mmul.x
18958 Generate mul.x and umul.x instructions.  This is the default for
18959 @samp{moxiebox-*-*} configurations.
18961 @item -mno-crt0
18962 @opindex mno-crt0
18963 Do not link in the C run-time initialization object file.
18965 @end table
18967 @node MSP430 Options
18968 @subsection MSP430 Options
18969 @cindex MSP430 Options
18971 These options are defined for the MSP430:
18973 @table @gcctabopt
18975 @item -masm-hex
18976 @opindex masm-hex
18977 Force assembly output to always use hex constants.  Normally such
18978 constants are signed decimals, but this option is available for
18979 testsuite and/or aesthetic purposes.
18981 @item -mmcu=
18982 @opindex mmcu=
18983 Select the MCU to target.  This is used to create a C preprocessor
18984 symbol based upon the MCU name, converted to upper case and pre- and
18985 post-fixed with @samp{__}.  This in turn is used by the
18986 @file{msp430.h} header file to select an MCU-specific supplementary
18987 header file.
18989 The option also sets the ISA to use.  If the MCU name is one that is
18990 known to only support the 430 ISA then that is selected, otherwise the
18991 430X ISA is selected.  A generic MCU name of @samp{msp430} can also be
18992 used to select the 430 ISA.  Similarly the generic @samp{msp430x} MCU
18993 name selects the 430X ISA.
18995 In addition an MCU-specific linker script is added to the linker
18996 command line.  The script's name is the name of the MCU with
18997 @file{.ld} appended.  Thus specifying @option{-mmcu=xxx} on the @command{gcc}
18998 command line defines the C preprocessor symbol @code{__XXX__} and
18999 cause the linker to search for a script called @file{xxx.ld}.
19001 This option is also passed on to the assembler.
19003 @item -mwarn-mcu
19004 @itemx -mno-warn-mcu
19005 @opindex mwarn-mcu
19006 @opindex mno-warn-mcu
19007 This option enables or disables warnings about conflicts between the
19008 MCU name specified by the @option{-mmcu} option and the ISA set by the
19009 @option{-mcpu} option and/or the hardware multiply support set by the
19010 @option{-mhwmult} option.  It also toggles warnings about unrecognized
19011 MCU names.  This option is on by default.
19013 @item -mcpu=
19014 @opindex mcpu=
19015 Specifies the ISA to use.  Accepted values are @samp{msp430},
19016 @samp{msp430x} and @samp{msp430xv2}.  This option is deprecated.  The
19017 @option{-mmcu=} option should be used to select the ISA.
19019 @item -msim
19020 @opindex msim
19021 Link to the simulator runtime libraries and linker script.  Overrides
19022 any scripts that would be selected by the @option{-mmcu=} option.
19024 @item -mlarge
19025 @opindex mlarge
19026 Use large-model addressing (20-bit pointers, 32-bit @code{size_t}).
19028 @item -msmall
19029 @opindex msmall
19030 Use small-model addressing (16-bit pointers, 16-bit @code{size_t}).
19032 @item -mrelax
19033 @opindex mrelax
19034 This option is passed to the assembler and linker, and allows the
19035 linker to perform certain optimizations that cannot be done until
19036 the final link.
19038 @item mhwmult=
19039 @opindex mhwmult=
19040 Describes the type of hardware multiply supported by the target.
19041 Accepted values are @samp{none} for no hardware multiply, @samp{16bit}
19042 for the original 16-bit-only multiply supported by early MCUs.
19043 @samp{32bit} for the 16/32-bit multiply supported by later MCUs and
19044 @samp{f5series} for the 16/32-bit multiply supported by F5-series MCUs.
19045 A value of @samp{auto} can also be given.  This tells GCC to deduce
19046 the hardware multiply support based upon the MCU name provided by the
19047 @option{-mmcu} option.  If no @option{-mmcu} option is specified or if
19048 the MCU name is not recognized then no hardware multiply support is
19049 assumed.  @code{auto} is the default setting.
19051 Hardware multiplies are normally performed by calling a library
19052 routine.  This saves space in the generated code.  When compiling at
19053 @option{-O3} or higher however the hardware multiplier is invoked
19054 inline.  This makes for bigger, but faster code.
19056 The hardware multiply routines disable interrupts whilst running and
19057 restore the previous interrupt state when they finish.  This makes
19058 them safe to use inside interrupt handlers as well as in normal code.
19060 @item -minrt
19061 @opindex minrt
19062 Enable the use of a minimum runtime environment - no static
19063 initializers or constructors.  This is intended for memory-constrained
19064 devices.  The compiler includes special symbols in some objects
19065 that tell the linker and runtime which code fragments are required.
19067 @item -mcode-region=
19068 @itemx -mdata-region=
19069 @opindex mcode-region
19070 @opindex mdata-region
19071 These options tell the compiler where to place functions and data that
19072 do not have one of the @code{lower}, @code{upper}, @code{either} or
19073 @code{section} attributes.  Possible values are @code{lower},
19074 @code{upper}, @code{either} or @code{any}.  The first three behave
19075 like the corresponding attribute.  The fourth possible value -
19076 @code{any} - is the default.  It leaves placement entirely up to the
19077 linker script and how it assigns the standard sections
19078 (@code{.text}, @code{.data}, etc) to the memory regions.
19080 @item -msilicon-errata=
19081 @opindex msilicon-errata
19082 This option passes on a request to assembler to enable the fixes for
19083 the named silicon errata.
19085 @item -msilicon-errata-warn=
19086 @opindex msilicon-errata-warn
19087 This option passes on a request to the assembler to enable warning
19088 messages when a silicon errata might need to be applied.
19090 @end table
19092 @node NDS32 Options
19093 @subsection NDS32 Options
19094 @cindex NDS32 Options
19096 These options are defined for NDS32 implementations:
19098 @table @gcctabopt
19100 @item -mbig-endian
19101 @opindex mbig-endian
19102 Generate code in big-endian mode.
19104 @item -mlittle-endian
19105 @opindex mlittle-endian
19106 Generate code in little-endian mode.
19108 @item -mreduced-regs
19109 @opindex mreduced-regs
19110 Use reduced-set registers for register allocation.
19112 @item -mfull-regs
19113 @opindex mfull-regs
19114 Use full-set registers for register allocation.
19116 @item -mcmov
19117 @opindex mcmov
19118 Generate conditional move instructions.
19120 @item -mno-cmov
19121 @opindex mno-cmov
19122 Do not generate conditional move instructions.
19124 @item -mperf-ext
19125 @opindex mperf-ext
19126 Generate performance extension instructions.
19128 @item -mno-perf-ext
19129 @opindex mno-perf-ext
19130 Do not generate performance extension instructions.
19132 @item -mv3push
19133 @opindex mv3push
19134 Generate v3 push25/pop25 instructions.
19136 @item -mno-v3push
19137 @opindex mno-v3push
19138 Do not generate v3 push25/pop25 instructions.
19140 @item -m16-bit
19141 @opindex m16-bit
19142 Generate 16-bit instructions.
19144 @item -mno-16-bit
19145 @opindex mno-16-bit
19146 Do not generate 16-bit instructions.
19148 @item -misr-vector-size=@var{num}
19149 @opindex misr-vector-size
19150 Specify the size of each interrupt vector, which must be 4 or 16.
19152 @item -mcache-block-size=@var{num}
19153 @opindex mcache-block-size
19154 Specify the size of each cache block,
19155 which must be a power of 2 between 4 and 512.
19157 @item -march=@var{arch}
19158 @opindex march
19159 Specify the name of the target architecture.
19161 @item -mcmodel=@var{code-model}
19162 @opindex mcmodel
19163 Set the code model to one of
19164 @table @asis
19165 @item @samp{small}
19166 All the data and read-only data segments must be within 512KB addressing space.
19167 The text segment must be within 16MB addressing space.
19168 @item @samp{medium}
19169 The data segment must be within 512KB while the read-only data segment can be
19170 within 4GB addressing space.  The text segment should be still within 16MB
19171 addressing space.
19172 @item @samp{large}
19173 All the text and data segments can be within 4GB addressing space.
19174 @end table
19176 @item -mctor-dtor
19177 @opindex mctor-dtor
19178 Enable constructor/destructor feature.
19180 @item -mrelax
19181 @opindex mrelax
19182 Guide linker to relax instructions.
19184 @end table
19186 @node Nios II Options
19187 @subsection Nios II Options
19188 @cindex Nios II options
19189 @cindex Altera Nios II options
19191 These are the options defined for the Altera Nios II processor.
19193 @table @gcctabopt
19195 @item -G @var{num}
19196 @opindex G
19197 @cindex smaller data references
19198 Put global and static objects less than or equal to @var{num} bytes
19199 into the small data or BSS sections instead of the normal data or BSS
19200 sections.  The default value of @var{num} is 8.
19202 @item -mgpopt=@var{option}
19203 @item -mgpopt
19204 @itemx -mno-gpopt
19205 @opindex mgpopt
19206 @opindex mno-gpopt
19207 Generate (do not generate) GP-relative accesses.  The following 
19208 @var{option} names are recognized:
19210 @table @samp
19212 @item none
19213 Do not generate GP-relative accesses.
19215 @item local
19216 Generate GP-relative accesses for small data objects that are not 
19217 external, weak, or uninitialized common symbols.  
19218 Also use GP-relative addressing for objects that
19219 have been explicitly placed in a small data section via a @code{section}
19220 attribute.
19222 @item global
19223 As for @samp{local}, but also generate GP-relative accesses for
19224 small data objects that are external, weak, or common.  If you use this option,
19225 you must ensure that all parts of your program (including libraries) are
19226 compiled with the same @option{-G} setting.
19228 @item data
19229 Generate GP-relative accesses for all data objects in the program.  If you
19230 use this option, the entire data and BSS segments
19231 of your program must fit in 64K of memory and you must use an appropriate
19232 linker script to allocate them within the addressable range of the
19233 global pointer.
19235 @item all
19236 Generate GP-relative addresses for function pointers as well as data
19237 pointers.  If you use this option, the entire text, data, and BSS segments
19238 of your program must fit in 64K of memory and you must use an appropriate
19239 linker script to allocate them within the addressable range of the
19240 global pointer.
19242 @end table
19244 @option{-mgpopt} is equivalent to @option{-mgpopt=local}, and
19245 @option{-mno-gpopt} is equivalent to @option{-mgpopt=none}.
19247 The default is @option{-mgpopt} except when @option{-fpic} or
19248 @option{-fPIC} is specified to generate position-independent code.
19249 Note that the Nios II ABI does not permit GP-relative accesses from
19250 shared libraries.
19252 You may need to specify @option{-mno-gpopt} explicitly when building
19253 programs that include large amounts of small data, including large
19254 GOT data sections.  In this case, the 16-bit offset for GP-relative
19255 addressing may not be large enough to allow access to the entire 
19256 small data section.
19258 @item -mel
19259 @itemx -meb
19260 @opindex mel
19261 @opindex meb
19262 Generate little-endian (default) or big-endian (experimental) code,
19263 respectively.
19265 @item -march=@var{arch}
19266 @opindex march
19267 This specifies the name of the target Nios II architecture.  GCC uses this
19268 name to determine what kind of instructions it can emit when generating
19269 assembly code.  Permissible names are: @samp{r1}, @samp{r2}.
19271 The preprocessor macro @code{__nios2_arch__} is available to programs,
19272 with value 1 or 2, indicating the targeted ISA level.
19274 @item -mbypass-cache
19275 @itemx -mno-bypass-cache
19276 @opindex mno-bypass-cache
19277 @opindex mbypass-cache
19278 Force all load and store instructions to always bypass cache by 
19279 using I/O variants of the instructions. The default is not to
19280 bypass the cache.
19282 @item -mno-cache-volatile 
19283 @itemx -mcache-volatile       
19284 @opindex mcache-volatile 
19285 @opindex mno-cache-volatile
19286 Volatile memory access bypass the cache using the I/O variants of 
19287 the load and store instructions. The default is not to bypass the cache.
19289 @item -mno-fast-sw-div
19290 @itemx -mfast-sw-div
19291 @opindex mno-fast-sw-div
19292 @opindex mfast-sw-div
19293 Do not use table-based fast divide for small numbers. The default 
19294 is to use the fast divide at @option{-O3} and above.
19296 @item -mno-hw-mul
19297 @itemx -mhw-mul
19298 @itemx -mno-hw-mulx
19299 @itemx -mhw-mulx
19300 @itemx -mno-hw-div
19301 @itemx -mhw-div
19302 @opindex mno-hw-mul
19303 @opindex mhw-mul
19304 @opindex mno-hw-mulx
19305 @opindex mhw-mulx
19306 @opindex mno-hw-div
19307 @opindex mhw-div
19308 Enable or disable emitting @code{mul}, @code{mulx} and @code{div} family of 
19309 instructions by the compiler. The default is to emit @code{mul}
19310 and not emit @code{div} and @code{mulx}.
19312 @item -mbmx
19313 @itemx -mno-bmx
19314 @itemx -mcdx
19315 @itemx -mno-cdx
19316 Enable or disable generation of Nios II R2 BMX (bit manipulation) and
19317 CDX (code density) instructions.  Enabling these instructions also
19318 requires @option{-march=r2}.  Since these instructions are optional
19319 extensions to the R2 architecture, the default is not to emit them.
19321 @item -mcustom-@var{insn}=@var{N}
19322 @itemx -mno-custom-@var{insn}
19323 @opindex mcustom-@var{insn}
19324 @opindex mno-custom-@var{insn}
19325 Each @option{-mcustom-@var{insn}=@var{N}} option enables use of a
19326 custom instruction with encoding @var{N} when generating code that uses 
19327 @var{insn}.  For example, @option{-mcustom-fadds=253} generates custom
19328 instruction 253 for single-precision floating-point add operations instead
19329 of the default behavior of using a library call.
19331 The following values of @var{insn} are supported.  Except as otherwise
19332 noted, floating-point operations are expected to be implemented with
19333 normal IEEE 754 semantics and correspond directly to the C operators or the
19334 equivalent GCC built-in functions (@pxref{Other Builtins}).
19336 Single-precision floating point:
19337 @table @asis
19339 @item @samp{fadds}, @samp{fsubs}, @samp{fdivs}, @samp{fmuls}
19340 Binary arithmetic operations.
19342 @item @samp{fnegs}
19343 Unary negation.
19345 @item @samp{fabss}
19346 Unary absolute value.
19348 @item @samp{fcmpeqs}, @samp{fcmpges}, @samp{fcmpgts}, @samp{fcmples}, @samp{fcmplts}, @samp{fcmpnes}
19349 Comparison operations.
19351 @item @samp{fmins}, @samp{fmaxs}
19352 Floating-point minimum and maximum.  These instructions are only
19353 generated if @option{-ffinite-math-only} is specified.
19355 @item @samp{fsqrts}
19356 Unary square root operation.
19358 @item @samp{fcoss}, @samp{fsins}, @samp{ftans}, @samp{fatans}, @samp{fexps}, @samp{flogs}
19359 Floating-point trigonometric and exponential functions.  These instructions
19360 are only generated if @option{-funsafe-math-optimizations} is also specified.
19362 @end table
19364 Double-precision floating point:
19365 @table @asis
19367 @item @samp{faddd}, @samp{fsubd}, @samp{fdivd}, @samp{fmuld}
19368 Binary arithmetic operations.
19370 @item @samp{fnegd}
19371 Unary negation.
19373 @item @samp{fabsd}
19374 Unary absolute value.
19376 @item @samp{fcmpeqd}, @samp{fcmpged}, @samp{fcmpgtd}, @samp{fcmpled}, @samp{fcmpltd}, @samp{fcmpned}
19377 Comparison operations.
19379 @item @samp{fmind}, @samp{fmaxd}
19380 Double-precision minimum and maximum.  These instructions are only
19381 generated if @option{-ffinite-math-only} is specified.
19383 @item @samp{fsqrtd}
19384 Unary square root operation.
19386 @item @samp{fcosd}, @samp{fsind}, @samp{ftand}, @samp{fatand}, @samp{fexpd}, @samp{flogd}
19387 Double-precision trigonometric and exponential functions.  These instructions
19388 are only generated if @option{-funsafe-math-optimizations} is also specified.
19390 @end table
19392 Conversions:
19393 @table @asis
19394 @item @samp{fextsd}
19395 Conversion from single precision to double precision.
19397 @item @samp{ftruncds}
19398 Conversion from double precision to single precision.
19400 @item @samp{fixsi}, @samp{fixsu}, @samp{fixdi}, @samp{fixdu}
19401 Conversion from floating point to signed or unsigned integer types, with
19402 truncation towards zero.
19404 @item @samp{round}
19405 Conversion from single-precision floating point to signed integer,
19406 rounding to the nearest integer and ties away from zero.
19407 This corresponds to the @code{__builtin_lroundf} function when
19408 @option{-fno-math-errno} is used.
19410 @item @samp{floatis}, @samp{floatus}, @samp{floatid}, @samp{floatud}
19411 Conversion from signed or unsigned integer types to floating-point types.
19413 @end table
19415 In addition, all of the following transfer instructions for internal
19416 registers X and Y must be provided to use any of the double-precision
19417 floating-point instructions.  Custom instructions taking two
19418 double-precision source operands expect the first operand in the
19419 64-bit register X.  The other operand (or only operand of a unary
19420 operation) is given to the custom arithmetic instruction with the
19421 least significant half in source register @var{src1} and the most
19422 significant half in @var{src2}.  A custom instruction that returns a
19423 double-precision result returns the most significant 32 bits in the
19424 destination register and the other half in 32-bit register Y.  
19425 GCC automatically generates the necessary code sequences to write
19426 register X and/or read register Y when double-precision floating-point
19427 instructions are used.
19429 @table @asis
19431 @item @samp{fwrx}
19432 Write @var{src1} into the least significant half of X and @var{src2} into
19433 the most significant half of X.
19435 @item @samp{fwry}
19436 Write @var{src1} into Y.
19438 @item @samp{frdxhi}, @samp{frdxlo}
19439 Read the most or least (respectively) significant half of X and store it in
19440 @var{dest}.
19442 @item @samp{frdy}
19443 Read the value of Y and store it into @var{dest}.
19444 @end table
19446 Note that you can gain more local control over generation of Nios II custom
19447 instructions by using the @code{target("custom-@var{insn}=@var{N}")}
19448 and @code{target("no-custom-@var{insn}")} function attributes
19449 (@pxref{Function Attributes})
19450 or pragmas (@pxref{Function Specific Option Pragmas}).
19452 @item -mcustom-fpu-cfg=@var{name}
19453 @opindex mcustom-fpu-cfg
19455 This option enables a predefined, named set of custom instruction encodings
19456 (see @option{-mcustom-@var{insn}} above).  
19457 Currently, the following sets are defined:
19459 @option{-mcustom-fpu-cfg=60-1} is equivalent to:
19460 @gccoptlist{-mcustom-fmuls=252 @gol
19461 -mcustom-fadds=253 @gol
19462 -mcustom-fsubs=254 @gol
19463 -fsingle-precision-constant}
19465 @option{-mcustom-fpu-cfg=60-2} is equivalent to:
19466 @gccoptlist{-mcustom-fmuls=252 @gol
19467 -mcustom-fadds=253 @gol
19468 -mcustom-fsubs=254 @gol
19469 -mcustom-fdivs=255 @gol
19470 -fsingle-precision-constant}
19472 @option{-mcustom-fpu-cfg=72-3} is equivalent to:
19473 @gccoptlist{-mcustom-floatus=243 @gol
19474 -mcustom-fixsi=244 @gol
19475 -mcustom-floatis=245 @gol
19476 -mcustom-fcmpgts=246 @gol
19477 -mcustom-fcmples=249 @gol
19478 -mcustom-fcmpeqs=250 @gol
19479 -mcustom-fcmpnes=251 @gol
19480 -mcustom-fmuls=252 @gol
19481 -mcustom-fadds=253 @gol
19482 -mcustom-fsubs=254 @gol
19483 -mcustom-fdivs=255 @gol
19484 -fsingle-precision-constant}
19486 Custom instruction assignments given by individual
19487 @option{-mcustom-@var{insn}=} options override those given by
19488 @option{-mcustom-fpu-cfg=}, regardless of the
19489 order of the options on the command line.
19491 Note that you can gain more local control over selection of a FPU
19492 configuration by using the @code{target("custom-fpu-cfg=@var{name}")}
19493 function attribute (@pxref{Function Attributes})
19494 or pragma (@pxref{Function Specific Option Pragmas}).
19496 @end table
19498 These additional @samp{-m} options are available for the Altera Nios II
19499 ELF (bare-metal) target:
19501 @table @gcctabopt
19503 @item -mhal
19504 @opindex mhal
19505 Link with HAL BSP.  This suppresses linking with the GCC-provided C runtime
19506 startup and termination code, and is typically used in conjunction with
19507 @option{-msys-crt0=} to specify the location of the alternate startup code
19508 provided by the HAL BSP.
19510 @item -msmallc
19511 @opindex msmallc
19512 Link with a limited version of the C library, @option{-lsmallc}, rather than
19513 Newlib.
19515 @item -msys-crt0=@var{startfile}
19516 @opindex msys-crt0
19517 @var{startfile} is the file name of the startfile (crt0) to use 
19518 when linking.  This option is only useful in conjunction with @option{-mhal}.
19520 @item -msys-lib=@var{systemlib}
19521 @opindex msys-lib
19522 @var{systemlib} is the library name of the library that provides
19523 low-level system calls required by the C library,
19524 e.g. @code{read} and @code{write}.
19525 This option is typically used to link with a library provided by a HAL BSP.
19527 @end table
19529 @node Nvidia PTX Options
19530 @subsection Nvidia PTX Options
19531 @cindex Nvidia PTX options
19532 @cindex nvptx options
19534 These options are defined for Nvidia PTX:
19536 @table @gcctabopt
19538 @item -m32
19539 @itemx -m64
19540 @opindex m32
19541 @opindex m64
19542 Generate code for 32-bit or 64-bit ABI.
19544 @item -mmainkernel
19545 @opindex mmainkernel
19546 Link in code for a __main kernel.  This is for stand-alone instead of
19547 offloading execution.
19549 @item -moptimize
19550 @opindex moptimize
19551 Apply partitioned execution optimizations.  This is the default when any
19552 level of optimization is selected.
19554 @end table
19556 @node PDP-11 Options
19557 @subsection PDP-11 Options
19558 @cindex PDP-11 Options
19560 These options are defined for the PDP-11:
19562 @table @gcctabopt
19563 @item -mfpu
19564 @opindex mfpu
19565 Use hardware FPP floating point.  This is the default.  (FIS floating
19566 point on the PDP-11/40 is not supported.)
19568 @item -msoft-float
19569 @opindex msoft-float
19570 Do not use hardware floating point.
19572 @item -mac0
19573 @opindex mac0
19574 Return floating-point results in ac0 (fr0 in Unix assembler syntax).
19576 @item -mno-ac0
19577 @opindex mno-ac0
19578 Return floating-point results in memory.  This is the default.
19580 @item -m40
19581 @opindex m40
19582 Generate code for a PDP-11/40.
19584 @item -m45
19585 @opindex m45
19586 Generate code for a PDP-11/45.  This is the default.
19588 @item -m10
19589 @opindex m10
19590 Generate code for a PDP-11/10.
19592 @item -mbcopy-builtin
19593 @opindex mbcopy-builtin
19594 Use inline @code{movmemhi} patterns for copying memory.  This is the
19595 default.
19597 @item -mbcopy
19598 @opindex mbcopy
19599 Do not use inline @code{movmemhi} patterns for copying memory.
19601 @item -mint16
19602 @itemx -mno-int32
19603 @opindex mint16
19604 @opindex mno-int32
19605 Use 16-bit @code{int}.  This is the default.
19607 @item -mint32
19608 @itemx -mno-int16
19609 @opindex mint32
19610 @opindex mno-int16
19611 Use 32-bit @code{int}.
19613 @item -mfloat64
19614 @itemx -mno-float32
19615 @opindex mfloat64
19616 @opindex mno-float32
19617 Use 64-bit @code{float}.  This is the default.
19619 @item -mfloat32
19620 @itemx -mno-float64
19621 @opindex mfloat32
19622 @opindex mno-float64
19623 Use 32-bit @code{float}.
19625 @item -mabshi
19626 @opindex mabshi
19627 Use @code{abshi2} pattern.  This is the default.
19629 @item -mno-abshi
19630 @opindex mno-abshi
19631 Do not use @code{abshi2} pattern.
19633 @item -mbranch-expensive
19634 @opindex mbranch-expensive
19635 Pretend that branches are expensive.  This is for experimenting with
19636 code generation only.
19638 @item -mbranch-cheap
19639 @opindex mbranch-cheap
19640 Do not pretend that branches are expensive.  This is the default.
19642 @item -munix-asm
19643 @opindex munix-asm
19644 Use Unix assembler syntax.  This is the default when configured for
19645 @samp{pdp11-*-bsd}.
19647 @item -mdec-asm
19648 @opindex mdec-asm
19649 Use DEC assembler syntax.  This is the default when configured for any
19650 PDP-11 target other than @samp{pdp11-*-bsd}.
19651 @end table
19653 @node picoChip Options
19654 @subsection picoChip Options
19655 @cindex picoChip options
19657 These @samp{-m} options are defined for picoChip implementations:
19659 @table @gcctabopt
19661 @item -mae=@var{ae_type}
19662 @opindex mcpu
19663 Set the instruction set, register set, and instruction scheduling
19664 parameters for array element type @var{ae_type}.  Supported values
19665 for @var{ae_type} are @samp{ANY}, @samp{MUL}, and @samp{MAC}.
19667 @option{-mae=ANY} selects a completely generic AE type.  Code
19668 generated with this option runs on any of the other AE types.  The
19669 code is not as efficient as it would be if compiled for a specific
19670 AE type, and some types of operation (e.g., multiplication) do not
19671 work properly on all types of AE.
19673 @option{-mae=MUL} selects a MUL AE type.  This is the most useful AE type
19674 for compiled code, and is the default.
19676 @option{-mae=MAC} selects a DSP-style MAC AE.  Code compiled with this
19677 option may suffer from poor performance of byte (char) manipulation,
19678 since the DSP AE does not provide hardware support for byte load/stores.
19680 @item -msymbol-as-address
19681 Enable the compiler to directly use a symbol name as an address in a
19682 load/store instruction, without first loading it into a
19683 register.  Typically, the use of this option generates larger
19684 programs, which run faster than when the option isn't used.  However, the
19685 results vary from program to program, so it is left as a user option,
19686 rather than being permanently enabled.
19688 @item -mno-inefficient-warnings
19689 Disables warnings about the generation of inefficient code.  These
19690 warnings can be generated, for example, when compiling code that
19691 performs byte-level memory operations on the MAC AE type.  The MAC AE has
19692 no hardware support for byte-level memory operations, so all byte
19693 load/stores must be synthesized from word load/store operations.  This is
19694 inefficient and a warning is generated to indicate
19695 that you should rewrite the code to avoid byte operations, or to target
19696 an AE type that has the necessary hardware support.  This option disables
19697 these warnings.
19699 @end table
19701 @node PowerPC Options
19702 @subsection PowerPC Options
19703 @cindex PowerPC options
19705 These are listed under @xref{RS/6000 and PowerPC Options}.
19707 @node RL78 Options
19708 @subsection RL78 Options
19709 @cindex RL78 Options
19711 @table @gcctabopt
19713 @item -msim
19714 @opindex msim
19715 Links in additional target libraries to support operation within a
19716 simulator.
19718 @item -mmul=none
19719 @itemx -mmul=g10
19720 @itemx -mmul=g13
19721 @itemx -mmul=g14
19722 @itemx -mmul=rl78
19723 @opindex mmul
19724 Specifies the type of hardware multiplication and division support to
19725 be used.  The simplest is @code{none}, which uses software for both
19726 multiplication and division.  This is the default.  The @code{g13}
19727 value is for the hardware multiply/divide peripheral found on the
19728 RL78/G13 (S2 core) targets.  The @code{g14} value selects the use of
19729 the multiplication and division instructions supported by the RL78/G14
19730 (S3 core) parts.  The value @code{rl78} is an alias for @code{g14} and
19731 the value @code{mg10} is an alias for @code{none}.
19733 In addition a C preprocessor macro is defined, based upon the setting
19734 of this option.  Possible values are: @code{__RL78_MUL_NONE__},
19735 @code{__RL78_MUL_G13__} or @code{__RL78_MUL_G14__}.
19737 @item -mcpu=g10
19738 @itemx -mcpu=g13
19739 @itemx -mcpu=g14
19740 @itemx -mcpu=rl78
19741 @opindex mcpu
19742 Specifies the RL78 core to target.  The default is the G14 core, also
19743 known as an S3 core or just RL78.  The G13 or S2 core does not have
19744 multiply or divide instructions, instead it uses a hardware peripheral
19745 for these operations.  The G10 or S1 core does not have register
19746 banks, so it uses a different calling convention.
19748 If this option is set it also selects the type of hardware multiply
19749 support to use, unless this is overridden by an explicit
19750 @option{-mmul=none} option on the command line.  Thus specifying
19751 @option{-mcpu=g13} enables the use of the G13 hardware multiply
19752 peripheral and specifying @option{-mcpu=g10} disables the use of
19753 hardware multiplications altogether.
19755 Note, although the RL78/G14 core is the default target, specifying
19756 @option{-mcpu=g14} or @option{-mcpu=rl78} on the command line does
19757 change the behavior of the toolchain since it also enables G14
19758 hardware multiply support.  If these options are not specified on the
19759 command line then software multiplication routines will be used even
19760 though the code targets the RL78 core.  This is for backwards
19761 compatibility with older toolchains which did not have hardware
19762 multiply and divide support.
19764 In addition a C preprocessor macro is defined, based upon the setting
19765 of this option.  Possible values are: @code{__RL78_G10__},
19766 @code{__RL78_G13__} or @code{__RL78_G14__}.
19768 @item -mg10
19769 @itemx -mg13
19770 @itemx -mg14
19771 @itemx -mrl78
19772 @opindex mg10
19773 @opindex mg13
19774 @opindex mg14
19775 @opindex mrl78
19776 These are aliases for the corresponding @option{-mcpu=} option.  They
19777 are provided for backwards compatibility.
19779 @item -mallregs
19780 @opindex mallregs
19781 Allow the compiler to use all of the available registers.  By default
19782 registers @code{r24..r31} are reserved for use in interrupt handlers.
19783 With this option enabled these registers can be used in ordinary
19784 functions as well.
19786 @item -m64bit-doubles
19787 @itemx -m32bit-doubles
19788 @opindex m64bit-doubles
19789 @opindex m32bit-doubles
19790 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
19791 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
19792 @option{-m32bit-doubles}.
19794 @item -msave-mduc-in-interrupts
19795 @item -mno-save-mduc-in-interrupts
19796 @opindex msave-mduc-in-interrupts
19797 @opindex mno-save-mduc-in-interrupts
19798 Specifies that interrupt handler functions should preserve the
19799 MDUC registers.  This is only necessary if normal code might use
19800 the MDUC registers, for example because it performs multiplication
19801 and division operations.  The default is to ignore the MDUC registers
19802 as this makes the interrupt handlers faster.  The target option -mg13
19803 needs to be passed for this to work as this feature is only available
19804 on the G13 target (S2 core).  The MDUC registers will only be saved
19805 if the interrupt handler performs a multiplication or division
19806 operation or it calls another function.
19808 @end table
19810 @node RS/6000 and PowerPC Options
19811 @subsection IBM RS/6000 and PowerPC Options
19812 @cindex RS/6000 and PowerPC Options
19813 @cindex IBM RS/6000 and PowerPC Options
19815 These @samp{-m} options are defined for the IBM RS/6000 and PowerPC:
19816 @table @gcctabopt
19817 @item -mpowerpc-gpopt
19818 @itemx -mno-powerpc-gpopt
19819 @itemx -mpowerpc-gfxopt
19820 @itemx -mno-powerpc-gfxopt
19821 @need 800
19822 @itemx -mpowerpc64
19823 @itemx -mno-powerpc64
19824 @itemx -mmfcrf
19825 @itemx -mno-mfcrf
19826 @itemx -mpopcntb
19827 @itemx -mno-popcntb
19828 @itemx -mpopcntd
19829 @itemx -mno-popcntd
19830 @itemx -mfprnd
19831 @itemx -mno-fprnd
19832 @need 800
19833 @itemx -mcmpb
19834 @itemx -mno-cmpb
19835 @itemx -mmfpgpr
19836 @itemx -mno-mfpgpr
19837 @itemx -mhard-dfp
19838 @itemx -mno-hard-dfp
19839 @opindex mpowerpc-gpopt
19840 @opindex mno-powerpc-gpopt
19841 @opindex mpowerpc-gfxopt
19842 @opindex mno-powerpc-gfxopt
19843 @opindex mpowerpc64
19844 @opindex mno-powerpc64
19845 @opindex mmfcrf
19846 @opindex mno-mfcrf
19847 @opindex mpopcntb
19848 @opindex mno-popcntb
19849 @opindex mpopcntd
19850 @opindex mno-popcntd
19851 @opindex mfprnd
19852 @opindex mno-fprnd
19853 @opindex mcmpb
19854 @opindex mno-cmpb
19855 @opindex mmfpgpr
19856 @opindex mno-mfpgpr
19857 @opindex mhard-dfp
19858 @opindex mno-hard-dfp
19859 You use these options to specify which instructions are available on the
19860 processor you are using.  The default value of these options is
19861 determined when configuring GCC@.  Specifying the
19862 @option{-mcpu=@var{cpu_type}} overrides the specification of these
19863 options.  We recommend you use the @option{-mcpu=@var{cpu_type}} option
19864 rather than the options listed above.
19866 Specifying @option{-mpowerpc-gpopt} allows
19867 GCC to use the optional PowerPC architecture instructions in the
19868 General Purpose group, including floating-point square root.  Specifying
19869 @option{-mpowerpc-gfxopt} allows GCC to
19870 use the optional PowerPC architecture instructions in the Graphics
19871 group, including floating-point select.
19873 The @option{-mmfcrf} option allows GCC to generate the move from
19874 condition register field instruction implemented on the POWER4
19875 processor and other processors that support the PowerPC V2.01
19876 architecture.
19877 The @option{-mpopcntb} option allows GCC to generate the popcount and
19878 double-precision FP reciprocal estimate instruction implemented on the
19879 POWER5 processor and other processors that support the PowerPC V2.02
19880 architecture.
19881 The @option{-mpopcntd} option allows GCC to generate the popcount
19882 instruction implemented on the POWER7 processor and other processors
19883 that support the PowerPC V2.06 architecture.
19884 The @option{-mfprnd} option allows GCC to generate the FP round to
19885 integer instructions implemented on the POWER5+ processor and other
19886 processors that support the PowerPC V2.03 architecture.
19887 The @option{-mcmpb} option allows GCC to generate the compare bytes
19888 instruction implemented on the POWER6 processor and other processors
19889 that support the PowerPC V2.05 architecture.
19890 The @option{-mmfpgpr} option allows GCC to generate the FP move to/from
19891 general-purpose register instructions implemented on the POWER6X
19892 processor and other processors that support the extended PowerPC V2.05
19893 architecture.
19894 The @option{-mhard-dfp} option allows GCC to generate the decimal
19895 floating-point instructions implemented on some POWER processors.
19897 The @option{-mpowerpc64} option allows GCC to generate the additional
19898 64-bit instructions that are found in the full PowerPC64 architecture
19899 and to treat GPRs as 64-bit, doubleword quantities.  GCC defaults to
19900 @option{-mno-powerpc64}.
19902 @item -mcpu=@var{cpu_type}
19903 @opindex mcpu
19904 Set architecture type, register usage, and
19905 instruction scheduling parameters for machine type @var{cpu_type}.
19906 Supported values for @var{cpu_type} are @samp{401}, @samp{403},
19907 @samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{464}, @samp{464fp},
19908 @samp{476}, @samp{476fp}, @samp{505}, @samp{601}, @samp{602}, @samp{603},
19909 @samp{603e}, @samp{604}, @samp{604e}, @samp{620}, @samp{630}, @samp{740},
19910 @samp{7400}, @samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
19911 @samp{860}, @samp{970}, @samp{8540}, @samp{a2}, @samp{e300c2},
19912 @samp{e300c3}, @samp{e500mc}, @samp{e500mc64}, @samp{e5500},
19913 @samp{e6500}, @samp{ec603e}, @samp{G3}, @samp{G4}, @samp{G5},
19914 @samp{titan}, @samp{power3}, @samp{power4}, @samp{power5}, @samp{power5+},
19915 @samp{power6}, @samp{power6x}, @samp{power7}, @samp{power8},
19916 @samp{power9}, @samp{powerpc}, @samp{powerpc64}, @samp{powerpc64le},
19917 and @samp{rs64}.
19919 @option{-mcpu=powerpc}, @option{-mcpu=powerpc64}, and
19920 @option{-mcpu=powerpc64le} specify pure 32-bit PowerPC (either
19921 endian), 64-bit big endian PowerPC and 64-bit little endian PowerPC
19922 architecture machine types, with an appropriate, generic processor
19923 model assumed for scheduling purposes.
19925 The other options specify a specific processor.  Code generated under
19926 those options runs best on that processor, and may not run at all on
19927 others.
19929 The @option{-mcpu} options automatically enable or disable the
19930 following options:
19932 @gccoptlist{-maltivec  -mfprnd  -mhard-float  -mmfcrf  -mmultiple @gol
19933 -mpopcntb -mpopcntd  -mpowerpc64 @gol
19934 -mpowerpc-gpopt  -mpowerpc-gfxopt  -msingle-float -mdouble-float @gol
19935 -msimple-fpu -mstring  -mmulhw  -mdlmzb  -mmfpgpr -mvsx @gol
19936 -mcrypto -mdirect-move -mpower8-fusion -mpower8-vector @gol
19937 -mquad-memory -mquad-memory-atomic -mmodulo -mfloat128 -mfloat128-hardware @gol
19938 -mpower9-fusion -mpower9-vector -mpower9-dform}
19940 The particular options set for any particular CPU varies between
19941 compiler versions, depending on what setting seems to produce optimal
19942 code for that CPU; it doesn't necessarily reflect the actual hardware's
19943 capabilities.  If you wish to set an individual option to a particular
19944 value, you may specify it after the @option{-mcpu} option, like
19945 @option{-mcpu=970 -mno-altivec}.
19947 On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
19948 not enabled or disabled by the @option{-mcpu} option at present because
19949 AIX does not have full support for these options.  You may still
19950 enable or disable them individually if you're sure it'll work in your
19951 environment.
19953 @item -mtune=@var{cpu_type}
19954 @opindex mtune
19955 Set the instruction scheduling parameters for machine type
19956 @var{cpu_type}, but do not set the architecture type or register usage,
19957 as @option{-mcpu=@var{cpu_type}} does.  The same
19958 values for @var{cpu_type} are used for @option{-mtune} as for
19959 @option{-mcpu}.  If both are specified, the code generated uses the
19960 architecture and registers set by @option{-mcpu}, but the
19961 scheduling parameters set by @option{-mtune}.
19963 @item -mcmodel=small
19964 @opindex mcmodel=small
19965 Generate PowerPC64 code for the small model: The TOC is limited to
19966 64k.
19968 @item -mcmodel=medium
19969 @opindex mcmodel=medium
19970 Generate PowerPC64 code for the medium model: The TOC and other static
19971 data may be up to a total of 4G in size.
19973 @item -mcmodel=large
19974 @opindex mcmodel=large
19975 Generate PowerPC64 code for the large model: The TOC may be up to 4G
19976 in size.  Other data and code is only limited by the 64-bit address
19977 space.
19979 @item -maltivec
19980 @itemx -mno-altivec
19981 @opindex maltivec
19982 @opindex mno-altivec
19983 Generate code that uses (does not use) AltiVec instructions, and also
19984 enable the use of built-in functions that allow more direct access to
19985 the AltiVec instruction set.  You may also need to set
19986 @option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
19987 enhancements.
19989 When @option{-maltivec} is used, rather than @option{-maltivec=le} or
19990 @option{-maltivec=be}, the element order for AltiVec intrinsics such
19991 as @code{vec_splat}, @code{vec_extract}, and @code{vec_insert} 
19992 match array element order corresponding to the endianness of the
19993 target.  That is, element zero identifies the leftmost element in a
19994 vector register when targeting a big-endian platform, and identifies
19995 the rightmost element in a vector register when targeting a
19996 little-endian platform.
19998 @item -maltivec=be
19999 @opindex maltivec=be
20000 Generate AltiVec instructions using big-endian element order,
20001 regardless of whether the target is big- or little-endian.  This is
20002 the default when targeting a big-endian platform.
20004 The element order is used to interpret element numbers in AltiVec
20005 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
20006 @code{vec_insert}.  By default, these match array element order
20007 corresponding to the endianness for the target.
20009 @item -maltivec=le
20010 @opindex maltivec=le
20011 Generate AltiVec instructions using little-endian element order,
20012 regardless of whether the target is big- or little-endian.  This is
20013 the default when targeting a little-endian platform.  This option is
20014 currently ignored when targeting a big-endian platform.
20016 The element order is used to interpret element numbers in AltiVec
20017 intrinsics such as @code{vec_splat}, @code{vec_extract}, and
20018 @code{vec_insert}.  By default, these match array element order
20019 corresponding to the endianness for the target.
20021 @item -mvrsave
20022 @itemx -mno-vrsave
20023 @opindex mvrsave
20024 @opindex mno-vrsave
20025 Generate VRSAVE instructions when generating AltiVec code.
20027 @item -mgen-cell-microcode
20028 @opindex mgen-cell-microcode
20029 Generate Cell microcode instructions.
20031 @item -mwarn-cell-microcode
20032 @opindex mwarn-cell-microcode
20033 Warn when a Cell microcode instruction is emitted.  An example
20034 of a Cell microcode instruction is a variable shift.
20036 @item -msecure-plt
20037 @opindex msecure-plt
20038 Generate code that allows @command{ld} and @command{ld.so}
20039 to build executables and shared
20040 libraries with non-executable @code{.plt} and @code{.got} sections.
20041 This is a PowerPC
20042 32-bit SYSV ABI option.
20044 @item -mbss-plt
20045 @opindex mbss-plt
20046 Generate code that uses a BSS @code{.plt} section that @command{ld.so}
20047 fills in, and
20048 requires @code{.plt} and @code{.got}
20049 sections that are both writable and executable.
20050 This is a PowerPC 32-bit SYSV ABI option.
20052 @item -misel
20053 @itemx -mno-isel
20054 @opindex misel
20055 @opindex mno-isel
20056 This switch enables or disables the generation of ISEL instructions.
20058 @item -misel=@var{yes/no}
20059 This switch has been deprecated.  Use @option{-misel} and
20060 @option{-mno-isel} instead.
20062 @item -mlra
20063 @opindex mlra
20064 Enable Local Register Allocation.  This is still experimental for PowerPC,
20065 so by default the compiler uses standard reload
20066 (i.e. @option{-mno-lra}).
20068 @item -mspe
20069 @itemx -mno-spe
20070 @opindex mspe
20071 @opindex mno-spe
20072 This switch enables or disables the generation of SPE simd
20073 instructions.
20075 @item -mpaired
20076 @itemx -mno-paired
20077 @opindex mpaired
20078 @opindex mno-paired
20079 This switch enables or disables the generation of PAIRED simd
20080 instructions.
20082 @item -mspe=@var{yes/no}
20083 This option has been deprecated.  Use @option{-mspe} and
20084 @option{-mno-spe} instead.
20086 @item -mvsx
20087 @itemx -mno-vsx
20088 @opindex mvsx
20089 @opindex mno-vsx
20090 Generate code that uses (does not use) vector/scalar (VSX)
20091 instructions, and also enable the use of built-in functions that allow
20092 more direct access to the VSX instruction set.
20094 @item -mcrypto
20095 @itemx -mno-crypto
20096 @opindex mcrypto
20097 @opindex mno-crypto
20098 Enable the use (disable) of the built-in functions that allow direct
20099 access to the cryptographic instructions that were added in version
20100 2.07 of the PowerPC ISA.
20102 @item -mdirect-move
20103 @itemx -mno-direct-move
20104 @opindex mdirect-move
20105 @opindex mno-direct-move
20106 Generate code that uses (does not use) the instructions to move data
20107 between the general purpose registers and the vector/scalar (VSX)
20108 registers that were added in version 2.07 of the PowerPC ISA.
20110 @item -mpower8-fusion
20111 @itemx -mno-power8-fusion
20112 @opindex mpower8-fusion
20113 @opindex mno-power8-fusion
20114 Generate code that keeps (does not keeps) some integer operations
20115 adjacent so that the instructions can be fused together on power8 and
20116 later processors.
20118 @item -mpower8-vector
20119 @itemx -mno-power8-vector
20120 @opindex mpower8-vector
20121 @opindex mno-power8-vector
20122 Generate code that uses (does not use) the vector and scalar
20123 instructions that were added in version 2.07 of the PowerPC ISA.  Also
20124 enable the use of built-in functions that allow more direct access to
20125 the vector instructions.
20127 @item -mquad-memory
20128 @itemx -mno-quad-memory
20129 @opindex mquad-memory
20130 @opindex mno-quad-memory
20131 Generate code that uses (does not use) the non-atomic quad word memory
20132 instructions.  The @option{-mquad-memory} option requires use of
20133 64-bit mode.
20135 @item -mquad-memory-atomic
20136 @itemx -mno-quad-memory-atomic
20137 @opindex mquad-memory-atomic
20138 @opindex mno-quad-memory-atomic
20139 Generate code that uses (does not use) the atomic quad word memory
20140 instructions.  The @option{-mquad-memory-atomic} option requires use of
20141 64-bit mode.
20143 @item -mupper-regs-df
20144 @itemx -mno-upper-regs-df
20145 @opindex mupper-regs-df
20146 @opindex mno-upper-regs-df
20147 Generate code that uses (does not use) the scalar double precision
20148 instructions that target all 64 registers in the vector/scalar
20149 floating point register set that were added in version 2.06 of the
20150 PowerPC ISA.  @option{-mupper-regs-df} is turned on by default if you
20151 use any of the @option{-mcpu=power7}, @option{-mcpu=power8}, or
20152 @option{-mvsx} options.
20154 @item -mupper-regs-sf
20155 @itemx -mno-upper-regs-sf
20156 @opindex mupper-regs-sf
20157 @opindex mno-upper-regs-sf
20158 Generate code that uses (does not use) the scalar single precision
20159 instructions that target all 64 registers in the vector/scalar
20160 floating point register set that were added in version 2.07 of the
20161 PowerPC ISA.  @option{-mupper-regs-sf} is turned on by default if you
20162 use either of the @option{-mcpu=power8} or @option{-mpower8-vector}
20163 options.
20165 @item -mupper-regs
20166 @itemx -mno-upper-regs
20167 @opindex mupper-regs
20168 @opindex mno-upper-regs
20169 Generate code that uses (does not use) the scalar
20170 instructions that target all 64 registers in the vector/scalar
20171 floating point register set, depending on the model of the machine.
20173 If the @option{-mno-upper-regs} option is used, it turns off both
20174 @option{-mupper-regs-sf} and @option{-mupper-regs-df} options.
20176 @item -mfloat128
20177 @itemx -mno-float128
20178 @opindex mfloat128
20179 @opindex mno-float128
20180 Enable/disable the @var{__float128} keyword for IEEE 128-bit floating point
20181 and use either software emulation for IEEE 128-bit floating point or
20182 hardware instructions.
20184 The VSX instruction set (@option{-mvsx}, @option{-mcpu=power7}, or
20185 @option{-mcpu=power8}) must be enabled to use the @option{-mfloat128}
20186 option.  The @code{-mfloat128} option only works on PowerPC 64-bit
20187 Linux systems.
20189 @item -mfloat128-hardware
20190 @itemx -mno-float128-hardware
20191 @opindex mfloat128-hardware
20192 @opindex mno-float128-hardware
20193 Enable/disable using ISA 3.0 hardware instructions to support the
20194 @var{__float128} data type.
20196 @item -mmodulo
20197 @itemx -mno-modulo
20198 @opindex mmodulo
20199 @opindex mno-module
20200 Generate code that uses (does not use) the ISA 3.0 integer modulo
20201 instructions.  The @option{-mmodulo} option is enabled by default
20202 with the @option{-mcpu=power9} option.
20204 @item -mpower9-fusion
20205 @itemx -mno-power9-fusion
20206 @opindex mpower9-fusion
20207 @opindex mno-power9-fusion
20208 Generate code that keeps (does not keeps) some operations adjacent so
20209 that the instructions can be fused together on power9 and later
20210 processors.
20212 @item -mpower9-vector
20213 @itemx -mno-power9-vector
20214 @opindex mpower9-vector
20215 @opindex mno-power9-vector
20216 Generate code that uses (does not use) the vector and scalar
20217 instructions that were added in version 3.0 of the PowerPC ISA.  Also
20218 enable the use of built-in functions that allow more direct access to
20219 the vector instructions.
20221 @item -mpower9-dform
20222 @itemx -mno-power9-dform
20223 @opindex mpower9-dform
20224 @opindex mno-power9-dform
20225 Enable (disable) scalar d-form (register + offset) memory instructions
20226 to load/store traditional Altivec registers. If the @var{LRA} register
20227 allocator is enabled, also enable (disable) vector d-form memory
20228 instructions.
20230 @item -mfloat-gprs=@var{yes/single/double/no}
20231 @itemx -mfloat-gprs
20232 @opindex mfloat-gprs
20233 This switch enables or disables the generation of floating-point
20234 operations on the general-purpose registers for architectures that
20235 support it.
20237 The argument @samp{yes} or @samp{single} enables the use of
20238 single-precision floating-point operations.
20240 The argument @samp{double} enables the use of single and
20241 double-precision floating-point operations.
20243 The argument @samp{no} disables floating-point operations on the
20244 general-purpose registers.
20246 This option is currently only available on the MPC854x.
20248 @item -m32
20249 @itemx -m64
20250 @opindex m32
20251 @opindex m64
20252 Generate code for 32-bit or 64-bit environments of Darwin and SVR4
20253 targets (including GNU/Linux).  The 32-bit environment sets int, long
20254 and pointer to 32 bits and generates code that runs on any PowerPC
20255 variant.  The 64-bit environment sets int to 32 bits and long and
20256 pointer to 64 bits, and generates code for PowerPC64, as for
20257 @option{-mpowerpc64}.
20259 @item -mfull-toc
20260 @itemx -mno-fp-in-toc
20261 @itemx -mno-sum-in-toc
20262 @itemx -mminimal-toc
20263 @opindex mfull-toc
20264 @opindex mno-fp-in-toc
20265 @opindex mno-sum-in-toc
20266 @opindex mminimal-toc
20267 Modify generation of the TOC (Table Of Contents), which is created for
20268 every executable file.  The @option{-mfull-toc} option is selected by
20269 default.  In that case, GCC allocates at least one TOC entry for
20270 each unique non-automatic variable reference in your program.  GCC
20271 also places floating-point constants in the TOC@.  However, only
20272 16,384 entries are available in the TOC@.
20274 If you receive a linker error message that saying you have overflowed
20275 the available TOC space, you can reduce the amount of TOC space used
20276 with the @option{-mno-fp-in-toc} and @option{-mno-sum-in-toc} options.
20277 @option{-mno-fp-in-toc} prevents GCC from putting floating-point
20278 constants in the TOC and @option{-mno-sum-in-toc} forces GCC to
20279 generate code to calculate the sum of an address and a constant at
20280 run time instead of putting that sum into the TOC@.  You may specify one
20281 or both of these options.  Each causes GCC to produce very slightly
20282 slower and larger code at the expense of conserving TOC space.
20284 If you still run out of space in the TOC even when you specify both of
20285 these options, specify @option{-mminimal-toc} instead.  This option causes
20286 GCC to make only one TOC entry for every file.  When you specify this
20287 option, GCC produces code that is slower and larger but which
20288 uses extremely little TOC space.  You may wish to use this option
20289 only on files that contain less frequently-executed code.
20291 @item -maix64
20292 @itemx -maix32
20293 @opindex maix64
20294 @opindex maix32
20295 Enable 64-bit AIX ABI and calling convention: 64-bit pointers, 64-bit
20296 @code{long} type, and the infrastructure needed to support them.
20297 Specifying @option{-maix64} implies @option{-mpowerpc64},
20298 while @option{-maix32} disables the 64-bit ABI and
20299 implies @option{-mno-powerpc64}.  GCC defaults to @option{-maix32}.
20301 @item -mxl-compat
20302 @itemx -mno-xl-compat
20303 @opindex mxl-compat
20304 @opindex mno-xl-compat
20305 Produce code that conforms more closely to IBM XL compiler semantics
20306 when using AIX-compatible ABI@.  Pass floating-point arguments to
20307 prototyped functions beyond the register save area (RSA) on the stack
20308 in addition to argument FPRs.  Do not assume that most significant
20309 double in 128-bit long double value is properly rounded when comparing
20310 values and converting to double.  Use XL symbol names for long double
20311 support routines.
20313 The AIX calling convention was extended but not initially documented to
20314 handle an obscure K&R C case of calling a function that takes the
20315 address of its arguments with fewer arguments than declared.  IBM XL
20316 compilers access floating-point arguments that do not fit in the
20317 RSA from the stack when a subroutine is compiled without
20318 optimization.  Because always storing floating-point arguments on the
20319 stack is inefficient and rarely needed, this option is not enabled by
20320 default and only is necessary when calling subroutines compiled by IBM
20321 XL compilers without optimization.
20323 @item -mpe
20324 @opindex mpe
20325 Support @dfn{IBM RS/6000 SP} @dfn{Parallel Environment} (PE)@.  Link an
20326 application written to use message passing with special startup code to
20327 enable the application to run.  The system must have PE installed in the
20328 standard location (@file{/usr/lpp/ppe.poe/}), or the @file{specs} file
20329 must be overridden with the @option{-specs=} option to specify the
20330 appropriate directory location.  The Parallel Environment does not
20331 support threads, so the @option{-mpe} option and the @option{-pthread}
20332 option are incompatible.
20334 @item -malign-natural
20335 @itemx -malign-power
20336 @opindex malign-natural
20337 @opindex malign-power
20338 On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option
20339 @option{-malign-natural} overrides the ABI-defined alignment of larger
20340 types, such as floating-point doubles, on their natural size-based boundary.
20341 The option @option{-malign-power} instructs GCC to follow the ABI-specified
20342 alignment rules.  GCC defaults to the standard alignment defined in the ABI@.
20344 On 64-bit Darwin, natural alignment is the default, and @option{-malign-power}
20345 is not supported.
20347 @item -msoft-float
20348 @itemx -mhard-float
20349 @opindex msoft-float
20350 @opindex mhard-float
20351 Generate code that does not use (uses) the floating-point register set.
20352 Software floating-point emulation is provided if you use the
20353 @option{-msoft-float} option, and pass the option to GCC when linking.
20355 @item -msingle-float
20356 @itemx -mdouble-float
20357 @opindex msingle-float
20358 @opindex mdouble-float
20359 Generate code for single- or double-precision floating-point operations.
20360 @option{-mdouble-float} implies @option{-msingle-float}.
20362 @item -msimple-fpu
20363 @opindex msimple-fpu
20364 Do not generate @code{sqrt} and @code{div} instructions for hardware
20365 floating-point unit.
20367 @item -mfpu=@var{name}
20368 @opindex mfpu
20369 Specify type of floating-point unit.  Valid values for @var{name} are
20370 @samp{sp_lite} (equivalent to @option{-msingle-float -msimple-fpu}),
20371 @samp{dp_lite} (equivalent to @option{-mdouble-float -msimple-fpu}),
20372 @samp{sp_full} (equivalent to @option{-msingle-float}),
20373 and @samp{dp_full} (equivalent to @option{-mdouble-float}).
20375 @item -mxilinx-fpu
20376 @opindex mxilinx-fpu
20377 Perform optimizations for the floating-point unit on Xilinx PPC 405/440.
20379 @item -mmultiple
20380 @itemx -mno-multiple
20381 @opindex mmultiple
20382 @opindex mno-multiple
20383 Generate code that uses (does not use) the load multiple word
20384 instructions and the store multiple word instructions.  These
20385 instructions are generated by default on POWER systems, and not
20386 generated on PowerPC systems.  Do not use @option{-mmultiple} on little-endian
20387 PowerPC systems, since those instructions do not work when the
20388 processor is in little-endian mode.  The exceptions are PPC740 and
20389 PPC750 which permit these instructions in little-endian mode.
20391 @item -mstring
20392 @itemx -mno-string
20393 @opindex mstring
20394 @opindex mno-string
20395 Generate code that uses (does not use) the load string instructions
20396 and the store string word instructions to save multiple registers and
20397 do small block moves.  These instructions are generated by default on
20398 POWER systems, and not generated on PowerPC systems.  Do not use
20399 @option{-mstring} on little-endian PowerPC systems, since those
20400 instructions do not work when the processor is in little-endian mode.
20401 The exceptions are PPC740 and PPC750 which permit these instructions
20402 in little-endian mode.
20404 @item -mupdate
20405 @itemx -mno-update
20406 @opindex mupdate
20407 @opindex mno-update
20408 Generate code that uses (does not use) the load or store instructions
20409 that update the base register to the address of the calculated memory
20410 location.  These instructions are generated by default.  If you use
20411 @option{-mno-update}, there is a small window between the time that the
20412 stack pointer is updated and the address of the previous frame is
20413 stored, which means code that walks the stack frame across interrupts or
20414 signals may get corrupted data.
20416 @item -mavoid-indexed-addresses
20417 @itemx -mno-avoid-indexed-addresses
20418 @opindex mavoid-indexed-addresses
20419 @opindex mno-avoid-indexed-addresses
20420 Generate code that tries to avoid (not avoid) the use of indexed load
20421 or store instructions. These instructions can incur a performance
20422 penalty on Power6 processors in certain situations, such as when
20423 stepping through large arrays that cross a 16M boundary.  This option
20424 is enabled by default when targeting Power6 and disabled otherwise.
20426 @item -mfused-madd
20427 @itemx -mno-fused-madd
20428 @opindex mfused-madd
20429 @opindex mno-fused-madd
20430 Generate code that uses (does not use) the floating-point multiply and
20431 accumulate instructions.  These instructions are generated by default
20432 if hardware floating point is used.  The machine-dependent
20433 @option{-mfused-madd} option is now mapped to the machine-independent
20434 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
20435 mapped to @option{-ffp-contract=off}.
20437 @item -mmulhw
20438 @itemx -mno-mulhw
20439 @opindex mmulhw
20440 @opindex mno-mulhw
20441 Generate code that uses (does not use) the half-word multiply and
20442 multiply-accumulate instructions on the IBM 405, 440, 464 and 476 processors.
20443 These instructions are generated by default when targeting those
20444 processors.
20446 @item -mdlmzb
20447 @itemx -mno-dlmzb
20448 @opindex mdlmzb
20449 @opindex mno-dlmzb
20450 Generate code that uses (does not use) the string-search @samp{dlmzb}
20451 instruction on the IBM 405, 440, 464 and 476 processors.  This instruction is
20452 generated by default when targeting those processors.
20454 @item -mno-bit-align
20455 @itemx -mbit-align
20456 @opindex mno-bit-align
20457 @opindex mbit-align
20458 On System V.4 and embedded PowerPC systems do not (do) force structures
20459 and unions that contain bit-fields to be aligned to the base type of the
20460 bit-field.
20462 For example, by default a structure containing nothing but 8
20463 @code{unsigned} bit-fields of length 1 is aligned to a 4-byte
20464 boundary and has a size of 4 bytes.  By using @option{-mno-bit-align},
20465 the structure is aligned to a 1-byte boundary and is 1 byte in
20466 size.
20468 @item -mno-strict-align
20469 @itemx -mstrict-align
20470 @opindex mno-strict-align
20471 @opindex mstrict-align
20472 On System V.4 and embedded PowerPC systems do not (do) assume that
20473 unaligned memory references are handled by the system.
20475 @item -mrelocatable
20476 @itemx -mno-relocatable
20477 @opindex mrelocatable
20478 @opindex mno-relocatable
20479 Generate code that allows (does not allow) a static executable to be
20480 relocated to a different address at run time.  A simple embedded
20481 PowerPC system loader should relocate the entire contents of
20482 @code{.got2} and 4-byte locations listed in the @code{.fixup} section,
20483 a table of 32-bit addresses generated by this option.  For this to
20484 work, all objects linked together must be compiled with
20485 @option{-mrelocatable} or @option{-mrelocatable-lib}.
20486 @option{-mrelocatable} code aligns the stack to an 8-byte boundary.
20488 @item -mrelocatable-lib
20489 @itemx -mno-relocatable-lib
20490 @opindex mrelocatable-lib
20491 @opindex mno-relocatable-lib
20492 Like @option{-mrelocatable}, @option{-mrelocatable-lib} generates a
20493 @code{.fixup} section to allow static executables to be relocated at
20494 run time, but @option{-mrelocatable-lib} does not use the smaller stack
20495 alignment of @option{-mrelocatable}.  Objects compiled with
20496 @option{-mrelocatable-lib} may be linked with objects compiled with
20497 any combination of the @option{-mrelocatable} options.
20499 @item -mno-toc
20500 @itemx -mtoc
20501 @opindex mno-toc
20502 @opindex mtoc
20503 On System V.4 and embedded PowerPC systems do not (do) assume that
20504 register 2 contains a pointer to a global area pointing to the addresses
20505 used in the program.
20507 @item -mlittle
20508 @itemx -mlittle-endian
20509 @opindex mlittle
20510 @opindex mlittle-endian
20511 On System V.4 and embedded PowerPC systems compile code for the
20512 processor in little-endian mode.  The @option{-mlittle-endian} option is
20513 the same as @option{-mlittle}.
20515 @item -mbig
20516 @itemx -mbig-endian
20517 @opindex mbig
20518 @opindex mbig-endian
20519 On System V.4 and embedded PowerPC systems compile code for the
20520 processor in big-endian mode.  The @option{-mbig-endian} option is
20521 the same as @option{-mbig}.
20523 @item -mdynamic-no-pic
20524 @opindex mdynamic-no-pic
20525 On Darwin and Mac OS X systems, compile code so that it is not
20526 relocatable, but that its external references are relocatable.  The
20527 resulting code is suitable for applications, but not shared
20528 libraries.
20530 @item -msingle-pic-base
20531 @opindex msingle-pic-base
20532 Treat the register used for PIC addressing as read-only, rather than
20533 loading it in the prologue for each function.  The runtime system is
20534 responsible for initializing this register with an appropriate value
20535 before execution begins.
20537 @item -mprioritize-restricted-insns=@var{priority}
20538 @opindex mprioritize-restricted-insns
20539 This option controls the priority that is assigned to
20540 dispatch-slot restricted instructions during the second scheduling
20541 pass.  The argument @var{priority} takes the value @samp{0}, @samp{1},
20542 or @samp{2} to assign no, highest, or second-highest (respectively) 
20543 priority to dispatch-slot restricted
20544 instructions.
20546 @item -msched-costly-dep=@var{dependence_type}
20547 @opindex msched-costly-dep
20548 This option controls which dependences are considered costly
20549 by the target during instruction scheduling.  The argument
20550 @var{dependence_type} takes one of the following values:
20552 @table @asis
20553 @item @samp{no}
20554 No dependence is costly.
20556 @item @samp{all}
20557 All dependences are costly.
20559 @item @samp{true_store_to_load}
20560 A true dependence from store to load is costly.
20562 @item @samp{store_to_load}
20563 Any dependence from store to load is costly.
20565 @item @var{number}
20566 Any dependence for which the latency is greater than or equal to 
20567 @var{number} is costly.
20568 @end table
20570 @item -minsert-sched-nops=@var{scheme}
20571 @opindex minsert-sched-nops
20572 This option controls which NOP insertion scheme is used during
20573 the second scheduling pass.  The argument @var{scheme} takes one of the
20574 following values:
20576 @table @asis
20577 @item @samp{no}
20578 Don't insert NOPs.
20580 @item @samp{pad}
20581 Pad with NOPs any dispatch group that has vacant issue slots,
20582 according to the scheduler's grouping.
20584 @item @samp{regroup_exact}
20585 Insert NOPs to force costly dependent insns into
20586 separate groups.  Insert exactly as many NOPs as needed to force an insn
20587 to a new group, according to the estimated processor grouping.
20589 @item @var{number}
20590 Insert NOPs to force costly dependent insns into
20591 separate groups.  Insert @var{number} NOPs to force an insn to a new group.
20592 @end table
20594 @item -mcall-sysv
20595 @opindex mcall-sysv
20596 On System V.4 and embedded PowerPC systems compile code using calling
20597 conventions that adhere to the March 1995 draft of the System V
20598 Application Binary Interface, PowerPC processor supplement.  This is the
20599 default unless you configured GCC using @samp{powerpc-*-eabiaix}.
20601 @item -mcall-sysv-eabi
20602 @itemx -mcall-eabi
20603 @opindex mcall-sysv-eabi
20604 @opindex mcall-eabi
20605 Specify both @option{-mcall-sysv} and @option{-meabi} options.
20607 @item -mcall-sysv-noeabi
20608 @opindex mcall-sysv-noeabi
20609 Specify both @option{-mcall-sysv} and @option{-mno-eabi} options.
20611 @item -mcall-aixdesc
20612 @opindex m
20613 On System V.4 and embedded PowerPC systems compile code for the AIX
20614 operating system.
20616 @item -mcall-linux
20617 @opindex mcall-linux
20618 On System V.4 and embedded PowerPC systems compile code for the
20619 Linux-based GNU system.
20621 @item -mcall-freebsd
20622 @opindex mcall-freebsd
20623 On System V.4 and embedded PowerPC systems compile code for the
20624 FreeBSD operating system.
20626 @item -mcall-netbsd
20627 @opindex mcall-netbsd
20628 On System V.4 and embedded PowerPC systems compile code for the
20629 NetBSD operating system.
20631 @item -mcall-openbsd
20632 @opindex mcall-netbsd
20633 On System V.4 and embedded PowerPC systems compile code for the
20634 OpenBSD operating system.
20636 @item -maix-struct-return
20637 @opindex maix-struct-return
20638 Return all structures in memory (as specified by the AIX ABI)@.
20640 @item -msvr4-struct-return
20641 @opindex msvr4-struct-return
20642 Return structures smaller than 8 bytes in registers (as specified by the
20643 SVR4 ABI)@.
20645 @item -mabi=@var{abi-type}
20646 @opindex mabi
20647 Extend the current ABI with a particular extension, or remove such extension.
20648 Valid values are @samp{altivec}, @samp{no-altivec}, @samp{spe},
20649 @samp{no-spe}, @samp{ibmlongdouble}, @samp{ieeelongdouble},
20650 @samp{elfv1}, @samp{elfv2}@.
20652 @item -mabi=spe
20653 @opindex mabi=spe
20654 Extend the current ABI with SPE ABI extensions.  This does not change
20655 the default ABI, instead it adds the SPE ABI extensions to the current
20656 ABI@.
20658 @item -mabi=no-spe
20659 @opindex mabi=no-spe
20660 Disable Book-E SPE ABI extensions for the current ABI@.
20662 @item -mabi=ibmlongdouble
20663 @opindex mabi=ibmlongdouble
20664 Change the current ABI to use IBM extended-precision long double.
20665 This is a PowerPC 32-bit SYSV ABI option.
20667 @item -mabi=ieeelongdouble
20668 @opindex mabi=ieeelongdouble
20669 Change the current ABI to use IEEE extended-precision long double.
20670 This is a PowerPC 32-bit Linux ABI option.
20672 @item -mabi=elfv1
20673 @opindex mabi=elfv1
20674 Change the current ABI to use the ELFv1 ABI.
20675 This is the default ABI for big-endian PowerPC 64-bit Linux.
20676 Overriding the default ABI requires special system support and is
20677 likely to fail in spectacular ways.
20679 @item -mabi=elfv2
20680 @opindex mabi=elfv2
20681 Change the current ABI to use the ELFv2 ABI.
20682 This is the default ABI for little-endian PowerPC 64-bit Linux.
20683 Overriding the default ABI requires special system support and is
20684 likely to fail in spectacular ways.
20686 @item -mprototype
20687 @itemx -mno-prototype
20688 @opindex mprototype
20689 @opindex mno-prototype
20690 On System V.4 and embedded PowerPC systems assume that all calls to
20691 variable argument functions are properly prototyped.  Otherwise, the
20692 compiler must insert an instruction before every non-prototyped call to
20693 set or clear bit 6 of the condition code register (@code{CR}) to
20694 indicate whether floating-point values are passed in the floating-point
20695 registers in case the function takes variable arguments.  With
20696 @option{-mprototype}, only calls to prototyped variable argument functions
20697 set or clear the bit.
20699 @item -msim
20700 @opindex msim
20701 On embedded PowerPC systems, assume that the startup module is called
20702 @file{sim-crt0.o} and that the standard C libraries are @file{libsim.a} and
20703 @file{libc.a}.  This is the default for @samp{powerpc-*-eabisim}
20704 configurations.
20706 @item -mmvme
20707 @opindex mmvme
20708 On embedded PowerPC systems, assume that the startup module is called
20709 @file{crt0.o} and the standard C libraries are @file{libmvme.a} and
20710 @file{libc.a}.
20712 @item -mads
20713 @opindex mads
20714 On embedded PowerPC systems, assume that the startup module is called
20715 @file{crt0.o} and the standard C libraries are @file{libads.a} and
20716 @file{libc.a}.
20718 @item -myellowknife
20719 @opindex myellowknife
20720 On embedded PowerPC systems, assume that the startup module is called
20721 @file{crt0.o} and the standard C libraries are @file{libyk.a} and
20722 @file{libc.a}.
20724 @item -mvxworks
20725 @opindex mvxworks
20726 On System V.4 and embedded PowerPC systems, specify that you are
20727 compiling for a VxWorks system.
20729 @item -memb
20730 @opindex memb
20731 On embedded PowerPC systems, set the @code{PPC_EMB} bit in the ELF flags
20732 header to indicate that @samp{eabi} extended relocations are used.
20734 @item -meabi
20735 @itemx -mno-eabi
20736 @opindex meabi
20737 @opindex mno-eabi
20738 On System V.4 and embedded PowerPC systems do (do not) adhere to the
20739 Embedded Applications Binary Interface (EABI), which is a set of
20740 modifications to the System V.4 specifications.  Selecting @option{-meabi}
20741 means that the stack is aligned to an 8-byte boundary, a function
20742 @code{__eabi} is called from @code{main} to set up the EABI
20743 environment, and the @option{-msdata} option can use both @code{r2} and
20744 @code{r13} to point to two separate small data areas.  Selecting
20745 @option{-mno-eabi} means that the stack is aligned to a 16-byte boundary,
20746 no EABI initialization function is called from @code{main}, and the
20747 @option{-msdata} option only uses @code{r13} to point to a single
20748 small data area.  The @option{-meabi} option is on by default if you
20749 configured GCC using one of the @samp{powerpc*-*-eabi*} options.
20751 @item -msdata=eabi
20752 @opindex msdata=eabi
20753 On System V.4 and embedded PowerPC systems, put small initialized
20754 @code{const} global and static data in the @code{.sdata2} section, which
20755 is pointed to by register @code{r2}.  Put small initialized
20756 non-@code{const} global and static data in the @code{.sdata} section,
20757 which is pointed to by register @code{r13}.  Put small uninitialized
20758 global and static data in the @code{.sbss} section, which is adjacent to
20759 the @code{.sdata} section.  The @option{-msdata=eabi} option is
20760 incompatible with the @option{-mrelocatable} option.  The
20761 @option{-msdata=eabi} option also sets the @option{-memb} option.
20763 @item -msdata=sysv
20764 @opindex msdata=sysv
20765 On System V.4 and embedded PowerPC systems, put small global and static
20766 data in the @code{.sdata} section, which is pointed to by register
20767 @code{r13}.  Put small uninitialized global and static data in the
20768 @code{.sbss} section, which is adjacent to the @code{.sdata} section.
20769 The @option{-msdata=sysv} option is incompatible with the
20770 @option{-mrelocatable} option.
20772 @item -msdata=default
20773 @itemx -msdata
20774 @opindex msdata=default
20775 @opindex msdata
20776 On System V.4 and embedded PowerPC systems, if @option{-meabi} is used,
20777 compile code the same as @option{-msdata=eabi}, otherwise compile code the
20778 same as @option{-msdata=sysv}.
20780 @item -msdata=data
20781 @opindex msdata=data
20782 On System V.4 and embedded PowerPC systems, put small global
20783 data in the @code{.sdata} section.  Put small uninitialized global
20784 data in the @code{.sbss} section.  Do not use register @code{r13}
20785 to address small data however.  This is the default behavior unless
20786 other @option{-msdata} options are used.
20788 @item -msdata=none
20789 @itemx -mno-sdata
20790 @opindex msdata=none
20791 @opindex mno-sdata
20792 On embedded PowerPC systems, put all initialized global and static data
20793 in the @code{.data} section, and all uninitialized data in the
20794 @code{.bss} section.
20796 @item -mblock-move-inline-limit=@var{num}
20797 @opindex mblock-move-inline-limit
20798 Inline all block moves (such as calls to @code{memcpy} or structure
20799 copies) less than or equal to @var{num} bytes.  The minimum value for
20800 @var{num} is 32 bytes on 32-bit targets and 64 bytes on 64-bit
20801 targets.  The default value is target-specific.
20803 @item -G @var{num}
20804 @opindex G
20805 @cindex smaller data references (PowerPC)
20806 @cindex .sdata/.sdata2 references (PowerPC)
20807 On embedded PowerPC systems, put global and static items less than or
20808 equal to @var{num} bytes into the small data or BSS sections instead of
20809 the normal data or BSS section.  By default, @var{num} is 8.  The
20810 @option{-G @var{num}} switch is also passed to the linker.
20811 All modules should be compiled with the same @option{-G @var{num}} value.
20813 @item -mregnames
20814 @itemx -mno-regnames
20815 @opindex mregnames
20816 @opindex mno-regnames
20817 On System V.4 and embedded PowerPC systems do (do not) emit register
20818 names in the assembly language output using symbolic forms.
20820 @item -mlongcall
20821 @itemx -mno-longcall
20822 @opindex mlongcall
20823 @opindex mno-longcall
20824 By default assume that all calls are far away so that a longer and more
20825 expensive calling sequence is required.  This is required for calls
20826 farther than 32 megabytes (33,554,432 bytes) from the current location.
20827 A short call is generated if the compiler knows
20828 the call cannot be that far away.  This setting can be overridden by
20829 the @code{shortcall} function attribute, or by @code{#pragma
20830 longcall(0)}.
20832 Some linkers are capable of detecting out-of-range calls and generating
20833 glue code on the fly.  On these systems, long calls are unnecessary and
20834 generate slower code.  As of this writing, the AIX linker can do this,
20835 as can the GNU linker for PowerPC/64.  It is planned to add this feature
20836 to the GNU linker for 32-bit PowerPC systems as well.
20838 On Darwin/PPC systems, @code{#pragma longcall} generates @code{jbsr
20839 callee, L42}, plus a @dfn{branch island} (glue code).  The two target
20840 addresses represent the callee and the branch island.  The
20841 Darwin/PPC linker prefers the first address and generates a @code{bl
20842 callee} if the PPC @code{bl} instruction reaches the callee directly;
20843 otherwise, the linker generates @code{bl L42} to call the branch
20844 island.  The branch island is appended to the body of the
20845 calling function; it computes the full 32-bit address of the callee
20846 and jumps to it.
20848 On Mach-O (Darwin) systems, this option directs the compiler emit to
20849 the glue for every direct call, and the Darwin linker decides whether
20850 to use or discard it.
20852 In the future, GCC may ignore all longcall specifications
20853 when the linker is known to generate glue.
20855 @item -mtls-markers
20856 @itemx -mno-tls-markers
20857 @opindex mtls-markers
20858 @opindex mno-tls-markers
20859 Mark (do not mark) calls to @code{__tls_get_addr} with a relocation
20860 specifying the function argument.  The relocation allows the linker to
20861 reliably associate function call with argument setup instructions for
20862 TLS optimization, which in turn allows GCC to better schedule the
20863 sequence.
20865 @item -pthread
20866 @opindex pthread
20867 Adds support for multithreading with the @dfn{pthreads} library.
20868 This option sets flags for both the preprocessor and linker.
20870 @item -mrecip
20871 @itemx -mno-recip
20872 @opindex mrecip
20873 This option enables use of the reciprocal estimate and
20874 reciprocal square root estimate instructions with additional
20875 Newton-Raphson steps to increase precision instead of doing a divide or
20876 square root and divide for floating-point arguments.  You should use
20877 the @option{-ffast-math} option when using @option{-mrecip} (or at
20878 least @option{-funsafe-math-optimizations},
20879 @option{-ffinite-math-only}, @option{-freciprocal-math} and
20880 @option{-fno-trapping-math}).  Note that while the throughput of the
20881 sequence is generally higher than the throughput of the non-reciprocal
20882 instruction, the precision of the sequence can be decreased by up to 2
20883 ulp (i.e.@: the inverse of 1.0 equals 0.99999994) for reciprocal square
20884 roots.
20886 @item -mrecip=@var{opt}
20887 @opindex mrecip=opt
20888 This option controls which reciprocal estimate instructions
20889 may be used.  @var{opt} is a comma-separated list of options, which may
20890 be preceded by a @code{!} to invert the option:
20892 @table @samp
20894 @item all
20895 Enable all estimate instructions.
20897 @item default 
20898 Enable the default instructions, equivalent to @option{-mrecip}.
20900 @item none 
20901 Disable all estimate instructions, equivalent to @option{-mno-recip}.
20903 @item div 
20904 Enable the reciprocal approximation instructions for both 
20905 single and double precision.
20907 @item divf 
20908 Enable the single-precision reciprocal approximation instructions.
20910 @item divd 
20911 Enable the double-precision reciprocal approximation instructions.
20913 @item rsqrt 
20914 Enable the reciprocal square root approximation instructions for both
20915 single and double precision.
20917 @item rsqrtf 
20918 Enable the single-precision reciprocal square root approximation instructions.
20920 @item rsqrtd 
20921 Enable the double-precision reciprocal square root approximation instructions.
20923 @end table
20925 So, for example, @option{-mrecip=all,!rsqrtd} enables
20926 all of the reciprocal estimate instructions, except for the
20927 @code{FRSQRTE}, @code{XSRSQRTEDP}, and @code{XVRSQRTEDP} instructions
20928 which handle the double-precision reciprocal square root calculations.
20930 @item -mrecip-precision
20931 @itemx -mno-recip-precision
20932 @opindex mrecip-precision
20933 Assume (do not assume) that the reciprocal estimate instructions
20934 provide higher-precision estimates than is mandated by the PowerPC
20935 ABI.  Selecting @option{-mcpu=power6}, @option{-mcpu=power7} or
20936 @option{-mcpu=power8} automatically selects @option{-mrecip-precision}.
20937 The double-precision square root estimate instructions are not generated by
20938 default on low-precision machines, since they do not provide an
20939 estimate that converges after three steps.
20941 @item -mveclibabi=@var{type}
20942 @opindex mveclibabi
20943 Specifies the ABI type to use for vectorizing intrinsics using an
20944 external library.  The only type supported at present is @samp{mass},
20945 which specifies to use IBM's Mathematical Acceleration Subsystem
20946 (MASS) libraries for vectorizing intrinsics using external libraries.
20947 GCC currently emits calls to @code{acosd2}, @code{acosf4},
20948 @code{acoshd2}, @code{acoshf4}, @code{asind2}, @code{asinf4},
20949 @code{asinhd2}, @code{asinhf4}, @code{atan2d2}, @code{atan2f4},
20950 @code{atand2}, @code{atanf4}, @code{atanhd2}, @code{atanhf4},
20951 @code{cbrtd2}, @code{cbrtf4}, @code{cosd2}, @code{cosf4},
20952 @code{coshd2}, @code{coshf4}, @code{erfcd2}, @code{erfcf4},
20953 @code{erfd2}, @code{erff4}, @code{exp2d2}, @code{exp2f4},
20954 @code{expd2}, @code{expf4}, @code{expm1d2}, @code{expm1f4},
20955 @code{hypotd2}, @code{hypotf4}, @code{lgammad2}, @code{lgammaf4},
20956 @code{log10d2}, @code{log10f4}, @code{log1pd2}, @code{log1pf4},
20957 @code{log2d2}, @code{log2f4}, @code{logd2}, @code{logf4},
20958 @code{powd2}, @code{powf4}, @code{sind2}, @code{sinf4}, @code{sinhd2},
20959 @code{sinhf4}, @code{sqrtd2}, @code{sqrtf4}, @code{tand2},
20960 @code{tanf4}, @code{tanhd2}, and @code{tanhf4} when generating code
20961 for power7.  Both @option{-ftree-vectorize} and
20962 @option{-funsafe-math-optimizations} must also be enabled.  The MASS
20963 libraries must be specified at link time.
20965 @item -mfriz
20966 @itemx -mno-friz
20967 @opindex mfriz
20968 Generate (do not generate) the @code{friz} instruction when the
20969 @option{-funsafe-math-optimizations} option is used to optimize
20970 rounding of floating-point values to 64-bit integer and back to floating
20971 point.  The @code{friz} instruction does not return the same value if
20972 the floating-point number is too large to fit in an integer.
20974 @item -mpointers-to-nested-functions
20975 @itemx -mno-pointers-to-nested-functions
20976 @opindex mpointers-to-nested-functions
20977 Generate (do not generate) code to load up the static chain register
20978 (@code{r11}) when calling through a pointer on AIX and 64-bit Linux
20979 systems where a function pointer points to a 3-word descriptor giving
20980 the function address, TOC value to be loaded in register @code{r2}, and
20981 static chain value to be loaded in register @code{r11}.  The
20982 @option{-mpointers-to-nested-functions} is on by default.  You cannot
20983 call through pointers to nested functions or pointers
20984 to functions compiled in other languages that use the static chain if
20985 you use @option{-mno-pointers-to-nested-functions}.
20987 @item -msave-toc-indirect
20988 @itemx -mno-save-toc-indirect
20989 @opindex msave-toc-indirect
20990 Generate (do not generate) code to save the TOC value in the reserved
20991 stack location in the function prologue if the function calls through
20992 a pointer on AIX and 64-bit Linux systems.  If the TOC value is not
20993 saved in the prologue, it is saved just before the call through the
20994 pointer.  The @option{-mno-save-toc-indirect} option is the default.
20996 @item -mcompat-align-parm
20997 @itemx -mno-compat-align-parm
20998 @opindex mcompat-align-parm
20999 Generate (do not generate) code to pass structure parameters with a
21000 maximum alignment of 64 bits, for compatibility with older versions
21001 of GCC.
21003 Older versions of GCC (prior to 4.9.0) incorrectly did not align a
21004 structure parameter on a 128-bit boundary when that structure contained
21005 a member requiring 128-bit alignment.  This is corrected in more
21006 recent versions of GCC.  This option may be used to generate code
21007 that is compatible with functions compiled with older versions of
21008 GCC.
21010 The @option{-mno-compat-align-parm} option is the default.
21011 @end table
21013 @node RX Options
21014 @subsection RX Options
21015 @cindex RX Options
21017 These command-line options are defined for RX targets:
21019 @table @gcctabopt
21020 @item -m64bit-doubles
21021 @itemx -m32bit-doubles
21022 @opindex m64bit-doubles
21023 @opindex m32bit-doubles
21024 Make the @code{double} data type be 64 bits (@option{-m64bit-doubles})
21025 or 32 bits (@option{-m32bit-doubles}) in size.  The default is
21026 @option{-m32bit-doubles}.  @emph{Note} RX floating-point hardware only
21027 works on 32-bit values, which is why the default is
21028 @option{-m32bit-doubles}.
21030 @item -fpu
21031 @itemx -nofpu
21032 @opindex fpu
21033 @opindex nofpu
21034 Enables (@option{-fpu}) or disables (@option{-nofpu}) the use of RX
21035 floating-point hardware.  The default is enabled for the RX600
21036 series and disabled for the RX200 series.
21038 Floating-point instructions are only generated for 32-bit floating-point 
21039 values, however, so the FPU hardware is not used for doubles if the
21040 @option{-m64bit-doubles} option is used.
21042 @emph{Note} If the @option{-fpu} option is enabled then
21043 @option{-funsafe-math-optimizations} is also enabled automatically.
21044 This is because the RX FPU instructions are themselves unsafe.
21046 @item -mcpu=@var{name}
21047 @opindex mcpu
21048 Selects the type of RX CPU to be targeted.  Currently three types are
21049 supported, the generic @samp{RX600} and @samp{RX200} series hardware and
21050 the specific @samp{RX610} CPU.  The default is @samp{RX600}.
21052 The only difference between @samp{RX600} and @samp{RX610} is that the
21053 @samp{RX610} does not support the @code{MVTIPL} instruction.
21055 The @samp{RX200} series does not have a hardware floating-point unit
21056 and so @option{-nofpu} is enabled by default when this type is
21057 selected.
21059 @item -mbig-endian-data
21060 @itemx -mlittle-endian-data
21061 @opindex mbig-endian-data
21062 @opindex mlittle-endian-data
21063 Store data (but not code) in the big-endian format.  The default is
21064 @option{-mlittle-endian-data}, i.e.@: to store data in the little-endian
21065 format.
21067 @item -msmall-data-limit=@var{N}
21068 @opindex msmall-data-limit
21069 Specifies the maximum size in bytes of global and static variables
21070 which can be placed into the small data area.  Using the small data
21071 area can lead to smaller and faster code, but the size of area is
21072 limited and it is up to the programmer to ensure that the area does
21073 not overflow.  Also when the small data area is used one of the RX's
21074 registers (usually @code{r13}) is reserved for use pointing to this
21075 area, so it is no longer available for use by the compiler.  This
21076 could result in slower and/or larger code if variables are pushed onto
21077 the stack instead of being held in this register.
21079 Note, common variables (variables that have not been initialized) and
21080 constants are not placed into the small data area as they are assigned
21081 to other sections in the output executable.
21083 The default value is zero, which disables this feature.  Note, this
21084 feature is not enabled by default with higher optimization levels
21085 (@option{-O2} etc) because of the potentially detrimental effects of
21086 reserving a register.  It is up to the programmer to experiment and
21087 discover whether this feature is of benefit to their program.  See the
21088 description of the @option{-mpid} option for a description of how the
21089 actual register to hold the small data area pointer is chosen.
21091 @item -msim
21092 @itemx -mno-sim
21093 @opindex msim
21094 @opindex mno-sim
21095 Use the simulator runtime.  The default is to use the libgloss
21096 board-specific runtime.
21098 @item -mas100-syntax
21099 @itemx -mno-as100-syntax
21100 @opindex mas100-syntax
21101 @opindex mno-as100-syntax
21102 When generating assembler output use a syntax that is compatible with
21103 Renesas's AS100 assembler.  This syntax can also be handled by the GAS
21104 assembler, but it has some restrictions so it is not generated by default.
21106 @item -mmax-constant-size=@var{N}
21107 @opindex mmax-constant-size
21108 Specifies the maximum size, in bytes, of a constant that can be used as
21109 an operand in a RX instruction.  Although the RX instruction set does
21110 allow constants of up to 4 bytes in length to be used in instructions,
21111 a longer value equates to a longer instruction.  Thus in some
21112 circumstances it can be beneficial to restrict the size of constants
21113 that are used in instructions.  Constants that are too big are instead
21114 placed into a constant pool and referenced via register indirection.
21116 The value @var{N} can be between 0 and 4.  A value of 0 (the default)
21117 or 4 means that constants of any size are allowed.
21119 @item -mrelax
21120 @opindex mrelax
21121 Enable linker relaxation.  Linker relaxation is a process whereby the
21122 linker attempts to reduce the size of a program by finding shorter
21123 versions of various instructions.  Disabled by default.
21125 @item -mint-register=@var{N}
21126 @opindex mint-register
21127 Specify the number of registers to reserve for fast interrupt handler
21128 functions.  The value @var{N} can be between 0 and 4.  A value of 1
21129 means that register @code{r13} is reserved for the exclusive use
21130 of fast interrupt handlers.  A value of 2 reserves @code{r13} and
21131 @code{r12}.  A value of 3 reserves @code{r13}, @code{r12} and
21132 @code{r11}, and a value of 4 reserves @code{r13} through @code{r10}.
21133 A value of 0, the default, does not reserve any registers.
21135 @item -msave-acc-in-interrupts
21136 @opindex msave-acc-in-interrupts
21137 Specifies that interrupt handler functions should preserve the
21138 accumulator register.  This is only necessary if normal code might use
21139 the accumulator register, for example because it performs 64-bit
21140 multiplications.  The default is to ignore the accumulator as this
21141 makes the interrupt handlers faster.
21143 @item -mpid
21144 @itemx -mno-pid
21145 @opindex mpid
21146 @opindex mno-pid
21147 Enables the generation of position independent data.  When enabled any
21148 access to constant data is done via an offset from a base address
21149 held in a register.  This allows the location of constant data to be
21150 determined at run time without requiring the executable to be
21151 relocated, which is a benefit to embedded applications with tight
21152 memory constraints.  Data that can be modified is not affected by this
21153 option.
21155 Note, using this feature reserves a register, usually @code{r13}, for
21156 the constant data base address.  This can result in slower and/or
21157 larger code, especially in complicated functions.
21159 The actual register chosen to hold the constant data base address
21160 depends upon whether the @option{-msmall-data-limit} and/or the
21161 @option{-mint-register} command-line options are enabled.  Starting
21162 with register @code{r13} and proceeding downwards, registers are
21163 allocated first to satisfy the requirements of @option{-mint-register},
21164 then @option{-mpid} and finally @option{-msmall-data-limit}.  Thus it
21165 is possible for the small data area register to be @code{r8} if both
21166 @option{-mint-register=4} and @option{-mpid} are specified on the
21167 command line.
21169 By default this feature is not enabled.  The default can be restored
21170 via the @option{-mno-pid} command-line option.
21172 @item -mno-warn-multiple-fast-interrupts
21173 @itemx -mwarn-multiple-fast-interrupts
21174 @opindex mno-warn-multiple-fast-interrupts
21175 @opindex mwarn-multiple-fast-interrupts
21176 Prevents GCC from issuing a warning message if it finds more than one
21177 fast interrupt handler when it is compiling a file.  The default is to
21178 issue a warning for each extra fast interrupt handler found, as the RX
21179 only supports one such interrupt.
21181 @item -mallow-string-insns
21182 @itemx -mno-allow-string-insns
21183 @opindex mallow-string-insns
21184 @opindex mno-allow-string-insns
21185 Enables or disables the use of the string manipulation instructions
21186 @code{SMOVF}, @code{SCMPU}, @code{SMOVB}, @code{SMOVU}, @code{SUNTIL}
21187 @code{SWHILE} and also the @code{RMPA} instruction.  These
21188 instructions may prefetch data, which is not safe to do if accessing
21189 an I/O register.  (See section 12.2.7 of the RX62N Group User's Manual
21190 for more information).
21192 The default is to allow these instructions, but it is not possible for
21193 GCC to reliably detect all circumstances where a string instruction
21194 might be used to access an I/O register, so their use cannot be
21195 disabled automatically.  Instead it is reliant upon the programmer to
21196 use the @option{-mno-allow-string-insns} option if their program
21197 accesses I/O space.
21199 When the instructions are enabled GCC defines the C preprocessor
21200 symbol @code{__RX_ALLOW_STRING_INSNS__}, otherwise it defines the
21201 symbol @code{__RX_DISALLOW_STRING_INSNS__}.
21203 @item -mjsr
21204 @itemx -mno-jsr
21205 @opindex mjsr
21206 @opindex mno-jsr
21207 Use only (or not only) @code{JSR} instructions to access functions.
21208 This option can be used when code size exceeds the range of @code{BSR}
21209 instructions.  Note that @option{-mno-jsr} does not mean to not use
21210 @code{JSR} but instead means that any type of branch may be used.
21211 @end table
21213 @emph{Note:} The generic GCC command-line option @option{-ffixed-@var{reg}}
21214 has special significance to the RX port when used with the
21215 @code{interrupt} function attribute.  This attribute indicates a
21216 function intended to process fast interrupts.  GCC ensures
21217 that it only uses the registers @code{r10}, @code{r11}, @code{r12}
21218 and/or @code{r13} and only provided that the normal use of the
21219 corresponding registers have been restricted via the
21220 @option{-ffixed-@var{reg}} or @option{-mint-register} command-line
21221 options.
21223 @node S/390 and zSeries Options
21224 @subsection S/390 and zSeries Options
21225 @cindex S/390 and zSeries Options
21227 These are the @samp{-m} options defined for the S/390 and zSeries architecture.
21229 @table @gcctabopt
21230 @item -mhard-float
21231 @itemx -msoft-float
21232 @opindex mhard-float
21233 @opindex msoft-float
21234 Use (do not use) the hardware floating-point instructions and registers
21235 for floating-point operations.  When @option{-msoft-float} is specified,
21236 functions in @file{libgcc.a} are used to perform floating-point
21237 operations.  When @option{-mhard-float} is specified, the compiler
21238 generates IEEE floating-point instructions.  This is the default.
21240 @item -mhard-dfp
21241 @itemx -mno-hard-dfp
21242 @opindex mhard-dfp
21243 @opindex mno-hard-dfp
21244 Use (do not use) the hardware decimal-floating-point instructions for
21245 decimal-floating-point operations.  When @option{-mno-hard-dfp} is
21246 specified, functions in @file{libgcc.a} are used to perform
21247 decimal-floating-point operations.  When @option{-mhard-dfp} is
21248 specified, the compiler generates decimal-floating-point hardware
21249 instructions.  This is the default for @option{-march=z9-ec} or higher.
21251 @item -mlong-double-64
21252 @itemx -mlong-double-128
21253 @opindex mlong-double-64
21254 @opindex mlong-double-128
21255 These switches control the size of @code{long double} type. A size
21256 of 64 bits makes the @code{long double} type equivalent to the @code{double}
21257 type. This is the default.
21259 @item -mbackchain
21260 @itemx -mno-backchain
21261 @opindex mbackchain
21262 @opindex mno-backchain
21263 Store (do not store) the address of the caller's frame as backchain pointer
21264 into the callee's stack frame.
21265 A backchain may be needed to allow debugging using tools that do not understand
21266 DWARF call frame information.
21267 When @option{-mno-packed-stack} is in effect, the backchain pointer is stored
21268 at the bottom of the stack frame; when @option{-mpacked-stack} is in effect,
21269 the backchain is placed into the topmost word of the 96/160 byte register
21270 save area.
21272 In general, code compiled with @option{-mbackchain} is call-compatible with
21273 code compiled with @option{-mmo-backchain}; however, use of the backchain
21274 for debugging purposes usually requires that the whole binary is built with
21275 @option{-mbackchain}.  Note that the combination of @option{-mbackchain},
21276 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
21277 to build a linux kernel use @option{-msoft-float}.
21279 The default is to not maintain the backchain.
21281 @item -mpacked-stack
21282 @itemx -mno-packed-stack
21283 @opindex mpacked-stack
21284 @opindex mno-packed-stack
21285 Use (do not use) the packed stack layout.  When @option{-mno-packed-stack} is
21286 specified, the compiler uses the all fields of the 96/160 byte register save
21287 area only for their default purpose; unused fields still take up stack space.
21288 When @option{-mpacked-stack} is specified, register save slots are densely
21289 packed at the top of the register save area; unused space is reused for other
21290 purposes, allowing for more efficient use of the available stack space.
21291 However, when @option{-mbackchain} is also in effect, the topmost word of
21292 the save area is always used to store the backchain, and the return address
21293 register is always saved two words below the backchain.
21295 As long as the stack frame backchain is not used, code generated with
21296 @option{-mpacked-stack} is call-compatible with code generated with
21297 @option{-mno-packed-stack}.  Note that some non-FSF releases of GCC 2.95 for
21298 S/390 or zSeries generated code that uses the stack frame backchain at run
21299 time, not just for debugging purposes.  Such code is not call-compatible
21300 with code compiled with @option{-mpacked-stack}.  Also, note that the
21301 combination of @option{-mbackchain},
21302 @option{-mpacked-stack} and @option{-mhard-float} is not supported.  In order
21303 to build a linux kernel use @option{-msoft-float}.
21305 The default is to not use the packed stack layout.
21307 @item -msmall-exec
21308 @itemx -mno-small-exec
21309 @opindex msmall-exec
21310 @opindex mno-small-exec
21311 Generate (or do not generate) code using the @code{bras} instruction
21312 to do subroutine calls.
21313 This only works reliably if the total executable size does not
21314 exceed 64k.  The default is to use the @code{basr} instruction instead,
21315 which does not have this limitation.
21317 @item -m64
21318 @itemx -m31
21319 @opindex m64
21320 @opindex m31
21321 When @option{-m31} is specified, generate code compliant to the
21322 GNU/Linux for S/390 ABI@.  When @option{-m64} is specified, generate
21323 code compliant to the GNU/Linux for zSeries ABI@.  This allows GCC in
21324 particular to generate 64-bit instructions.  For the @samp{s390}
21325 targets, the default is @option{-m31}, while the @samp{s390x}
21326 targets default to @option{-m64}.
21328 @item -mzarch
21329 @itemx -mesa
21330 @opindex mzarch
21331 @opindex mesa
21332 When @option{-mzarch} is specified, generate code using the
21333 instructions available on z/Architecture.
21334 When @option{-mesa} is specified, generate code using the
21335 instructions available on ESA/390.  Note that @option{-mesa} is
21336 not possible with @option{-m64}.
21337 When generating code compliant to the GNU/Linux for S/390 ABI,
21338 the default is @option{-mesa}.  When generating code compliant
21339 to the GNU/Linux for zSeries ABI, the default is @option{-mzarch}.
21341 @item -mhtm
21342 @itemx -mno-htm
21343 @opindex mhtm
21344 @opindex mno-htm
21345 The @option{-mhtm} option enables a set of builtins making use of
21346 instructions available with the transactional execution facility
21347 introduced with the IBM zEnterprise EC12 machine generation
21348 @ref{S/390 System z Built-in Functions}.
21349 @option{-mhtm} is enabled by default when using @option{-march=zEC12}.
21351 @item -mvx
21352 @itemx -mno-vx
21353 @opindex mvx
21354 @opindex mno-vx
21355 When @option{-mvx} is specified, generate code using the instructions
21356 available with the vector extension facility introduced with the IBM
21357 z13 machine generation.
21358 This option changes the ABI for some vector type values with regard to
21359 alignment and calling conventions.  In case vector type values are
21360 being used in an ABI-relevant context a GAS @samp{.gnu_attribute}
21361 command will be added to mark the resulting binary with the ABI used.
21362 @option{-mvx} is enabled by default when using @option{-march=z13}.
21364 @item -mzvector
21365 @itemx -mno-zvector
21366 @opindex mzvector
21367 @opindex mno-zvector
21368 The @option{-mzvector} option enables vector language extensions and
21369 builtins using instructions available with the vector extension
21370 facility introduced with the IBM z13 machine generation.
21371 This option adds support for @samp{vector} to be used as a keyword to
21372 define vector type variables and arguments.  @samp{vector} is only
21373 available when GNU extensions are enabled.  It will not be expanded
21374 when requesting strict standard compliance e.g. with @option{-std=c99}.
21375 In addition to the GCC low-level builtins @option{-mzvector} enables
21376 a set of builtins added for compatibility with AltiVec-style
21377 implementations like Power and Cell.  In order to make use of these
21378 builtins the header file @file{vecintrin.h} needs to be included.
21379 @option{-mzvector} is disabled by default.
21381 @item -mmvcle
21382 @itemx -mno-mvcle
21383 @opindex mmvcle
21384 @opindex mno-mvcle
21385 Generate (or do not generate) code using the @code{mvcle} instruction
21386 to perform block moves.  When @option{-mno-mvcle} is specified,
21387 use a @code{mvc} loop instead.  This is the default unless optimizing for
21388 size.
21390 @item -mdebug
21391 @itemx -mno-debug
21392 @opindex mdebug
21393 @opindex mno-debug
21394 Print (or do not print) additional debug information when compiling.
21395 The default is to not print debug information.
21397 @item -march=@var{cpu-type}
21398 @opindex march
21399 Generate code that runs on @var{cpu-type}, which is the name of a
21400 system representing a certain processor type.  Possible values for
21401 @var{cpu-type} are @samp{z900}, @samp{z990}, @samp{z9-109},
21402 @samp{z9-ec}, @samp{z10}, @samp{z196}, @samp{zEC12}, and @samp{z13}.
21403 The default is @option{-march=z900}.  @samp{g5} and @samp{g6} are
21404 deprecated and will be removed with future releases.
21406 @item -mtune=@var{cpu-type}
21407 @opindex mtune
21408 Tune to @var{cpu-type} everything applicable about the generated code,
21409 except for the ABI and the set of available instructions.
21410 The list of @var{cpu-type} values is the same as for @option{-march}.
21411 The default is the value used for @option{-march}.
21413 @item -mtpf-trace
21414 @itemx -mno-tpf-trace
21415 @opindex mtpf-trace
21416 @opindex mno-tpf-trace
21417 Generate code that adds (does not add) in TPF OS specific branches to trace
21418 routines in the operating system.  This option is off by default, even
21419 when compiling for the TPF OS@.
21421 @item -mfused-madd
21422 @itemx -mno-fused-madd
21423 @opindex mfused-madd
21424 @opindex mno-fused-madd
21425 Generate code that uses (does not use) the floating-point multiply and
21426 accumulate instructions.  These instructions are generated by default if
21427 hardware floating point is used.
21429 @item -mwarn-framesize=@var{framesize}
21430 @opindex mwarn-framesize
21431 Emit a warning if the current function exceeds the given frame size.  Because
21432 this is a compile-time check it doesn't need to be a real problem when the program
21433 runs.  It is intended to identify functions that most probably cause
21434 a stack overflow.  It is useful to be used in an environment with limited stack
21435 size e.g.@: the linux kernel.
21437 @item -mwarn-dynamicstack
21438 @opindex mwarn-dynamicstack
21439 Emit a warning if the function calls @code{alloca} or uses dynamically-sized
21440 arrays.  This is generally a bad idea with a limited stack size.
21442 @item -mstack-guard=@var{stack-guard}
21443 @itemx -mstack-size=@var{stack-size}
21444 @opindex mstack-guard
21445 @opindex mstack-size
21446 If these options are provided the S/390 back end emits additional instructions in
21447 the function prologue that trigger a trap if the stack size is @var{stack-guard}
21448 bytes above the @var{stack-size} (remember that the stack on S/390 grows downward).
21449 If the @var{stack-guard} option is omitted the smallest power of 2 larger than
21450 the frame size of the compiled function is chosen.
21451 These options are intended to be used to help debugging stack overflow problems.
21452 The additionally emitted code causes only little overhead and hence can also be
21453 used in production-like systems without greater performance degradation.  The given
21454 values have to be exact powers of 2 and @var{stack-size} has to be greater than
21455 @var{stack-guard} without exceeding 64k.
21456 In order to be efficient the extra code makes the assumption that the stack starts
21457 at an address aligned to the value given by @var{stack-size}.
21458 The @var{stack-guard} option can only be used in conjunction with @var{stack-size}.
21460 @item -mhotpatch=@var{pre-halfwords},@var{post-halfwords}
21461 @opindex mhotpatch
21462 If the hotpatch option is enabled, a ``hot-patching'' function
21463 prologue is generated for all functions in the compilation unit.
21464 The funtion label is prepended with the given number of two-byte
21465 NOP instructions (@var{pre-halfwords}, maximum 1000000).  After
21466 the label, 2 * @var{post-halfwords} bytes are appended, using the
21467 largest NOP like instructions the architecture allows (maximum
21468 1000000).
21470 If both arguments are zero, hotpatching is disabled.
21472 This option can be overridden for individual functions with the
21473 @code{hotpatch} attribute.
21474 @end table
21476 @node Score Options
21477 @subsection Score Options
21478 @cindex Score Options
21480 These options are defined for Score implementations:
21482 @table @gcctabopt
21483 @item -meb
21484 @opindex meb
21485 Compile code for big-endian mode.  This is the default.
21487 @item -mel
21488 @opindex mel
21489 Compile code for little-endian mode.
21491 @item -mnhwloop
21492 @opindex mnhwloop
21493 Disable generation of @code{bcnz} instructions.
21495 @item -muls
21496 @opindex muls
21497 Enable generation of unaligned load and store instructions.
21499 @item -mmac
21500 @opindex mmac
21501 Enable the use of multiply-accumulate instructions. Disabled by default.
21503 @item -mscore5
21504 @opindex mscore5
21505 Specify the SCORE5 as the target architecture.
21507 @item -mscore5u
21508 @opindex mscore5u
21509 Specify the SCORE5U of the target architecture.
21511 @item -mscore7
21512 @opindex mscore7
21513 Specify the SCORE7 as the target architecture. This is the default.
21515 @item -mscore7d
21516 @opindex mscore7d
21517 Specify the SCORE7D as the target architecture.
21518 @end table
21520 @node SH Options
21521 @subsection SH Options
21523 These @samp{-m} options are defined for the SH implementations:
21525 @table @gcctabopt
21526 @item -m1
21527 @opindex m1
21528 Generate code for the SH1.
21530 @item -m2
21531 @opindex m2
21532 Generate code for the SH2.
21534 @item -m2e
21535 Generate code for the SH2e.
21537 @item -m2a-nofpu
21538 @opindex m2a-nofpu
21539 Generate code for the SH2a without FPU, or for a SH2a-FPU in such a way
21540 that the floating-point unit is not used.
21542 @item -m2a-single-only
21543 @opindex m2a-single-only
21544 Generate code for the SH2a-FPU, in such a way that no double-precision
21545 floating-point operations are used.
21547 @item -m2a-single
21548 @opindex m2a-single
21549 Generate code for the SH2a-FPU assuming the floating-point unit is in
21550 single-precision mode by default.
21552 @item -m2a
21553 @opindex m2a
21554 Generate code for the SH2a-FPU assuming the floating-point unit is in
21555 double-precision mode by default.
21557 @item -m3
21558 @opindex m3
21559 Generate code for the SH3.
21561 @item -m3e
21562 @opindex m3e
21563 Generate code for the SH3e.
21565 @item -m4-nofpu
21566 @opindex m4-nofpu
21567 Generate code for the SH4 without a floating-point unit.
21569 @item -m4-single-only
21570 @opindex m4-single-only
21571 Generate code for the SH4 with a floating-point unit that only
21572 supports single-precision arithmetic.
21574 @item -m4-single
21575 @opindex m4-single
21576 Generate code for the SH4 assuming the floating-point unit is in
21577 single-precision mode by default.
21579 @item -m4
21580 @opindex m4
21581 Generate code for the SH4.
21583 @item -m4-100
21584 @opindex m4-100
21585 Generate code for SH4-100.
21587 @item -m4-100-nofpu
21588 @opindex m4-100-nofpu
21589 Generate code for SH4-100 in such a way that the
21590 floating-point unit is not used.
21592 @item -m4-100-single
21593 @opindex m4-100-single
21594 Generate code for SH4-100 assuming the floating-point unit is in
21595 single-precision mode by default.
21597 @item -m4-100-single-only
21598 @opindex m4-100-single-only
21599 Generate code for SH4-100 in such a way that no double-precision
21600 floating-point operations are used.
21602 @item -m4-200
21603 @opindex m4-200
21604 Generate code for SH4-200.
21606 @item -m4-200-nofpu
21607 @opindex m4-200-nofpu
21608 Generate code for SH4-200 without in such a way that the
21609 floating-point unit is not used.
21611 @item -m4-200-single
21612 @opindex m4-200-single
21613 Generate code for SH4-200 assuming the floating-point unit is in
21614 single-precision mode by default.
21616 @item -m4-200-single-only
21617 @opindex m4-200-single-only
21618 Generate code for SH4-200 in such a way that no double-precision
21619 floating-point operations are used.
21621 @item -m4-300
21622 @opindex m4-300
21623 Generate code for SH4-300.
21625 @item -m4-300-nofpu
21626 @opindex m4-300-nofpu
21627 Generate code for SH4-300 without in such a way that the
21628 floating-point unit is not used.
21630 @item -m4-300-single
21631 @opindex m4-300-single
21632 Generate code for SH4-300 in such a way that no double-precision
21633 floating-point operations are used.
21635 @item -m4-300-single-only
21636 @opindex m4-300-single-only
21637 Generate code for SH4-300 in such a way that no double-precision
21638 floating-point operations are used.
21640 @item -m4-340
21641 @opindex m4-340
21642 Generate code for SH4-340 (no MMU, no FPU).
21644 @item -m4-500
21645 @opindex m4-500
21646 Generate code for SH4-500 (no FPU).  Passes @option{-isa=sh4-nofpu} to the
21647 assembler.
21649 @item -m4a-nofpu
21650 @opindex m4a-nofpu
21651 Generate code for the SH4al-dsp, or for a SH4a in such a way that the
21652 floating-point unit is not used.
21654 @item -m4a-single-only
21655 @opindex m4a-single-only
21656 Generate code for the SH4a, in such a way that no double-precision
21657 floating-point operations are used.
21659 @item -m4a-single
21660 @opindex m4a-single
21661 Generate code for the SH4a assuming the floating-point unit is in
21662 single-precision mode by default.
21664 @item -m4a
21665 @opindex m4a
21666 Generate code for the SH4a.
21668 @item -m4al
21669 @opindex m4al
21670 Same as @option{-m4a-nofpu}, except that it implicitly passes
21671 @option{-dsp} to the assembler.  GCC doesn't generate any DSP
21672 instructions at the moment.
21674 @item -mb
21675 @opindex mb
21676 Compile code for the processor in big-endian mode.
21678 @item -ml
21679 @opindex ml
21680 Compile code for the processor in little-endian mode.
21682 @item -mdalign
21683 @opindex mdalign
21684 Align doubles at 64-bit boundaries.  Note that this changes the calling
21685 conventions, and thus some functions from the standard C library do
21686 not work unless you recompile it first with @option{-mdalign}.
21688 @item -mrelax
21689 @opindex mrelax
21690 Shorten some address references at link time, when possible; uses the
21691 linker option @option{-relax}.
21693 @item -mbigtable
21694 @opindex mbigtable
21695 Use 32-bit offsets in @code{switch} tables.  The default is to use
21696 16-bit offsets.
21698 @item -mbitops
21699 @opindex mbitops
21700 Enable the use of bit manipulation instructions on SH2A.
21702 @item -mfmovd
21703 @opindex mfmovd
21704 Enable the use of the instruction @code{fmovd}.  Check @option{-mdalign} for
21705 alignment constraints.
21707 @item -mrenesas
21708 @opindex mrenesas
21709 Comply with the calling conventions defined by Renesas.
21711 @item -mno-renesas
21712 @opindex mno-renesas
21713 Comply with the calling conventions defined for GCC before the Renesas
21714 conventions were available.  This option is the default for all
21715 targets of the SH toolchain.
21717 @item -mnomacsave
21718 @opindex mnomacsave
21719 Mark the @code{MAC} register as call-clobbered, even if
21720 @option{-mrenesas} is given.
21722 @item -mieee
21723 @itemx -mno-ieee
21724 @opindex mieee
21725 @opindex mno-ieee
21726 Control the IEEE compliance of floating-point comparisons, which affects the
21727 handling of cases where the result of a comparison is unordered.  By default
21728 @option{-mieee} is implicitly enabled.  If @option{-ffinite-math-only} is
21729 enabled @option{-mno-ieee} is implicitly set, which results in faster
21730 floating-point greater-equal and less-equal comparisons.  The implicit settings
21731 can be overridden by specifying either @option{-mieee} or @option{-mno-ieee}.
21733 @item -minline-ic_invalidate
21734 @opindex minline-ic_invalidate
21735 Inline code to invalidate instruction cache entries after setting up
21736 nested function trampolines.
21737 This option has no effect if @option{-musermode} is in effect and the selected
21738 code generation option (e.g. @option{-m4}) does not allow the use of the @code{icbi}
21739 instruction.
21740 If the selected code generation option does not allow the use of the @code{icbi}
21741 instruction, and @option{-musermode} is not in effect, the inlined code
21742 manipulates the instruction cache address array directly with an associative
21743 write.  This not only requires privileged mode at run time, but it also
21744 fails if the cache line had been mapped via the TLB and has become unmapped.
21746 @item -misize
21747 @opindex misize
21748 Dump instruction size and location in the assembly code.
21750 @item -mpadstruct
21751 @opindex mpadstruct
21752 This option is deprecated.  It pads structures to multiple of 4 bytes,
21753 which is incompatible with the SH ABI@.
21755 @item -matomic-model=@var{model}
21756 @opindex matomic-model=@var{model}
21757 Sets the model of atomic operations and additional parameters as a comma
21758 separated list.  For details on the atomic built-in functions see
21759 @ref{__atomic Builtins}.  The following models and parameters are supported:
21761 @table @samp
21763 @item none
21764 Disable compiler generated atomic sequences and emit library calls for atomic
21765 operations.  This is the default if the target is not @code{sh*-*-linux*}.
21767 @item soft-gusa
21768 Generate GNU/Linux compatible gUSA software atomic sequences for the atomic
21769 built-in functions.  The generated atomic sequences require additional support
21770 from the interrupt/exception handling code of the system and are only suitable
21771 for SH3* and SH4* single-core systems.  This option is enabled by default when
21772 the target is @code{sh*-*-linux*} and SH3* or SH4*.  When the target is SH4A,
21773 this option also partially utilizes the hardware atomic instructions
21774 @code{movli.l} and @code{movco.l} to create more efficient code, unless
21775 @samp{strict} is specified.  
21777 @item soft-tcb
21778 Generate software atomic sequences that use a variable in the thread control
21779 block.  This is a variation of the gUSA sequences which can also be used on
21780 SH1* and SH2* targets.  The generated atomic sequences require additional
21781 support from the interrupt/exception handling code of the system and are only
21782 suitable for single-core systems.  When using this model, the @samp{gbr-offset=}
21783 parameter has to be specified as well.
21785 @item soft-imask
21786 Generate software atomic sequences that temporarily disable interrupts by
21787 setting @code{SR.IMASK = 1111}.  This model works only when the program runs
21788 in privileged mode and is only suitable for single-core systems.  Additional
21789 support from the interrupt/exception handling code of the system is not
21790 required.  This model is enabled by default when the target is
21791 @code{sh*-*-linux*} and SH1* or SH2*.
21793 @item hard-llcs
21794 Generate hardware atomic sequences using the @code{movli.l} and @code{movco.l}
21795 instructions only.  This is only available on SH4A and is suitable for
21796 multi-core systems.  Since the hardware instructions support only 32 bit atomic
21797 variables access to 8 or 16 bit variables is emulated with 32 bit accesses.
21798 Code compiled with this option is also compatible with other software
21799 atomic model interrupt/exception handling systems if executed on an SH4A
21800 system.  Additional support from the interrupt/exception handling code of the
21801 system is not required for this model.
21803 @item gbr-offset=
21804 This parameter specifies the offset in bytes of the variable in the thread
21805 control block structure that should be used by the generated atomic sequences
21806 when the @samp{soft-tcb} model has been selected.  For other models this
21807 parameter is ignored.  The specified value must be an integer multiple of four
21808 and in the range 0-1020.
21810 @item strict
21811 This parameter prevents mixed usage of multiple atomic models, even if they
21812 are compatible, and makes the compiler generate atomic sequences of the
21813 specified model only.
21815 @end table
21817 @item -mtas
21818 @opindex mtas
21819 Generate the @code{tas.b} opcode for @code{__atomic_test_and_set}.
21820 Notice that depending on the particular hardware and software configuration
21821 this can degrade overall performance due to the operand cache line flushes
21822 that are implied by the @code{tas.b} instruction.  On multi-core SH4A
21823 processors the @code{tas.b} instruction must be used with caution since it
21824 can result in data corruption for certain cache configurations.
21826 @item -mprefergot
21827 @opindex mprefergot
21828 When generating position-independent code, emit function calls using
21829 the Global Offset Table instead of the Procedure Linkage Table.
21831 @item -musermode
21832 @itemx -mno-usermode
21833 @opindex musermode
21834 @opindex mno-usermode
21835 Don't allow (allow) the compiler generating privileged mode code.  Specifying
21836 @option{-musermode} also implies @option{-mno-inline-ic_invalidate} if the
21837 inlined code would not work in user mode.  @option{-musermode} is the default
21838 when the target is @code{sh*-*-linux*}.  If the target is SH1* or SH2*
21839 @option{-musermode} has no effect, since there is no user mode.
21841 @item -multcost=@var{number}
21842 @opindex multcost=@var{number}
21843 Set the cost to assume for a multiply insn.
21845 @item -mdiv=@var{strategy}
21846 @opindex mdiv=@var{strategy}
21847 Set the division strategy to be used for integer division operations.
21848 @var{strategy} can be one of: 
21850 @table @samp
21852 @item call-div1
21853 Calls a library function that uses the single-step division instruction
21854 @code{div1} to perform the operation.  Division by zero calculates an
21855 unspecified result and does not trap.  This is the default except for SH4,
21856 SH2A and SHcompact.
21858 @item call-fp
21859 Calls a library function that performs the operation in double precision
21860 floating point.  Division by zero causes a floating-point exception.  This is
21861 the default for SHcompact with FPU.  Specifying this for targets that do not
21862 have a double precision FPU defaults to @code{call-div1}.
21864 @item call-table
21865 Calls a library function that uses a lookup table for small divisors and
21866 the @code{div1} instruction with case distinction for larger divisors.  Division
21867 by zero calculates an unspecified result and does not trap.  This is the default
21868 for SH4.  Specifying this for targets that do not have dynamic shift
21869 instructions defaults to @code{call-div1}.
21871 @end table
21873 When a division strategy has not been specified the default strategy is
21874 selected based on the current target.  For SH2A the default strategy is to
21875 use the @code{divs} and @code{divu} instructions instead of library function
21876 calls.
21878 @item -maccumulate-outgoing-args
21879 @opindex maccumulate-outgoing-args
21880 Reserve space once for outgoing arguments in the function prologue rather
21881 than around each call.  Generally beneficial for performance and size.  Also
21882 needed for unwinding to avoid changing the stack frame around conditional code.
21884 @item -mdivsi3_libfunc=@var{name}
21885 @opindex mdivsi3_libfunc=@var{name}
21886 Set the name of the library function used for 32-bit signed division to
21887 @var{name}.
21888 This only affects the name used in the @samp{call} division strategies, and
21889 the compiler still expects the same sets of input/output/clobbered registers as
21890 if this option were not present.
21892 @item -mfixed-range=@var{register-range}
21893 @opindex mfixed-range
21894 Generate code treating the given register range as fixed registers.
21895 A fixed register is one that the register allocator can not use.  This is
21896 useful when compiling kernel code.  A register range is specified as
21897 two registers separated by a dash.  Multiple register ranges can be
21898 specified separated by a comma.
21900 @item -mbranch-cost=@var{num}
21901 @opindex mbranch-cost=@var{num}
21902 Assume @var{num} to be the cost for a branch instruction.  Higher numbers
21903 make the compiler try to generate more branch-free code if possible.  
21904 If not specified the value is selected depending on the processor type that
21905 is being compiled for.
21907 @item -mzdcbranch
21908 @itemx -mno-zdcbranch
21909 @opindex mzdcbranch
21910 @opindex mno-zdcbranch
21911 Assume (do not assume) that zero displacement conditional branch instructions
21912 @code{bt} and @code{bf} are fast.  If @option{-mzdcbranch} is specified, the
21913 compiler prefers zero displacement branch code sequences.  This is
21914 enabled by default when generating code for SH4 and SH4A.  It can be explicitly
21915 disabled by specifying @option{-mno-zdcbranch}.
21917 @item -mcbranch-force-delay-slot
21918 @opindex mcbranch-force-delay-slot
21919 Force the usage of delay slots for conditional branches, which stuffs the delay
21920 slot with a @code{nop} if a suitable instruction can't be found.  By default
21921 this option is disabled.  It can be enabled to work around hardware bugs as
21922 found in the original SH7055.
21924 @item -mfused-madd
21925 @itemx -mno-fused-madd
21926 @opindex mfused-madd
21927 @opindex mno-fused-madd
21928 Generate code that uses (does not use) the floating-point multiply and
21929 accumulate instructions.  These instructions are generated by default
21930 if hardware floating point is used.  The machine-dependent
21931 @option{-mfused-madd} option is now mapped to the machine-independent
21932 @option{-ffp-contract=fast} option, and @option{-mno-fused-madd} is
21933 mapped to @option{-ffp-contract=off}.
21935 @item -mfsca
21936 @itemx -mno-fsca
21937 @opindex mfsca
21938 @opindex mno-fsca
21939 Allow or disallow the compiler to emit the @code{fsca} instruction for sine
21940 and cosine approximations.  The option @option{-mfsca} must be used in
21941 combination with @option{-funsafe-math-optimizations}.  It is enabled by default
21942 when generating code for SH4A.  Using @option{-mno-fsca} disables sine and cosine
21943 approximations even if @option{-funsafe-math-optimizations} is in effect.
21945 @item -mfsrra
21946 @itemx -mno-fsrra
21947 @opindex mfsrra
21948 @opindex mno-fsrra
21949 Allow or disallow the compiler to emit the @code{fsrra} instruction for
21950 reciprocal square root approximations.  The option @option{-mfsrra} must be used
21951 in combination with @option{-funsafe-math-optimizations} and
21952 @option{-ffinite-math-only}.  It is enabled by default when generating code for
21953 SH4A.  Using @option{-mno-fsrra} disables reciprocal square root approximations
21954 even if @option{-funsafe-math-optimizations} and @option{-ffinite-math-only} are
21955 in effect.
21957 @item -mpretend-cmove
21958 @opindex mpretend-cmove
21959 Prefer zero-displacement conditional branches for conditional move instruction
21960 patterns.  This can result in faster code on the SH4 processor.
21962 @item -mfdpic
21963 @opindex fdpic
21964 Generate code using the FDPIC ABI.
21966 @end table
21968 @node Solaris 2 Options
21969 @subsection Solaris 2 Options
21970 @cindex Solaris 2 options
21972 These @samp{-m} options are supported on Solaris 2:
21974 @table @gcctabopt
21975 @item -mclear-hwcap
21976 @opindex mclear-hwcap
21977 @option{-mclear-hwcap} tells the compiler to remove the hardware
21978 capabilities generated by the Solaris assembler.  This is only necessary
21979 when object files use ISA extensions not supported by the current
21980 machine, but check at runtime whether or not to use them.
21982 @item -mimpure-text
21983 @opindex mimpure-text
21984 @option{-mimpure-text}, used in addition to @option{-shared}, tells
21985 the compiler to not pass @option{-z text} to the linker when linking a
21986 shared object.  Using this option, you can link position-dependent
21987 code into a shared object.
21989 @option{-mimpure-text} suppresses the ``relocations remain against
21990 allocatable but non-writable sections'' linker error message.
21991 However, the necessary relocations trigger copy-on-write, and the
21992 shared object is not actually shared across processes.  Instead of
21993 using @option{-mimpure-text}, you should compile all source code with
21994 @option{-fpic} or @option{-fPIC}.
21996 @end table
21998 These switches are supported in addition to the above on Solaris 2:
22000 @table @gcctabopt
22001 @item -pthreads
22002 @opindex pthreads
22003 Add support for multithreading using the POSIX threads library.  This
22004 option sets flags for both the preprocessor and linker.  This option does
22005 not affect the thread safety of object code produced  by the compiler or
22006 that of libraries supplied with it.
22008 @item -pthread
22009 @opindex pthread
22010 This is a synonym for @option{-pthreads}.
22011 @end table
22013 @node SPARC Options
22014 @subsection SPARC Options
22015 @cindex SPARC options
22017 These @samp{-m} options are supported on the SPARC:
22019 @table @gcctabopt
22020 @item -mno-app-regs
22021 @itemx -mapp-regs
22022 @opindex mno-app-regs
22023 @opindex mapp-regs
22024 Specify @option{-mapp-regs} to generate output using the global registers
22025 2 through 4, which the SPARC SVR4 ABI reserves for applications.  Like the
22026 global register 1, each global register 2 through 4 is then treated as an
22027 allocable register that is clobbered by function calls.  This is the default.
22029 To be fully SVR4 ABI-compliant at the cost of some performance loss,
22030 specify @option{-mno-app-regs}.  You should compile libraries and system
22031 software with this option.
22033 @item -mflat
22034 @itemx -mno-flat
22035 @opindex mflat
22036 @opindex mno-flat
22037 With @option{-mflat}, the compiler does not generate save/restore instructions
22038 and uses a ``flat'' or single register window model.  This model is compatible
22039 with the regular register window model.  The local registers and the input
22040 registers (0--5) are still treated as ``call-saved'' registers and are
22041 saved on the stack as needed.
22043 With @option{-mno-flat} (the default), the compiler generates save/restore
22044 instructions (except for leaf functions).  This is the normal operating mode.
22046 @item -mfpu
22047 @itemx -mhard-float
22048 @opindex mfpu
22049 @opindex mhard-float
22050 Generate output containing floating-point instructions.  This is the
22051 default.
22053 @item -mno-fpu
22054 @itemx -msoft-float
22055 @opindex mno-fpu
22056 @opindex msoft-float
22057 Generate output containing library calls for floating point.
22058 @strong{Warning:} the requisite libraries are not available for all SPARC
22059 targets.  Normally the facilities of the machine's usual C compiler are
22060 used, but this cannot be done directly in cross-compilation.  You must make
22061 your own arrangements to provide suitable library functions for
22062 cross-compilation.  The embedded targets @samp{sparc-*-aout} and
22063 @samp{sparclite-*-*} do provide software floating-point support.
22065 @option{-msoft-float} changes the calling convention in the output file;
22066 therefore, it is only useful if you compile @emph{all} of a program with
22067 this option.  In particular, you need to compile @file{libgcc.a}, the
22068 library that comes with GCC, with @option{-msoft-float} in order for
22069 this to work.
22071 @item -mhard-quad-float
22072 @opindex mhard-quad-float
22073 Generate output containing quad-word (long double) floating-point
22074 instructions.
22076 @item -msoft-quad-float
22077 @opindex msoft-quad-float
22078 Generate output containing library calls for quad-word (long double)
22079 floating-point instructions.  The functions called are those specified
22080 in the SPARC ABI@.  This is the default.
22082 As of this writing, there are no SPARC implementations that have hardware
22083 support for the quad-word floating-point instructions.  They all invoke
22084 a trap handler for one of these instructions, and then the trap handler
22085 emulates the effect of the instruction.  Because of the trap handler overhead,
22086 this is much slower than calling the ABI library routines.  Thus the
22087 @option{-msoft-quad-float} option is the default.
22089 @item -mno-unaligned-doubles
22090 @itemx -munaligned-doubles
22091 @opindex mno-unaligned-doubles
22092 @opindex munaligned-doubles
22093 Assume that doubles have 8-byte alignment.  This is the default.
22095 With @option{-munaligned-doubles}, GCC assumes that doubles have 8-byte
22096 alignment only if they are contained in another type, or if they have an
22097 absolute address.  Otherwise, it assumes they have 4-byte alignment.
22098 Specifying this option avoids some rare compatibility problems with code
22099 generated by other compilers.  It is not the default because it results
22100 in a performance loss, especially for floating-point code.
22102 @item -muser-mode
22103 @itemx -mno-user-mode
22104 @opindex muser-mode
22105 @opindex mno-user-mode
22106 Do not generate code that can only run in supervisor mode.  This is relevant
22107 only for the @code{casa} instruction emitted for the LEON3 processor.  This
22108 is the default.
22110 @item -mfaster-structs
22111 @itemx -mno-faster-structs
22112 @opindex mfaster-structs
22113 @opindex mno-faster-structs
22114 With @option{-mfaster-structs}, the compiler assumes that structures
22115 should have 8-byte alignment.  This enables the use of pairs of
22116 @code{ldd} and @code{std} instructions for copies in structure
22117 assignment, in place of twice as many @code{ld} and @code{st} pairs.
22118 However, the use of this changed alignment directly violates the SPARC
22119 ABI@.  Thus, it's intended only for use on targets where the developer
22120 acknowledges that their resulting code is not directly in line with
22121 the rules of the ABI@.
22123 @item -mstd-struct-return
22124 @itemx -mno-std-struct-return
22125 @opindex mstd-struct-return
22126 @opindex mno-std-struct-return
22127 With @option{-mstd-struct-return}, the compiler generates checking code
22128 in functions returning structures or unions to detect size mismatches
22129 between the two sides of function calls, as per the 32-bit ABI@.
22131 The default is @option{-mno-std-struct-return}.  This option has no effect
22132 in 64-bit mode.
22134 @item -mcpu=@var{cpu_type}
22135 @opindex mcpu
22136 Set the instruction set, register set, and instruction scheduling parameters
22137 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
22138 @samp{v7}, @samp{cypress}, @samp{v8}, @samp{supersparc}, @samp{hypersparc},
22139 @samp{leon}, @samp{leon3}, @samp{leon3v7}, @samp{sparclite}, @samp{f930},
22140 @samp{f934}, @samp{sparclite86x}, @samp{sparclet}, @samp{tsc701}, @samp{v9},
22141 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
22142 @samp{niagara3} and @samp{niagara4}.
22144 Native Solaris and GNU/Linux toolchains also support the value @samp{native},
22145 which selects the best architecture option for the host processor.
22146 @option{-mcpu=native} has no effect if GCC does not recognize
22147 the processor.
22149 Default instruction scheduling parameters are used for values that select
22150 an architecture and not an implementation.  These are @samp{v7}, @samp{v8},
22151 @samp{sparclite}, @samp{sparclet}, @samp{v9}.
22153 Here is a list of each supported architecture and their supported
22154 implementations.
22156 @table @asis
22157 @item v7
22158 cypress, leon3v7
22160 @item v8
22161 supersparc, hypersparc, leon, leon3
22163 @item sparclite
22164 f930, f934, sparclite86x
22166 @item sparclet
22167 tsc701
22169 @item v9
22170 ultrasparc, ultrasparc3, niagara, niagara2, niagara3, niagara4
22171 @end table
22173 By default (unless configured otherwise), GCC generates code for the V7
22174 variant of the SPARC architecture.  With @option{-mcpu=cypress}, the compiler
22175 additionally optimizes it for the Cypress CY7C602 chip, as used in the
22176 SPARCStation/SPARCServer 3xx series.  This is also appropriate for the older
22177 SPARCStation 1, 2, IPX etc.
22179 With @option{-mcpu=v8}, GCC generates code for the V8 variant of the SPARC
22180 architecture.  The only difference from V7 code is that the compiler emits
22181 the integer multiply and integer divide instructions which exist in SPARC-V8
22182 but not in SPARC-V7.  With @option{-mcpu=supersparc}, the compiler additionally
22183 optimizes it for the SuperSPARC chip, as used in the SPARCStation 10, 1000 and
22184 2000 series.
22186 With @option{-mcpu=sparclite}, GCC generates code for the SPARClite variant of
22187 the SPARC architecture.  This adds the integer multiply, integer divide step
22188 and scan (@code{ffs}) instructions which exist in SPARClite but not in SPARC-V7.
22189 With @option{-mcpu=f930}, the compiler additionally optimizes it for the
22190 Fujitsu MB86930 chip, which is the original SPARClite, with no FPU@.  With
22191 @option{-mcpu=f934}, the compiler additionally optimizes it for the Fujitsu
22192 MB86934 chip, which is the more recent SPARClite with FPU@.
22194 With @option{-mcpu=sparclet}, GCC generates code for the SPARClet variant of
22195 the SPARC architecture.  This adds the integer multiply, multiply/accumulate,
22196 integer divide step and scan (@code{ffs}) instructions which exist in SPARClet
22197 but not in SPARC-V7.  With @option{-mcpu=tsc701}, the compiler additionally
22198 optimizes it for the TEMIC SPARClet chip.
22200 With @option{-mcpu=v9}, GCC generates code for the V9 variant of the SPARC
22201 architecture.  This adds 64-bit integer and floating-point move instructions,
22202 3 additional floating-point condition code registers and conditional move
22203 instructions.  With @option{-mcpu=ultrasparc}, the compiler additionally
22204 optimizes it for the Sun UltraSPARC I/II/IIi chips.  With
22205 @option{-mcpu=ultrasparc3}, the compiler additionally optimizes it for the
22206 Sun UltraSPARC III/III+/IIIi/IIIi+/IV/IV+ chips.  With
22207 @option{-mcpu=niagara}, the compiler additionally optimizes it for
22208 Sun UltraSPARC T1 chips.  With @option{-mcpu=niagara2}, the compiler
22209 additionally optimizes it for Sun UltraSPARC T2 chips. With
22210 @option{-mcpu=niagara3}, the compiler additionally optimizes it for Sun
22211 UltraSPARC T3 chips.  With @option{-mcpu=niagara4}, the compiler
22212 additionally optimizes it for Sun UltraSPARC T4 chips.
22214 @item -mtune=@var{cpu_type}
22215 @opindex mtune
22216 Set the instruction scheduling parameters for machine type
22217 @var{cpu_type}, but do not set the instruction set or register set that the
22218 option @option{-mcpu=@var{cpu_type}} does.
22220 The same values for @option{-mcpu=@var{cpu_type}} can be used for
22221 @option{-mtune=@var{cpu_type}}, but the only useful values are those
22222 that select a particular CPU implementation.  Those are @samp{cypress},
22223 @samp{supersparc}, @samp{hypersparc}, @samp{leon}, @samp{leon3},
22224 @samp{leon3v7}, @samp{f930}, @samp{f934}, @samp{sparclite86x}, @samp{tsc701},
22225 @samp{ultrasparc}, @samp{ultrasparc3}, @samp{niagara}, @samp{niagara2},
22226 @samp{niagara3} and @samp{niagara4}.  With native Solaris and GNU/Linux
22227 toolchains, @samp{native} can also be used.
22229 @item -mv8plus
22230 @itemx -mno-v8plus
22231 @opindex mv8plus
22232 @opindex mno-v8plus
22233 With @option{-mv8plus}, GCC generates code for the SPARC-V8+ ABI@.  The
22234 difference from the V8 ABI is that the global and out registers are
22235 considered 64 bits wide.  This is enabled by default on Solaris in 32-bit
22236 mode for all SPARC-V9 processors.
22238 @item -mvis
22239 @itemx -mno-vis
22240 @opindex mvis
22241 @opindex mno-vis
22242 With @option{-mvis}, GCC generates code that takes advantage of the UltraSPARC
22243 Visual Instruction Set extensions.  The default is @option{-mno-vis}.
22245 @item -mvis2
22246 @itemx -mno-vis2
22247 @opindex mvis2
22248 @opindex mno-vis2
22249 With @option{-mvis2}, GCC generates code that takes advantage of
22250 version 2.0 of the UltraSPARC Visual Instruction Set extensions.  The
22251 default is @option{-mvis2} when targeting a cpu that supports such
22252 instructions, such as UltraSPARC-III and later.  Setting @option{-mvis2}
22253 also sets @option{-mvis}.
22255 @item -mvis3
22256 @itemx -mno-vis3
22257 @opindex mvis3
22258 @opindex mno-vis3
22259 With @option{-mvis3}, GCC generates code that takes advantage of
22260 version 3.0 of the UltraSPARC Visual Instruction Set extensions.  The
22261 default is @option{-mvis3} when targeting a cpu that supports such
22262 instructions, such as niagara-3 and later.  Setting @option{-mvis3}
22263 also sets @option{-mvis2} and @option{-mvis}.
22265 @item -mcbcond
22266 @itemx -mno-cbcond
22267 @opindex mcbcond
22268 @opindex mno-cbcond
22269 With @option{-mcbcond}, GCC generates code that takes advantage of
22270 compare-and-branch instructions, as defined in the Sparc Architecture 2011.
22271 The default is @option{-mcbcond} when targeting a cpu that supports such
22272 instructions, such as niagara-4 and later.
22274 @item -mpopc
22275 @itemx -mno-popc
22276 @opindex mpopc
22277 @opindex mno-popc
22278 With @option{-mpopc}, GCC generates code that takes advantage of the UltraSPARC
22279 population count instruction.  The default is @option{-mpopc}
22280 when targeting a cpu that supports such instructions, such as Niagara-2 and
22281 later.
22283 @item -mfmaf
22284 @itemx -mno-fmaf
22285 @opindex mfmaf
22286 @opindex mno-fmaf
22287 With @option{-mfmaf}, GCC generates code that takes advantage of the UltraSPARC
22288 Fused Multiply-Add Floating-point extensions.  The default is @option{-mfmaf}
22289 when targeting a cpu that supports such instructions, such as Niagara-3 and
22290 later.
22292 @item -mfix-at697f
22293 @opindex mfix-at697f
22294 Enable the documented workaround for the single erratum of the Atmel AT697F
22295 processor (which corresponds to erratum #13 of the AT697E processor).
22297 @item -mfix-ut699
22298 @opindex mfix-ut699
22299 Enable the documented workarounds for the floating-point errata and the data
22300 cache nullify errata of the UT699 processor.
22301 @end table
22303 These @samp{-m} options are supported in addition to the above
22304 on SPARC-V9 processors in 64-bit environments:
22306 @table @gcctabopt
22307 @item -m32
22308 @itemx -m64
22309 @opindex m32
22310 @opindex m64
22311 Generate code for a 32-bit or 64-bit environment.
22312 The 32-bit environment sets int, long and pointer to 32 bits.
22313 The 64-bit environment sets int to 32 bits and long and pointer
22314 to 64 bits.
22316 @item -mcmodel=@var{which}
22317 @opindex mcmodel
22318 Set the code model to one of
22320 @table @samp
22321 @item medlow
22322 The Medium/Low code model: 64-bit addresses, programs
22323 must be linked in the low 32 bits of memory.  Programs can be statically
22324 or dynamically linked.
22326 @item medmid
22327 The Medium/Middle code model: 64-bit addresses, programs
22328 must be linked in the low 44 bits of memory, the text and data segments must
22329 be less than 2GB in size and the data segment must be located within 2GB of
22330 the text segment.
22332 @item medany
22333 The Medium/Anywhere code model: 64-bit addresses, programs
22334 may be linked anywhere in memory, the text and data segments must be less
22335 than 2GB in size and the data segment must be located within 2GB of the
22336 text segment.
22338 @item embmedany
22339 The Medium/Anywhere code model for embedded systems:
22340 64-bit addresses, the text and data segments must be less than 2GB in
22341 size, both starting anywhere in memory (determined at link time).  The
22342 global register %g4 points to the base of the data segment.  Programs
22343 are statically linked and PIC is not supported.
22344 @end table
22346 @item -mmemory-model=@var{mem-model}
22347 @opindex mmemory-model
22348 Set the memory model in force on the processor to one of
22350 @table @samp
22351 @item default
22352 The default memory model for the processor and operating system.
22354 @item rmo
22355 Relaxed Memory Order
22357 @item pso
22358 Partial Store Order
22360 @item tso
22361 Total Store Order
22363 @item sc
22364 Sequential Consistency
22365 @end table
22367 These memory models are formally defined in Appendix D of the Sparc V9
22368 architecture manual, as set in the processor's @code{PSTATE.MM} field.
22370 @item -mstack-bias
22371 @itemx -mno-stack-bias
22372 @opindex mstack-bias
22373 @opindex mno-stack-bias
22374 With @option{-mstack-bias}, GCC assumes that the stack pointer, and
22375 frame pointer if present, are offset by @minus{}2047 which must be added back
22376 when making stack frame references.  This is the default in 64-bit mode.
22377 Otherwise, assume no such offset is present.
22378 @end table
22380 @node SPU Options
22381 @subsection SPU Options
22382 @cindex SPU options
22384 These @samp{-m} options are supported on the SPU:
22386 @table @gcctabopt
22387 @item -mwarn-reloc
22388 @itemx -merror-reloc
22389 @opindex mwarn-reloc
22390 @opindex merror-reloc
22392 The loader for SPU does not handle dynamic relocations.  By default, GCC
22393 gives an error when it generates code that requires a dynamic
22394 relocation.  @option{-mno-error-reloc} disables the error,
22395 @option{-mwarn-reloc} generates a warning instead.
22397 @item -msafe-dma
22398 @itemx -munsafe-dma
22399 @opindex msafe-dma
22400 @opindex munsafe-dma
22402 Instructions that initiate or test completion of DMA must not be
22403 reordered with respect to loads and stores of the memory that is being
22404 accessed.
22405 With @option{-munsafe-dma} you must use the @code{volatile} keyword to protect
22406 memory accesses, but that can lead to inefficient code in places where the
22407 memory is known to not change.  Rather than mark the memory as volatile,
22408 you can use @option{-msafe-dma} to tell the compiler to treat
22409 the DMA instructions as potentially affecting all memory.  
22411 @item -mbranch-hints
22412 @opindex mbranch-hints
22414 By default, GCC generates a branch hint instruction to avoid
22415 pipeline stalls for always-taken or probably-taken branches.  A hint
22416 is not generated closer than 8 instructions away from its branch.
22417 There is little reason to disable them, except for debugging purposes,
22418 or to make an object a little bit smaller.
22420 @item -msmall-mem
22421 @itemx -mlarge-mem
22422 @opindex msmall-mem
22423 @opindex mlarge-mem
22425 By default, GCC generates code assuming that addresses are never larger
22426 than 18 bits.  With @option{-mlarge-mem} code is generated that assumes
22427 a full 32-bit address.
22429 @item -mstdmain
22430 @opindex mstdmain
22432 By default, GCC links against startup code that assumes the SPU-style
22433 main function interface (which has an unconventional parameter list).
22434 With @option{-mstdmain}, GCC links your program against startup
22435 code that assumes a C99-style interface to @code{main}, including a
22436 local copy of @code{argv} strings.
22438 @item -mfixed-range=@var{register-range}
22439 @opindex mfixed-range
22440 Generate code treating the given register range as fixed registers.
22441 A fixed register is one that the register allocator cannot use.  This is
22442 useful when compiling kernel code.  A register range is specified as
22443 two registers separated by a dash.  Multiple register ranges can be
22444 specified separated by a comma.
22446 @item -mea32
22447 @itemx -mea64
22448 @opindex mea32
22449 @opindex mea64
22450 Compile code assuming that pointers to the PPU address space accessed
22451 via the @code{__ea} named address space qualifier are either 32 or 64
22452 bits wide.  The default is 32 bits.  As this is an ABI-changing option,
22453 all object code in an executable must be compiled with the same setting.
22455 @item -maddress-space-conversion
22456 @itemx -mno-address-space-conversion
22457 @opindex maddress-space-conversion
22458 @opindex mno-address-space-conversion
22459 Allow/disallow treating the @code{__ea} address space as superset
22460 of the generic address space.  This enables explicit type casts
22461 between @code{__ea} and generic pointer as well as implicit
22462 conversions of generic pointers to @code{__ea} pointers.  The
22463 default is to allow address space pointer conversions.
22465 @item -mcache-size=@var{cache-size}
22466 @opindex mcache-size
22467 This option controls the version of libgcc that the compiler links to an
22468 executable and selects a software-managed cache for accessing variables
22469 in the @code{__ea} address space with a particular cache size.  Possible
22470 options for @var{cache-size} are @samp{8}, @samp{16}, @samp{32}, @samp{64}
22471 and @samp{128}.  The default cache size is 64KB.
22473 @item -matomic-updates
22474 @itemx -mno-atomic-updates
22475 @opindex matomic-updates
22476 @opindex mno-atomic-updates
22477 This option controls the version of libgcc that the compiler links to an
22478 executable and selects whether atomic updates to the software-managed
22479 cache of PPU-side variables are used.  If you use atomic updates, changes
22480 to a PPU variable from SPU code using the @code{__ea} named address space
22481 qualifier do not interfere with changes to other PPU variables residing
22482 in the same cache line from PPU code.  If you do not use atomic updates,
22483 such interference may occur; however, writing back cache lines is
22484 more efficient.  The default behavior is to use atomic updates.
22486 @item -mdual-nops
22487 @itemx -mdual-nops=@var{n}
22488 @opindex mdual-nops
22489 By default, GCC inserts nops to increase dual issue when it expects
22490 it to increase performance.  @var{n} can be a value from 0 to 10.  A
22491 smaller @var{n} inserts fewer nops.  10 is the default, 0 is the
22492 same as @option{-mno-dual-nops}.  Disabled with @option{-Os}.
22494 @item -mhint-max-nops=@var{n}
22495 @opindex mhint-max-nops
22496 Maximum number of nops to insert for a branch hint.  A branch hint must
22497 be at least 8 instructions away from the branch it is affecting.  GCC
22498 inserts up to @var{n} nops to enforce this, otherwise it does not
22499 generate the branch hint.
22501 @item -mhint-max-distance=@var{n}
22502 @opindex mhint-max-distance
22503 The encoding of the branch hint instruction limits the hint to be within
22504 256 instructions of the branch it is affecting.  By default, GCC makes
22505 sure it is within 125.
22507 @item -msafe-hints
22508 @opindex msafe-hints
22509 Work around a hardware bug that causes the SPU to stall indefinitely.
22510 By default, GCC inserts the @code{hbrp} instruction to make sure
22511 this stall won't happen.
22513 @end table
22515 @node System V Options
22516 @subsection Options for System V
22518 These additional options are available on System V Release 4 for
22519 compatibility with other compilers on those systems:
22521 @table @gcctabopt
22522 @item -G
22523 @opindex G
22524 Create a shared object.
22525 It is recommended that @option{-symbolic} or @option{-shared} be used instead.
22527 @item -Qy
22528 @opindex Qy
22529 Identify the versions of each tool used by the compiler, in a
22530 @code{.ident} assembler directive in the output.
22532 @item -Qn
22533 @opindex Qn
22534 Refrain from adding @code{.ident} directives to the output file (this is
22535 the default).
22537 @item -YP,@var{dirs}
22538 @opindex YP
22539 Search the directories @var{dirs}, and no others, for libraries
22540 specified with @option{-l}.
22542 @item -Ym,@var{dir}
22543 @opindex Ym
22544 Look in the directory @var{dir} to find the M4 preprocessor.
22545 The assembler uses this option.
22546 @c This is supposed to go with a -Yd for predefined M4 macro files, but
22547 @c the generic assembler that comes with Solaris takes just -Ym.
22548 @end table
22550 @node TILE-Gx Options
22551 @subsection TILE-Gx Options
22552 @cindex TILE-Gx options
22554 These @samp{-m} options are supported on the TILE-Gx:
22556 @table @gcctabopt
22557 @item -mcmodel=small
22558 @opindex mcmodel=small
22559 Generate code for the small model.  The distance for direct calls is
22560 limited to 500M in either direction.  PC-relative addresses are 32
22561 bits.  Absolute addresses support the full address range.
22563 @item -mcmodel=large
22564 @opindex mcmodel=large
22565 Generate code for the large model.  There is no limitation on call
22566 distance, pc-relative addresses, or absolute addresses.
22568 @item -mcpu=@var{name}
22569 @opindex mcpu
22570 Selects the type of CPU to be targeted.  Currently the only supported
22571 type is @samp{tilegx}.
22573 @item -m32
22574 @itemx -m64
22575 @opindex m32
22576 @opindex m64
22577 Generate code for a 32-bit or 64-bit environment.  The 32-bit
22578 environment sets int, long, and pointer to 32 bits.  The 64-bit
22579 environment sets int to 32 bits and long and pointer to 64 bits.
22581 @item -mbig-endian
22582 @itemx -mlittle-endian
22583 @opindex mbig-endian
22584 @opindex mlittle-endian
22585 Generate code in big/little endian mode, respectively.
22586 @end table
22588 @node TILEPro Options
22589 @subsection TILEPro Options
22590 @cindex TILEPro options
22592 These @samp{-m} options are supported on the TILEPro:
22594 @table @gcctabopt
22595 @item -mcpu=@var{name}
22596 @opindex mcpu
22597 Selects the type of CPU to be targeted.  Currently the only supported
22598 type is @samp{tilepro}.
22600 @item -m32
22601 @opindex m32
22602 Generate code for a 32-bit environment, which sets int, long, and
22603 pointer to 32 bits.  This is the only supported behavior so the flag
22604 is essentially ignored.
22605 @end table
22607 @node V850 Options
22608 @subsection V850 Options
22609 @cindex V850 Options
22611 These @samp{-m} options are defined for V850 implementations:
22613 @table @gcctabopt
22614 @item -mlong-calls
22615 @itemx -mno-long-calls
22616 @opindex mlong-calls
22617 @opindex mno-long-calls
22618 Treat all calls as being far away (near).  If calls are assumed to be
22619 far away, the compiler always loads the function's address into a
22620 register, and calls indirect through the pointer.
22622 @item -mno-ep
22623 @itemx -mep
22624 @opindex mno-ep
22625 @opindex mep
22626 Do not optimize (do optimize) basic blocks that use the same index
22627 pointer 4 or more times to copy pointer into the @code{ep} register, and
22628 use the shorter @code{sld} and @code{sst} instructions.  The @option{-mep}
22629 option is on by default if you optimize.
22631 @item -mno-prolog-function
22632 @itemx -mprolog-function
22633 @opindex mno-prolog-function
22634 @opindex mprolog-function
22635 Do not use (do use) external functions to save and restore registers
22636 at the prologue and epilogue of a function.  The external functions
22637 are slower, but use less code space if more than one function saves
22638 the same number of registers.  The @option{-mprolog-function} option
22639 is on by default if you optimize.
22641 @item -mspace
22642 @opindex mspace
22643 Try to make the code as small as possible.  At present, this just turns
22644 on the @option{-mep} and @option{-mprolog-function} options.
22646 @item -mtda=@var{n}
22647 @opindex mtda
22648 Put static or global variables whose size is @var{n} bytes or less into
22649 the tiny data area that register @code{ep} points to.  The tiny data
22650 area can hold up to 256 bytes in total (128 bytes for byte references).
22652 @item -msda=@var{n}
22653 @opindex msda
22654 Put static or global variables whose size is @var{n} bytes or less into
22655 the small data area that register @code{gp} points to.  The small data
22656 area can hold up to 64 kilobytes.
22658 @item -mzda=@var{n}
22659 @opindex mzda
22660 Put static or global variables whose size is @var{n} bytes or less into
22661 the first 32 kilobytes of memory.
22663 @item -mv850
22664 @opindex mv850
22665 Specify that the target processor is the V850.
22667 @item -mv850e3v5
22668 @opindex mv850e3v5
22669 Specify that the target processor is the V850E3V5.  The preprocessor
22670 constant @code{__v850e3v5__} is defined if this option is used.
22672 @item -mv850e2v4
22673 @opindex mv850e2v4
22674 Specify that the target processor is the V850E3V5.  This is an alias for
22675 the @option{-mv850e3v5} option.
22677 @item -mv850e2v3
22678 @opindex mv850e2v3
22679 Specify that the target processor is the V850E2V3.  The preprocessor
22680 constant @code{__v850e2v3__} is defined if this option is used.
22682 @item -mv850e2
22683 @opindex mv850e2
22684 Specify that the target processor is the V850E2.  The preprocessor
22685 constant @code{__v850e2__} is defined if this option is used.
22687 @item -mv850e1
22688 @opindex mv850e1
22689 Specify that the target processor is the V850E1.  The preprocessor
22690 constants @code{__v850e1__} and @code{__v850e__} are defined if
22691 this option is used.
22693 @item -mv850es
22694 @opindex mv850es
22695 Specify that the target processor is the V850ES.  This is an alias for
22696 the @option{-mv850e1} option.
22698 @item -mv850e
22699 @opindex mv850e
22700 Specify that the target processor is the V850E@.  The preprocessor
22701 constant @code{__v850e__} is defined if this option is used.
22703 If neither @option{-mv850} nor @option{-mv850e} nor @option{-mv850e1}
22704 nor @option{-mv850e2} nor @option{-mv850e2v3} nor @option{-mv850e3v5}
22705 are defined then a default target processor is chosen and the
22706 relevant @samp{__v850*__} preprocessor constant is defined.
22708 The preprocessor constants @code{__v850} and @code{__v851__} are always
22709 defined, regardless of which processor variant is the target.
22711 @item -mdisable-callt
22712 @itemx -mno-disable-callt
22713 @opindex mdisable-callt
22714 @opindex mno-disable-callt
22715 This option suppresses generation of the @code{CALLT} instruction for the
22716 v850e, v850e1, v850e2, v850e2v3 and v850e3v5 flavors of the v850
22717 architecture.
22719 This option is enabled by default when the RH850 ABI is
22720 in use (see @option{-mrh850-abi}), and disabled by default when the
22721 GCC ABI is in use.  If @code{CALLT} instructions are being generated
22722 then the C preprocessor symbol @code{__V850_CALLT__} is defined.
22724 @item -mrelax
22725 @itemx -mno-relax
22726 @opindex mrelax
22727 @opindex mno-relax
22728 Pass on (or do not pass on) the @option{-mrelax} command-line option
22729 to the assembler.
22731 @item -mlong-jumps
22732 @itemx -mno-long-jumps
22733 @opindex mlong-jumps
22734 @opindex mno-long-jumps
22735 Disable (or re-enable) the generation of PC-relative jump instructions.
22737 @item -msoft-float
22738 @itemx -mhard-float
22739 @opindex msoft-float
22740 @opindex mhard-float
22741 Disable (or re-enable) the generation of hardware floating point
22742 instructions.  This option is only significant when the target
22743 architecture is @samp{V850E2V3} or higher.  If hardware floating point
22744 instructions are being generated then the C preprocessor symbol
22745 @code{__FPU_OK__} is defined, otherwise the symbol
22746 @code{__NO_FPU__} is defined.
22748 @item -mloop
22749 @opindex mloop
22750 Enables the use of the e3v5 LOOP instruction.  The use of this
22751 instruction is not enabled by default when the e3v5 architecture is
22752 selected because its use is still experimental.
22754 @item -mrh850-abi
22755 @itemx -mghs
22756 @opindex mrh850-abi
22757 @opindex mghs
22758 Enables support for the RH850 version of the V850 ABI.  This is the
22759 default.  With this version of the ABI the following rules apply:
22761 @itemize
22762 @item
22763 Integer sized structures and unions are returned via a memory pointer
22764 rather than a register.
22766 @item
22767 Large structures and unions (more than 8 bytes in size) are passed by
22768 value.
22770 @item
22771 Functions are aligned to 16-bit boundaries.
22773 @item
22774 The @option{-m8byte-align} command-line option is supported.
22776 @item
22777 The @option{-mdisable-callt} command-line option is enabled by
22778 default.  The @option{-mno-disable-callt} command-line option is not
22779 supported.
22780 @end itemize
22782 When this version of the ABI is enabled the C preprocessor symbol
22783 @code{__V850_RH850_ABI__} is defined.
22785 @item -mgcc-abi
22786 @opindex mgcc-abi
22787 Enables support for the old GCC version of the V850 ABI.  With this
22788 version of the ABI the following rules apply:
22790 @itemize
22791 @item
22792 Integer sized structures and unions are returned in register @code{r10}.
22794 @item
22795 Large structures and unions (more than 8 bytes in size) are passed by
22796 reference.
22798 @item
22799 Functions are aligned to 32-bit boundaries, unless optimizing for
22800 size.
22802 @item
22803 The @option{-m8byte-align} command-line option is not supported.
22805 @item
22806 The @option{-mdisable-callt} command-line option is supported but not
22807 enabled by default.
22808 @end itemize
22810 When this version of the ABI is enabled the C preprocessor symbol
22811 @code{__V850_GCC_ABI__} is defined.
22813 @item -m8byte-align
22814 @itemx -mno-8byte-align
22815 @opindex m8byte-align
22816 @opindex mno-8byte-align
22817 Enables support for @code{double} and @code{long long} types to be
22818 aligned on 8-byte boundaries.  The default is to restrict the
22819 alignment of all objects to at most 4-bytes.  When
22820 @option{-m8byte-align} is in effect the C preprocessor symbol
22821 @code{__V850_8BYTE_ALIGN__} is defined.
22823 @item -mbig-switch
22824 @opindex mbig-switch
22825 Generate code suitable for big switch tables.  Use this option only if
22826 the assembler/linker complain about out of range branches within a switch
22827 table.
22829 @item -mapp-regs
22830 @opindex mapp-regs
22831 This option causes r2 and r5 to be used in the code generated by
22832 the compiler.  This setting is the default.
22834 @item -mno-app-regs
22835 @opindex mno-app-regs
22836 This option causes r2 and r5 to be treated as fixed registers.
22838 @end table
22840 @node VAX Options
22841 @subsection VAX Options
22842 @cindex VAX options
22844 These @samp{-m} options are defined for the VAX:
22846 @table @gcctabopt
22847 @item -munix
22848 @opindex munix
22849 Do not output certain jump instructions (@code{aobleq} and so on)
22850 that the Unix assembler for the VAX cannot handle across long
22851 ranges.
22853 @item -mgnu
22854 @opindex mgnu
22855 Do output those jump instructions, on the assumption that the
22856 GNU assembler is being used.
22858 @item -mg
22859 @opindex mg
22860 Output code for G-format floating-point numbers instead of D-format.
22861 @end table
22863 @node Visium Options
22864 @subsection Visium Options
22865 @cindex Visium options
22867 @table @gcctabopt
22869 @item -mdebug
22870 @opindex mdebug
22871 A program which performs file I/O and is destined to run on an MCM target
22872 should be linked with this option.  It causes the libraries libc.a and
22873 libdebug.a to be linked.  The program should be run on the target under
22874 the control of the GDB remote debugging stub.
22876 @item -msim
22877 @opindex msim
22878 A program which performs file I/O and is destined to run on the simulator
22879 should be linked with option.  This causes libraries libc.a and libsim.a to
22880 be linked.
22882 @item -mfpu
22883 @itemx -mhard-float
22884 @opindex mfpu
22885 @opindex mhard-float
22886 Generate code containing floating-point instructions.  This is the
22887 default.
22889 @item -mno-fpu
22890 @itemx -msoft-float
22891 @opindex mno-fpu
22892 @opindex msoft-float
22893 Generate code containing library calls for floating-point.
22895 @option{-msoft-float} changes the calling convention in the output file;
22896 therefore, it is only useful if you compile @emph{all} of a program with
22897 this option.  In particular, you need to compile @file{libgcc.a}, the
22898 library that comes with GCC, with @option{-msoft-float} in order for
22899 this to work.
22901 @item -mcpu=@var{cpu_type}
22902 @opindex mcpu
22903 Set the instruction set, register set, and instruction scheduling parameters
22904 for machine type @var{cpu_type}.  Supported values for @var{cpu_type} are
22905 @samp{mcm}, @samp{gr5} and @samp{gr6}.
22907 @samp{mcm} is a synonym of @samp{gr5} present for backward compatibility.
22909 By default (unless configured otherwise), GCC generates code for the GR5
22910 variant of the Visium architecture.  
22912 With @option{-mcpu=gr6}, GCC generates code for the GR6 variant of the Visium
22913 architecture.  The only difference from GR5 code is that the compiler will
22914 generate block move instructions.
22916 @item -mtune=@var{cpu_type}
22917 @opindex mtune
22918 Set the instruction scheduling parameters for machine type @var{cpu_type},
22919 but do not set the instruction set or register set that the option
22920 @option{-mcpu=@var{cpu_type}} would.
22922 @item -msv-mode
22923 @opindex msv-mode
22924 Generate code for the supervisor mode, where there are no restrictions on
22925 the access to general registers.  This is the default.
22927 @item -muser-mode
22928 @opindex muser-mode
22929 Generate code for the user mode, where the access to some general registers
22930 is forbidden: on the GR5, registers r24 to r31 cannot be accessed in this
22931 mode; on the GR6, only registers r29 to r31 are affected.
22932 @end table
22934 @node VMS Options
22935 @subsection VMS Options
22937 These @samp{-m} options are defined for the VMS implementations:
22939 @table @gcctabopt
22940 @item -mvms-return-codes
22941 @opindex mvms-return-codes
22942 Return VMS condition codes from @code{main}. The default is to return POSIX-style
22943 condition (e.g.@ error) codes.
22945 @item -mdebug-main=@var{prefix}
22946 @opindex mdebug-main=@var{prefix}
22947 Flag the first routine whose name starts with @var{prefix} as the main
22948 routine for the debugger.
22950 @item -mmalloc64
22951 @opindex mmalloc64
22952 Default to 64-bit memory allocation routines.
22954 @item -mpointer-size=@var{size}
22955 @opindex mpointer-size=@var{size}
22956 Set the default size of pointers. Possible options for @var{size} are
22957 @samp{32} or @samp{short} for 32 bit pointers, @samp{64} or @samp{long}
22958 for 64 bit pointers, and @samp{no} for supporting only 32 bit pointers.
22959 The later option disables @code{pragma pointer_size}.
22960 @end table
22962 @node VxWorks Options
22963 @subsection VxWorks Options
22964 @cindex VxWorks Options
22966 The options in this section are defined for all VxWorks targets.
22967 Options specific to the target hardware are listed with the other
22968 options for that target.
22970 @table @gcctabopt
22971 @item -mrtp
22972 @opindex mrtp
22973 GCC can generate code for both VxWorks kernels and real time processes
22974 (RTPs).  This option switches from the former to the latter.  It also
22975 defines the preprocessor macro @code{__RTP__}.
22977 @item -non-static
22978 @opindex non-static
22979 Link an RTP executable against shared libraries rather than static
22980 libraries.  The options @option{-static} and @option{-shared} can
22981 also be used for RTPs (@pxref{Link Options}); @option{-static}
22982 is the default.
22984 @item -Bstatic
22985 @itemx -Bdynamic
22986 @opindex Bstatic
22987 @opindex Bdynamic
22988 These options are passed down to the linker.  They are defined for
22989 compatibility with Diab.
22991 @item -Xbind-lazy
22992 @opindex Xbind-lazy
22993 Enable lazy binding of function calls.  This option is equivalent to
22994 @option{-Wl,-z,now} and is defined for compatibility with Diab.
22996 @item -Xbind-now
22997 @opindex Xbind-now
22998 Disable lazy binding of function calls.  This option is the default and
22999 is defined for compatibility with Diab.
23000 @end table
23002 @node x86 Options
23003 @subsection x86 Options
23004 @cindex x86 Options
23006 These @samp{-m} options are defined for the x86 family of computers.
23008 @table @gcctabopt
23010 @item -march=@var{cpu-type}
23011 @opindex march
23012 Generate instructions for the machine type @var{cpu-type}.  In contrast to
23013 @option{-mtune=@var{cpu-type}}, which merely tunes the generated code 
23014 for the specified @var{cpu-type}, @option{-march=@var{cpu-type}} allows GCC
23015 to generate code that may not run at all on processors other than the one
23016 indicated.  Specifying @option{-march=@var{cpu-type}} implies 
23017 @option{-mtune=@var{cpu-type}}.
23019 The choices for @var{cpu-type} are:
23021 @table @samp
23022 @item native
23023 This selects the CPU to generate code for at compilation time by determining
23024 the processor type of the compiling machine.  Using @option{-march=native}
23025 enables all instruction subsets supported by the local machine (hence
23026 the result might not run on different machines).  Using @option{-mtune=native}
23027 produces code optimized for the local machine under the constraints
23028 of the selected instruction set.  
23030 @item i386
23031 Original Intel i386 CPU@.
23033 @item i486
23034 Intel i486 CPU@.  (No scheduling is implemented for this chip.)
23036 @item i586
23037 @itemx pentium
23038 Intel Pentium CPU with no MMX support.
23040 @item lakemont
23041 Intel Lakemont MCU, based on Intel Pentium CPU.
23043 @item pentium-mmx
23044 Intel Pentium MMX CPU, based on Pentium core with MMX instruction set support.
23046 @item pentiumpro
23047 Intel Pentium Pro CPU@.
23049 @item i686
23050 When used with @option{-march}, the Pentium Pro
23051 instruction set is used, so the code runs on all i686 family chips.
23052 When used with @option{-mtune}, it has the same meaning as @samp{generic}.
23054 @item pentium2
23055 Intel Pentium II CPU, based on Pentium Pro core with MMX instruction set
23056 support.
23058 @item pentium3
23059 @itemx pentium3m
23060 Intel Pentium III CPU, based on Pentium Pro core with MMX and SSE instruction
23061 set support.
23063 @item pentium-m
23064 Intel Pentium M; low-power version of Intel Pentium III CPU
23065 with MMX, SSE and SSE2 instruction set support.  Used by Centrino notebooks.
23067 @item pentium4
23068 @itemx pentium4m
23069 Intel Pentium 4 CPU with MMX, SSE and SSE2 instruction set support.
23071 @item prescott
23072 Improved version of Intel Pentium 4 CPU with MMX, SSE, SSE2 and SSE3 instruction
23073 set support.
23075 @item nocona
23076 Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE,
23077 SSE2 and SSE3 instruction set support.
23079 @item core2
23080 Intel Core 2 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3 and SSSE3
23081 instruction set support.
23083 @item nehalem
23084 Intel Nehalem CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23085 SSE4.1, SSE4.2 and POPCNT instruction set support.
23087 @item westmere
23088 Intel Westmere CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23089 SSE4.1, SSE4.2, POPCNT, AES and PCLMUL instruction set support.
23091 @item sandybridge
23092 Intel Sandy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23093 SSE4.1, SSE4.2, POPCNT, AVX, AES and PCLMUL instruction set support.
23095 @item ivybridge
23096 Intel Ivy Bridge CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
23097 SSE4.1, SSE4.2, POPCNT, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C
23098 instruction set support.
23100 @item haswell
23101 Intel Haswell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23102 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23103 BMI, BMI2 and F16C instruction set support.
23105 @item broadwell
23106 Intel Broadwell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23107 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23108 BMI, BMI2, F16C, RDSEED, ADCX and PREFETCHW instruction set support.
23110 @item skylake
23111 Intel Skylake CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23112 SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23113 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC and
23114 XSAVES instruction set support.
23116 @item bonnell
23117 Intel Bonnell CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3 and SSSE3
23118 instruction set support.
23120 @item silvermont
23121 Intel Silvermont CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3, SSSE3,
23122 SSE4.1, SSE4.2, POPCNT, AES, PCLMUL and RDRND instruction set support.
23124 @item knl
23125 Intel Knight's Landing CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
23126 SSSE3, SSE4.1, SSE4.2, POPCNT, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23127 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, AVX512F, AVX512PF, AVX512ER and
23128 AVX512CD instruction set support.
23130 @item skylake-avx512
23131 Intel Skylake Server CPU with 64-bit extensions, MOVBE, MMX, SSE, SSE2, SSE3,
23132 SSSE3, SSE4.1, SSE4.2, POPCNT, PKU, AVX, AVX2, AES, PCLMUL, FSGSBASE, RDRND, FMA,
23133 BMI, BMI2, F16C, RDSEED, ADCX, PREFETCHW, CLFLUSHOPT, XSAVEC, XSAVES, AVX512F,
23134 AVX512VL, AVX512BW, AVX512DQ and AVX512CD instruction set support.
23136 @item k6
23137 AMD K6 CPU with MMX instruction set support.
23139 @item k6-2
23140 @itemx k6-3
23141 Improved versions of AMD K6 CPU with MMX and 3DNow!@: instruction set support.
23143 @item athlon
23144 @itemx athlon-tbird
23145 AMD Athlon CPU with MMX, 3dNOW!, enhanced 3DNow!@: and SSE prefetch instructions
23146 support.
23148 @item athlon-4
23149 @itemx athlon-xp
23150 @itemx athlon-mp
23151 Improved AMD Athlon CPU with MMX, 3DNow!, enhanced 3DNow!@: and full SSE
23152 instruction set support.
23154 @item k8
23155 @itemx opteron
23156 @itemx athlon64
23157 @itemx athlon-fx
23158 Processors based on the AMD K8 core with x86-64 instruction set support,
23159 including the AMD Opteron, Athlon 64, and Athlon 64 FX processors.
23160 (This supersets MMX, SSE, SSE2, 3DNow!, enhanced 3DNow!@: and 64-bit
23161 instruction set extensions.)
23163 @item k8-sse3
23164 @itemx opteron-sse3
23165 @itemx athlon64-sse3
23166 Improved versions of AMD K8 cores with SSE3 instruction set support.
23168 @item amdfam10
23169 @itemx barcelona
23170 CPUs based on AMD Family 10h cores with x86-64 instruction set support.  (This
23171 supersets MMX, SSE, SSE2, SSE3, SSE4A, 3DNow!, enhanced 3DNow!, ABM and 64-bit
23172 instruction set extensions.)
23174 @item bdver1
23175 CPUs based on AMD Family 15h cores with x86-64 instruction set support.  (This
23176 supersets FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A,
23177 SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set extensions.)
23178 @item bdver2
23179 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23180 supersets BMI, TBM, F16C, FMA, FMA4, AVX, XOP, LWP, AES, PCL_MUL, CX16, MMX,
23181 SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 64-bit instruction set 
23182 extensions.)
23183 @item bdver3
23184 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23185 supersets BMI, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, XOP, LWP, AES, 
23186 PCL_MUL, CX16, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, SSE4.2, ABM and 
23187 64-bit instruction set extensions.
23188 @item bdver4
23189 AMD Family 15h core based CPUs with x86-64 instruction set support.  (This
23190 supersets BMI, BMI2, TBM, F16C, FMA, FMA4, FSGSBASE, AVX, AVX2, XOP, LWP, 
23191 AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3, SSE4.1, 
23192 SSE4.2, ABM and 64-bit instruction set extensions.
23194 @item znver1
23195 AMD Family 17h core based CPUs with x86-64 instruction set support.  (This
23196 supersets BMI, BMI2, F16C, FMA, FSGSBASE, AVX, AVX2, ADCX, RDSEED, MWAITX,
23197 SHA, CLZERO, AES, PCL_MUL, CX16, MOVBE, MMX, SSE, SSE2, SSE3, SSE4A, SSSE3,
23198 SSE4.1, SSE4.2, ABM, XSAVEC, XSAVES, CLFLUSHOPT, POPCNT, and 64-bit
23199 instruction set extensions.
23201 @item btver1
23202 CPUs based on AMD Family 14h cores with x86-64 instruction set support.  (This
23203 supersets MMX, SSE, SSE2, SSE3, SSSE3, SSE4A, CX16, ABM and 64-bit
23204 instruction set extensions.)
23206 @item btver2
23207 CPUs based on AMD Family 16h cores with x86-64 instruction set support. This
23208 includes MOVBE, F16C, BMI, AVX, PCL_MUL, AES, SSE4.2, SSE4.1, CX16, ABM,
23209 SSE4A, SSSE3, SSE3, SSE2, SSE, MMX and 64-bit instruction set extensions.
23211 @item winchip-c6
23212 IDT WinChip C6 CPU, dealt in same way as i486 with additional MMX instruction
23213 set support.
23215 @item winchip2
23216 IDT WinChip 2 CPU, dealt in same way as i486 with additional MMX and 3DNow!@:
23217 instruction set support.
23219 @item c3
23220 VIA C3 CPU with MMX and 3DNow!@: instruction set support.  (No scheduling is
23221 implemented for this chip.)
23223 @item c3-2
23224 VIA C3-2 (Nehemiah/C5XL) CPU with MMX and SSE instruction set support.
23225 (No scheduling is
23226 implemented for this chip.)
23228 @item geode
23229 AMD Geode embedded processor with MMX and 3DNow!@: instruction set support.
23230 @end table
23232 @item -mtune=@var{cpu-type}
23233 @opindex mtune
23234 Tune to @var{cpu-type} everything applicable about the generated code, except
23235 for the ABI and the set of available instructions.  
23236 While picking a specific @var{cpu-type} schedules things appropriately
23237 for that particular chip, the compiler does not generate any code that
23238 cannot run on the default machine type unless you use a
23239 @option{-march=@var{cpu-type}} option.
23240 For example, if GCC is configured for i686-pc-linux-gnu
23241 then @option{-mtune=pentium4} generates code that is tuned for Pentium 4
23242 but still runs on i686 machines.
23244 The choices for @var{cpu-type} are the same as for @option{-march}.
23245 In addition, @option{-mtune} supports 2 extra choices for @var{cpu-type}:
23247 @table @samp
23248 @item generic
23249 Produce code optimized for the most common IA32/@/AMD64/@/EM64T processors.
23250 If you know the CPU on which your code will run, then you should use
23251 the corresponding @option{-mtune} or @option{-march} option instead of
23252 @option{-mtune=generic}.  But, if you do not know exactly what CPU users
23253 of your application will have, then you should use this option.
23255 As new processors are deployed in the marketplace, the behavior of this
23256 option will change.  Therefore, if you upgrade to a newer version of
23257 GCC, code generation controlled by this option will change to reflect
23258 the processors
23259 that are most common at the time that version of GCC is released.
23261 There is no @option{-march=generic} option because @option{-march}
23262 indicates the instruction set the compiler can use, and there is no
23263 generic instruction set applicable to all processors.  In contrast,
23264 @option{-mtune} indicates the processor (or, in this case, collection of
23265 processors) for which the code is optimized.
23267 @item intel
23268 Produce code optimized for the most current Intel processors, which are
23269 Haswell and Silvermont for this version of GCC.  If you know the CPU
23270 on which your code will run, then you should use the corresponding
23271 @option{-mtune} or @option{-march} option instead of @option{-mtune=intel}.
23272 But, if you want your application performs better on both Haswell and
23273 Silvermont, then you should use this option.
23275 As new Intel processors are deployed in the marketplace, the behavior of
23276 this option will change.  Therefore, if you upgrade to a newer version of
23277 GCC, code generation controlled by this option will change to reflect
23278 the most current Intel processors at the time that version of GCC is
23279 released.
23281 There is no @option{-march=intel} option because @option{-march} indicates
23282 the instruction set the compiler can use, and there is no common
23283 instruction set applicable to all processors.  In contrast,
23284 @option{-mtune} indicates the processor (or, in this case, collection of
23285 processors) for which the code is optimized.
23286 @end table
23288 @item -mcpu=@var{cpu-type}
23289 @opindex mcpu
23290 A deprecated synonym for @option{-mtune}.
23292 @item -mfpmath=@var{unit}
23293 @opindex mfpmath
23294 Generate floating-point arithmetic for selected unit @var{unit}.  The choices
23295 for @var{unit} are:
23297 @table @samp
23298 @item 387
23299 Use the standard 387 floating-point coprocessor present on the majority of chips and
23300 emulated otherwise.  Code compiled with this option runs almost everywhere.
23301 The temporary results are computed in 80-bit precision instead of the precision
23302 specified by the type, resulting in slightly different results compared to most
23303 of other chips.  See @option{-ffloat-store} for more detailed description.
23305 This is the default choice for x86-32 targets.
23307 @item sse
23308 Use scalar floating-point instructions present in the SSE instruction set.
23309 This instruction set is supported by Pentium III and newer chips,
23310 and in the AMD line
23311 by Athlon-4, Athlon XP and Athlon MP chips.  The earlier version of the SSE
23312 instruction set supports only single-precision arithmetic, thus the double and
23313 extended-precision arithmetic are still done using 387.  A later version, present
23314 only in Pentium 4 and AMD x86-64 chips, supports double-precision
23315 arithmetic too.
23317 For the x86-32 compiler, you must use @option{-march=@var{cpu-type}}, @option{-msse}
23318 or @option{-msse2} switches to enable SSE extensions and make this option
23319 effective.  For the x86-64 compiler, these extensions are enabled by default.
23321 The resulting code should be considerably faster in the majority of cases and avoid
23322 the numerical instability problems of 387 code, but may break some existing
23323 code that expects temporaries to be 80 bits.
23325 This is the default choice for the x86-64 compiler.
23327 @item sse,387
23328 @itemx sse+387
23329 @itemx both
23330 Attempt to utilize both instruction sets at once.  This effectively doubles the
23331 amount of available registers, and on chips with separate execution units for
23332 387 and SSE the execution resources too.  Use this option with care, as it is
23333 still experimental, because the GCC register allocator does not model separate
23334 functional units well, resulting in unstable performance.
23335 @end table
23337 @item -masm=@var{dialect}
23338 @opindex masm=@var{dialect}
23339 Output assembly instructions using selected @var{dialect}.  Also affects
23340 which dialect is used for basic @code{asm} (@pxref{Basic Asm}) and
23341 extended @code{asm} (@pxref{Extended Asm}). Supported choices (in dialect
23342 order) are @samp{att} or @samp{intel}. The default is @samp{att}. Darwin does
23343 not support @samp{intel}.
23345 @item -mieee-fp
23346 @itemx -mno-ieee-fp
23347 @opindex mieee-fp
23348 @opindex mno-ieee-fp
23349 Control whether or not the compiler uses IEEE floating-point
23350 comparisons.  These correctly handle the case where the result of a
23351 comparison is unordered.
23353 @item -msoft-float
23354 @opindex msoft-float
23355 Generate output containing library calls for floating point.
23357 @strong{Warning:} the requisite libraries are not part of GCC@.
23358 Normally the facilities of the machine's usual C compiler are used, but
23359 this can't be done directly in cross-compilation.  You must make your
23360 own arrangements to provide suitable library functions for
23361 cross-compilation.
23363 On machines where a function returns floating-point results in the 80387
23364 register stack, some floating-point opcodes may be emitted even if
23365 @option{-msoft-float} is used.
23367 @item -mno-fp-ret-in-387
23368 @opindex mno-fp-ret-in-387
23369 Do not use the FPU registers for return values of functions.
23371 The usual calling convention has functions return values of types
23372 @code{float} and @code{double} in an FPU register, even if there
23373 is no FPU@.  The idea is that the operating system should emulate
23374 an FPU@.
23376 The option @option{-mno-fp-ret-in-387} causes such values to be returned
23377 in ordinary CPU registers instead.
23379 @item -mno-fancy-math-387
23380 @opindex mno-fancy-math-387
23381 Some 387 emulators do not support the @code{sin}, @code{cos} and
23382 @code{sqrt} instructions for the 387.  Specify this option to avoid
23383 generating those instructions.  This option is the default on
23384 OpenBSD and NetBSD@.  This option is overridden when @option{-march}
23385 indicates that the target CPU always has an FPU and so the
23386 instruction does not need emulation.  These
23387 instructions are not generated unless you also use the
23388 @option{-funsafe-math-optimizations} switch.
23390 @item -malign-double
23391 @itemx -mno-align-double
23392 @opindex malign-double
23393 @opindex mno-align-double
23394 Control whether GCC aligns @code{double}, @code{long double}, and
23395 @code{long long} variables on a two-word boundary or a one-word
23396 boundary.  Aligning @code{double} variables on a two-word boundary
23397 produces code that runs somewhat faster on a Pentium at the
23398 expense of more memory.
23400 On x86-64, @option{-malign-double} is enabled by default.
23402 @strong{Warning:} if you use the @option{-malign-double} switch,
23403 structures containing the above types are aligned differently than
23404 the published application binary interface specifications for the x86-32
23405 and are not binary compatible with structures in code compiled
23406 without that switch.
23408 @item -m96bit-long-double
23409 @itemx -m128bit-long-double
23410 @opindex m96bit-long-double
23411 @opindex m128bit-long-double
23412 These switches control the size of @code{long double} type.  The x86-32
23413 application binary interface specifies the size to be 96 bits,
23414 so @option{-m96bit-long-double} is the default in 32-bit mode.
23416 Modern architectures (Pentium and newer) prefer @code{long double}
23417 to be aligned to an 8- or 16-byte boundary.  In arrays or structures
23418 conforming to the ABI, this is not possible.  So specifying
23419 @option{-m128bit-long-double} aligns @code{long double}
23420 to a 16-byte boundary by padding the @code{long double} with an additional
23421 32-bit zero.
23423 In the x86-64 compiler, @option{-m128bit-long-double} is the default choice as
23424 its ABI specifies that @code{long double} is aligned on 16-byte boundary.
23426 Notice that neither of these options enable any extra precision over the x87
23427 standard of 80 bits for a @code{long double}.
23429 @strong{Warning:} if you override the default value for your target ABI, this
23430 changes the size of 
23431 structures and arrays containing @code{long double} variables,
23432 as well as modifying the function calling convention for functions taking
23433 @code{long double}.  Hence they are not binary-compatible
23434 with code compiled without that switch.
23436 @item -mlong-double-64
23437 @itemx -mlong-double-80
23438 @itemx -mlong-double-128
23439 @opindex mlong-double-64
23440 @opindex mlong-double-80
23441 @opindex mlong-double-128
23442 These switches control the size of @code{long double} type. A size
23443 of 64 bits makes the @code{long double} type equivalent to the @code{double}
23444 type. This is the default for 32-bit Bionic C library.  A size
23445 of 128 bits makes the @code{long double} type equivalent to the
23446 @code{__float128} type. This is the default for 64-bit Bionic C library.
23448 @strong{Warning:} if you override the default value for your target ABI, this
23449 changes the size of
23450 structures and arrays containing @code{long double} variables,
23451 as well as modifying the function calling convention for functions taking
23452 @code{long double}.  Hence they are not binary-compatible
23453 with code compiled without that switch.
23455 @item -malign-data=@var{type}
23456 @opindex malign-data
23457 Control how GCC aligns variables.  Supported values for @var{type} are
23458 @samp{compat} uses increased alignment value compatible uses GCC 4.8
23459 and earlier, @samp{abi} uses alignment value as specified by the
23460 psABI, and @samp{cacheline} uses increased alignment value to match
23461 the cache line size.  @samp{compat} is the default.
23463 @item -mlarge-data-threshold=@var{threshold}
23464 @opindex mlarge-data-threshold
23465 When @option{-mcmodel=medium} is specified, data objects larger than
23466 @var{threshold} are placed in the large data section.  This value must be the
23467 same across all objects linked into the binary, and defaults to 65535.
23469 @item -mrtd
23470 @opindex mrtd
23471 Use a different function-calling convention, in which functions that
23472 take a fixed number of arguments return with the @code{ret @var{num}}
23473 instruction, which pops their arguments while returning.  This saves one
23474 instruction in the caller since there is no need to pop the arguments
23475 there.
23477 You can specify that an individual function is called with this calling
23478 sequence with the function attribute @code{stdcall}.  You can also
23479 override the @option{-mrtd} option by using the function attribute
23480 @code{cdecl}.  @xref{Function Attributes}.
23482 @strong{Warning:} this calling convention is incompatible with the one
23483 normally used on Unix, so you cannot use it if you need to call
23484 libraries compiled with the Unix compiler.
23486 Also, you must provide function prototypes for all functions that
23487 take variable numbers of arguments (including @code{printf});
23488 otherwise incorrect code is generated for calls to those
23489 functions.
23491 In addition, seriously incorrect code results if you call a
23492 function with too many arguments.  (Normally, extra arguments are
23493 harmlessly ignored.)
23495 @item -mregparm=@var{num}
23496 @opindex mregparm
23497 Control how many registers are used to pass integer arguments.  By
23498 default, no registers are used to pass arguments, and at most 3
23499 registers can be used.  You can control this behavior for a specific
23500 function by using the function attribute @code{regparm}.
23501 @xref{Function Attributes}.
23503 @strong{Warning:} if you use this switch, and
23504 @var{num} is nonzero, then you must build all modules with the same
23505 value, including any libraries.  This includes the system libraries and
23506 startup modules.
23508 @item -msseregparm
23509 @opindex msseregparm
23510 Use SSE register passing conventions for float and double arguments
23511 and return values.  You can control this behavior for a specific
23512 function by using the function attribute @code{sseregparm}.
23513 @xref{Function Attributes}.
23515 @strong{Warning:} if you use this switch then you must build all
23516 modules with the same value, including any libraries.  This includes
23517 the system libraries and startup modules.
23519 @item -mvect8-ret-in-mem
23520 @opindex mvect8-ret-in-mem
23521 Return 8-byte vectors in memory instead of MMX registers.  This is the
23522 default on Solaris@tie{}8 and 9 and VxWorks to match the ABI of the Sun
23523 Studio compilers until version 12.  Later compiler versions (starting
23524 with Studio 12 Update@tie{}1) follow the ABI used by other x86 targets, which
23525 is the default on Solaris@tie{}10 and later.  @emph{Only} use this option if
23526 you need to remain compatible with existing code produced by those
23527 previous compiler versions or older versions of GCC@.
23529 @item -mpc32
23530 @itemx -mpc64
23531 @itemx -mpc80
23532 @opindex mpc32
23533 @opindex mpc64
23534 @opindex mpc80
23536 Set 80387 floating-point precision to 32, 64 or 80 bits.  When @option{-mpc32}
23537 is specified, the significands of results of floating-point operations are
23538 rounded to 24 bits (single precision); @option{-mpc64} rounds the
23539 significands of results of floating-point operations to 53 bits (double
23540 precision) and @option{-mpc80} rounds the significands of results of
23541 floating-point operations to 64 bits (extended double precision), which is
23542 the default.  When this option is used, floating-point operations in higher
23543 precisions are not available to the programmer without setting the FPU
23544 control word explicitly.
23546 Setting the rounding of floating-point operations to less than the default
23547 80 bits can speed some programs by 2% or more.  Note that some mathematical
23548 libraries assume that extended-precision (80-bit) floating-point operations
23549 are enabled by default; routines in such libraries could suffer significant
23550 loss of accuracy, typically through so-called ``catastrophic cancellation'',
23551 when this option is used to set the precision to less than extended precision.
23553 @item -mstackrealign
23554 @opindex mstackrealign
23555 Realign the stack at entry.  On the x86, the @option{-mstackrealign}
23556 option generates an alternate prologue and epilogue that realigns the
23557 run-time stack if necessary.  This supports mixing legacy codes that keep
23558 4-byte stack alignment with modern codes that keep 16-byte stack alignment for
23559 SSE compatibility.  See also the attribute @code{force_align_arg_pointer},
23560 applicable to individual functions.
23562 @item -mpreferred-stack-boundary=@var{num}
23563 @opindex mpreferred-stack-boundary
23564 Attempt to keep the stack boundary aligned to a 2 raised to @var{num}
23565 byte boundary.  If @option{-mpreferred-stack-boundary} is not specified,
23566 the default is 4 (16 bytes or 128 bits).
23568 @strong{Warning:} When generating code for the x86-64 architecture with
23569 SSE extensions disabled, @option{-mpreferred-stack-boundary=3} can be
23570 used to keep the stack boundary aligned to 8 byte boundary.  Since
23571 x86-64 ABI require 16 byte stack alignment, this is ABI incompatible and
23572 intended to be used in controlled environment where stack space is
23573 important limitation.  This option leads to wrong code when functions
23574 compiled with 16 byte stack alignment (such as functions from a standard
23575 library) are called with misaligned stack.  In this case, SSE
23576 instructions may lead to misaligned memory access traps.  In addition,
23577 variable arguments are handled incorrectly for 16 byte aligned
23578 objects (including x87 long double and __int128), leading to wrong
23579 results.  You must build all modules with
23580 @option{-mpreferred-stack-boundary=3}, including any libraries.  This
23581 includes the system libraries and startup modules.
23583 @item -mincoming-stack-boundary=@var{num}
23584 @opindex mincoming-stack-boundary
23585 Assume the incoming stack is aligned to a 2 raised to @var{num} byte
23586 boundary.  If @option{-mincoming-stack-boundary} is not specified,
23587 the one specified by @option{-mpreferred-stack-boundary} is used.
23589 On Pentium and Pentium Pro, @code{double} and @code{long double} values
23590 should be aligned to an 8-byte boundary (see @option{-malign-double}) or
23591 suffer significant run time performance penalties.  On Pentium III, the
23592 Streaming SIMD Extension (SSE) data type @code{__m128} may not work
23593 properly if it is not 16-byte aligned.
23595 To ensure proper alignment of this values on the stack, the stack boundary
23596 must be as aligned as that required by any value stored on the stack.
23597 Further, every function must be generated such that it keeps the stack
23598 aligned.  Thus calling a function compiled with a higher preferred
23599 stack boundary from a function compiled with a lower preferred stack
23600 boundary most likely misaligns the stack.  It is recommended that
23601 libraries that use callbacks always use the default setting.
23603 This extra alignment does consume extra stack space, and generally
23604 increases code size.  Code that is sensitive to stack space usage, such
23605 as embedded systems and operating system kernels, may want to reduce the
23606 preferred alignment to @option{-mpreferred-stack-boundary=2}.
23608 @need 200
23609 @item -mmmx
23610 @opindex mmmx
23611 @need 200
23612 @itemx -msse
23613 @opindex msse
23614 @need 200
23615 @itemx -msse2
23616 @opindex msse2
23617 @need 200
23618 @itemx -msse3
23619 @opindex msse3
23620 @need 200
23621 @itemx -mssse3
23622 @opindex mssse3
23623 @need 200
23624 @itemx -msse4
23625 @opindex msse4
23626 @need 200
23627 @itemx -msse4a
23628 @opindex msse4a
23629 @need 200
23630 @itemx -msse4.1
23631 @opindex msse4.1
23632 @need 200
23633 @itemx -msse4.2
23634 @opindex msse4.2
23635 @need 200
23636 @itemx -mavx
23637 @opindex mavx
23638 @need 200
23639 @itemx -mavx2
23640 @opindex mavx2
23641 @need 200
23642 @itemx -mavx512f
23643 @opindex mavx512f
23644 @need 200
23645 @itemx -mavx512pf
23646 @opindex mavx512pf
23647 @need 200
23648 @itemx -mavx512er
23649 @opindex mavx512er
23650 @need 200
23651 @itemx -mavx512cd
23652 @opindex mavx512cd
23653 @need 200
23654 @itemx -mavx512vl
23655 @opindex mavx512vl
23656 @need 200
23657 @itemx -mavx512bw
23658 @opindex mavx512bw
23659 @need 200
23660 @itemx -mavx512dq
23661 @opindex mavx512dq
23662 @need 200
23663 @itemx -mavx512ifma
23664 @opindex mavx512ifma
23665 @need 200
23666 @itemx -mavx512vbmi
23667 @opindex mavx512vbmi
23668 @need 200
23669 @itemx -msha
23670 @opindex msha
23671 @need 200
23672 @itemx -maes
23673 @opindex maes
23674 @need 200
23675 @itemx -mpclmul
23676 @opindex mpclmul
23677 @need 200
23678 @itemx -mclfushopt
23679 @opindex mclfushopt
23680 @need 200
23681 @itemx -mfsgsbase
23682 @opindex mfsgsbase
23683 @need 200
23684 @itemx -mrdrnd
23685 @opindex mrdrnd
23686 @need 200
23687 @itemx -mf16c
23688 @opindex mf16c
23689 @need 200
23690 @itemx -mfma
23691 @opindex mfma
23692 @need 200
23693 @itemx -mfma4
23694 @opindex mfma4
23695 @need 200
23696 @itemx -mprefetchwt1
23697 @opindex mprefetchwt1
23698 @need 200
23699 @itemx -mxop
23700 @opindex mxop
23701 @need 200
23702 @itemx -mlwp
23703 @opindex mlwp
23704 @need 200
23705 @itemx -m3dnow
23706 @opindex m3dnow
23707 @need 200
23708 @itemx -mpopcnt
23709 @opindex mpopcnt
23710 @need 200
23711 @itemx -mabm
23712 @opindex mabm
23713 @need 200
23714 @itemx -mbmi
23715 @opindex mbmi
23716 @need 200
23717 @itemx -mbmi2
23718 @need 200
23719 @itemx -mlzcnt
23720 @opindex mlzcnt
23721 @need 200
23722 @itemx -mfxsr
23723 @opindex mfxsr
23724 @need 200
23725 @itemx -mxsave
23726 @opindex mxsave
23727 @need 200
23728 @itemx -mxsaveopt
23729 @opindex mxsaveopt
23730 @need 200
23731 @itemx -mxsavec
23732 @opindex mxsavec
23733 @need 200
23734 @itemx -mxsaves
23735 @opindex mxsaves
23736 @need 200
23737 @itemx -mrtm
23738 @opindex mrtm
23739 @need 200
23740 @itemx -mtbm
23741 @opindex mtbm
23742 @need 200
23743 @itemx -mmpx
23744 @opindex mmpx
23745 @need 200
23746 @itemx -mmwaitx
23747 @opindex mmwaitx
23748 @need 200
23749 @itemx -mclzero
23750 @opindex mclzero
23751 @itemx -mpku
23752 @opindex mpku
23753 These switches enable the use of instructions in the MMX, SSE,
23754 SSE2, SSE3, SSSE3, SSE4.1, AVX, AVX2, AVX512F, AVX512PF, AVX512ER, AVX512CD,
23755 SHA, AES, PCLMUL, FSGSBASE, RDRND, F16C, FMA, SSE4A, FMA4, XOP, LWP, ABM,
23756 AVX512VL, AVX512BW, AVX512DQ, AVX512IFMA AVX512VBMI, BMI, BMI2, FXSR,
23757 XSAVE, XSAVEOPT, LZCNT, RTM, MPX, MWAITX, PKU or 3DNow!@:
23758 extended instruction sets.  Each has a corresponding @option{-mno-} option
23759 to disable use of these instructions.
23761 These extensions are also available as built-in functions: see
23762 @ref{x86 Built-in Functions}, for details of the functions enabled and
23763 disabled by these switches.
23765 To generate SSE/SSE2 instructions automatically from floating-point
23766 code (as opposed to 387 instructions), see @option{-mfpmath=sse}.
23768 GCC depresses SSEx instructions when @option{-mavx} is used. Instead, it
23769 generates new AVX instructions or AVX equivalence for all SSEx instructions
23770 when needed.
23772 These options enable GCC to use these extended instructions in
23773 generated code, even without @option{-mfpmath=sse}.  Applications that
23774 perform run-time CPU detection must compile separate files for each
23775 supported architecture, using the appropriate flags.  In particular,
23776 the file containing the CPU detection code should be compiled without
23777 these options.
23779 @item -mdump-tune-features
23780 @opindex mdump-tune-features
23781 This option instructs GCC to dump the names of the x86 performance 
23782 tuning features and default settings. The names can be used in 
23783 @option{-mtune-ctrl=@var{feature-list}}.
23785 @item -mtune-ctrl=@var{feature-list}
23786 @opindex mtune-ctrl=@var{feature-list}
23787 This option is used to do fine grain control of x86 code generation features.
23788 @var{feature-list} is a comma separated list of @var{feature} names. See also
23789 @option{-mdump-tune-features}. When specified, the @var{feature} is turned
23790 on if it is not preceded with @samp{^}, otherwise, it is turned off. 
23791 @option{-mtune-ctrl=@var{feature-list}} is intended to be used by GCC
23792 developers. Using it may lead to code paths not covered by testing and can
23793 potentially result in compiler ICEs or runtime errors.
23795 @item -mno-default
23796 @opindex mno-default
23797 This option instructs GCC to turn off all tunable features. See also 
23798 @option{-mtune-ctrl=@var{feature-list}} and @option{-mdump-tune-features}.
23800 @item -mcld
23801 @opindex mcld
23802 This option instructs GCC to emit a @code{cld} instruction in the prologue
23803 of functions that use string instructions.  String instructions depend on
23804 the DF flag to select between autoincrement or autodecrement mode.  While the
23805 ABI specifies the DF flag to be cleared on function entry, some operating
23806 systems violate this specification by not clearing the DF flag in their
23807 exception dispatchers.  The exception handler can be invoked with the DF flag
23808 set, which leads to wrong direction mode when string instructions are used.
23809 This option can be enabled by default on 32-bit x86 targets by configuring
23810 GCC with the @option{--enable-cld} configure option.  Generation of @code{cld}
23811 instructions can be suppressed with the @option{-mno-cld} compiler option
23812 in this case.
23814 @item -mvzeroupper
23815 @opindex mvzeroupper
23816 This option instructs GCC to emit a @code{vzeroupper} instruction
23817 before a transfer of control flow out of the function to minimize
23818 the AVX to SSE transition penalty as well as remove unnecessary @code{zeroupper}
23819 intrinsics.
23821 @item -mprefer-avx128
23822 @opindex mprefer-avx128
23823 This option instructs GCC to use 128-bit AVX instructions instead of
23824 256-bit AVX instructions in the auto-vectorizer.
23826 @item -mcx16
23827 @opindex mcx16
23828 This option enables GCC to generate @code{CMPXCHG16B} instructions.
23829 @code{CMPXCHG16B} allows for atomic operations on 128-bit double quadword
23830 (or oword) data types.  
23831 This is useful for high-resolution counters that can be updated
23832 by multiple processors (or cores).  This instruction is generated as part of
23833 atomic built-in functions: see @ref{__sync Builtins} or
23834 @ref{__atomic Builtins} for details.
23836 @item -msahf
23837 @opindex msahf
23838 This option enables generation of @code{SAHF} instructions in 64-bit code.
23839 Early Intel Pentium 4 CPUs with Intel 64 support,
23840 prior to the introduction of Pentium 4 G1 step in December 2005,
23841 lacked the @code{LAHF} and @code{SAHF} instructions
23842 which are supported by AMD64.
23843 These are load and store instructions, respectively, for certain status flags.
23844 In 64-bit mode, the @code{SAHF} instruction is used to optimize @code{fmod},
23845 @code{drem}, and @code{remainder} built-in functions;
23846 see @ref{Other Builtins} for details.
23848 @item -mmovbe
23849 @opindex mmovbe
23850 This option enables use of the @code{movbe} instruction to implement
23851 @code{__builtin_bswap32} and @code{__builtin_bswap64}.
23853 @item -mcrc32
23854 @opindex mcrc32
23855 This option enables built-in functions @code{__builtin_ia32_crc32qi},
23856 @code{__builtin_ia32_crc32hi}, @code{__builtin_ia32_crc32si} and
23857 @code{__builtin_ia32_crc32di} to generate the @code{crc32} machine instruction.
23859 @item -mrecip
23860 @opindex mrecip
23861 This option enables use of @code{RCPSS} and @code{RSQRTSS} instructions
23862 (and their vectorized variants @code{RCPPS} and @code{RSQRTPS})
23863 with an additional Newton-Raphson step
23864 to increase precision instead of @code{DIVSS} and @code{SQRTSS}
23865 (and their vectorized
23866 variants) for single-precision floating-point arguments.  These instructions
23867 are generated only when @option{-funsafe-math-optimizations} is enabled
23868 together with @option{-ffinite-math-only} and @option{-fno-trapping-math}.
23869 Note that while the throughput of the sequence is higher than the throughput
23870 of the non-reciprocal instruction, the precision of the sequence can be
23871 decreased by up to 2 ulp (i.e. the inverse of 1.0 equals 0.99999994).
23873 Note that GCC implements @code{1.0f/sqrtf(@var{x})} in terms of @code{RSQRTSS}
23874 (or @code{RSQRTPS}) already with @option{-ffast-math} (or the above option
23875 combination), and doesn't need @option{-mrecip}.
23877 Also note that GCC emits the above sequence with additional Newton-Raphson step
23878 for vectorized single-float division and vectorized @code{sqrtf(@var{x})}
23879 already with @option{-ffast-math} (or the above option combination), and
23880 doesn't need @option{-mrecip}.
23882 @item -mrecip=@var{opt}
23883 @opindex mrecip=opt
23884 This option controls which reciprocal estimate instructions
23885 may be used.  @var{opt} is a comma-separated list of options, which may
23886 be preceded by a @samp{!} to invert the option:
23888 @table @samp
23889 @item all
23890 Enable all estimate instructions.
23892 @item default
23893 Enable the default instructions, equivalent to @option{-mrecip}.
23895 @item none
23896 Disable all estimate instructions, equivalent to @option{-mno-recip}.
23898 @item div
23899 Enable the approximation for scalar division.
23901 @item vec-div
23902 Enable the approximation for vectorized division.
23904 @item sqrt
23905 Enable the approximation for scalar square root.
23907 @item vec-sqrt
23908 Enable the approximation for vectorized square root.
23909 @end table
23911 So, for example, @option{-mrecip=all,!sqrt} enables
23912 all of the reciprocal approximations, except for square root.
23914 @item -mveclibabi=@var{type}
23915 @opindex mveclibabi
23916 Specifies the ABI type to use for vectorizing intrinsics using an
23917 external library.  Supported values for @var{type} are @samp{svml} 
23918 for the Intel short
23919 vector math library and @samp{acml} for the AMD math core library.
23920 To use this option, both @option{-ftree-vectorize} and
23921 @option{-funsafe-math-optimizations} have to be enabled, and an SVML or ACML 
23922 ABI-compatible library must be specified at link time.
23924 GCC currently emits calls to @code{vmldExp2},
23925 @code{vmldLn2}, @code{vmldLog102}, @code{vmldLog102}, @code{vmldPow2},
23926 @code{vmldTanh2}, @code{vmldTan2}, @code{vmldAtan2}, @code{vmldAtanh2},
23927 @code{vmldCbrt2}, @code{vmldSinh2}, @code{vmldSin2}, @code{vmldAsinh2},
23928 @code{vmldAsin2}, @code{vmldCosh2}, @code{vmldCos2}, @code{vmldAcosh2},
23929 @code{vmldAcos2}, @code{vmlsExp4}, @code{vmlsLn4}, @code{vmlsLog104},
23930 @code{vmlsLog104}, @code{vmlsPow4}, @code{vmlsTanh4}, @code{vmlsTan4},
23931 @code{vmlsAtan4}, @code{vmlsAtanh4}, @code{vmlsCbrt4}, @code{vmlsSinh4},
23932 @code{vmlsSin4}, @code{vmlsAsinh4}, @code{vmlsAsin4}, @code{vmlsCosh4},
23933 @code{vmlsCos4}, @code{vmlsAcosh4} and @code{vmlsAcos4} for corresponding
23934 function type when @option{-mveclibabi=svml} is used, and @code{__vrd2_sin},
23935 @code{__vrd2_cos}, @code{__vrd2_exp}, @code{__vrd2_log}, @code{__vrd2_log2},
23936 @code{__vrd2_log10}, @code{__vrs4_sinf}, @code{__vrs4_cosf},
23937 @code{__vrs4_expf}, @code{__vrs4_logf}, @code{__vrs4_log2f},
23938 @code{__vrs4_log10f} and @code{__vrs4_powf} for the corresponding function type
23939 when @option{-mveclibabi=acml} is used.  
23941 @item -mabi=@var{name}
23942 @opindex mabi
23943 Generate code for the specified calling convention.  Permissible values
23944 are @samp{sysv} for the ABI used on GNU/Linux and other systems, and
23945 @samp{ms} for the Microsoft ABI.  The default is to use the Microsoft
23946 ABI when targeting Microsoft Windows and the SysV ABI on all other systems.
23947 You can control this behavior for specific functions by
23948 using the function attributes @code{ms_abi} and @code{sysv_abi}.
23949 @xref{Function Attributes}.
23951 @item -mtls-dialect=@var{type}
23952 @opindex mtls-dialect
23953 Generate code to access thread-local storage using the @samp{gnu} or
23954 @samp{gnu2} conventions.  @samp{gnu} is the conservative default;
23955 @samp{gnu2} is more efficient, but it may add compile- and run-time
23956 requirements that cannot be satisfied on all systems.
23958 @item -mpush-args
23959 @itemx -mno-push-args
23960 @opindex mpush-args
23961 @opindex mno-push-args
23962 Use PUSH operations to store outgoing parameters.  This method is shorter
23963 and usually equally fast as method using SUB/MOV operations and is enabled
23964 by default.  In some cases disabling it may improve performance because of
23965 improved scheduling and reduced dependencies.
23967 @item -maccumulate-outgoing-args
23968 @opindex maccumulate-outgoing-args
23969 If enabled, the maximum amount of space required for outgoing arguments is
23970 computed in the function prologue.  This is faster on most modern CPUs
23971 because of reduced dependencies, improved scheduling and reduced stack usage
23972 when the preferred stack boundary is not equal to 2.  The drawback is a notable
23973 increase in code size.  This switch implies @option{-mno-push-args}.
23975 @item -mthreads
23976 @opindex mthreads
23977 Support thread-safe exception handling on MinGW.  Programs that rely
23978 on thread-safe exception handling must compile and link all code with the
23979 @option{-mthreads} option.  When compiling, @option{-mthreads} defines
23980 @option{-D_MT}; when linking, it links in a special thread helper library
23981 @option{-lmingwthrd} which cleans up per-thread exception-handling data.
23983 @item -mms-bitfields
23984 @itemx -mno-ms-bitfields
23985 @opindex mms-bitfields
23986 @opindex mno-ms-bitfields
23988 Enable/disable bit-field layout compatible with the native Microsoft
23989 Windows compiler.  
23991 If @code{packed} is used on a structure, or if bit-fields are used,
23992 it may be that the Microsoft ABI lays out the structure differently
23993 than the way GCC normally does.  Particularly when moving packed
23994 data between functions compiled with GCC and the native Microsoft compiler
23995 (either via function call or as data in a file), it may be necessary to access
23996 either format.
23998 This option is enabled by default for Microsoft Windows
23999 targets.  This behavior can also be controlled locally by use of variable
24000 or type attributes.  For more information, see @ref{x86 Variable Attributes}
24001 and @ref{x86 Type Attributes}.
24003 The Microsoft structure layout algorithm is fairly simple with the exception
24004 of the bit-field packing.  
24005 The padding and alignment of members of structures and whether a bit-field 
24006 can straddle a storage-unit boundary are determine by these rules:
24008 @enumerate
24009 @item Structure members are stored sequentially in the order in which they are
24010 declared: the first member has the lowest memory address and the last member
24011 the highest.
24013 @item Every data object has an alignment requirement.  The alignment requirement
24014 for all data except structures, unions, and arrays is either the size of the
24015 object or the current packing size (specified with either the
24016 @code{aligned} attribute or the @code{pack} pragma),
24017 whichever is less.  For structures, unions, and arrays,
24018 the alignment requirement is the largest alignment requirement of its members.
24019 Every object is allocated an offset so that:
24021 @smallexample
24022 offset % alignment_requirement == 0
24023 @end smallexample
24025 @item Adjacent bit-fields are packed into the same 1-, 2-, or 4-byte allocation
24026 unit if the integral types are the same size and if the next bit-field fits
24027 into the current allocation unit without crossing the boundary imposed by the
24028 common alignment requirements of the bit-fields.
24029 @end enumerate
24031 MSVC interprets zero-length bit-fields in the following ways:
24033 @enumerate
24034 @item If a zero-length bit-field is inserted between two bit-fields that
24035 are normally coalesced, the bit-fields are not coalesced.
24037 For example:
24039 @smallexample
24040 struct
24041  @{
24042    unsigned long bf_1 : 12;
24043    unsigned long : 0;
24044    unsigned long bf_2 : 12;
24045  @} t1;
24046 @end smallexample
24048 @noindent
24049 The size of @code{t1} is 8 bytes with the zero-length bit-field.  If the
24050 zero-length bit-field were removed, @code{t1}'s size would be 4 bytes.
24052 @item If a zero-length bit-field is inserted after a bit-field, @code{foo}, and the
24053 alignment of the zero-length bit-field is greater than the member that follows it,
24054 @code{bar}, @code{bar} is aligned as the type of the zero-length bit-field.
24056 For example:
24058 @smallexample
24059 struct
24060  @{
24061    char foo : 4;
24062    short : 0;
24063    char bar;
24064  @} t2;
24066 struct
24067  @{
24068    char foo : 4;
24069    short : 0;
24070    double bar;
24071  @} t3;
24072 @end smallexample
24074 @noindent
24075 For @code{t2}, @code{bar} is placed at offset 2, rather than offset 1.
24076 Accordingly, the size of @code{t2} is 4.  For @code{t3}, the zero-length
24077 bit-field does not affect the alignment of @code{bar} or, as a result, the size
24078 of the structure.
24080 Taking this into account, it is important to note the following:
24082 @enumerate
24083 @item If a zero-length bit-field follows a normal bit-field, the type of the
24084 zero-length bit-field may affect the alignment of the structure as whole. For
24085 example, @code{t2} has a size of 4 bytes, since the zero-length bit-field follows a
24086 normal bit-field, and is of type short.
24088 @item Even if a zero-length bit-field is not followed by a normal bit-field, it may
24089 still affect the alignment of the structure:
24091 @smallexample
24092 struct
24093  @{
24094    char foo : 6;
24095    long : 0;
24096  @} t4;
24097 @end smallexample
24099 @noindent
24100 Here, @code{t4} takes up 4 bytes.
24101 @end enumerate
24103 @item Zero-length bit-fields following non-bit-field members are ignored:
24105 @smallexample
24106 struct
24107  @{
24108    char foo;
24109    long : 0;
24110    char bar;
24111  @} t5;
24112 @end smallexample
24114 @noindent
24115 Here, @code{t5} takes up 2 bytes.
24116 @end enumerate
24119 @item -mno-align-stringops
24120 @opindex mno-align-stringops
24121 Do not align the destination of inlined string operations.  This switch reduces
24122 code size and improves performance in case the destination is already aligned,
24123 but GCC doesn't know about it.
24125 @item -minline-all-stringops
24126 @opindex minline-all-stringops
24127 By default GCC inlines string operations only when the destination is 
24128 known to be aligned to least a 4-byte boundary.  
24129 This enables more inlining and increases code
24130 size, but may improve performance of code that depends on fast
24131 @code{memcpy}, @code{strlen},
24132 and @code{memset} for short lengths.
24134 @item -minline-stringops-dynamically
24135 @opindex minline-stringops-dynamically
24136 For string operations of unknown size, use run-time checks with
24137 inline code for small blocks and a library call for large blocks.
24139 @item -mstringop-strategy=@var{alg}
24140 @opindex mstringop-strategy=@var{alg}
24141 Override the internal decision heuristic for the particular algorithm to use
24142 for inlining string operations.  The allowed values for @var{alg} are:
24144 @table @samp
24145 @item rep_byte
24146 @itemx rep_4byte
24147 @itemx rep_8byte
24148 Expand using i386 @code{rep} prefix of the specified size.
24150 @item byte_loop
24151 @itemx loop
24152 @itemx unrolled_loop
24153 Expand into an inline loop.
24155 @item libcall
24156 Always use a library call.
24157 @end table
24159 @item -mmemcpy-strategy=@var{strategy}
24160 @opindex mmemcpy-strategy=@var{strategy}
24161 Override the internal decision heuristic to decide if @code{__builtin_memcpy}
24162 should be inlined and what inline algorithm to use when the expected size
24163 of the copy operation is known. @var{strategy} 
24164 is a comma-separated list of @var{alg}:@var{max_size}:@var{dest_align} triplets. 
24165 @var{alg} is specified in @option{-mstringop-strategy}, @var{max_size} specifies
24166 the max byte size with which inline algorithm @var{alg} is allowed.  For the last
24167 triplet, the @var{max_size} must be @code{-1}. The @var{max_size} of the triplets
24168 in the list must be specified in increasing order.  The minimal byte size for 
24169 @var{alg} is @code{0} for the first triplet and @code{@var{max_size} + 1} of the 
24170 preceding range.
24172 @item -mmemset-strategy=@var{strategy}
24173 @opindex mmemset-strategy=@var{strategy}
24174 The option is similar to @option{-mmemcpy-strategy=} except that it is to control
24175 @code{__builtin_memset} expansion.
24177 @item -momit-leaf-frame-pointer
24178 @opindex momit-leaf-frame-pointer
24179 Don't keep the frame pointer in a register for leaf functions.  This
24180 avoids the instructions to save, set up, and restore frame pointers and
24181 makes an extra register available in leaf functions.  The option
24182 @option{-fomit-leaf-frame-pointer} removes the frame pointer for leaf functions,
24183 which might make debugging harder.
24185 @item -mtls-direct-seg-refs
24186 @itemx -mno-tls-direct-seg-refs
24187 @opindex mtls-direct-seg-refs
24188 Controls whether TLS variables may be accessed with offsets from the
24189 TLS segment register (@code{%gs} for 32-bit, @code{%fs} for 64-bit),
24190 or whether the thread base pointer must be added.  Whether or not this
24191 is valid depends on the operating system, and whether it maps the
24192 segment to cover the entire TLS area.
24194 For systems that use the GNU C Library, the default is on.
24196 @item -msse2avx
24197 @itemx -mno-sse2avx
24198 @opindex msse2avx
24199 Specify that the assembler should encode SSE instructions with VEX
24200 prefix.  The option @option{-mavx} turns this on by default.
24202 @item -mfentry
24203 @itemx -mno-fentry
24204 @opindex mfentry
24205 If profiling is active (@option{-pg}), put the profiling
24206 counter call before the prologue.
24207 Note: On x86 architectures the attribute @code{ms_hook_prologue}
24208 isn't possible at the moment for @option{-mfentry} and @option{-pg}.
24210 @item -mrecord-mcount
24211 @itemx -mno-record-mcount
24212 @opindex mrecord-mcount
24213 If profiling is active (@option{-pg}), generate a __mcount_loc section
24214 that contains pointers to each profiling call. This is useful for
24215 automatically patching and out calls.
24217 @item -mnop-mcount
24218 @itemx -mno-nop-mcount
24219 @opindex mnop-mcount
24220 If profiling is active (@option{-pg}), generate the calls to
24221 the profiling functions as nops. This is useful when they
24222 should be patched in later dynamically. This is likely only
24223 useful together with @option{-mrecord-mcount}.
24225 @item -mskip-rax-setup
24226 @itemx -mno-skip-rax-setup
24227 @opindex mskip-rax-setup
24228 When generating code for the x86-64 architecture with SSE extensions
24229 disabled, @option{-mskip-rax-setup} can be used to skip setting up RAX
24230 register when there are no variable arguments passed in vector registers.
24232 @strong{Warning:} Since RAX register is used to avoid unnecessarily
24233 saving vector registers on stack when passing variable arguments, the
24234 impacts of this option are callees may waste some stack space,
24235 misbehave or jump to a random location.  GCC 4.4 or newer don't have
24236 those issues, regardless the RAX register value.
24238 @item -m8bit-idiv
24239 @itemx -mno-8bit-idiv
24240 @opindex m8bit-idiv
24241 On some processors, like Intel Atom, 8-bit unsigned integer divide is
24242 much faster than 32-bit/64-bit integer divide.  This option generates a
24243 run-time check.  If both dividend and divisor are within range of 0
24244 to 255, 8-bit unsigned integer divide is used instead of
24245 32-bit/64-bit integer divide.
24247 @item -mavx256-split-unaligned-load
24248 @itemx -mavx256-split-unaligned-store
24249 @opindex mavx256-split-unaligned-load
24250 @opindex mavx256-split-unaligned-store
24251 Split 32-byte AVX unaligned load and store.
24253 @item -mstack-protector-guard=@var{guard}
24254 @opindex mstack-protector-guard=@var{guard}
24255 Generate stack protection code using canary at @var{guard}.  Supported
24256 locations are @samp{global} for global canary or @samp{tls} for per-thread
24257 canary in the TLS block (the default).  This option has effect only when
24258 @option{-fstack-protector} or @option{-fstack-protector-all} is specified.
24260 @item -mmitigate-rop
24261 @opindex mmitigate-rop
24262 Try to avoid generating code sequences that contain unintended return
24263 opcodes, to mitigate against certain forms of attack. At the moment,
24264 this option is limited in what it can do and should not be relied
24265 on to provide serious protection.
24267 @end table
24269 These @samp{-m} switches are supported in addition to the above
24270 on x86-64 processors in 64-bit environments.
24272 @table @gcctabopt
24273 @item -m32
24274 @itemx -m64
24275 @itemx -mx32
24276 @itemx -m16
24277 @itemx -miamcu
24278 @opindex m32
24279 @opindex m64
24280 @opindex mx32
24281 @opindex m16
24282 @opindex miamcu
24283 Generate code for a 16-bit, 32-bit or 64-bit environment.
24284 The @option{-m32} option sets @code{int}, @code{long}, and pointer types
24285 to 32 bits, and
24286 generates code that runs on any i386 system.
24288 The @option{-m64} option sets @code{int} to 32 bits and @code{long} and pointer
24289 types to 64 bits, and generates code for the x86-64 architecture.
24290 For Darwin only the @option{-m64} option also turns off the @option{-fno-pic}
24291 and @option{-mdynamic-no-pic} options.
24293 The @option{-mx32} option sets @code{int}, @code{long}, and pointer types
24294 to 32 bits, and
24295 generates code for the x86-64 architecture.
24297 The @option{-m16} option is the same as @option{-m32}, except for that
24298 it outputs the @code{.code16gcc} assembly directive at the beginning of
24299 the assembly output so that the binary can run in 16-bit mode.
24301 The @option{-miamcu} option generates code which conforms to Intel MCU
24302 psABI.  It requires the @option{-m32} option to be turned on.
24304 @item -mno-red-zone
24305 @opindex mno-red-zone
24306 Do not use a so-called ``red zone'' for x86-64 code.  The red zone is mandated
24307 by the x86-64 ABI; it is a 128-byte area beyond the location of the
24308 stack pointer that is not modified by signal or interrupt handlers
24309 and therefore can be used for temporary data without adjusting the stack
24310 pointer.  The flag @option{-mno-red-zone} disables this red zone.
24312 @item -mcmodel=small
24313 @opindex mcmodel=small
24314 Generate code for the small code model: the program and its symbols must
24315 be linked in the lower 2 GB of the address space.  Pointers are 64 bits.
24316 Programs can be statically or dynamically linked.  This is the default
24317 code model.
24319 @item -mcmodel=kernel
24320 @opindex mcmodel=kernel
24321 Generate code for the kernel code model.  The kernel runs in the
24322 negative 2 GB of the address space.
24323 This model has to be used for Linux kernel code.
24325 @item -mcmodel=medium
24326 @opindex mcmodel=medium
24327 Generate code for the medium model: the program is linked in the lower 2
24328 GB of the address space.  Small symbols are also placed there.  Symbols
24329 with sizes larger than @option{-mlarge-data-threshold} are put into
24330 large data or BSS sections and can be located above 2GB.  Programs can
24331 be statically or dynamically linked.
24333 @item -mcmodel=large
24334 @opindex mcmodel=large
24335 Generate code for the large model.  This model makes no assumptions
24336 about addresses and sizes of sections.
24338 @item -maddress-mode=long
24339 @opindex maddress-mode=long
24340 Generate code for long address mode.  This is only supported for 64-bit
24341 and x32 environments.  It is the default address mode for 64-bit
24342 environments.
24344 @item -maddress-mode=short
24345 @opindex maddress-mode=short
24346 Generate code for short address mode.  This is only supported for 32-bit
24347 and x32 environments.  It is the default address mode for 32-bit and
24348 x32 environments.
24349 @end table
24351 @node x86 Windows Options
24352 @subsection x86 Windows Options
24353 @cindex x86 Windows Options
24354 @cindex Windows Options for x86
24356 These additional options are available for Microsoft Windows targets:
24358 @table @gcctabopt
24359 @item -mconsole
24360 @opindex mconsole
24361 This option
24362 specifies that a console application is to be generated, by
24363 instructing the linker to set the PE header subsystem type
24364 required for console applications.
24365 This option is available for Cygwin and MinGW targets and is
24366 enabled by default on those targets.
24368 @item -mdll
24369 @opindex mdll
24370 This option is available for Cygwin and MinGW targets.  It
24371 specifies that a DLL---a dynamic link library---is to be
24372 generated, enabling the selection of the required runtime
24373 startup object and entry point.
24375 @item -mnop-fun-dllimport
24376 @opindex mnop-fun-dllimport
24377 This option is available for Cygwin and MinGW targets.  It
24378 specifies that the @code{dllimport} attribute should be ignored.
24380 @item -mthread
24381 @opindex mthread
24382 This option is available for MinGW targets. It specifies
24383 that MinGW-specific thread support is to be used.
24385 @item -municode
24386 @opindex municode
24387 This option is available for MinGW-w64 targets.  It causes
24388 the @code{UNICODE} preprocessor macro to be predefined, and
24389 chooses Unicode-capable runtime startup code.
24391 @item -mwin32
24392 @opindex mwin32
24393 This option is available for Cygwin and MinGW targets.  It
24394 specifies that the typical Microsoft Windows predefined macros are to
24395 be set in the pre-processor, but does not influence the choice
24396 of runtime library/startup code.
24398 @item -mwindows
24399 @opindex mwindows
24400 This option is available for Cygwin and MinGW targets.  It
24401 specifies that a GUI application is to be generated by
24402 instructing the linker to set the PE header subsystem type
24403 appropriately.
24405 @item -fno-set-stack-executable
24406 @opindex fno-set-stack-executable
24407 This option is available for MinGW targets. It specifies that
24408 the executable flag for the stack used by nested functions isn't
24409 set. This is necessary for binaries running in kernel mode of
24410 Microsoft Windows, as there the User32 API, which is used to set executable
24411 privileges, isn't available.
24413 @item -fwritable-relocated-rdata
24414 @opindex fno-writable-relocated-rdata
24415 This option is available for MinGW and Cygwin targets.  It specifies
24416 that relocated-data in read-only section is put into the @code{.data}
24417 section.  This is a necessary for older runtimes not supporting
24418 modification of @code{.rdata} sections for pseudo-relocation.
24420 @item -mpe-aligned-commons
24421 @opindex mpe-aligned-commons
24422 This option is available for Cygwin and MinGW targets.  It
24423 specifies that the GNU extension to the PE file format that
24424 permits the correct alignment of COMMON variables should be
24425 used when generating code.  It is enabled by default if
24426 GCC detects that the target assembler found during configuration
24427 supports the feature.
24428 @end table
24430 See also under @ref{x86 Options} for standard options.
24432 @node Xstormy16 Options
24433 @subsection Xstormy16 Options
24434 @cindex Xstormy16 Options
24436 These options are defined for Xstormy16:
24438 @table @gcctabopt
24439 @item -msim
24440 @opindex msim
24441 Choose startup files and linker script suitable for the simulator.
24442 @end table
24444 @node Xtensa Options
24445 @subsection Xtensa Options
24446 @cindex Xtensa Options
24448 These options are supported for Xtensa targets:
24450 @table @gcctabopt
24451 @item -mconst16
24452 @itemx -mno-const16
24453 @opindex mconst16
24454 @opindex mno-const16
24455 Enable or disable use of @code{CONST16} instructions for loading
24456 constant values.  The @code{CONST16} instruction is currently not a
24457 standard option from Tensilica.  When enabled, @code{CONST16}
24458 instructions are always used in place of the standard @code{L32R}
24459 instructions.  The use of @code{CONST16} is enabled by default only if
24460 the @code{L32R} instruction is not available.
24462 @item -mfused-madd
24463 @itemx -mno-fused-madd
24464 @opindex mfused-madd
24465 @opindex mno-fused-madd
24466 Enable or disable use of fused multiply/add and multiply/subtract
24467 instructions in the floating-point option.  This has no effect if the
24468 floating-point option is not also enabled.  Disabling fused multiply/add
24469 and multiply/subtract instructions forces the compiler to use separate
24470 instructions for the multiply and add/subtract operations.  This may be
24471 desirable in some cases where strict IEEE 754-compliant results are
24472 required: the fused multiply add/subtract instructions do not round the
24473 intermediate result, thereby producing results with @emph{more} bits of
24474 precision than specified by the IEEE standard.  Disabling fused multiply
24475 add/subtract instructions also ensures that the program output is not
24476 sensitive to the compiler's ability to combine multiply and add/subtract
24477 operations.
24479 @item -mserialize-volatile
24480 @itemx -mno-serialize-volatile
24481 @opindex mserialize-volatile
24482 @opindex mno-serialize-volatile
24483 When this option is enabled, GCC inserts @code{MEMW} instructions before
24484 @code{volatile} memory references to guarantee sequential consistency.
24485 The default is @option{-mserialize-volatile}.  Use
24486 @option{-mno-serialize-volatile} to omit the @code{MEMW} instructions.
24488 @item -mforce-no-pic
24489 @opindex mforce-no-pic
24490 For targets, like GNU/Linux, where all user-mode Xtensa code must be
24491 position-independent code (PIC), this option disables PIC for compiling
24492 kernel code.
24494 @item -mtext-section-literals
24495 @itemx -mno-text-section-literals
24496 @opindex mtext-section-literals
24497 @opindex mno-text-section-literals
24498 These options control the treatment of literal pools.  The default is
24499 @option{-mno-text-section-literals}, which places literals in a separate
24500 section in the output file.  This allows the literal pool to be placed
24501 in a data RAM/ROM, and it also allows the linker to combine literal
24502 pools from separate object files to remove redundant literals and
24503 improve code size.  With @option{-mtext-section-literals}, the literals
24504 are interspersed in the text section in order to keep them as close as
24505 possible to their references.  This may be necessary for large assembly
24506 files.  Literals for each function are placed right before that function.
24508 @item -mauto-litpools
24509 @itemx -mno-auto-litpools
24510 @opindex mauto-litpools
24511 @opindex mno-auto-litpools
24512 These options control the treatment of literal pools.  The default is
24513 @option{-mno-auto-litpools}, which places literals in a separate
24514 section in the output file unless @option{-mtext-section-literals} is
24515 used.  With @option{-mauto-litpools} the literals are interspersed in
24516 the text section by the assembler.  Compiler does not produce explicit
24517 @code{.literal} directives and loads literals into registers with
24518 @code{MOVI} instructions instead of @code{L32R} to let the assembler
24519 do relaxation and place literals as necessary.  This option allows
24520 assembler to create several literal pools per function and assemble
24521 very big functions, which may not be possible with
24522 @option{-mtext-section-literals}.
24524 @item -mtarget-align
24525 @itemx -mno-target-align
24526 @opindex mtarget-align
24527 @opindex mno-target-align
24528 When this option is enabled, GCC instructs the assembler to
24529 automatically align instructions to reduce branch penalties at the
24530 expense of some code density.  The assembler attempts to widen density
24531 instructions to align branch targets and the instructions following call
24532 instructions.  If there are not enough preceding safe density
24533 instructions to align a target, no widening is performed.  The
24534 default is @option{-mtarget-align}.  These options do not affect the
24535 treatment of auto-aligned instructions like @code{LOOP}, which the
24536 assembler always aligns, either by widening density instructions or
24537 by inserting NOP instructions.
24539 @item -mlongcalls
24540 @itemx -mno-longcalls
24541 @opindex mlongcalls
24542 @opindex mno-longcalls
24543 When this option is enabled, GCC instructs the assembler to translate
24544 direct calls to indirect calls unless it can determine that the target
24545 of a direct call is in the range allowed by the call instruction.  This
24546 translation typically occurs for calls to functions in other source
24547 files.  Specifically, the assembler translates a direct @code{CALL}
24548 instruction into an @code{L32R} followed by a @code{CALLX} instruction.
24549 The default is @option{-mno-longcalls}.  This option should be used in
24550 programs where the call target can potentially be out of range.  This
24551 option is implemented in the assembler, not the compiler, so the
24552 assembly code generated by GCC still shows direct call
24553 instructions---look at the disassembled object code to see the actual
24554 instructions.  Note that the assembler uses an indirect call for
24555 every cross-file call, not just those that really are out of range.
24556 @end table
24558 @node zSeries Options
24559 @subsection zSeries Options
24560 @cindex zSeries options
24562 These are listed under @xref{S/390 and zSeries Options}.
24565 @c man end
24567 @node Spec Files
24568 @section Specifying Subprocesses and the Switches to Pass to Them
24569 @cindex Spec Files
24571 @command{gcc} is a driver program.  It performs its job by invoking a
24572 sequence of other programs to do the work of compiling, assembling and
24573 linking.  GCC interprets its command-line parameters and uses these to
24574 deduce which programs it should invoke, and which command-line options
24575 it ought to place on their command lines.  This behavior is controlled
24576 by @dfn{spec strings}.  In most cases there is one spec string for each
24577 program that GCC can invoke, but a few programs have multiple spec
24578 strings to control their behavior.  The spec strings built into GCC can
24579 be overridden by using the @option{-specs=} command-line switch to specify
24580 a spec file.
24582 @dfn{Spec files} are plain-text files that are used to construct spec
24583 strings.  They consist of a sequence of directives separated by blank
24584 lines.  The type of directive is determined by the first non-whitespace
24585 character on the line, which can be one of the following:
24587 @table @code
24588 @item %@var{command}
24589 Issues a @var{command} to the spec file processor.  The commands that can
24590 appear here are:
24592 @table @code
24593 @item %include <@var{file}>
24594 @cindex @code{%include}
24595 Search for @var{file} and insert its text at the current point in the
24596 specs file.
24598 @item %include_noerr <@var{file}>
24599 @cindex @code{%include_noerr}
24600 Just like @samp{%include}, but do not generate an error message if the include
24601 file cannot be found.
24603 @item %rename @var{old_name} @var{new_name}
24604 @cindex @code{%rename}
24605 Rename the spec string @var{old_name} to @var{new_name}.
24607 @end table
24609 @item *[@var{spec_name}]:
24610 This tells the compiler to create, override or delete the named spec
24611 string.  All lines after this directive up to the next directive or
24612 blank line are considered to be the text for the spec string.  If this
24613 results in an empty string then the spec is deleted.  (Or, if the
24614 spec did not exist, then nothing happens.)  Otherwise, if the spec
24615 does not currently exist a new spec is created.  If the spec does
24616 exist then its contents are overridden by the text of this
24617 directive, unless the first character of that text is the @samp{+}
24618 character, in which case the text is appended to the spec.
24620 @item [@var{suffix}]:
24621 Creates a new @samp{[@var{suffix}] spec} pair.  All lines after this directive
24622 and up to the next directive or blank line are considered to make up the
24623 spec string for the indicated suffix.  When the compiler encounters an
24624 input file with the named suffix, it processes the spec string in
24625 order to work out how to compile that file.  For example:
24627 @smallexample
24628 .ZZ:
24629 z-compile -input %i
24630 @end smallexample
24632 This says that any input file whose name ends in @samp{.ZZ} should be
24633 passed to the program @samp{z-compile}, which should be invoked with the
24634 command-line switch @option{-input} and with the result of performing the
24635 @samp{%i} substitution.  (See below.)
24637 As an alternative to providing a spec string, the text following a
24638 suffix directive can be one of the following:
24640 @table @code
24641 @item @@@var{language}
24642 This says that the suffix is an alias for a known @var{language}.  This is
24643 similar to using the @option{-x} command-line switch to GCC to specify a
24644 language explicitly.  For example:
24646 @smallexample
24647 .ZZ:
24648 @@c++
24649 @end smallexample
24651 Says that .ZZ files are, in fact, C++ source files.
24653 @item #@var{name}
24654 This causes an error messages saying:
24656 @smallexample
24657 @var{name} compiler not installed on this system.
24658 @end smallexample
24659 @end table
24661 GCC already has an extensive list of suffixes built into it.
24662 This directive adds an entry to the end of the list of suffixes, but
24663 since the list is searched from the end backwards, it is effectively
24664 possible to override earlier entries using this technique.
24666 @end table
24668 GCC has the following spec strings built into it.  Spec files can
24669 override these strings or create their own.  Note that individual
24670 targets can also add their own spec strings to this list.
24672 @smallexample
24673 asm          Options to pass to the assembler
24674 asm_final    Options to pass to the assembler post-processor
24675 cpp          Options to pass to the C preprocessor
24676 cc1          Options to pass to the C compiler
24677 cc1plus      Options to pass to the C++ compiler
24678 endfile      Object files to include at the end of the link
24679 link         Options to pass to the linker
24680 lib          Libraries to include on the command line to the linker
24681 libgcc       Decides which GCC support library to pass to the linker
24682 linker       Sets the name of the linker
24683 predefines   Defines to be passed to the C preprocessor
24684 signed_char  Defines to pass to CPP to say whether @code{char} is signed
24685              by default
24686 startfile    Object files to include at the start of the link
24687 @end smallexample
24689 Here is a small example of a spec file:
24691 @smallexample
24692 %rename lib                 old_lib
24694 *lib:
24695 --start-group -lgcc -lc -leval1 --end-group %(old_lib)
24696 @end smallexample
24698 This example renames the spec called @samp{lib} to @samp{old_lib} and
24699 then overrides the previous definition of @samp{lib} with a new one.
24700 The new definition adds in some extra command-line options before
24701 including the text of the old definition.
24703 @dfn{Spec strings} are a list of command-line options to be passed to their
24704 corresponding program.  In addition, the spec strings can contain
24705 @samp{%}-prefixed sequences to substitute variable text or to
24706 conditionally insert text into the command line.  Using these constructs
24707 it is possible to generate quite complex command lines.
24709 Here is a table of all defined @samp{%}-sequences for spec
24710 strings.  Note that spaces are not generated automatically around the
24711 results of expanding these sequences.  Therefore you can concatenate them
24712 together or combine them with constant text in a single argument.
24714 @table @code
24715 @item %%
24716 Substitute one @samp{%} into the program name or argument.
24718 @item %i
24719 Substitute the name of the input file being processed.
24721 @item %b
24722 Substitute the basename of the input file being processed.
24723 This is the substring up to (and not including) the last period
24724 and not including the directory.
24726 @item %B
24727 This is the same as @samp{%b}, but include the file suffix (text after
24728 the last period).
24730 @item %d
24731 Marks the argument containing or following the @samp{%d} as a
24732 temporary file name, so that that file is deleted if GCC exits
24733 successfully.  Unlike @samp{%g}, this contributes no text to the
24734 argument.
24736 @item %g@var{suffix}
24737 Substitute a file name that has suffix @var{suffix} and is chosen
24738 once per compilation, and mark the argument in the same way as
24739 @samp{%d}.  To reduce exposure to denial-of-service attacks, the file
24740 name is now chosen in a way that is hard to predict even when previously
24741 chosen file names are known.  For example, @samp{%g.s @dots{} %g.o @dots{} %g.s}
24742 might turn into @samp{ccUVUUAU.s ccXYAXZ12.o ccUVUUAU.s}.  @var{suffix} matches
24743 the regexp @samp{[.A-Za-z]*} or the special string @samp{%O}, which is
24744 treated exactly as if @samp{%O} had been preprocessed.  Previously, @samp{%g}
24745 was simply substituted with a file name chosen once per compilation,
24746 without regard to any appended suffix (which was therefore treated
24747 just like ordinary text), making such attacks more likely to succeed.
24749 @item %u@var{suffix}
24750 Like @samp{%g}, but generates a new temporary file name
24751 each time it appears instead of once per compilation.
24753 @item %U@var{suffix}
24754 Substitutes the last file name generated with @samp{%u@var{suffix}}, generating a
24755 new one if there is no such last file name.  In the absence of any
24756 @samp{%u@var{suffix}}, this is just like @samp{%g@var{suffix}}, except they don't share
24757 the same suffix @emph{space}, so @samp{%g.s @dots{} %U.s @dots{} %g.s @dots{} %U.s}
24758 involves the generation of two distinct file names, one
24759 for each @samp{%g.s} and another for each @samp{%U.s}.  Previously, @samp{%U} was
24760 simply substituted with a file name chosen for the previous @samp{%u},
24761 without regard to any appended suffix.
24763 @item %j@var{suffix}
24764 Substitutes the name of the @code{HOST_BIT_BUCKET}, if any, and if it is
24765 writable, and if @option{-save-temps} is not used; 
24766 otherwise, substitute the name
24767 of a temporary file, just like @samp{%u}.  This temporary file is not
24768 meant for communication between processes, but rather as a junk
24769 disposal mechanism.
24771 @item %|@var{suffix}
24772 @itemx %m@var{suffix}
24773 Like @samp{%g}, except if @option{-pipe} is in effect.  In that case
24774 @samp{%|} substitutes a single dash and @samp{%m} substitutes nothing at
24775 all.  These are the two most common ways to instruct a program that it
24776 should read from standard input or write to standard output.  If you
24777 need something more elaborate you can use an @samp{%@{pipe:@code{X}@}}
24778 construct: see for example @file{f/lang-specs.h}.
24780 @item %.@var{SUFFIX}
24781 Substitutes @var{.SUFFIX} for the suffixes of a matched switch's args
24782 when it is subsequently output with @samp{%*}.  @var{SUFFIX} is
24783 terminated by the next space or %.
24785 @item %w
24786 Marks the argument containing or following the @samp{%w} as the
24787 designated output file of this compilation.  This puts the argument
24788 into the sequence of arguments that @samp{%o} substitutes.
24790 @item %o
24791 Substitutes the names of all the output files, with spaces
24792 automatically placed around them.  You should write spaces
24793 around the @samp{%o} as well or the results are undefined.
24794 @samp{%o} is for use in the specs for running the linker.
24795 Input files whose names have no recognized suffix are not compiled
24796 at all, but they are included among the output files, so they are
24797 linked.
24799 @item %O
24800 Substitutes the suffix for object files.  Note that this is
24801 handled specially when it immediately follows @samp{%g, %u, or %U},
24802 because of the need for those to form complete file names.  The
24803 handling is such that @samp{%O} is treated exactly as if it had already
24804 been substituted, except that @samp{%g, %u, and %U} do not currently
24805 support additional @var{suffix} characters following @samp{%O} as they do
24806 following, for example, @samp{.o}.
24808 @item %p
24809 Substitutes the standard macro predefinitions for the
24810 current target machine.  Use this when running @command{cpp}.
24812 @item %P
24813 Like @samp{%p}, but puts @samp{__} before and after the name of each
24814 predefined macro, except for macros that start with @samp{__} or with
24815 @samp{_@var{L}}, where @var{L} is an uppercase letter.  This is for ISO
24818 @item %I
24819 Substitute any of @option{-iprefix} (made from @env{GCC_EXEC_PREFIX}),
24820 @option{-isysroot} (made from @env{TARGET_SYSTEM_ROOT}),
24821 @option{-isystem} (made from @env{COMPILER_PATH} and @option{-B} options)
24822 and @option{-imultilib} as necessary.
24824 @item %s
24825 Current argument is the name of a library or startup file of some sort.
24826 Search for that file in a standard list of directories and substitute
24827 the full name found.  The current working directory is included in the
24828 list of directories scanned.
24830 @item %T
24831 Current argument is the name of a linker script.  Search for that file
24832 in the current list of directories to scan for libraries. If the file
24833 is located insert a @option{--script} option into the command line
24834 followed by the full path name found.  If the file is not found then
24835 generate an error message.  Note: the current working directory is not
24836 searched.
24838 @item %e@var{str}
24839 Print @var{str} as an error message.  @var{str} is terminated by a newline.
24840 Use this when inconsistent options are detected.
24842 @item %(@var{name})
24843 Substitute the contents of spec string @var{name} at this point.
24845 @item %x@{@var{option}@}
24846 Accumulate an option for @samp{%X}.
24848 @item %X
24849 Output the accumulated linker options specified by @option{-Wl} or a @samp{%x}
24850 spec string.
24852 @item %Y
24853 Output the accumulated assembler options specified by @option{-Wa}.
24855 @item %Z
24856 Output the accumulated preprocessor options specified by @option{-Wp}.
24858 @item %a
24859 Process the @code{asm} spec.  This is used to compute the
24860 switches to be passed to the assembler.
24862 @item %A
24863 Process the @code{asm_final} spec.  This is a spec string for
24864 passing switches to an assembler post-processor, if such a program is
24865 needed.
24867 @item %l
24868 Process the @code{link} spec.  This is the spec for computing the
24869 command line passed to the linker.  Typically it makes use of the
24870 @samp{%L %G %S %D and %E} sequences.
24872 @item %D
24873 Dump out a @option{-L} option for each directory that GCC believes might
24874 contain startup files.  If the target supports multilibs then the
24875 current multilib directory is prepended to each of these paths.
24877 @item %L
24878 Process the @code{lib} spec.  This is a spec string for deciding which
24879 libraries are included on the command line to the linker.
24881 @item %G
24882 Process the @code{libgcc} spec.  This is a spec string for deciding
24883 which GCC support library is included on the command line to the linker.
24885 @item %S
24886 Process the @code{startfile} spec.  This is a spec for deciding which
24887 object files are the first ones passed to the linker.  Typically
24888 this might be a file named @file{crt0.o}.
24890 @item %E
24891 Process the @code{endfile} spec.  This is a spec string that specifies
24892 the last object files that are passed to the linker.
24894 @item %C
24895 Process the @code{cpp} spec.  This is used to construct the arguments
24896 to be passed to the C preprocessor.
24898 @item %1
24899 Process the @code{cc1} spec.  This is used to construct the options to be
24900 passed to the actual C compiler (@command{cc1}).
24902 @item %2
24903 Process the @code{cc1plus} spec.  This is used to construct the options to be
24904 passed to the actual C++ compiler (@command{cc1plus}).
24906 @item %*
24907 Substitute the variable part of a matched option.  See below.
24908 Note that each comma in the substituted string is replaced by
24909 a single space.
24911 @item %<@code{S}
24912 Remove all occurrences of @code{-S} from the command line.  Note---this
24913 command is position dependent.  @samp{%} commands in the spec string
24914 before this one see @code{-S}, @samp{%} commands in the spec string
24915 after this one do not.
24917 @item %:@var{function}(@var{args})
24918 Call the named function @var{function}, passing it @var{args}.
24919 @var{args} is first processed as a nested spec string, then split
24920 into an argument vector in the usual fashion.  The function returns
24921 a string which is processed as if it had appeared literally as part
24922 of the current spec.
24924 The following built-in spec functions are provided:
24926 @table @code
24927 @item @code{getenv}
24928 The @code{getenv} spec function takes two arguments: an environment
24929 variable name and a string.  If the environment variable is not
24930 defined, a fatal error is issued.  Otherwise, the return value is the
24931 value of the environment variable concatenated with the string.  For
24932 example, if @env{TOPDIR} is defined as @file{/path/to/top}, then:
24934 @smallexample
24935 %:getenv(TOPDIR /include)
24936 @end smallexample
24938 expands to @file{/path/to/top/include}.
24940 @item @code{if-exists}
24941 The @code{if-exists} spec function takes one argument, an absolute
24942 pathname to a file.  If the file exists, @code{if-exists} returns the
24943 pathname.  Here is a small example of its usage:
24945 @smallexample
24946 *startfile:
24947 crt0%O%s %:if-exists(crti%O%s) crtbegin%O%s
24948 @end smallexample
24950 @item @code{if-exists-else}
24951 The @code{if-exists-else} spec function is similar to the @code{if-exists}
24952 spec function, except that it takes two arguments.  The first argument is
24953 an absolute pathname to a file.  If the file exists, @code{if-exists-else}
24954 returns the pathname.  If it does not exist, it returns the second argument.
24955 This way, @code{if-exists-else} can be used to select one file or another,
24956 based on the existence of the first.  Here is a small example of its usage:
24958 @smallexample
24959 *startfile:
24960 crt0%O%s %:if-exists(crti%O%s) \
24961 %:if-exists-else(crtbeginT%O%s crtbegin%O%s)
24962 @end smallexample
24964 @item @code{replace-outfile}
24965 The @code{replace-outfile} spec function takes two arguments.  It looks for the
24966 first argument in the outfiles array and replaces it with the second argument.  Here
24967 is a small example of its usage:
24969 @smallexample
24970 %@{fgnu-runtime:%:replace-outfile(-lobjc -lobjc-gnu)@}
24971 @end smallexample
24973 @item @code{remove-outfile}
24974 The @code{remove-outfile} spec function takes one argument.  It looks for the
24975 first argument in the outfiles array and removes it.  Here is a small example
24976 its usage:
24978 @smallexample
24979 %:remove-outfile(-lm)
24980 @end smallexample
24982 @item @code{pass-through-libs}
24983 The @code{pass-through-libs} spec function takes any number of arguments.  It
24984 finds any @option{-l} options and any non-options ending in @file{.a} (which it
24985 assumes are the names of linker input library archive files) and returns a
24986 result containing all the found arguments each prepended by
24987 @option{-plugin-opt=-pass-through=} and joined by spaces.  This list is
24988 intended to be passed to the LTO linker plugin.
24990 @smallexample
24991 %:pass-through-libs(%G %L %G)
24992 @end smallexample
24994 @item @code{print-asm-header}
24995 The @code{print-asm-header} function takes no arguments and simply
24996 prints a banner like:
24998 @smallexample
24999 Assembler options
25000 =================
25002 Use "-Wa,OPTION" to pass "OPTION" to the assembler.
25003 @end smallexample
25005 It is used to separate compiler options from assembler options
25006 in the @option{--target-help} output.
25007 @end table
25009 @item %@{@code{S}@}
25010 Substitutes the @code{-S} switch, if that switch is given to GCC@.
25011 If that switch is not specified, this substitutes nothing.  Note that
25012 the leading dash is omitted when specifying this option, and it is
25013 automatically inserted if the substitution is performed.  Thus the spec
25014 string @samp{%@{foo@}} matches the command-line option @option{-foo}
25015 and outputs the command-line option @option{-foo}.
25017 @item %W@{@code{S}@}
25018 Like %@{@code{S}@} but mark last argument supplied within as a file to be
25019 deleted on failure.
25021 @item %@{@code{S}*@}
25022 Substitutes all the switches specified to GCC whose names start
25023 with @code{-S}, but which also take an argument.  This is used for
25024 switches like @option{-o}, @option{-D}, @option{-I}, etc.
25025 GCC considers @option{-o foo} as being
25026 one switch whose name starts with @samp{o}.  %@{o*@} substitutes this
25027 text, including the space.  Thus two arguments are generated.
25029 @item %@{@code{S}*&@code{T}*@}
25030 Like %@{@code{S}*@}, but preserve order of @code{S} and @code{T} options
25031 (the order of @code{S} and @code{T} in the spec is not significant).
25032 There can be any number of ampersand-separated variables; for each the
25033 wild card is optional.  Useful for CPP as @samp{%@{D*&U*&A*@}}.
25035 @item %@{@code{S}:@code{X}@}
25036 Substitutes @code{X}, if the @option{-S} switch is given to GCC@.
25038 @item %@{!@code{S}:@code{X}@}
25039 Substitutes @code{X}, if the @option{-S} switch is @emph{not} given to GCC@.
25041 @item %@{@code{S}*:@code{X}@}
25042 Substitutes @code{X} if one or more switches whose names start with
25043 @code{-S} are specified to GCC@.  Normally @code{X} is substituted only
25044 once, no matter how many such switches appeared.  However, if @code{%*}
25045 appears somewhere in @code{X}, then @code{X} is substituted once
25046 for each matching switch, with the @code{%*} replaced by the part of
25047 that switch matching the @code{*}.
25049 If @code{%*} appears as the last part of a spec sequence then a space
25050 is added after the end of the last substitution.  If there is more
25051 text in the sequence, however, then a space is not generated.  This
25052 allows the @code{%*} substitution to be used as part of a larger
25053 string.  For example, a spec string like this:
25055 @smallexample
25056 %@{mcu=*:--script=%*/memory.ld@}
25057 @end smallexample
25059 @noindent
25060 when matching an option like @option{-mcu=newchip} produces:
25062 @smallexample
25063 --script=newchip/memory.ld
25064 @end smallexample
25066 @item %@{.@code{S}:@code{X}@}
25067 Substitutes @code{X}, if processing a file with suffix @code{S}.
25069 @item %@{!.@code{S}:@code{X}@}
25070 Substitutes @code{X}, if @emph{not} processing a file with suffix @code{S}.
25072 @item %@{,@code{S}:@code{X}@}
25073 Substitutes @code{X}, if processing a file for language @code{S}.
25075 @item %@{!,@code{S}:@code{X}@}
25076 Substitutes @code{X}, if not processing a file for language @code{S}.
25078 @item %@{@code{S}|@code{P}:@code{X}@}
25079 Substitutes @code{X} if either @code{-S} or @code{-P} is given to
25080 GCC@.  This may be combined with @samp{!}, @samp{.}, @samp{,}, and
25081 @code{*} sequences as well, although they have a stronger binding than
25082 the @samp{|}.  If @code{%*} appears in @code{X}, all of the
25083 alternatives must be starred, and only the first matching alternative
25084 is substituted.
25086 For example, a spec string like this:
25088 @smallexample
25089 %@{.c:-foo@} %@{!.c:-bar@} %@{.c|d:-baz@} %@{!.c|d:-boggle@}
25090 @end smallexample
25092 @noindent
25093 outputs the following command-line options from the following input
25094 command-line options:
25096 @smallexample
25097 fred.c        -foo -baz
25098 jim.d         -bar -boggle
25099 -d fred.c     -foo -baz -boggle
25100 -d jim.d      -bar -baz -boggle
25101 @end smallexample
25103 @item %@{S:X; T:Y; :D@}
25105 If @code{S} is given to GCC, substitutes @code{X}; else if @code{T} is
25106 given to GCC, substitutes @code{Y}; else substitutes @code{D}.  There can
25107 be as many clauses as you need.  This may be combined with @code{.},
25108 @code{,}, @code{!}, @code{|}, and @code{*} as needed.
25111 @end table
25113 The conditional text @code{X} in a %@{@code{S}:@code{X}@} or similar
25114 construct may contain other nested @samp{%} constructs or spaces, or
25115 even newlines.  They are processed as usual, as described above.
25116 Trailing white space in @code{X} is ignored.  White space may also
25117 appear anywhere on the left side of the colon in these constructs,
25118 except between @code{.} or @code{*} and the corresponding word.
25120 The @option{-O}, @option{-f}, @option{-m}, and @option{-W} switches are
25121 handled specifically in these constructs.  If another value of
25122 @option{-O} or the negated form of a @option{-f}, @option{-m}, or
25123 @option{-W} switch is found later in the command line, the earlier
25124 switch value is ignored, except with @{@code{S}*@} where @code{S} is
25125 just one letter, which passes all matching options.
25127 The character @samp{|} at the beginning of the predicate text is used to
25128 indicate that a command should be piped to the following command, but
25129 only if @option{-pipe} is specified.
25131 It is built into GCC which switches take arguments and which do not.
25132 (You might think it would be useful to generalize this to allow each
25133 compiler's spec to say which switches take arguments.  But this cannot
25134 be done in a consistent fashion.  GCC cannot even decide which input
25135 files have been specified without knowing which switches take arguments,
25136 and it must know which input files to compile in order to tell which
25137 compilers to run).
25139 GCC also knows implicitly that arguments starting in @option{-l} are to be
25140 treated as compiler output files, and passed to the linker in their
25141 proper position among the other output files.
25143 @node Environment Variables
25144 @section Environment Variables Affecting GCC
25145 @cindex environment variables
25147 @c man begin ENVIRONMENT
25148 This section describes several environment variables that affect how GCC
25149 operates.  Some of them work by specifying directories or prefixes to use
25150 when searching for various kinds of files.  Some are used to specify other
25151 aspects of the compilation environment.
25153 Note that you can also specify places to search using options such as
25154 @option{-B}, @option{-I} and @option{-L} (@pxref{Directory Options}).  These
25155 take precedence over places specified using environment variables, which
25156 in turn take precedence over those specified by the configuration of GCC@.
25157 @xref{Driver,, Controlling the Compilation Driver @file{gcc}, gccint,
25158 GNU Compiler Collection (GCC) Internals}.
25160 @table @env
25161 @item LANG
25162 @itemx LC_CTYPE
25163 @c @itemx LC_COLLATE
25164 @itemx LC_MESSAGES
25165 @c @itemx LC_MONETARY
25166 @c @itemx LC_NUMERIC
25167 @c @itemx LC_TIME
25168 @itemx LC_ALL
25169 @findex LANG
25170 @findex LC_CTYPE
25171 @c @findex LC_COLLATE
25172 @findex LC_MESSAGES
25173 @c @findex LC_MONETARY
25174 @c @findex LC_NUMERIC
25175 @c @findex LC_TIME
25176 @findex LC_ALL
25177 @cindex locale
25178 These environment variables control the way that GCC uses
25179 localization information which allows GCC to work with different
25180 national conventions.  GCC inspects the locale categories
25181 @env{LC_CTYPE} and @env{LC_MESSAGES} if it has been configured to do
25182 so.  These locale categories can be set to any value supported by your
25183 installation.  A typical value is @samp{en_GB.UTF-8} for English in the United
25184 Kingdom encoded in UTF-8.
25186 The @env{LC_CTYPE} environment variable specifies character
25187 classification.  GCC uses it to determine the character boundaries in
25188 a string; this is needed for some multibyte encodings that contain quote
25189 and escape characters that are otherwise interpreted as a string
25190 end or escape.
25192 The @env{LC_MESSAGES} environment variable specifies the language to
25193 use in diagnostic messages.
25195 If the @env{LC_ALL} environment variable is set, it overrides the value
25196 of @env{LC_CTYPE} and @env{LC_MESSAGES}; otherwise, @env{LC_CTYPE}
25197 and @env{LC_MESSAGES} default to the value of the @env{LANG}
25198 environment variable.  If none of these variables are set, GCC
25199 defaults to traditional C English behavior.
25201 @item TMPDIR
25202 @findex TMPDIR
25203 If @env{TMPDIR} is set, it specifies the directory to use for temporary
25204 files.  GCC uses temporary files to hold the output of one stage of
25205 compilation which is to be used as input to the next stage: for example,
25206 the output of the preprocessor, which is the input to the compiler
25207 proper.
25209 @item GCC_COMPARE_DEBUG
25210 @findex GCC_COMPARE_DEBUG
25211 Setting @env{GCC_COMPARE_DEBUG} is nearly equivalent to passing
25212 @option{-fcompare-debug} to the compiler driver.  See the documentation
25213 of this option for more details.
25215 @item GCC_EXEC_PREFIX
25216 @findex GCC_EXEC_PREFIX
25217 If @env{GCC_EXEC_PREFIX} is set, it specifies a prefix to use in the
25218 names of the subprograms executed by the compiler.  No slash is added
25219 when this prefix is combined with the name of a subprogram, but you can
25220 specify a prefix that ends with a slash if you wish.
25222 If @env{GCC_EXEC_PREFIX} is not set, GCC attempts to figure out
25223 an appropriate prefix to use based on the pathname it is invoked with.
25225 If GCC cannot find the subprogram using the specified prefix, it
25226 tries looking in the usual places for the subprogram.
25228 The default value of @env{GCC_EXEC_PREFIX} is
25229 @file{@var{prefix}/lib/gcc/} where @var{prefix} is the prefix to
25230 the installed compiler. In many cases @var{prefix} is the value
25231 of @code{prefix} when you ran the @file{configure} script.
25233 Other prefixes specified with @option{-B} take precedence over this prefix.
25235 This prefix is also used for finding files such as @file{crt0.o} that are
25236 used for linking.
25238 In addition, the prefix is used in an unusual way in finding the
25239 directories to search for header files.  For each of the standard
25240 directories whose name normally begins with @samp{/usr/local/lib/gcc}
25241 (more precisely, with the value of @env{GCC_INCLUDE_DIR}), GCC tries
25242 replacing that beginning with the specified prefix to produce an
25243 alternate directory name.  Thus, with @option{-Bfoo/}, GCC searches
25244 @file{foo/bar} just before it searches the standard directory 
25245 @file{/usr/local/lib/bar}.
25246 If a standard directory begins with the configured
25247 @var{prefix} then the value of @var{prefix} is replaced by
25248 @env{GCC_EXEC_PREFIX} when looking for header files.
25250 @item COMPILER_PATH
25251 @findex COMPILER_PATH
25252 The value of @env{COMPILER_PATH} is a colon-separated list of
25253 directories, much like @env{PATH}.  GCC tries the directories thus
25254 specified when searching for subprograms, if it can't find the
25255 subprograms using @env{GCC_EXEC_PREFIX}.
25257 @item LIBRARY_PATH
25258 @findex LIBRARY_PATH
25259 The value of @env{LIBRARY_PATH} is a colon-separated list of
25260 directories, much like @env{PATH}.  When configured as a native compiler,
25261 GCC tries the directories thus specified when searching for special
25262 linker files, if it can't find them using @env{GCC_EXEC_PREFIX}.  Linking
25263 using GCC also uses these directories when searching for ordinary
25264 libraries for the @option{-l} option (but directories specified with
25265 @option{-L} come first).
25267 @item LANG
25268 @findex LANG
25269 @cindex locale definition
25270 This variable is used to pass locale information to the compiler.  One way in
25271 which this information is used is to determine the character set to be used
25272 when character literals, string literals and comments are parsed in C and C++.
25273 When the compiler is configured to allow multibyte characters,
25274 the following values for @env{LANG} are recognized:
25276 @table @samp
25277 @item C-JIS
25278 Recognize JIS characters.
25279 @item C-SJIS
25280 Recognize SJIS characters.
25281 @item C-EUCJP
25282 Recognize EUCJP characters.
25283 @end table
25285 If @env{LANG} is not defined, or if it has some other value, then the
25286 compiler uses @code{mblen} and @code{mbtowc} as defined by the default locale to
25287 recognize and translate multibyte characters.
25288 @end table
25290 @noindent
25291 Some additional environment variables affect the behavior of the
25292 preprocessor.
25294 @include cppenv.texi
25296 @c man end
25298 @node Precompiled Headers
25299 @section Using Precompiled Headers
25300 @cindex precompiled headers
25301 @cindex speed of compilation
25303 Often large projects have many header files that are included in every
25304 source file.  The time the compiler takes to process these header files
25305 over and over again can account for nearly all of the time required to
25306 build the project.  To make builds faster, GCC allows you to
25307 @dfn{precompile} a header file.
25309 To create a precompiled header file, simply compile it as you would any
25310 other file, if necessary using the @option{-x} option to make the driver
25311 treat it as a C or C++ header file.  You may want to use a
25312 tool like @command{make} to keep the precompiled header up-to-date when
25313 the headers it contains change.
25315 A precompiled header file is searched for when @code{#include} is
25316 seen in the compilation.  As it searches for the included file
25317 (@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
25318 compiler looks for a precompiled header in each directory just before it
25319 looks for the include file in that directory.  The name searched for is
25320 the name specified in the @code{#include} with @samp{.gch} appended.  If
25321 the precompiled header file can't be used, it is ignored.
25323 For instance, if you have @code{#include "all.h"}, and you have
25324 @file{all.h.gch} in the same directory as @file{all.h}, then the
25325 precompiled header file is used if possible, and the original
25326 header is used otherwise.
25328 Alternatively, you might decide to put the precompiled header file in a
25329 directory and use @option{-I} to ensure that directory is searched
25330 before (or instead of) the directory containing the original header.
25331 Then, if you want to check that the precompiled header file is always
25332 used, you can put a file of the same name as the original header in this
25333 directory containing an @code{#error} command.
25335 This also works with @option{-include}.  So yet another way to use
25336 precompiled headers, good for projects not designed with precompiled
25337 header files in mind, is to simply take most of the header files used by
25338 a project, include them from another header file, precompile that header
25339 file, and @option{-include} the precompiled header.  If the header files
25340 have guards against multiple inclusion, they are skipped because
25341 they've already been included (in the precompiled header).
25343 If you need to precompile the same header file for different
25344 languages, targets, or compiler options, you can instead make a
25345 @emph{directory} named like @file{all.h.gch}, and put each precompiled
25346 header in the directory, perhaps using @option{-o}.  It doesn't matter
25347 what you call the files in the directory; every precompiled header in
25348 the directory is considered.  The first precompiled header
25349 encountered in the directory that is valid for this compilation is
25350 used; they're searched in no particular order.
25352 There are many other possibilities, limited only by your imagination,
25353 good sense, and the constraints of your build system.
25355 A precompiled header file can be used only when these conditions apply:
25357 @itemize
25358 @item
25359 Only one precompiled header can be used in a particular compilation.
25361 @item
25362 A precompiled header can't be used once the first C token is seen.  You
25363 can have preprocessor directives before a precompiled header; you cannot
25364 include a precompiled header from inside another header.
25366 @item
25367 The precompiled header file must be produced for the same language as
25368 the current compilation.  You can't use a C precompiled header for a C++
25369 compilation.
25371 @item
25372 The precompiled header file must have been produced by the same compiler
25373 binary as the current compilation is using.
25375 @item
25376 Any macros defined before the precompiled header is included must
25377 either be defined in the same way as when the precompiled header was
25378 generated, or must not affect the precompiled header, which usually
25379 means that they don't appear in the precompiled header at all.
25381 The @option{-D} option is one way to define a macro before a
25382 precompiled header is included; using a @code{#define} can also do it.
25383 There are also some options that define macros implicitly, like
25384 @option{-O} and @option{-Wdeprecated}; the same rule applies to macros
25385 defined this way.
25387 @item If debugging information is output when using the precompiled
25388 header, using @option{-g} or similar, the same kind of debugging information
25389 must have been output when building the precompiled header.  However,
25390 a precompiled header built using @option{-g} can be used in a compilation
25391 when no debugging information is being output.
25393 @item The same @option{-m} options must generally be used when building
25394 and using the precompiled header.  @xref{Submodel Options},
25395 for any cases where this rule is relaxed.
25397 @item Each of the following options must be the same when building and using
25398 the precompiled header:
25400 @gccoptlist{-fexceptions}
25402 @item
25403 Some other command-line options starting with @option{-f},
25404 @option{-p}, or @option{-O} must be defined in the same way as when
25405 the precompiled header was generated.  At present, it's not clear
25406 which options are safe to change and which are not; the safest choice
25407 is to use exactly the same options when generating and using the
25408 precompiled header.  The following are known to be safe:
25410 @gccoptlist{-fmessage-length=  -fpreprocessed  -fsched-interblock @gol
25411 -fsched-spec  -fsched-spec-load  -fsched-spec-load-dangerous @gol
25412 -fsched-verbose=@var{number}  -fschedule-insns  -fvisibility= @gol
25413 -pedantic-errors}
25415 @end itemize
25417 For all of these except the last, the compiler automatically
25418 ignores the precompiled header if the conditions aren't met.  If you
25419 find an option combination that doesn't work and doesn't cause the
25420 precompiled header to be ignored, please consider filing a bug report,
25421 see @ref{Bugs}.
25423 If you do use differing options when generating and using the
25424 precompiled header, the actual behavior is a mixture of the
25425 behavior for the options.  For instance, if you use @option{-g} to
25426 generate the precompiled header but not when using it, you may or may
25427 not get debugging information for routines in the precompiled header.